All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
sbndcode/sbndcode/gallery/galleryAnalysis/TrackAnalysis.h
Go to the documentation of this file.
1 /**
2  * @file TrackAnalysis.h
3  * @brief Does something with the tracks.
4  * @author Gianluca Petrillo (petrillo@fnal.gov)
5  * @date October 23, 2017
6  * @see galleryAnalysis.cpp
7  *
8  */
9 
10 #ifndef TRACKANALYSIS_H
11 #define TRACKANALYSIS_H
12 
13 // LArSoft libraries
16 
17 // canvas libraries
18 #include "fhiclcpp/ParameterSet.h"
19 
20 // ROOT libraries
21 #include "TDirectory.h"
22 #include "TH1.h"
23 
24 // C/C++ standard libraries
25 #include <vector>
26 #include <memory> // std::unique_ptr<>
27 
28 
29 /**
30  * @brief Track analysis example.
31  *
32  * Configuration
33  * --------------
34  *
35  * * *MinLength* (real, default: 0): minimum track length, in centimetres
36  *
37  */
38 class TrackAnalysis {
39 
40  geo::GeometryCore const* fGeom = nullptr;
41  TDirectory* fDir = nullptr;
42  double fMinLength = 0.0; ///< Minimum length, in centimetres.
43  std::unique_ptr<TH1> fHNTracks;
44 
45  public:
46 
47  TrackAnalysis(fhicl::ParameterSet const& config);
48 
49  void setup(geo::GeometryCore const& geom, TDirectory* outDir)
50  {
51  fGeom = &geom;
52  fDir = outDir;
53  }
54 
55  void prepare();
56 
57  void processTracks(std::vector<recob::Track> const& tracks);
58 
59  void finish();
60 
61 }; // class TrackAnalysis
62 
63 
64 
65 #endif // TRACKANALYSIS_H
ClusterModuleLabel join with tracks
Access the description of detector geometry.
double fMinLength
Minimum length, in centimetres.
void processTracks(std::vector< recob::Track > const &tracks)
Description of geometry of one entire detector.
Provides recob::Track data product.
void setup(geo::GeometryCore const &geom, TDirectory *outDir)