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

Public Member Functions

 TimeDist (fhicl::ParameterSet const &parameterSet)
 
virtual void beginJob () override
 
virtual void reconfigure (fhicl::ParameterSet const &parameterSet)
 
virtual void analyze (const art::Event &event) 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 Attributes

std::string fHitProducerLabel
 The name of the producer that created hits. More...
 
std::string fFlashProducerLabel
 The name of the producer that created flashes. More...
 
TH1D * fTimeHist
 Hit time of all particles. More...
 
TH1D * fFlashHist
 Flash time of all particles. More...
 
TH1D * fTmFshHist
 Hit times minus Flash times. More...
 
TH1D * fTmFshHistU
 Hit times minus Flash times. More...
 
TH1D * fTmFshHistV
 Hit times minus Flash times. More...
 
TH1D * fTmFshHistW
 Hit times minus Flash times. More...
 
double frequency
 
double hittime
 

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 TimeDist_module.cc.

Constructor & Destructor Documentation

TimeDist::TimeDist::TimeDist ( fhicl::ParameterSet const &  parameterSet)
explicit

Definition at line 68 of file TimeDist_module.cc.

69  : EDAnalyzer(parameterSet)
70  {
71  reconfigure(parameterSet);
72  }
EDAnalyzer(fhicl::ParameterSet const &pset)
Definition: EDAnalyzer.h:25
virtual void reconfigure(fhicl::ParameterSet const &parameterSet)

Member Function Documentation

void TimeDist::TimeDist::analyze ( const art::Event event)
overridevirtual

Definition at line 95 of file TimeDist_module.cc.

96  {
97  auto const clockData = art::ServiceHandle<detinfo::DetectorClocksService const>()->DataFor(event);
98 
99  auto hitHandle = event.getHandle< std::vector<recob::Hit> >(fHitProducerLabel);
100 
101  // For every Hit:
102  for ( auto const& hit : (*hitHandle) )
103  {
104  frequency = clockData.TPCClock().Frequency();
105  hittime = hit.PeakTime()/frequency;
106 
107  fTimeHist->Fill(hittime); // filling the historgram with hit times
108 
109  } // for each Hit
110 
111  auto flashHandle = event.getHandle< std::vector<recob::OpFlash> >(fFlashProducerLabel);
112 
113  // For every Flash:
114  for ( auto const& opflash : (*flashHandle) )
115  {
116  // The channel associated with this flash.
117  fFlashHist->Fill(opflash.Time());
118  } // for each Flash
119 
120  for ( auto const& hit : (*hitHandle) )
121  {
122  double frequency = clockData.TPCClock().Frequency();
123  double hittime = hit.PeakTime()/frequency;
124  for ( auto const& opflash : (*flashHandle) )
125  {
126  fTmFshHist->Fill(hittime-opflash.Time());
127  }
128  if (hit.View()==geo::kU)
129  {
130  for ( auto const& opflash : (*flashHandle) )
131  {
132  fTmFshHistU->Fill(hittime-opflash.Time());
133  }
134  }
135  else if (hit.View()==geo::kV)
136  {
137  for ( auto const& opflash : (*flashHandle) )
138  {
139  fTmFshHistV->Fill(hittime-opflash.Time());
140  }
141  }
142  else
143  {
144  for ( auto const& opflash : (*flashHandle) )
145  {
146  fTmFshHistW->Fill(hittime-opflash.Time());
147  }
148  }
149  } // hit for
150  } // TimeDist::analyze()
TH1D * fTimeHist
Hit time of all particles.
TH1D * fFlashHist
Flash time of all particles.
Planes which measure V.
Definition: geo_types.h:130
TH1D * fTmFshHist
Hit times minus Flash times.
TH1D * fTmFshHistW
Hit times minus Flash times.
TH1D * fTmFshHistU
Hit times minus Flash times.
Planes which measure U.
Definition: geo_types.h:129
std::string fFlashProducerLabel
The name of the producer that created flashes.
TH1D * fTmFshHistV
Hit times minus Flash times.
Detector simulation of raw signals on wires.
std::string fHitProducerLabel
The name of the producer that created hits.
void TimeDist::TimeDist::beginJob ( )
overridevirtual

Reimplemented from art::EDAnalyzer.

Definition at line 75 of file TimeDist_module.cc.

76  {
78 
79  fTimeHist = tfs->make<TH1D>("timehist",";Histogram of Hit Times;",4500, -1000, 17000);
80  fFlashHist = tfs->make<TH1D>("flashhist",";Histogram of Flash Times;",180, -1000, 17000);
81  fTmFshHist = tfs->make<TH1D>("hit-flash_Times" ,";Histogram of Hit-Flash Times;",7000, -3000, 4000);
82  fTmFshHistU = tfs->make<TH1D>("hit-flash_Times_U",";Histogram of Hit-Flash Times;",7000, -3000, 4000);
83  fTmFshHistV = tfs->make<TH1D>("hit-flash_Times_V",";Histogram of Hit-Flash Times;",7000, -3000, 4000);
84  fTmFshHistW = tfs->make<TH1D>("hit-flash_Times_W",";Histogram of Hit-Flash Times;",7000, -3000, 4000);
85  }
TH1D * fTimeHist
Hit time of all particles.
TH1D * fFlashHist
Flash time of all particles.
TH1D * fTmFshHist
Hit times minus Flash times.
TH1D * fTmFshHistW
Hit times minus Flash times.
TH1D * fTmFshHistU
Hit times minus Flash times.
TH1D * fTmFshHistV
Hit times minus Flash times.
void TimeDist::TimeDist::reconfigure ( fhicl::ParameterSet const &  parameterSet)
virtual

Definition at line 88 of file TimeDist_module.cc.

89  {
90  fHitProducerLabel = parameterSet.get< std::string >("HitLabel");
91  fFlashProducerLabel = parameterSet.get< std::string >("FlashLabel");
92  }
std::string string
Definition: nybbler.cc:12
std::string fFlashProducerLabel
The name of the producer that created flashes.
std::string fHitProducerLabel
The name of the producer that created hits.

Member Data Documentation

TH1D* TimeDist::TimeDist::fFlashHist
private

Flash time of all particles.

Definition at line 57 of file TimeDist_module.cc.

std::string TimeDist::TimeDist::fFlashProducerLabel
private

The name of the producer that created flashes.

Definition at line 55 of file TimeDist_module.cc.

std::string TimeDist::TimeDist::fHitProducerLabel
private

The name of the producer that created hits.

Definition at line 54 of file TimeDist_module.cc.

double TimeDist::TimeDist::frequency
private

Definition at line 63 of file TimeDist_module.cc.

TH1D* TimeDist::TimeDist::fTimeHist
private

Hit time of all particles.

Definition at line 56 of file TimeDist_module.cc.

TH1D* TimeDist::TimeDist::fTmFshHist
private

Hit times minus Flash times.

Definition at line 58 of file TimeDist_module.cc.

TH1D* TimeDist::TimeDist::fTmFshHistU
private

Hit times minus Flash times.

Definition at line 59 of file TimeDist_module.cc.

TH1D* TimeDist::TimeDist::fTmFshHistV
private

Hit times minus Flash times.

Definition at line 60 of file TimeDist_module.cc.

TH1D* TimeDist::TimeDist::fTmFshHistW
private

Hit times minus Flash times.

Definition at line 61 of file TimeDist_module.cc.

double TimeDist::TimeDist::hittime
private

Definition at line 64 of file TimeDist_module.cc.


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