LArSoft  v09_90_00
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 
22 #include "lardata/DetectorInfoServices/ServicePack.h" // lar::extractProviders()
24 
25 #include "TH1F.h"
26 #include "TTree.h"
27 
28 namespace opdet {
29  class FlashHypothesisAna;
30 }
31 
32 namespace opdet {
33 
35  public:
36  explicit FlashHypothesisAna(fhicl::ParameterSet const& p);
37  // The destructor generated by the compiler is fine for classes
38  // without bare pointers or other resource use.
39 
40  // Plugins should not be copied or assigned.
41  FlashHypothesisAna(FlashHypothesisAna const&) = delete;
45 
46  // Required functions.
47  void analyze(art::Event const& e) override;
48 
49  // Selected optional functions.
50  void beginJob() override;
51 
52  private:
53  std::string fMCTrackLabel;
54  std::string fMCSimPhotonsLabel;
55 
57  };
58 
60  : EDAnalyzer(p)
61  , fMCTrackLabel(p.get<std::string>("MCTrackLabel"))
62  , fMCSimPhotonsLabel(p.get<std::string>("MCSimPhotonsLabel"))
63  , fAlg(p.get<fhicl::ParameterSet>("FlashHypothesisAnaAlgParams"))
64  {}
65 
67  {
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:181
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
Namespace collecting geometry-related classes utilities.
void FillOpDetPositions(geo::Geometry const &)
void analyze(art::Event const &e) override
EventID id() const
Definition: Event.cc:23