FlashHypothesisAna_module.cc
Go to the documentation of this file.
1 ////////////////////////////////////////////////////////////////////////
2 // 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.
8 ////////////////////////////////////////////////////////////////////////
9 
14 #include "fhiclcpp/ParameterSet.h"
15 
16 #include "art_root_io/TFileService.h"
17 
18 #include "FlashHypothesisAnaAlg.h"
19 
20 #include "lardata/DetectorInfoServices/ServicePack.h" // lar::extractProviders()
22 
23 #include "TH1F.h"
24 #include "TTree.h"
25 
26 namespace opdet{
27  class FlashHypothesisAna;
28 }
29 
30 namespace opdet{
31 
33  public:
34  explicit FlashHypothesisAna(fhicl::ParameterSet const & p);
35  // The destructor generated by the compiler is fine for classes
36  // without bare pointers or other resource use.
37 
38  // Plugins should not be copied or assigned.
39  FlashHypothesisAna(FlashHypothesisAna const &) = delete;
43 
44  // Required functions.
45  void analyze(art::Event const & e) override;
46 
47  // Selected optional functions.
48  void beginJob() override;
49 
50  private:
51 
54 
56 
57  };
58 
59 
61  :
62  EDAnalyzer(p),
63  fMCTrackLabel(p.get<std::string>("MCTrackLabel")),
64  fMCSimPhotonsLabel(p.get<std::string>("MCSimPhotonsLabel")),
65  fAlg(p.get<fhicl::ParameterSet>("FlashHypothesisAnaAlgParams"))
66  {}
67 
69  {
70 
72  e.getByLabel(fMCTrackLabel,mctrackHandle);
73  std::vector<sim::MCTrack> const& mctrackVec(*mctrackHandle);
74 
76  e.getByLabel(fMCSimPhotonsLabel,simPhotonsHandle);
77  std::vector<sim::SimPhotons> const& simPhotonsVec(*simPhotonsHandle);
78 
79 
82 
83  opdet::OpDigiProperties const& opdigi(*opdigiHandle);
84  phot::PhotonVisibilityService const& pvs(*pvsHandle);
85 
86  fAlg.RunComparison((unsigned int)e.run(),(unsigned int)e.id().event(),
87  mctrackVec,simPhotonsVec,
88  lar::extractProviders<geo::Geometry, detinfo::LArPropertiesService>(),
89  opdigi,pvs);
90 
91  }
92 
94  {
96  geo::Geometry const& geo(*geoHandle);
97 
99 
100  fAlg.SetOutputObjects(tfs->make<TTree>("ctree","FlashHypothesisAnaTree"),
101  tfs->make<TH1F>(), tfs->make<TH1F>(), tfs->make<TH1F>(),
102  tfs->make<TH1F>(), tfs->make<TH1F>(), tfs->make<TH1F>(),
103  tfs->make<TH1F>(), tfs->make<TH1F>(), tfs->make<TH1F>(),
104  geo);
106  }
107 
108 }
109 
std::string string
Definition: nybbler.cc:12
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.h:25
bool getByLabel(std::string const &label, std::string const &instance, Handle< PROD > &result) const
Definition: DataViewImpl.h:633
void SetOutputObjects(TTree *, TH1F *, TH1F *, TH1F *, TH1F *, TH1F *, TH1F *, TH1F *, TH1F *, TH1F *, geo::Geometry const &)
const double e
#define DEFINE_ART_MODULE(klass)
Definition: ModuleMacros.h:67
FlashHypothesisAna & operator=(FlashHypothesisAna const &)=delete
p
Definition: test.py:223
RunNumber_t run() const
Definition: DataViewImpl.cc:71
The geometry of one entire detector, as served by art.
Definition: Geometry.h:196
FlashHypothesisAna(fhicl::ParameterSet const &p)
EventNumber_t event() const
Definition: EventID.h:116
auto const & get(AssnsNode< L, R, D > const &r)
Definition: AssnsNode.h:115
LArSoft geometry interface.
Definition: ChannelGeo.h:16
void FillOpDetPositions(geo::Geometry const &)
void analyze(art::Event const &e) override
EventID id() const
Definition: Event.cc:34