Classes | Public Types | Public Member Functions | Private Member Functions | Private Attributes | List of all members
pdune::RecoHitsEff Class Reference
Inheritance diagram for pdune::RecoHitsEff:
art::EDAnalyzer art::detail::Analyzer art::detail::LegacyModule art::Observer art::ModuleBase

Classes

struct  Config
 

Public Types

using Parameters = art::EDAnalyzer::Table< Config >
 
- Public Types inherited from art::EDAnalyzer
using WorkerType = WorkerT< EDAnalyzer >
 
using ModuleType = EDAnalyzer
 

Public Member Functions

 RecoHitsEff (Parameters const &config)
 
 RecoHitsEff (RecoHitsEff const &)=delete
 
 RecoHitsEff (RecoHitsEff &&)=delete
 
RecoHitsEffoperator= (RecoHitsEff const &)=delete
 
RecoHitsEffoperator= (RecoHitsEff &&)=delete
 
void analyze (art::Event const &e) override
 
void beginJob () override
 
- Public Member Functions inherited from art::EDAnalyzer
 EDAnalyzer (fhicl::ParameterSet const &pset)
 
template<typename Config >
 EDAnalyzer (Table< Config > const &config)
 
std::string workerType () const
 
- Public Member Functions inherited from art::detail::Analyzer
virtual ~Analyzer () noexcept
 
 Analyzer (fhicl::ParameterSet const &pset)
 
template<typename Config >
 Analyzer (Table< Config > const &config)
 
void doBeginJob (SharedResources const &resources)
 
void doEndJob ()
 
void doRespondToOpenInputFile (FileBlock const &fb)
 
void doRespondToCloseInputFile (FileBlock const &fb)
 
void doRespondToOpenOutputFiles (FileBlock const &fb)
 
void doRespondToCloseOutputFiles (FileBlock const &fb)
 
bool doBeginRun (RunPrincipal &rp, ModuleContext const &mc)
 
bool doEndRun (RunPrincipal &rp, ModuleContext const &mc)
 
bool doBeginSubRun (SubRunPrincipal &srp, ModuleContext const &mc)
 
bool doEndSubRun (SubRunPrincipal &srp, ModuleContext const &mc)
 
bool doEvent (EventPrincipal &ep, ModuleContext const &mc, std::atomic< std::size_t > &counts_run, std::atomic< std::size_t > &counts_passed, std::atomic< std::size_t > &counts_failed)
 
- Public Member Functions inherited from art::Observer
 ~Observer () noexcept
 
 Observer (Observer const &)=delete
 
 Observer (Observer &&)=delete
 
Observeroperator= (Observer const &)=delete
 
Observeroperator= (Observer &&)=delete
 
void registerProducts (ProductDescriptions &, ModuleDescription const &)
 
void fillDescriptions (ModuleDescription const &)
 
fhicl::ParameterSetID selectorConfig () const
 
- Public Member Functions inherited from art::ModuleBase
virtual ~ModuleBase () noexcept
 
 ModuleBase ()
 
ModuleDescription const & moduleDescription () const
 
void setModuleDescription (ModuleDescription const &)
 
std::array< std::vector< ProductInfo >, NumBranchTypes > const & getConsumables () const
 
void sortConsumables (std::string const &current_process_name)
 
template<typename T , BranchType BT>
ViewToken< T > consumesView (InputTag const &tag)
 
template<typename T , BranchType BT>
ViewToken< T > mayConsumeView (InputTag const &tag)
 

Private Member Functions

void ResetVars ()
 

Private Attributes

TTree * fTree
 
int fRun
 
int fEvent
 
int fNhits
 
int fNdcheat
 
int fMatching
 
art::InputTag fHitModuleLabel
 
art::InputTag fHitDCheatLabel
 
int fPlane
 

Additional Inherited Members

- Protected Member Functions inherited from art::Observer
std::string const & processName () const
 
bool wantAllEvents () const noexcept
 
bool wantEvent (ScheduleID id, Event const &e) const
 
Handle< TriggerResultsgetTriggerResults (Event const &e) const
 
 Observer (fhicl::ParameterSet const &config)
 
 Observer (std::vector< std::string > const &select_paths, std::vector< std::string > const &reject_paths, fhicl::ParameterSet const &config)
 
- Protected Member Functions inherited from art::ModuleBase
ConsumesCollectorconsumesCollector ()
 
template<typename T , BranchType = InEvent>
ProductToken< T > consumes (InputTag const &)
 
template<typename Element , BranchType = InEvent>
ViewToken< Element > consumesView (InputTag const &)
 
template<typename T , BranchType = InEvent>
void consumesMany ()
 
template<typename T , BranchType = InEvent>
ProductToken< T > mayConsume (InputTag const &)
 
template<typename Element , BranchType = InEvent>
ViewToken< Element > mayConsumeView (InputTag const &)
 
template<typename T , BranchType = InEvent>
void mayConsumeMany ()
 

Detailed Description

Definition at line 40 of file RecoHitsEff_module.cc.

Member Typedef Documentation

Definition at line 59 of file RecoHitsEff_module.cc.

Constructor & Destructor Documentation

pdune::RecoHitsEff::RecoHitsEff ( Parameters const &  config)
explicit

Definition at line 86 of file RecoHitsEff_module.cc.

86  : EDAnalyzer(config),
87  fHitModuleLabel(config().HitModuleLabel()),
88  fHitDCheatLabel(config().HitDCheatLabel()),
89  fPlane(config().Plane())
90 {
91 }
EDAnalyzer(fhicl::ParameterSet const &pset)
Definition: EDAnalyzer.h:25
art::InputTag fHitModuleLabel
static Config * config
Definition: config.cpp:1054
art::InputTag fHitDCheatLabel
recob::tracking::Plane Plane
Definition: TrackState.h:17
pdune::RecoHitsEff::RecoHitsEff ( RecoHitsEff const &  )
delete
pdune::RecoHitsEff::RecoHitsEff ( RecoHitsEff &&  )
delete

Member Function Documentation

void pdune::RecoHitsEff::analyze ( art::Event const &  e)
overridevirtual

Implements art::EDAnalyzer.

Definition at line 106 of file RecoHitsEff_module.cc.

107 {
108  ResetVars();
109 
110  fRun = evt.run();
111  fEvent = evt.id().event();
112 
113  auto const & hitList = *evt.getValidHandle< std::vector<recob::Hit> >(fHitModuleLabel);
114 
115  std::vector< size_t > hits;
116  // get and sort hits
117  int plane = 0;
118  for (size_t k = 0; k < hitList.size(); ++k)
119  {
120  plane = hitList[k].WireID().Plane;
121  if (plane != fPlane) continue;
122  fNhits++;
123 
124  hits.push_back(k);
125  }
126 
127  auto const & dcheatList = *evt.getValidHandle< std::vector<recob::Hit> >(fHitDCheatLabel);
128 
129  std::vector< size_t > hitsdc;
130  // get and short hits_dc
131  for (size_t k = 0; k < dcheatList.size(); ++k)
132  {
133  plane = dcheatList[k].WireID().Plane;
134  if (plane != fPlane) continue;
135  fNdcheat++;
136 
137  hitsdc.push_back(k);
138  }
139 
140  std::cout << " fNhits " << fNhits << std::endl;
141  std::cout << " fNdcheat " << fNdcheat << std::endl;
142 
143  for (auto const h: hits)
144  {
145  for (auto const hdc: hitsdc)
146  {
147  if ((hitList[h].PeakTime() == dcheatList[hdc].PeakTime()) && (hitList[h].WireID() == dcheatList[hdc].WireID()))
148  {
149  fMatching++;
150  }
151  }
152  }
153 
154  std::cout << " fMatching " << fMatching << std::endl;
155 
156  fTree->Fill();
157 }
unsigned int event
Definition: DataStructs.h:636
unsigned int run
Definition: DataStructs.h:637
art::InputTag fHitModuleLabel
IDparameter< geo::WireID > WireID
Member type of validated geo::WireID parameter.
art::InputTag fHitDCheatLabel
TCEvent evt
Definition: DataStructs.cxx:7
QTextStream & endl(QTextStream &s)
void pdune::RecoHitsEff::beginJob ( )
overridevirtual

Reimplemented from art::EDAnalyzer.

Definition at line 93 of file RecoHitsEff_module.cc.

94 {
96 
97  fTree = tfs->make<TTree>("events", "summary tree");
98  fTree->Branch("fRun", &fRun, "fRun/I");
99  fTree->Branch("fEvent", &fEvent, "fEvent/I");
100  fTree->Branch("fPlane", &fPlane, "fPlane/I");
101  fTree->Branch("fNhits", &fNhits, "fNhits/I");
102  fTree->Branch("fNdcheat", &fNdcheat, "fNdcheat/I");
103  fTree->Branch("fMatching", &fMatching, "fMatching/I");
104 }
RecoHitsEff& pdune::RecoHitsEff::operator= ( RecoHitsEff const &  )
delete
RecoHitsEff& pdune::RecoHitsEff::operator= ( RecoHitsEff &&  )
delete
void pdune::RecoHitsEff::ResetVars ( void  )
private

Definition at line 159 of file RecoHitsEff_module.cc.

160 {
161  fRun = 0;
162  fEvent = 0;
163  fNhits = 0;
164  fNdcheat = 0;
165  fMatching = 0;
166 }

Member Data Documentation

int pdune::RecoHitsEff::fEvent
private

Definition at line 77 of file RecoHitsEff_module.cc.

art::InputTag pdune::RecoHitsEff::fHitDCheatLabel
private

Definition at line 82 of file RecoHitsEff_module.cc.

art::InputTag pdune::RecoHitsEff::fHitModuleLabel
private

Definition at line 81 of file RecoHitsEff_module.cc.

int pdune::RecoHitsEff::fMatching
private

Definition at line 79 of file RecoHitsEff_module.cc.

int pdune::RecoHitsEff::fNdcheat
private

Definition at line 78 of file RecoHitsEff_module.cc.

int pdune::RecoHitsEff::fNhits
private

Definition at line 78 of file RecoHitsEff_module.cc.

int pdune::RecoHitsEff::fPlane
private

Definition at line 83 of file RecoHitsEff_module.cc.

int pdune::RecoHitsEff::fRun
private

Definition at line 77 of file RecoHitsEff_module.cc.

TTree* pdune::RecoHitsEff::fTree
private

Definition at line 75 of file RecoHitsEff_module.cc.


The documentation for this class was generated from the following file: