OpFlashSimpleAna_module.cc
Go to the documentation of this file.
1 ////////////////////////////////////////////////////////////////////////
2 // Class: OpFlashSimpleAna
3 // Module Type: analyzer
4 // File: OpFlashSimpleAna_module.cc
5 //
6 // Generated at Tue Apr 21 10:58:24 2015 by Wesley Ketchum using artmod
7 // from cetpkgsupport v1_08_05.
8 ////////////////////////////////////////////////////////////////////////
9 
14 #include "fhiclcpp/ParameterSet.h"
15 
16 #include "art_root_io/TFileService.h"
17 
18 #include "OpFlashAnaAlg.h"
19 
20 #include "TTree.h"
21 
22 namespace opdet {
23  class OpFlashSimpleAna;
24 }
25 
27 public:
28  explicit OpFlashSimpleAna(fhicl::ParameterSet const & p);
29  // The destructor generated by the compiler is fine for classes
30  // without bare pointers or other resource use.
31 
32  // Plugins should not be copied or assigned.
33  OpFlashSimpleAna(OpFlashSimpleAna const &) = delete;
35  OpFlashSimpleAna & operator = (OpFlashSimpleAna const &) = delete;
37 
38  void analyze(art::Event const & e) override;
39 
40  void beginJob() override;
41 
42 private:
43 
44  // Declare member data here.
48 
50 
51 };
52 
53 
55  :
56  EDAnalyzer(p) // ,
57  // More initializers here.
58 {
59  fOpFlashModuleLabel = p.get<std::string>("OpFlashModuleLabel","");
60  fOpHitModuleLabel = p.get<std::string>("OpFlashModuleLabel","");
61  fMakeOpDetPEHist = p.get<bool>("MakeOpDetPEHist",true);
62 }
63 
65 {
66  if(fOpFlashModuleLabel.size()>0){
68  e.getByLabel(fOpFlashModuleLabel, flashHandle);
69  std::vector<recob::OpFlash> const& flashVector(*flashHandle);
70  fAnaAlg.FillOpFlashes(flashVector);
71  }
72  if(fOpHitModuleLabel.size()>0){
74  e.getByLabel(fOpHitModuleLabel, hitHandle);
75  std::vector<recob::OpHit> const& hitVector(*hitHandle);
76  fAnaAlg.FillOpHits(hitVector);
77  }
78 }
79 
81 {
83  if(fOpFlashModuleLabel.size()>0)
84  fAnaAlg.SetOpFlashTree(tfs->make<TTree>("OpFlashTree","OpFlashSimpleAna: Flash Tree"),
86  if(fOpHitModuleLabel.size()>0)
87  fAnaAlg.SetOpHitTree(tfs->make<TTree>("OpHitTree","OpFlashSimpleAna: Hit Tree"));
88 }
89 
OpFlashSimpleAna & operator=(OpFlashSimpleAna const &)=delete
void FillOpFlashes(const std::vector< recob::OpFlash > &)
std::string string
Definition: nybbler.cc:12
void FillOpHits(const std::vector< recob::OpHit > &)
EDAnalyzer(fhicl::ParameterSet const &pset)
Definition: EDAnalyzer.h:25
void SetOpFlashTree(TTree *, bool makeOpDetPEHist=true)
bool getByLabel(std::string const &label, std::string const &instance, Handle< PROD > &result) const
Definition: DataViewImpl.h:633
const double e
#define DEFINE_ART_MODULE(klass)
Definition: ModuleMacros.h:67
void analyze(art::Event const &e) override
T get(std::string const &key) const
Definition: ParameterSet.h:271
p
Definition: test.py:223
void SetOpHitTree(TTree *)
OpFlashSimpleAna(fhicl::ParameterSet const &p)