LArSoft  v10_04_05
Liquid Argon Software toolkit - https://larsoft.org/
FlashHypothesisAna_module.cc
Go to the documentation of this file.
1 // Class: FlashHypothesisAna
3 // Module Type: analyzer
4 // File: FlashHypothesisAna_module.cc
5 //
6 // Generated at Mon Jan 19 18:46:10 2015 by Wesley Ketchum using artmod
7 // from cetpkgsupport v1_08_02.
9 
14 #include "fhiclcpp/ParameterSet.h"
15 
16 #include "art_root_io/TFileService.h"
17 
18 #include "FlashHypothesisAnaAlg.h"
19 
23 #include "lardata/DetectorInfoServices/ServicePack.h" // lar::extractProviders()
25 
26 #include "TH1F.h"
27 #include "TTree.h"
28 
29 namespace opdet {
30  class FlashHypothesisAna;
31 }
32 
33 namespace opdet {
34 
36  public:
37  explicit FlashHypothesisAna(fhicl::ParameterSet const& p);
38  // The destructor generated by the compiler is fine for classes
39  // without bare pointers or other resource use.
40 
41  // Plugins should not be copied or assigned.
42  FlashHypothesisAna(FlashHypothesisAna const&) = delete;
46 
47  // Required functions.
48  void analyze(art::Event const& e) override;
49 
50  // Selected optional functions.
51  void beginJob() override;
52 
53  private:
54  std::string fMCTrackLabel;
55  std::string fMCSimPhotonsLabel;
56 
58  };
59 
61  : EDAnalyzer(p)
62  , fMCTrackLabel(p.get<std::string>("MCTrackLabel"))
63  , fMCSimPhotonsLabel(p.get<std::string>("MCSimPhotonsLabel"))
64  , fAlg(p.get<fhicl::ParameterSet>("FlashHypothesisAnaAlgParams"))
65  {}
66 
68  {
70  e.getByLabel(fMCTrackLabel, mctrackHandle);
71  std::vector<sim::MCTrack> const& mctrackVec(*mctrackHandle);
72 
74  e.getByLabel(fMCSimPhotonsLabel, simPhotonsHandle);
75  std::vector<sim::SimPhotons> const& simPhotonsVec(*simPhotonsHandle);
76 
79 
80  opdet::OpDigiProperties const& opdigi(*opdigiHandle);
81  phot::PhotonVisibilityService const& pvs(*pvsHandle);
82 
83  fAlg.RunComparison((unsigned int)e.run(),
84  (unsigned int)e.id().event(),
85  mctrackVec,
86  simPhotonsVec,
87  lar::extractProviders<geo::Geometry, detinfo::LArPropertiesService>(),
88  opdigi,
89  pvs);
90  }
91 
93  {
95  geo::Geometry const& geo(*geoHandle);
96 
98 
99  fAlg.SetOutputObjects(tfs->make<TTree>("ctree", "FlashHypothesisAnaTree"),
100  tfs->make<TH1F>(),
101  tfs->make<TH1F>(),
102  tfs->make<TH1F>(),
103  tfs->make<TH1F>(),
104  tfs->make<TH1F>(),
105  tfs->make<TH1F>(),
106  tfs->make<TH1F>(),
107  tfs->make<TH1F>(),
108  tfs->make<TH1F>(),
109  geo);
111  }
112 
113 }
114 
Utilities to manage ProviderPack objects with art.
void RunComparison(const unsigned int run, const unsigned int event, std::vector< sim::MCTrack > const &, std::vector< sim::SimPhotons > const &, Providers_t providers, opdet::OpDigiProperties const &opdigip, phot::PhotonVisibilityService const &pvs)
STL namespace.
EDAnalyzer(fhicl::ParameterSet const &pset)
Definition: EDAnalyzer.cc:6
void SetOutputObjects(TTree *, TH1F *, TH1F *, TH1F *, TH1F *, TH1F *, TH1F *, TH1F *, TH1F *, TH1F *, geo::Geometry const &)
#define DEFINE_ART_MODULE(klass)
Definition: ModuleMacros.h:65
FlashHypothesisAna & operator=(FlashHypothesisAna const &)=delete
parameter set interface
The geometry of one entire detector, as served by art.
Definition: Geometry.h:42
decltype(auto) get(T &&obj)
ADL-aware version of std::to_string.
Definition: StdUtils.h:120
bool getByLabel(std::string const &label, std::string const &instance, Handle< PROD > &result) const
FlashHypothesisAna(fhicl::ParameterSet const &p)
EventNumber_t event() const
Definition: EventID.h:116
Float_t e
Definition: plot.C:35
RunNumber_t run() const
Definition: Event.cc:29
ROOT libraries.
void FillOpDetPositions(geo::Geometry const &)
void analyze(art::Event const &e) override
EventID id() const
Definition: Event.cc:23
art framework interface to geometry description