TrackContainmentAnalyzer_module.cc
Go to the documentation of this file.
1 ////////////////////////////////////////////////////////////////////////
2 // 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.
8 ////////////////////////////////////////////////////////////////////////
9 
14 #include "fhiclcpp/ParameterSet.h"
15 
16 #include "art_root_io/TFileService.h"
17 
18 #include "TTree.h"
19 
22 
23 namespace trk {
24  class TrackContainmentAnalyzer;
25 }
26 
28 public:
30  // The destructor generated by the compiler is fine for classes
31  // without bare pointers or other resource use.
32 
33  // Plugins should not be copied or assigned.
38 
39  // Required functions.
40  void analyze(art::Event const & e) override;
41 
42 private:
43 
44  // Declare member data here.
46 
47  std::vector<std::string> fTrackModuleLabels;
48 
49 };
50 
51 
53  :
54  EDAnalyzer(p) // ,
55  // More initializers here.
56 {
57  fAlg.Configure(p.get<fhicl::ParameterSet>("TrackContainmentAlg"));
58  fTrackModuleLabels = p.get< std::vector<std::string> >("TrackModuleLabels");
61  fAlg.SetupOutputTree(tfs->make<TTree>("myanatree","MyAnalysis Tree"));
62 }
63 
65 {
66 
67  fAlg.SetRunEvent(e.run(),e.event());
68 
69  std::vector< std::vector<recob::Track> > trackVectors;
70  for(size_t i_l=0; i_l<fTrackModuleLabels.size(); ++i_l){
72  e.getByLabel(fTrackModuleLabels[i_l],trackHandle);
73  trackVectors.push_back(*trackHandle);
74  }
75 
77 
78  fAlg.ProcessTracks(trackVectors,*geoHandle);
79 
80 }
81 
EventNumber_t event() const
Definition: DataViewImpl.cc:85
void setFillOutputTree(bool flag=true)
EDAnalyzer(fhicl::ParameterSet const &pset)
Definition: EDAnalyzer.h:25
art framework interface to geometry description
void ProcessTracks(std::vector< std::vector< recob::Track > > const &, geo::GeometryCore const &)
TrackContainmentAnalyzer & operator=(TrackContainmentAnalyzer const &)=delete
bool getByLabel(std::string const &label, std::string const &instance, Handle< PROD > &result) const
Definition: DataViewImpl.h:633
const double e
#define DEFINE_ART_MODULE(klass)
Definition: ModuleMacros.h:67
T get(std::string const &key) const
Definition: ParameterSet.h:271
p
Definition: test.py:223
void Configure(fhicl::ParameterSet const &)
void SetRunEvent(unsigned int const &, unsigned int const &)
RunNumber_t run() const
Definition: DataViewImpl.cc:71
void analyze(art::Event const &e) override
TrackContainmentAnalyzer(fhicl::ParameterSet const &p)