LArSoft  v09_90_00
Liquid Argon Software toolkit - https://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 
15 #include "fhiclcpp/ParameterSet.h"
16 
17 #include "art_root_io/TFileService.h"
18 
19 #include "OpFlashAnaAlg.h"
20 
21 #include "TTree.h"
22 
23 namespace opdet {
24  class OpFlashSimpleAna;
25 }
26 
28 public:
29  explicit OpFlashSimpleAna(fhicl::ParameterSet const& p);
30  // The destructor generated by the compiler is fine for classes
31  // without bare pointers or other resource use.
32 
33  // Plugins should not be copied or assigned.
34  OpFlashSimpleAna(OpFlashSimpleAna const&) = delete;
38 
39  void analyze(art::Event const& e) override;
40 
41  void beginJob() override;
42 
43 private:
44  // Declare member data here.
45  std::string fOpFlashModuleLabel;
46  std::string fOpHitModuleLabel;
48 
50 };
51 
53 // More initializers here.
54 {
55  fOpFlashModuleLabel = p.get<std::string>("OpFlashModuleLabel", "");
56  fOpHitModuleLabel = p.get<std::string>("OpFlashModuleLabel", "");
57  fMakeOpDetPEHist = p.get<bool>("MakeOpDetPEHist", true);
58 }
59 
61 {
62  if (fOpFlashModuleLabel.size() > 0) {
64  e.getByLabel(fOpFlashModuleLabel, flashHandle);
65  std::vector<recob::OpFlash> const& flashVector(*flashHandle);
66  fAnaAlg.FillOpFlashes(flashVector);
67  }
68  if (fOpHitModuleLabel.size() > 0) {
70  e.getByLabel(fOpHitModuleLabel, hitHandle);
71  std::vector<recob::OpHit> const& hitVector(*hitHandle);
72  fAnaAlg.FillOpHits(hitVector);
73  }
74 }
75 
77 {
79  if (fOpFlashModuleLabel.size() > 0)
80  fAnaAlg.SetOpFlashTree(tfs->make<TTree>("OpFlashTree", "OpFlashSimpleAna: Flash Tree"),
82  if (fOpHitModuleLabel.size() > 0)
83  fAnaAlg.SetOpHitTree(tfs->make<TTree>("OpHitTree", "OpFlashSimpleAna: Hit Tree"));
84 }
85 
OpFlashSimpleAna & operator=(OpFlashSimpleAna const &)=delete
void FillOpFlashes(const std::vector< recob::OpFlash > &)
void FillOpHits(const std::vector< recob::OpHit > &)
EDAnalyzer(fhicl::ParameterSet const &pset)
Definition: EDAnalyzer.cc:6
void SetOpFlashTree(TTree *, bool makeOpDetPEHist=true)
#define DEFINE_ART_MODULE(klass)
Definition: ModuleMacros.h:65
void analyze(art::Event const &e) override
T get(std::string const &key) const
Definition: ParameterSet.h:314
void SetOpHitTree(TTree *)
bool getByLabel(std::string const &label, std::string const &instance, Handle< PROD > &result) const
Float_t e
Definition: plot.C:35
OpFlashSimpleAna(fhicl::ParameterSet const &p)