LArSoft  v06_85_00
Liquid Argon Software toolkit - http://larsoft.org/
OpFlashSimpleAna_module.cc
Go to the documentation of this file.
1 // 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.
9 
17 #include "fhiclcpp/ParameterSet.h"
19 
21 
22 #include "OpFlashAnaAlg.h"
23 
24 namespace opdet {
25  class OpFlashSimpleAna;
26 }
27 
29 public:
30  explicit OpFlashSimpleAna(fhicl::ParameterSet const & p);
31  // The destructor generated by the compiler is fine for classes
32  // without bare pointers or other resource use.
33 
34  // Plugins should not be copied or assigned.
35  OpFlashSimpleAna(OpFlashSimpleAna const &) = delete;
37  OpFlashSimpleAna & operator = (OpFlashSimpleAna const &) = delete;
39 
40  void analyze(art::Event const & e) override;
41 
42  void reconfigure(fhicl::ParameterSet const & p) ;
43  void beginJob() override;
44 
45 private:
46 
47  // Declare member data here.
48  std::string fOpFlashModuleLabel;
49  std::string fOpHitModuleLabel;
51 
53 
54 };
55 
56 
58  :
59  EDAnalyzer(p) // ,
60  // More initializers here.
61 { this->reconfigure(p); }
62 
64 {
65  if(fOpFlashModuleLabel.size()>0){
67  e.getByLabel(fOpFlashModuleLabel, flashHandle);
68  std::vector<recob::OpFlash> const& flashVector(*flashHandle);
69  fAnaAlg.FillOpFlashes(flashVector);
70  }
71  if(fOpHitModuleLabel.size()>0){
73  e.getByLabel(fOpHitModuleLabel, hitHandle);
74  std::vector<recob::OpHit> const& hitVector(*hitHandle);
75  fAnaAlg.FillOpHits(hitVector);
76  }
77 }
78 
80 {
82  if(fOpFlashModuleLabel.size()>0)
83  fAnaAlg.SetOpFlashTree(tfs->make<TTree>("OpFlashTree","OpFlashSimpleAna: Flash Tree"),
85  if(fOpHitModuleLabel.size()>0)
86  fAnaAlg.SetOpHitTree(tfs->make<TTree>("OpHitTree","OpFlashSimpleAna: Hit Tree"));
87 }
88 
90 {
91  fOpFlashModuleLabel = p.get<std::string>("OpFlashModuleLabel","");
92  fOpHitModuleLabel = p.get<std::string>("OpFlashModuleLabel","");
93  fMakeOpDetPEHist = p.get<bool>("MakeOpDetPEHist",true);
94 }
95 
OpFlashSimpleAna & operator=(OpFlashSimpleAna const &)=delete
void FillOpFlashes(const std::vector< recob::OpFlash > &)
void FillOpHits(const std::vector< recob::OpHit > &)
void reconfigure(fhicl::ParameterSet const &p)
void SetOpFlashTree(TTree *, bool makeOpDetPEHist=true)
#define DEFINE_ART_MODULE(klass)
Definition: ModuleMacros.h:42
void analyze(art::Event const &e) override
T get(std::string const &key) const
Definition: ParameterSet.h:231
void SetOpHitTree(TTree *)
EDAnalyzer(Table< Config > const &config)
Definition: EDAnalyzer.h:100
T * make(ARGS...args) const
bool getByLabel(std::string const &label, std::string const &productInstanceName, Handle< PROD > &result) const
Definition: DataViewImpl.h:344
Float_t e
Definition: plot.C:34
OpFlashSimpleAna(fhicl::ParameterSet const &p)