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

Public Member Functions

 PlotTrackDetails (fhicl::ParameterSet const &p)
 
 PlotTrackDetails (PlotTrackDetails const &)=delete
 
 PlotTrackDetails (PlotTrackDetails &&)=delete
 
PlotTrackDetailsoperator= (PlotTrackDetails const &)=delete
 
PlotTrackDetailsoperator= (PlotTrackDetails &&)=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 fTrackProducerLabel
 
TH1F * fNTracksHist
 
TH1F * fNCosmicTagHist
 
TH1F * fNT0Hist
 
TH1F * fT0Hist
 
TH1F * fT0HistHiRes
 
TH1F * fCosmicT0Hist
 
TH1F * fCosmicT0HistHiRes
 

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 42 of file PlotTrackDetails_module.cc.

Constructor & Destructor Documentation

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

Definition at line 84 of file PlotTrackDetails_module.cc.

85  :
86  EDAnalyzer(pset) // ,
87  // More initializers here.
88 {
89  reconfigure(pset);
90 
91 }
EDAnalyzer(fhicl::ParameterSet const &pset)
Definition: EDAnalyzer.h:25
void reconfigure(fhicl::ParameterSet const &p)
nlana::PlotTrackDetails::PlotTrackDetails ( PlotTrackDetails const &  )
delete
nlana::PlotTrackDetails::PlotTrackDetails ( PlotTrackDetails &&  )
delete

Member Function Documentation

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

Implements art::EDAnalyzer.

Definition at line 126 of file PlotTrackDetails_module.cc.

127 {
128 
129  // Try finding some tracks
131  = evt.getValidHandle<std::vector<recob::Track> >(fTrackProducerLabel);
132 
133  // Find the associations between tracks and T0
134  const art::FindManyP<anab::T0> findTrackT0(trackHandle,evt,fTrackProducerLabel);
135 
136  // Also look for cosmic tags so we can make a T0 plot for cosmic tagged events only
137  const art::FindManyP<anab::CosmicTag> findCosmicTag(trackHandle,evt,fTrackProducerLabel);
138 
139  fNTracksHist->Fill(trackHandle->size());
140 
141  unsigned int nT0s = 0;
142  unsigned int nTags = 0;
143 
144  for ( size_t track_index = 0; track_index != trackHandle->size(); ++track_index )
145  {
146  const auto thisTrack = (*trackHandle)[track_index];
147 
148  // Did this track have an associated T0?
149  auto const& t0s = findTrackT0.at(track_index);
150  if(t0s.size() != 0){
151  ++nT0s;
152  fT0Hist->Fill(t0s[0]->Time());
153  fT0HistHiRes->Fill(t0s[0]->Time());
154  }
155  // Did this track have a cosmic tag?
156  auto const& tag = findCosmicTag.at(track_index);
157  if(tag.size() != 0){
158  ++nTags;
159  }
160 
161  if(t0s.size() && tag.size()){
162  fCosmicT0Hist->Fill(t0s[0]->Time());
163  fCosmicT0HistHiRes->Fill(t0s[0]->Time());
164  }
165 
166  }
167 
168  fNCosmicTagHist->Fill(nTags);
169  fNT0Hist->Fill(nT0s);
170 
171 } // analyze
TCEvent evt
Definition: DataStructs.cxx:7
void nlana::PlotTrackDetails::beginJob ( )
overridevirtual

Reimplemented from art::EDAnalyzer.

Definition at line 94 of file PlotTrackDetails_module.cc.

95 {
96  // Implementation of optional member function here.
97 
99 
100  fNTracksHist = tfs->make<TH1F>("NTracks",";Number of tracks",50,0,200);
101  fNCosmicTagHist = tfs->make<TH1F>("NCosmicTag",";Number of tracks tagged as cosmic",50,0,200);
102  fNT0Hist = tfs->make<TH1F>("NT0s",";Number of tracks with reconstructed T0",50,0,40);
103 
104  fT0Hist = tfs->make<TH1F>("TrackT0",";T0 (us)",100,-4000,4000);
105  fT0HistHiRes = tfs->make<TH1F>("TrackT0HiRes",";T0 (us)",1000,-4000,4000);
106  fCosmicT0Hist = tfs->make<TH1F>("CosmicTrackT0",";T0 (us)",100,-4000,4000);
107  fCosmicT0HistHiRes = tfs->make<TH1F>("CosmicTrackT0HiRes",";T0 (us)",1000,-4000,4000);
108 
109 } // beginJob
void nlana::PlotTrackDetails::endJob ( )
overridevirtual

Reimplemented from art::EDAnalyzer.

Definition at line 120 of file PlotTrackDetails_module.cc.

121 {
122 
123 } // endJob
PlotTrackDetails& nlana::PlotTrackDetails::operator= ( PlotTrackDetails const &  )
delete
PlotTrackDetails& nlana::PlotTrackDetails::operator= ( PlotTrackDetails &&  )
delete
void nlana::PlotTrackDetails::reconfigure ( fhicl::ParameterSet const &  p)

Definition at line 112 of file PlotTrackDetails_module.cc.

113 {
114  // The name of the module that produced the tracks
115  fTrackProducerLabel = pset.get<std::string>("TrackProducerLabel");
116 } // reconfigure
std::string string
Definition: nybbler.cc:12

Member Data Documentation

TH1F* nlana::PlotTrackDetails::fCosmicT0Hist
private

Definition at line 78 of file PlotTrackDetails_module.cc.

TH1F* nlana::PlotTrackDetails::fCosmicT0HistHiRes
private

Definition at line 79 of file PlotTrackDetails_module.cc.

TH1F* nlana::PlotTrackDetails::fNCosmicTagHist
private

Definition at line 70 of file PlotTrackDetails_module.cc.

TH1F* nlana::PlotTrackDetails::fNT0Hist
private

Definition at line 73 of file PlotTrackDetails_module.cc.

TH1F* nlana::PlotTrackDetails::fNTracksHist
private

Definition at line 67 of file PlotTrackDetails_module.cc.

TH1F* nlana::PlotTrackDetails::fT0Hist
private

Definition at line 76 of file PlotTrackDetails_module.cc.

TH1F* nlana::PlotTrackDetails::fT0HistHiRes
private

Definition at line 77 of file PlotTrackDetails_module.cc.

std::string nlana::PlotTrackDetails::fTrackProducerLabel
private

Definition at line 64 of file PlotTrackDetails_module.cc.


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