ProtoDUNEBeamTPCRecoEfficiency_module.cc
Go to the documentation of this file.
1 // leigh.howard.whitehead@cern.ch
2 // A simple module to determine the efficiency of reconstructing
3 // a beam particle using Pandora in events with a beam trigger
4 
5 #include <iostream>
6 #include <utility>
7 #include <set>
8 
12 
13 #include "dune/Protodune/singlephase/DataUtils/ProtoDUNEDataUtils.h"
16 #include "dune/Protodune/singlephase/CTB/data/pdspctb.h"
17 
18 namespace protoana{
19 
21  public:
24  void analyze(art::Event const &evt) override;
25  virtual void endJob() override;
26  private:
28  unsigned int fBeamTriggers;
29  unsigned int fBeamParticles;
30 
32  };
33 
35  EDAnalyzer(pset),
36  fDataUtils(pset.get<fhicl::ParameterSet>("DataUtils"))
37  {
38  fParticleLabel = pset.get<std::string>("ParticleLabel");
39  fBeamTriggers = 0;
40  fBeamParticles = 0;
41  }
42 
44 
46 
47  // Is this event from a beam trigger?
48  if(fDataUtils.IsBeamTrigger(evt)){
49  ++fBeamTriggers;
50  }
51 
52  // Do we have a reconstructed beam slice from Pandora?
53  if(pfpUtil.GetBeamSlice(evt,fParticleLabel) != 9999){
55  }
56 
57  }
58 
60  std::cout << "Beam triggered particle reconstruction efficiency = " << fBeamParticles/static_cast<float>(fBeamTriggers)
61  << " (" << fBeamParticles << "/" << fBeamTriggers << ")" << std::endl;
62  }
63 
65 
66 }
std::string string
Definition: nybbler.cc:12
EDAnalyzer(fhicl::ParameterSet const &pset)
Definition: EDAnalyzer.h:25
#define DEFINE_ART_MODULE(klass)
Definition: ModuleMacros.h:67
unsigned short GetBeamSlice(art::Event const &evt, const std::string particleLabel) const
Try to get the slice tagged as beam. Returns 9999 if no beam slice was found.
T get(std::string const &key) const
Definition: ParameterSet.h:271
TCEvent evt
Definition: DataStructs.cxx:7
auto const & get(AssnsNode< L, R, D > const &r)
Definition: AssnsNode.h:115
QTextStream & endl(QTextStream &s)
bool IsBeamTrigger(art::Event const &evt) const