Public Member Functions | Private Attributes | List of all members
nlana::PlotEventDetails Class Reference
Inheritance diagram for nlana::PlotEventDetails:
art::EDAnalyzer art::detail::Analyzer art::detail::LegacyModule art::Observer art::ModuleBase

Public Member Functions

 PlotEventDetails (fhicl::ParameterSet const &p)
 
 PlotEventDetails (PlotEventDetails const &)=delete
 
 PlotEventDetails (PlotEventDetails &&)=delete
 
PlotEventDetailsoperator= (PlotEventDetails const &)=delete
 
PlotEventDetailsoperator= (PlotEventDetails &&)=delete
 
void analyze (art::Event const &e) override
 
void beginJob () override
 
void endJob () override
 
void reconfigure (fhicl::ParameterSet const &p)
 
- 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 Attributes

std::string fParticleProducerLabel
 
std::string fTrackProducerLabel
 
std::string fShowerProducerLabel
 
float fLongTrackCut
 
TH1F * fNParticlesHist
 
TH1F * fNTracksHist
 
TH1F * fNLongTracksHist
 
TH1F * fNShowersHist
 

Additional Inherited Members

- Public Types inherited from art::EDAnalyzer
using WorkerType = WorkerT< EDAnalyzer >
 
using ModuleType = EDAnalyzer
 
- 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 35 of file PlotEventDetails_module.cc.

Constructor & Destructor Documentation

nlana::PlotEventDetails::PlotEventDetails ( fhicl::ParameterSet const &  p)
explicit

Definition at line 72 of file PlotEventDetails_module.cc.

73  :
74  EDAnalyzer(pset) // ,
75  // More initializers here.
76 {
77  reconfigure(pset);
78 
79 }
EDAnalyzer(fhicl::ParameterSet const &pset)
Definition: EDAnalyzer.h:25
void reconfigure(fhicl::ParameterSet const &p)
nlana::PlotEventDetails::PlotEventDetails ( PlotEventDetails const &  )
delete
nlana::PlotEventDetails::PlotEventDetails ( PlotEventDetails &&  )
delete

Member Function Documentation

void nlana::PlotEventDetails::analyze ( art::Event const &  e)
overridevirtual

Implements art::EDAnalyzer.

Definition at line 116 of file PlotEventDetails_module.cc.

117 {
118 
119  // Try finding some tracks
120  art::ValidHandle< std::vector<recob::PFParticle> > particleHandle = evt.getValidHandle<std::vector<recob::PFParticle> >(fParticleProducerLabel);
121  art::ValidHandle< std::vector<recob::Track> > trackHandle = evt.getValidHandle<std::vector<recob::Track> >(fTrackProducerLabel);
122  art::ValidHandle< std::vector<recob::Shower> > showerHandle = evt.getValidHandle<std::vector<recob::Shower> >(fShowerProducerLabel);
123 
124  fNParticlesHist->Fill(particleHandle->size());
125 
126  fNTracksHist->Fill(trackHandle->size());
127  unsigned int nLongTracks = 0;
128  for(auto const track : (*trackHandle)){
129  if(track.Length() > fLongTrackCut) ++nLongTracks;
130  }
131  fNLongTracksHist->Fill(nLongTracks);
132 
133  fNShowersHist->Fill(showerHandle->size());
134 
135 } // analyze
TCEvent evt
Definition: DataStructs.cxx:7
void nlana::PlotEventDetails::beginJob ( )
overridevirtual

Reimplemented from art::EDAnalyzer.

Definition at line 82 of file PlotEventDetails_module.cc.

83 {
84  // Implementation of optional member function here.
85 
87 
88  fNParticlesHist = tfs->make<TH1F>("NParticles",";Number of particles",50,0,200);
89  fNTracksHist = tfs->make<TH1F>("NTracks",";Number of tracks",50,0,200);
90  fNLongTracksHist = tfs->make<TH1F>("NLongTracks",";Number of long tracks",50,0,200);
91  fNShowersHist = tfs->make<TH1F>("NShowers",";Number of showers",50,0,200);
92 
93 } // beginJob
void nlana::PlotEventDetails::endJob ( )
overridevirtual

Reimplemented from art::EDAnalyzer.

Definition at line 110 of file PlotEventDetails_module.cc.

111 {
112 
113 } // endJob
PlotEventDetails& nlana::PlotEventDetails::operator= ( PlotEventDetails const &  )
delete
PlotEventDetails& nlana::PlotEventDetails::operator= ( PlotEventDetails &&  )
delete
void nlana::PlotEventDetails::reconfigure ( fhicl::ParameterSet const &  p)

Definition at line 96 of file PlotEventDetails_module.cc.

97 {
98  // The names of the module that produced the reconstructed objects
99  fParticleProducerLabel = pset.get<std::string>("ParticleProducerLabel");
100  fTrackProducerLabel = pset.get<std::string>("TrackProducerLabel");
101  fShowerProducerLabel = pset.get<std::string>("ShowerProducerLabel");
102 
103  // Threshold cut for considering a track as long
104  fLongTrackCut = pset.get<float>("LongTrackThreshold");
105 
106 } // reconfigure
std::string string
Definition: nybbler.cc:12

Member Data Documentation

float nlana::PlotEventDetails::fLongTrackCut
private

Definition at line 61 of file PlotEventDetails_module.cc.

TH1F* nlana::PlotEventDetails::fNLongTracksHist
private

Definition at line 66 of file PlotEventDetails_module.cc.

TH1F* nlana::PlotEventDetails::fNParticlesHist
private

Definition at line 64 of file PlotEventDetails_module.cc.

TH1F* nlana::PlotEventDetails::fNShowersHist
private

Definition at line 67 of file PlotEventDetails_module.cc.

TH1F* nlana::PlotEventDetails::fNTracksHist
private

Definition at line 65 of file PlotEventDetails_module.cc.

std::string nlana::PlotEventDetails::fParticleProducerLabel
private

Definition at line 57 of file PlotEventDetails_module.cc.

std::string nlana::PlotEventDetails::fShowerProducerLabel
private

Definition at line 59 of file PlotEventDetails_module.cc.

std::string nlana::PlotEventDetails::fTrackProducerLabel
private

Definition at line 58 of file PlotEventDetails_module.cc.


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