LArSoft  v07_13_02
Liquid Argon Software toolkit - http://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 
17 #include "fhiclcpp/ParameterSet.h"
19 
21 
22 #include "FlashHypothesisAnaAlg.h"
23 
24 #include "lardata/DetectorInfoServices/ServicePack.h" // lar::extractProviders()
26 
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 
54  std::string fMCTrackLabel;
55  std::string fMCSimPhotonsLabel;
56 
58 
59  };
60 
61 
63  :
64  EDAnalyzer(p),
65  fMCTrackLabel(p.get<std::string>("MCTrackLabel")),
66  fMCSimPhotonsLabel(p.get<std::string>("MCSimPhotonsLabel")),
67  fAlg(p.get<fhicl::ParameterSet>("FlashHypothesisAnaAlgParams"))
68  {}
69 
71  {
72 
74  e.getByLabel(fMCTrackLabel,mctrackHandle);
75  std::vector<sim::MCTrack> const& mctrackVec(*mctrackHandle);
76 
78  e.getByLabel(fMCSimPhotonsLabel,simPhotonsHandle);
79  std::vector<sim::SimPhotons> const& simPhotonsVec(*simPhotonsHandle);
80 
81 
84 
85  opdet::OpDigiProperties const& opdigi(*opdigiHandle);
86  phot::PhotonVisibilityService const& pvs(*pvsHandle);
87 
88  fAlg.RunComparison((unsigned int)e.run(),(unsigned int)e.id().event(),
89  mctrackVec,simPhotonsVec,
90  lar::extractProviders<geo::Geometry, detinfo::LArPropertiesService>(),
91  opdigi,pvs);
92 
93  }
94 
96  {
98  geo::Geometry const& geo(*geoHandle);
99 
101 
102  fAlg.SetOutputObjects(tfs->make<TTree>("ctree","FlashHypothesisAnaTree"),
103  tfs->make<TH1F>(), tfs->make<TH1F>(), tfs->make<TH1F>(),
104  tfs->make<TH1F>(), tfs->make<TH1F>(), tfs->make<TH1F>(),
105  tfs->make<TH1F>(), tfs->make<TH1F>(), tfs->make<TH1F>(),
106  geo);
108  }
109 
110 }
111 
113 
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.
void SetOutputObjects(TTree *, TH1F *, TH1F *, TH1F *, TH1F *, TH1F *, TH1F *, TH1F *, TH1F *, TH1F *, geo::Geometry const &)
#define DEFINE_ART_MODULE(klass)
Definition: ModuleMacros.h:42
FlashHypothesisAna & operator=(FlashHypothesisAna const &)=delete
parameter set interface
EDAnalyzer(Table< Config > const &config)
Definition: EDAnalyzer.h:100
The geometry of one entire detector, as served by art.
Definition: Geometry.h:110
T * make(ARGS...args) const
bool getByLabel(std::string const &label, std::string const &productInstanceName, Handle< PROD > &result) const
Definition: DataViewImpl.h:344
FlashHypothesisAna(fhicl::ParameterSet const &p)
EventNumber_t event() const
Definition: EventID.h:117
Float_t e
Definition: plot.C:34
RunNumber_t run() const
Definition: Event.h:77
Namespace collecting geometry-related classes utilities.
void FillOpDetPositions(geo::Geometry const &)
void analyze(art::Event const &e) override
EventID id() const
Definition: Event.h:56