LArSoft  v09_90_00
Liquid Argon Software toolkit - https://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 
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  // Declare member data here.
45 
46  std::vector<std::string> fTrackModuleLabels;
47 };
48 
50  : EDAnalyzer(p) // ,
51  // More initializers here.
52 {
53  fAlg.Configure(p.get<fhicl::ParameterSet>("TrackContainmentAlg"));
54  fTrackModuleLabels = p.get<std::vector<std::string>>("TrackModuleLabels");
57  fAlg.SetupOutputTree(tfs->make<TTree>("myanatree", "MyAnalysis Tree"));
58 }
59 
61 {
62 
63  fAlg.SetRunEvent(e.run(), e.event());
64 
65  std::vector<std::vector<recob::Track>> trackVectors;
66  for (size_t i_l = 0; i_l < fTrackModuleLabels.size(); ++i_l) {
68  e.getByLabel(fTrackModuleLabels[i_l], trackHandle);
69  trackVectors.push_back(*trackHandle);
70  }
71 
73 
74  fAlg.ProcessTracks(trackVectors, *geoHandle);
75 }
76 
void ProcessTracks(std::vector< std::vector< recob::Track >> const &, geo::GeometryCore const &)
void setFillOutputTree(bool flag=true)
EDAnalyzer(fhicl::ParameterSet const &pset)
Definition: EDAnalyzer.cc:6
TrackContainmentAnalyzer & operator=(TrackContainmentAnalyzer const &)=delete
#define DEFINE_ART_MODULE(klass)
Definition: ModuleMacros.h:65
T get(std::string const &key) const
Definition: ParameterSet.h:314
EventNumber_t event() const
Definition: Event.cc:41
void Configure(fhicl::ParameterSet const &)
void SetRunEvent(unsigned int const &, unsigned int const &)
void analyze(art::Event const &e) override
TrackContainmentAnalyzer(fhicl::ParameterSet const &p)
bool getByLabel(std::string const &label, std::string const &instance, Handle< PROD > &result) const
Float_t e
Definition: plot.C:35
RunNumber_t run() const
Definition: Event.cc:29
art framework interface to geometry description