LArSoft  v07_13_02
Liquid Argon Software toolkit - http://larsoft.org/
TrackContainmentAnalyzer_module.cc
Go to the documentation of this file.
1 // Class: TrackContainmentAnalyzer
3 // Module Type: analyzer
4 // File: TrackContainmentAnalyzer_module.cc
5 //
6 // Generated at Tue Nov 10 13:06:09 2015 by Wesley Ketchum using artmod
7 // from cetpkgsupport v1_08_07.
9 
17 #include "fhiclcpp/ParameterSet.h"
19 
21 
22 #include "TTree.h"
23 
26 
27 namespace trk {
28  class TrackContainmentAnalyzer;
29 }
30 
32 public:
34  // The destructor generated by the compiler is fine for classes
35  // without bare pointers or other resource use.
36 
37  // Plugins should not be copied or assigned.
42 
43  // Required functions.
44  void analyze(art::Event const & e) override;
45 
46  // Selected optional functions.
47  void reconfigure(fhicl::ParameterSet const & p) ;
48 
49 private:
50 
51  // Declare member data here.
53 
54  std::vector<std::string> fTrackModuleLabels;
55 
56 };
57 
58 
60  :
61  EDAnalyzer(p) // ,
62  // More initializers here.
63 {
64  this->reconfigure(p);
66  fAlg.SetupOutputTree(tfs->make<TTree>("myanatree","MyAnalysis Tree"));
67 }
68 
70 {
71 
72  fAlg.SetRunEvent(e.run(),e.event());
73 
74  std::vector< std::vector<recob::Track> > trackVectors;
75  for(size_t i_l=0; i_l<fTrackModuleLabels.size(); ++i_l){
77  e.getByLabel(fTrackModuleLabels[i_l],trackHandle);
78  trackVectors.push_back(*trackHandle);
79  }
80 
82 
83  fAlg.ProcessTracks(trackVectors,*geoHandle);
84 
85 }
86 
88 {
89  fAlg.Configure(p.get<fhicl::ParameterSet>("TrackContainmentAlg"));
90  fTrackModuleLabels = p.get< std::vector<std::string> >("TrackModuleLabels");
92 }
93 
void setFillOutputTree(bool flag=true)
void reconfigure(fhicl::ParameterSet const &p)
void ProcessTracks(std::vector< std::vector< recob::Track > > const &, geo::GeometryCore const &)
TrackContainmentAnalyzer & operator=(TrackContainmentAnalyzer const &)=delete
#define DEFINE_ART_MODULE(klass)
Definition: ModuleMacros.h:42
T get(std::string const &key) const
Definition: ParameterSet.h:231
EventNumber_t event() const
Definition: Event.h:67
void Configure(fhicl::ParameterSet const &)
EDAnalyzer(Table< Config > const &config)
Definition: EDAnalyzer.h:100
void SetRunEvent(unsigned int const &, unsigned int const &)
void analyze(art::Event const &e) override
TrackContainmentAnalyzer(fhicl::ParameterSet const &p)
T * make(ARGS...args) const
bool getByLabel(std::string const &label, std::string const &productInstanceName, Handle< PROD > &result) const
Definition: DataViewImpl.h:344
Float_t e
Definition: plot.C:34
RunNumber_t run() const
Definition: Event.h:77
art framework interface to geometry description