Public Types | Public Member Functions | Static Public Member Functions | Protected Member Functions | Private Member Functions | Private Attributes | List of all members
beamlinereco::ToFSingleCounterAnalysis Class Reference
Inheritance diagram for beamlinereco::ToFSingleCounterAnalysis:
art::EDAnalyzer art::EventObserverBase art::Consumer art::EngineCreator

Public Types

using WorkerType = WorkerT< EDAnalyzer >
 
using ModuleType = EDAnalyzer
 

Public Member Functions

 ToFSingleCounterAnalysis (fhicl::ParameterSet const &p)
 
void reconfigure (const fhicl::ParameterSet &p)
 
void beginJob () override
 
void analyze (const art::Event &e)
 
std::string workerType () const
 
bool modifiesEvent () const
 
void registerProducts (MasterProductRegistry &, ProductDescriptions &, ModuleDescription const &)
 
std::string const & processName () const
 
bool wantAllEvents () const
 
bool wantEvent (Event const &e)
 
fhicl::ParameterSetID selectorConfig () const
 
art::Handle< art::TriggerResultsgetTriggerResults (Event const &e) const
 
template<typename T , BranchType = InEvent>
ProductToken< Tconsumes (InputTag const &)
 
template<typename T , art::BranchType BT>
art::ProductToken< Tconsumes (InputTag const &it)
 
template<typename T , BranchType = InEvent>
void consumesMany ()
 
template<typename Element , BranchType = InEvent>
ViewToken< Element > consumesView (InputTag const &)
 
template<typename T , art::BranchType BT>
art::ViewToken< TconsumesView (InputTag const &it)
 
template<typename T , BranchType = InEvent>
ProductToken< TmayConsume (InputTag const &)
 
template<typename T , art::BranchType BT>
art::ProductToken< TmayConsume (InputTag const &it)
 
template<typename T , BranchType = InEvent>
void mayConsumeMany ()
 
template<typename Element , BranchType = InEvent>
ViewToken< Element > mayConsumeView (InputTag const &)
 
template<typename T , art::BranchType BT>
art::ViewToken< TmayConsumeView (InputTag const &it)
 
base_engine_tcreateEngine (seed_t seed)
 
base_engine_tcreateEngine (seed_t seed, std::string const &kind_of_engine_to_make)
 
base_engine_tcreateEngine (seed_t seed, std::string const &kind_of_engine_to_make, label_t const &engine_label)
 
seed_t get_seed_value (fhicl::ParameterSet const &pset, char const key[]="seed", seed_t const implicit_seed=-1)
 

Static Public Member Functions

static cet::exempt_ptr< Consumernon_module_context ()
 

Protected Member Functions

CurrentProcessingContext const * currentContext () const
 
detail::CachedProducts & cachedProducts ()
 
void validateConsumedProduct (BranchType const bt, ProductInfo const &pi)
 
void prepareForJob (fhicl::ParameterSet const &pset)
 
void showMissingConsumes () const
 

Private Member Functions

double calculateTime (ToFPulseCluster c, std::string method) const
 

Private Attributes

art::InputTag fToFDigitLabel
 
double fSamplingInterval
 
double fHitClusterWindow
 
std::string fClusterTimeMethod
 
double fHistdtBound
 
double fHistdABound
 
double fHistdIBound
 
unsigned int fHistdtNBins
 
unsigned int fHistdANBins
 
unsigned int fHistdINBins
 
unsigned int fHistdAdtNBins
 
unsigned int fHistdIdtNBins
 
unsigned int fHistdAdINBins
 
std::map< beamlinegeo::ChannelID, TH1D * > hAmplitude_AllHits_channel
 
std::map< beamlinegeo::ChannelID, TH1D * > hIntegral_AllHits_channel
 
std::map< beamlinegeo::ChannelID, TH1D * > hStartTime_AllHits_channel
 
std::map< beamlinegeo::ChannelID, TH1D * > hWidth_AllHits_channel
 
std::map< beamlinegeo::ChannelID, TH2D * > hAmplitude_vs_Integral_AllHits_channel
 
std::map< beamlinegeo::ChannelID, TH2D * > hAmplitude_vs_Width_AllHits_channel
 
TH1I * hUSHitMultiplicity
 
TH1I * hDSHitMultiplicity
 
TH1I * hSiPMHitMultiplicity
 
TH1I * hUSFirstHitDetector
 
TH1I * hDSFirstHitDetector
 
TH1I * hSiPMFirstHitDetector
 
TH1D * hUSClusterTime
 
TH1D * hDSClusterTime
 
TH1D * hSiPMClusterTime
 
TH1D * hUSdt [4][4]
 
TH1D * hUSdA [4][4]
 
TH1D * hUSdI [4][4]
 
TH2D * hUSdAdt [4][4]
 
TH2D * hUSdIdt [4][4]
 
TH2D * hUSdAdI [4][4]
 
TH1D * hDSdt [4][4]
 
TH1D * hDSdA [4][4]
 
TH1D * hDSdI [4][4]
 
TH2D * hDSdAdt [4][4]
 
TH2D * hDSdIdt [4][4]
 
TH2D * hDSdAdI [4][4]
 
TH1D * hSiPMdt [4][4]
 
TH1D * hSiPMdA [4][4]
 
TH1D * hSiPMdI [4][4]
 
TH2D * hSiPMdAdt [4][4]
 
TH2D * hSiPMdIdt [4][4]
 
TH2D * hSiPMdAdI [4][4]
 
art::ServiceHandle< beamlineutil::BeamlineChannelMapfChannelMap
 
art::ServiceHandle< art::TFileServicetfs
 

Detailed Description

Definition at line 39 of file ToFSingleCounterAnalysis_module.cc.

Member Typedef Documentation

Definition at line 39 of file EDAnalyzer.h.

Definition at line 38 of file EDAnalyzer.h.

Constructor & Destructor Documentation

beamlinereco::ToFSingleCounterAnalysis::ToFSingleCounterAnalysis ( fhicl::ParameterSet const &  p)

Definition at line 181 of file ToFSingleCounterAnalysis_module.cc.

References reconfigure().

181  : EDAnalyzer(p)
182 {
183  reconfigure(p);
184 }
const char * p
Definition: xmltok.h:285
EDAnalyzer(Table< Config > const &config)
Definition: EDAnalyzer.h:100

Member Function Documentation

void beamlinereco::ToFSingleCounterAnalysis::analyze ( const art::Event e)

Definition at line 304 of file ToFSingleCounterAnalysis_module.cc.

References abs(), plot_validation_datamc::c, calculateTime(), d, DEFINE_ART_MODULE(), beamlinegeo::DS, beamlinegeo::DSSiPM, fClusterTimeMethod, fHitClusterWindow, art::fill_ptr_vector(), beamlinereco::ToFClusterAlg::FindClusters(), fToFDigitLabel, art::DataViewImpl::getByLabel(), beamlinereco::ToFClusterAlg::GetClusters(), getEarliest(), hAmplitude_AllHits_channel, hAmplitude_vs_Integral_AllHits_channel, hAmplitude_vs_Width_AllHits_channel, hDSClusterTime, hDSdA, hDSdAdI, hDSdAdt, hDSdI, hDSdIdt, hDSdt, hDSFirstHitDetector, hDSHitMultiplicity, hIntegral_AllHits_channel, hSiPMClusterTime, hSiPMdA, hSiPMdAdI, hSiPMdAdt, hSiPMdI, hSiPMdIdt, hSiPMdt, hSiPMFirstHitDetector, hSiPMHitMultiplicity, hStartTime_AllHits_channel, hUSClusterTime, hUSdA, hUSdAdI, hUSdAdt, hUSdI, hUSdIdt, hUSdt, hUSFirstHitDetector, hUSHitMultiplicity, hWidth_AllHits_channel, MECModelEnuComparisons::i, calib::j, onlineChannel(), plot_timing_data::times, and beamlinegeo::US.

305 {
306  // Load ToF digits
308  std::vector<art::Ptr<brb::BeamlineDigit>> tofDigits;
309  if (e.getByLabel(fToFDigitLabel, tofDigitHandle))
310  art::fill_ptr_vector(tofDigits, tofDigitHandle);
311 
312  // process digits
313 
314  unsigned int USHits = 0;
315  unsigned int DSHits = 0;
316  unsigned int SiPMHits = 0;
317 
318  //std::cout << "------------------------------ run " << e.run() << " subrun " << e.subRun() << " event " << e.event() << std::endl;
319  for (auto d : tofDigits) {
320  //unsigned int ch = onlineChannel(d->ChannelID());
321  //std::cout << "Digit " << d << " Online Channel " << ch << " Channel " << d->ChannelID();
322  //std::cout << " Associated hStartTime_AllHits_channel: " << hStartTime_AllHits_channel[d->ChannelID()]->GetName() << std::endl << std::endl;
323 
324  switch(d->ChannelID().Detector) {
325  case beamlinegeo::ToFCounter::US: ++USHits; break;
326  case beamlinegeo::ToFCounter::DS: ++DSHits; break;
327  case beamlinegeo::ToFCounter::DSSiPM: ++SiPMHits; break;
328  default: break;
329  }
330 
331  //std::cout << "width: " << d->WidthInNanoSec() << std::endl;
332  hAmplitude_AllHits_channel[d->ChannelID()]->Fill(d->AmplitudeInADC());
333  hIntegral_AllHits_channel[d->ChannelID()]->Fill(abs(d->AreaInADCNanoSec()));
334  hStartTime_AllHits_channel[d->ChannelID()]->Fill(d->StartTimeInNanoSec());
335  hWidth_AllHits_channel[d->ChannelID()]->Fill(d->WidthInNanoSec());
336  hAmplitude_vs_Integral_AllHits_channel[d->ChannelID()]->Fill(abs(d->AreaInADCNanoSec()), d->AmplitudeInADC());
337  hAmplitude_vs_Width_AllHits_channel[d->ChannelID()]->Fill(d->WidthInNanoSec(), d->AmplitudeInADC());
338  }
339 
340  // Process clusters
341 
342  // Find clusters
343  ToFClusterAlg clusterAlg;
344  clusterAlg.FindClusters(tofDigits, fHitClusterWindow);
345 
346  std::vector<ToFPulseCluster> usclusters = clusterAlg.GetClusters(beamlinegeo::ToFCounter::US);
347  std::vector<ToFPulseCluster> dsclusters = clusterAlg.GetClusters(beamlinegeo::ToFCounter::DS);
348  std::vector<ToFPulseCluster> sipmclusters = clusterAlg.GetClusters(beamlinegeo::ToFCounter::DSSiPM);
349 
350  for (auto c : usclusters) {
351  //std::cout << "----------------------------" << std::endl;
352  //for (auto a : c.pulses) std::cout << a->Channel() << " " << a->StartTimeInNanoSec() << std::endl;
353  unsigned int earliest = onlineChannel((*getEarliest(c.pulses))->ChannelID()) - 8+1;
354  //std::cout << "Earliest: " << earliest + 8-1 << " (" << earliest << ")" << std::endl;
355  hUSFirstHitDetector->Fill(Form("%d",earliest), earliest);
357  double times[4] = { -1, -1, -1, -1 };
358  double amps[4] = { -1, -1, -1, -1 };
359  double areas[4] = { -1, -1, -1, -1 };
360  for (auto d : c.pulses) {
361  times[onlineChannel(d->ChannelID()) - 8] = d->StartTimeInNanoSec();
362  amps[onlineChannel(d->ChannelID()) - 8] = d->AmplitudeInADC();
363  areas[onlineChannel(d->ChannelID()) - 8] = d->AreaInADCNanoSec();
364  }
365  for (int i=0; i<4; i++) {
366  for (int j=i+1; j<4; j++) {
367  if ((times[i] >= 0) && (times[j] >= 0)) {
368  double dA = amps[j] - amps[i];
369  double dI = areas[j] - areas[i];
370  double dt = times[j] - times[i];
371  hUSdt[i][j]->Fill(dt);
372  hUSdA[i][j]->Fill(dA);
373  hUSdI[i][j]->Fill(dI);
374  hUSdAdt[i][j]->Fill(dt, dA);
375  hUSdIdt[i][j]->Fill(dt, dI);
376  hUSdAdI[i][j]->Fill(dI, dA);
377  }
378  }
379  }
380  }
381 
382  for (auto c : dsclusters) {
383  unsigned int earliest = onlineChannel((*getEarliest(c.pulses))->ChannelID()) - 12+1;
384  hDSFirstHitDetector->Fill(Form("%d",earliest), earliest);
386  double times[4] = { -1, -1, -1, -1 };
387  double amps[4] = { -1, -1, -1, -1 };
388  double areas[4] = { -1, -1, -1, -1 };
389  for (auto d : c.pulses) {
390  times[onlineChannel(d->ChannelID()) - 12] = d->StartTimeInNanoSec();
391  amps[onlineChannel(d->ChannelID()) - 12] = d->AmplitudeInADC();
392  areas[onlineChannel(d->ChannelID()) - 12] = d->AreaInADCNanoSec();
393  }
394  for (int i=0; i<4; i++) {
395  for (int j=i+1; j<4; j++) {
396  if ((times[i] >= 0) && (times[j] >= 0)) {
397  double dA = amps[j] - amps[i];
398  double dI = areas[j] - areas[i];
399  double dt = times[j] - times[i];
400  hDSdt[i][j]->Fill(dt);
401  hDSdA[i][j]->Fill(dA);
402  hDSdI[i][j]->Fill(dI);
403  hDSdAdt[i][j]->Fill(dt, dA);
404  hDSdIdt[i][j]->Fill(dt, dI);
405  hDSdAdI[i][j]->Fill(dI, dA);
406  }
407  }
408  }
409  }
410 
411  for (auto c : sipmclusters) {
412  unsigned int earliest = onlineChannel((*getEarliest(c.pulses))->ChannelID()) - 4+1;
413  hSiPMFirstHitDetector->Fill(Form("%d",earliest), earliest);
415  double times[4] = { -1, -1, -1, -1 };
416  double amps[4] = { -1, -1, -1, -1 };
417  double areas[4] = { -1, -1, -1, -1 };
418  for (auto d : c.pulses) {
419  times[onlineChannel(d->ChannelID()) - 4] = d->StartTimeInNanoSec();
420  amps[onlineChannel(d->ChannelID()) - 4] = d->AmplitudeInADC();
421  areas[onlineChannel(d->ChannelID()) - 4] = d->AreaInADCNanoSec();
422  }
423  for (int i=0; i<4; i++) {
424  for (int j=i+1; j<4; j++) {
425  if ((times[i] >= 0) && (times[j] >= 0)) {
426  double dA = amps[j] - amps[i];
427  double dI = areas[j] - areas[i];
428  double dt = times[j] - times[i];
429  hSiPMdt[i][j]->Fill(dt);
430  hSiPMdA[i][j]->Fill(dA);
431  hSiPMdI[i][j]->Fill(dI);
432  hSiPMdAdt[i][j]->Fill(dt, dA);
433  hSiPMdIdt[i][j]->Fill(dt, dI);
434  hSiPMdAdI[i][j]->Fill(dI, dA);
435  }
436  }
437  }
438  }
439 
440  hUSHitMultiplicity->Fill(USHits);
441  hDSHitMultiplicity->Fill(DSHits);
442  hSiPMHitMultiplicity->Fill(SiPMHits);
443 }
double calculateTime(ToFPulseCluster c, std::string method) const
std::map< beamlinegeo::ChannelID, TH2D * > hAmplitude_vs_Integral_AllHits_channel
std::map< beamlinegeo::ChannelID, TH1D * > hWidth_AllHits_channel
static std::vector< art::Ptr< brb::BeamlineDigit > >::iterator getEarliest(std::vector< art::Ptr< brb::BeamlineDigit >> v)
void abs(TH1 *hist)
Definition: Cand.cxx:23
std::map< beamlinegeo::ChannelID, TH1D * > hIntegral_AllHits_channel
static unsigned int onlineChannel(ChannelID id)
std::map< beamlinegeo::ChannelID, TH2D * > hAmplitude_vs_Width_AllHits_channel
Float_t d
Definition: plot.C:236
const double j
Definition: BetheBloch.cxx:29
std::map< beamlinegeo::ChannelID, TH1D * > hStartTime_AllHits_channel
bool getByLabel(std::string const &label, std::string const &productInstanceName, Handle< PROD > &result) const
Definition: DataViewImpl.h:344
std::map< beamlinegeo::ChannelID, TH1D * > hAmplitude_AllHits_channel
void fill_ptr_vector(std::vector< Ptr< T >> &ptrs, H const &h)
Definition: Ptr.h:464
void beamlinereco::ToFSingleCounterAnalysis::beginJob ( )
overridevirtual

Reimplemented from art::EDAnalyzer.

Definition at line 203 of file ToFSingleCounterAnalysis_module.cc.

References beamlineutil::BeamlineChannelMap::ChannelIDs(), shutoffs::endtime, fChannelMap, fHistdABound, fHistdAdINBins, fHistdAdtNBins, fHistdANBins, fHistdIBound, fHistdIdtNBins, fHistdINBins, fHistdtBound, fHistdtNBins, fSamplingInterval, hAmplitude_AllHits_channel, hAmplitude_vs_Integral_AllHits_channel, hAmplitude_vs_Width_AllHits_channel, hDSClusterTime, hDSdA, hDSdAdI, hDSdAdt, hDSdI, hDSdIdt, hDSdt, hDSFirstHitDetector, hDSHitMultiplicity, hIntegral_AllHits_channel, hSiPMClusterTime, hSiPMdA, hSiPMdAdI, hSiPMdAdt, hSiPMdI, hSiPMdIdt, hSiPMdt, hSiPMFirstHitDetector, hSiPMHitMultiplicity, hStartTime_AllHits_channel, hUSClusterTime, hUSdA, hUSdAdI, hUSdAdt, hUSdI, hUSdIdt, hUSdt, hUSFirstHitDetector, hUSHitMultiplicity, hWidth_AllHits_channel, MECModelEnuComparisons::i, calib::j, art::TFileDirectory::make(), art::TFileDirectory::mkdir(), onlineChannel(), and tfs.

203  {
204  double endtime = 1024.*fSamplingInterval;
205 
206  //std::cout << "Channels in map:" << std::endl;
207  for (auto channel : fChannelMap->ChannelIDs()) {
208  unsigned int online_channel = onlineChannel(channel);
209  //std::cout << "\t" << online_channel << " " << channel << std::endl;
210  art::TFileDirectory chdir = tfs->mkdir(Form("Channel%d",online_channel));
211  this->hAmplitude_AllHits_channel[channel] = chdir.make<TH1D>(Form("hAmplitude_AllHits_channel%d",online_channel),
212  Form("Amplitude Channel %d (all hits)",online_channel),
213  200, 0, 4000);
214  this->hIntegral_AllHits_channel[channel] = chdir.make<TH1D>(Form("hIntegral_AllHits_channel%d",online_channel),
215  Form("Charge Integral Channel %d (all hits)",online_channel),
216  200, 0, 100000);
217  this->hStartTime_AllHits_channel[channel] = chdir.make<TH1D>(Form("hStartTime_AllHits_channel%d",online_channel),
218  Form("Start Time Channel %d (all hits)",online_channel),
219  200, 0, endtime);
220  this->hWidth_AllHits_channel[channel] = chdir.make<TH1D>(Form("hWidth_AllHits_channel%d",online_channel),
221  Form("Width Channel %d (all hits)",online_channel),
222  200, 0, 20);
223  this->hAmplitude_vs_Integral_AllHits_channel[channel] = chdir.make<TH2D>(Form("hAmplitude_vs_Integral_AllHits_channel%d",online_channel),
224  Form("Amplitude vs Integral Channel %d (all hits)",online_channel),
225  200, 0, 100000, 200, 0, 4000);
226  this->hAmplitude_vs_Width_AllHits_channel[channel] = chdir.make<TH2D>(Form("hAmplitude_vs_Width_AllHits_channel%d",online_channel),
227  Form("Amplitude vs Width Channel %d (all hits)",online_channel),
228  200, 0, 20, 200, 0, 4000);
229  }
230 
231  this->hUSClusterTime = tfs->make<TH1D>("hUSClusterTime", "US Cluster Start Time", 200, 0, endtime);
232  this->hDSClusterTime = tfs->make<TH1D>("hDSClusterTime", "DS Cluster Start Time", 200, 0, endtime);
233  this->hSiPMClusterTime = tfs->make<TH1D>("hSiPMClusterTime", "SiPM Cluster Start Time", 200, 0, endtime);
234 
235  this->hUSHitMultiplicity = tfs->make<TH1I>("hUSHitMultiplicity", "US Hits per Event", 15, 0, 15);
236  this->hDSHitMultiplicity = tfs->make<TH1I>("hDSHitMultiplicity", "DS Hits per Event", 15, 0, 15);
237  this->hSiPMHitMultiplicity = tfs->make<TH1I>("hSiPMHitMultiplicity", "SiPM Hits per Event", 15, 0, 15);
238 
239  this->hUSFirstHitDetector = tfs->make<TH1I>("hUSFirstHitDetector", "US First Hit Detector", 4, 1, 5);
240  this->hDSFirstHitDetector = tfs->make<TH1I>("hDSFirstHitDetector", "DS First Hit Detector", 4, 1, 5);
241  this->hSiPMFirstHitDetector = tfs->make<TH1I>("hSiPMFirstHitDetector", "SiPM First Hit Detector", 4, 1, 5);
242 
243  art::TFileDirectory usdir = tfs->mkdir("US deltas");
244  art::TFileDirectory dsdir = tfs->mkdir("DS deltas");
245  art::TFileDirectory sipmdir = tfs->mkdir("SiPM deltas");
246 
247  for (int i=0; i<4; i++) {
248  for (int j=i+1; j<4; j++) {
249  art::TFileDirectory usijdir = tfs->mkdir(Form("US delta %d-%d", i+1, j+1));
250  art::TFileDirectory dsijdir = tfs->mkdir(Form("DS delta %d-%d", i+1, j+1));
251  art::TFileDirectory sipmijdir = tfs->mkdir(Form("SiPM delta %d-%d", i+1, j+1));
252 
253  hUSdt[i][j] = usijdir.make<TH1D>(Form("hUSdt%d%d",i+1,j+1), Form("ToF dt between channels %d and %d",i+8,j+8),
255  hUSdA[i][j] = usijdir.make<TH1D>(Form("hUSdA%d%d",i+1,j+1), Form("ToF dA between channels %d and %d",i+8,j+8),
257  hUSdI[i][j] = usijdir.make<TH1D>(Form("hUSdI%d%d",i+1,j+1), Form("ToF dI between channels %d and %d",i+8,j+8),
259  hUSdAdt[i][j] = usijdir.make<TH2D>(Form("hUSdAdt%d%d",i+1,j+1), Form("ToF dA vs dt channels %d and %d",i+8,j+8),
262  hUSdIdt[i][j] = usijdir.make<TH2D>(Form("hUSdIdt%d%d",i+1,j+1), Form("ToF dI vs dt channels %d and %d",i+8,j+8),
265  hUSdAdI[i][j] = usijdir.make<TH2D>(Form("hUSdAdI%d%d",i+1,j+1), Form("ToF dA vs dI channels %d and %d",i+8,j+8),
268 
269  hDSdt[i][j] = dsijdir.make<TH1D>(Form("hDSdt%d%d",i+1,j+1), Form("ToF dt between channels %d and %d",i+12,j+12),
271  hDSdA[i][j] = dsijdir.make<TH1D>(Form("hDSdA%d%d",i+1,j+1), Form("ToF dA between channels %d and %d",i+12,j+12),
273  hDSdI[i][j] = dsijdir.make<TH1D>(Form("hDSdI%d%d",i+1,j+1), Form("ToF dI between channels %d and %d",i+12,j+12),
275  hDSdAdt[i][j] = dsijdir.make<TH2D>(Form("hDSdAdt%d%d",i+1,j+1), Form("ToF dA vs dt channels %d and %d",i+12,j+12),
278  hDSdIdt[i][j] = dsijdir.make<TH2D>(Form("hDSdIdt%d%d",i+1,j+1), Form("ToF dI vs dt channels %d and %d",i+12,j+12),
281  hDSdAdI[i][j] = dsijdir.make<TH2D>(Form("hDSdAdI%d%d",i+1,j+1), Form("ToF dA vs dI channels %d and %d",i+12,j+12),
284 
285  hSiPMdt[i][j] = sipmijdir.make<TH1D>(Form("hSiPMdt%d%d",i+1,j+1), Form("ToF dt between channels %d and %d",i+4,j+4),
287  hSiPMdA[i][j] = sipmijdir.make<TH1D>(Form("hSiPMdA%d%d",i+1,j+1), Form("ToF dA between channels %d and %d",i+4,j+4),
289  hSiPMdI[i][j] = sipmijdir.make<TH1D>(Form("hSiPMdI%d%d",i+1,j+1), Form("ToF dI between channels %d and %d",i+4,j+4),
291  hSiPMdAdt[i][j] = sipmijdir.make<TH2D>(Form("hSiPMdAdt%d%d",i+1,j+1), Form("ToF dA vs dt channels %d and %d",i+4,j+4),
294  hSiPMdIdt[i][j] = sipmijdir.make<TH2D>(Form("hSiPMdIdt%d%d",i+1,j+1), Form("ToF dI vs dt channels %d and %d",i+4,j+4),
297  hSiPMdAdI[i][j] = sipmijdir.make<TH2D>(Form("hSiPMdAdI%d%d",i+1,j+1), Form("ToF dA vs dI channels %d and %d",i+4,j+4),
300  }
301  }
302 }
std::map< beamlinegeo::ChannelID, TH2D * > hAmplitude_vs_Integral_AllHits_channel
std::map< beamlinegeo::ChannelID, TH1D * > hWidth_AllHits_channel
art::ServiceHandle< art::TFileService > tfs
TFileDirectory mkdir(std::string const &dir, std::string const &descr="")
std::vector< ChannelID > ChannelIDs() const
All the ChannelIDs in this channel mapping.
std::map< beamlinegeo::ChannelID, TH1D * > hIntegral_AllHits_channel
static unsigned int onlineChannel(ChannelID id)
std::map< beamlinegeo::ChannelID, TH2D * > hAmplitude_vs_Width_AllHits_channel
const double j
Definition: BetheBloch.cxx:29
std::map< beamlinegeo::ChannelID, TH1D * > hStartTime_AllHits_channel
T * make(ARGS...args) const
art::ServiceHandle< beamlineutil::BeamlineChannelMap > fChannelMap
std::map< beamlinegeo::ChannelID, TH1D * > hAmplitude_AllHits_channel
detail::CachedProducts& art::EventObserverBase::cachedProducts ( )
inlineprotectedinherited

Definition at line 79 of file EventObserverBase.h.

References art::EventObserverBase::selectors_.

80  {
81  return selectors_;
82  }
detail::CachedProducts selectors_
double beamlinereco::ToFSingleCounterAnalysis::calculateTime ( ToFPulseCluster  c,
std::string  method 
) const
private

Definition at line 140 of file ToFSingleCounterAnalysis_module.cc.

References brb::BeamlineDigit::AmplitudeInADC(), art::errors::Configuration, d, allTimeWatchdog::endl, plot_validation_datamc::p1, plot_validation_datamc::p2, beamlinereco::ToFPulseCluster::pulses, brb::BeamlineDigit::StartTimeInNanoSec(), confusionMatrixTree::t, and w.

Referenced by analyze().

140  {
141  if (c.pulses.size() == 0) {
142  return std::numeric_limits<double>::quiet_NaN();
143  }
144 
145  double t = std::numeric_limits<double>::quiet_NaN();
146 
147  if (method == "Mean") {
148  t = 0;
149  for (auto p : c.pulses) { t += p->StartTimeInNanoSec(); }
150  t = t / (double(c.pulses.size()));
151 
152  } else if (method == "Weighted_MaxAmpNorm") {
153  t = 0;
154  auto dmaxamp = *std::max_element(c.pulses.begin(), c.pulses.end(),
156  return p1->AmplitudeInADC() > p2->AmplitudeInADC();
157  });
158  double maxamp = dmaxamp->AmplitudeInADC();
159  double w = 0;
160  for (auto p : c.pulses) {
161  t += p->StartTimeInNanoSec() * (p->AmplitudeInADC() / maxamp);
162  w += p->AmplitudeInADC() / maxamp;
163  }
164  t = t / w;
165 
166  } else if (method == "First") {
167  auto d = *std::min_element(c.pulses.begin(), c.pulses.end(),
169  return p1->StartTimeInNanoSec() < p2->StartTimeInNanoSec();
170  });
171  t = d->StartTimeInNanoSec();
172 
173  } else {
175  << "Unknown time of flight cluster time calculation method: " << method << "." << std::endl;
176  }
177 
178  return t;
179 }
const char * p
Definition: xmltok.h:285
int AmplitudeInADC() const
double StartTimeInNanoSec() const
Float_t d
Definition: plot.C:236
cet::coded_exception< errors::ErrorCodes, ExceptionDetail::translate > Exception
Definition: Exception.h:66
Float_t w
Definition: plot.C:20
Definition: fwd.h:28
template<typename T , BranchType = InEvent>
ProductToken<T> art::Consumer::consumes ( InputTag const &  )
inherited
template<typename T , art::BranchType BT>
art::ProductToken<T> art::Consumer::consumes ( InputTag const &  it)
inherited

Definition at line 146 of file Consumer.h.

References art::InputTag::instance(), PandAna.reco_validation.prod5_pid_validation::invalid, art::InputTag::label(), art::InputTag::process(), and T.

147 {
148  if (!moduleContext_)
149  return ProductToken<T>::invalid();
150 
151  consumables_[BT].emplace_back(ConsumableType::Product,
152  TypeID{typeid(T)},
153  it.label(),
154  it.instance(),
155  it.process());
156  return ProductToken<T>{it};
157 }
set< int >::iterator it
static ProductToken< T > invalid()
Definition: ProductToken.h:47
ConsumableProducts consumables_
Definition: Consumer.h:137
double T
Definition: Xdiff_gwt.C:5
bool moduleContext_
Definition: Consumer.h:135
template<typename T , art::BranchType BT>
void art::Consumer::consumesMany ( )
inherited

Definition at line 161 of file Consumer.h.

References T.

162 {
163  if (!moduleContext_)
164  return;
165 
166  consumables_[BT].emplace_back(ConsumableType::Many, TypeID{typeid(T)});
167 }
ConsumableProducts consumables_
Definition: Consumer.h:137
double T
Definition: Xdiff_gwt.C:5
bool moduleContext_
Definition: Consumer.h:135
template<typename Element , BranchType = InEvent>
ViewToken<Element> art::Consumer::consumesView ( InputTag const &  )
inherited
template<typename T , art::BranchType BT>
art::ViewToken<T> art::Consumer::consumesView ( InputTag const &  it)
inherited

Definition at line 171 of file Consumer.h.

References art::InputTag::instance(), PandAna.reco_validation.prod5_pid_validation::invalid, art::InputTag::label(), art::InputTag::process(), and T.

172 {
173  if (!moduleContext_)
174  return ViewToken<T>::invalid();
175 
176  consumables_[BT].emplace_back(ConsumableType::ViewElement,
177  TypeID{typeid(T)},
178  it.label(),
179  it.instance(),
180  it.process());
181  return ViewToken<T>{it};
182 }
set< int >::iterator it
static ViewToken< Element > invalid()
Definition: ProductToken.h:75
ConsumableProducts consumables_
Definition: Consumer.h:137
double T
Definition: Xdiff_gwt.C:5
bool moduleContext_
Definition: Consumer.h:135
base_engine_t& art::EngineCreator::createEngine ( seed_t  seed)
inherited
base_engine_t& art::EngineCreator::createEngine ( seed_t  seed,
std::string const &  kind_of_engine_to_make 
)
inherited
base_engine_t& art::EngineCreator::createEngine ( seed_t  seed,
std::string const &  kind_of_engine_to_make,
label_t const &  engine_label 
)
inherited
CurrentProcessingContext const* art::EDAnalyzer::currentContext ( ) const
protectedinherited
seed_t art::EngineCreator::get_seed_value ( fhicl::ParameterSet const &  pset,
char const  key[] = "seed",
seed_t const  implicit_seed = -1 
)
inherited
art::Handle<art::TriggerResults> art::EventObserverBase::getTriggerResults ( Event const &  e) const
inlineinherited

Definition at line 61 of file EventObserverBase.h.

References art::detail::CachedProducts::getOneTriggerResults(), and art::EventObserverBase::selectors_.

62  {
64  }
detail::CachedProducts selectors_
art::Handle< art::TriggerResults > getOneTriggerResults(Event const &) const
Float_t e
Definition: plot.C:35
template<typename T , BranchType = InEvent>
ProductToken<T> art::Consumer::mayConsume ( InputTag const &  )
inherited
template<typename T , art::BranchType BT>
art::ProductToken<T> art::Consumer::mayConsume ( InputTag const &  it)
inherited

Definition at line 189 of file Consumer.h.

References art::InputTag::instance(), PandAna.reco_validation.prod5_pid_validation::invalid, art::InputTag::label(), art::InputTag::process(), and T.

190 {
191  if (!moduleContext_)
192  return ProductToken<T>::invalid();
193 
194  consumables_[BT].emplace_back(ConsumableType::Product,
195  TypeID{typeid(T)},
196  it.label(),
197  it.instance(),
198  it.process());
199  return ProductToken<T>{it};
200 }
set< int >::iterator it
static ProductToken< T > invalid()
Definition: ProductToken.h:47
ConsumableProducts consumables_
Definition: Consumer.h:137
double T
Definition: Xdiff_gwt.C:5
bool moduleContext_
Definition: Consumer.h:135
template<typename T , art::BranchType BT>
void art::Consumer::mayConsumeMany ( )
inherited

Definition at line 204 of file Consumer.h.

References T.

205 {
206  if (!moduleContext_)
207  return;
208 
209  consumables_[BT].emplace_back(ConsumableType::Many, TypeID{typeid(T)});
210 }
ConsumableProducts consumables_
Definition: Consumer.h:137
double T
Definition: Xdiff_gwt.C:5
bool moduleContext_
Definition: Consumer.h:135
template<typename Element , BranchType = InEvent>
ViewToken<Element> art::Consumer::mayConsumeView ( InputTag const &  )
inherited
template<typename T , art::BranchType BT>
art::ViewToken<T> art::Consumer::mayConsumeView ( InputTag const &  it)
inherited

Definition at line 214 of file Consumer.h.

References art::InputTag::instance(), PandAna.reco_validation.prod5_pid_validation::invalid, art::InputTag::label(), art::InputTag::process(), and T.

215 {
216  if (!moduleContext_)
217  return ViewToken<T>::invalid();
218 
219  consumables_[BT].emplace_back(ConsumableType::ViewElement,
220  TypeID{typeid(T)},
221  it.label(),
222  it.instance(),
223  it.process());
224  return ViewToken<T>{it};
225 }
set< int >::iterator it
static ViewToken< Element > invalid()
Definition: ProductToken.h:75
ConsumableProducts consumables_
Definition: Consumer.h:137
double T
Definition: Xdiff_gwt.C:5
bool moduleContext_
Definition: Consumer.h:135
bool art::EventObserverBase::modifiesEvent ( ) const
inlineinherited

Definition at line 25 of file EventObserverBase.h.

26  {
27  return false;
28  }
static cet::exempt_ptr<Consumer> art::Consumer::non_module_context ( )
staticinherited
void art::Consumer::prepareForJob ( fhicl::ParameterSet const &  pset)
protectedinherited
std::string const& art::EventObserverBase::processName ( ) const
inlineinherited
void beamlinereco::ToFSingleCounterAnalysis::reconfigure ( const fhicl::ParameterSet p)

Definition at line 186 of file ToFSingleCounterAnalysis_module.cc.

References fClusterTimeMethod, fHistdABound, fHistdAdINBins, fHistdAdtNBins, fHistdANBins, fHistdIBound, fHistdIdtNBins, fHistdINBins, fHistdtBound, fHistdtNBins, fHitClusterWindow, fSamplingInterval, fToFDigitLabel, fhicl::ParameterSet::get(), and string.

Referenced by ToFSingleCounterAnalysis().

186  {
187  fToFDigitLabel = p.get<art::InputTag>("ToFDigitLabel");
188  fSamplingInterval = p.get<double>("TimeSamplingInterval");
189  fHitClusterWindow = p.get<double>("HitClusterWindow");
190  fClusterTimeMethod = p.get<std::string>("ClusterTimeMethod", "First");
191 
192  fHistdtBound = p.get<double>("HistdtBound");
193  fHistdABound = p.get<double>("HistdABound");
194  fHistdIBound = p.get<double>("HistdIBound");
195  fHistdtNBins = p.get<unsigned int>("HistdtNBins");
196  fHistdANBins = p.get<unsigned int>("HistdANBins");
197  fHistdINBins = p.get<unsigned int>("HistdINBins");
198  fHistdAdtNBins = p.get<unsigned int>("HistdAdtNBins");
199  fHistdIdtNBins = p.get<unsigned int>("HistdIdtNBins");
200  fHistdAdINBins = p.get<unsigned int>("HistdIdtNBins");
201 }
T get(std::string const &key) const
Definition: ParameterSet.h:231
enum BeamMode string
void art::EventObserverBase::registerProducts ( MasterProductRegistry ,
ProductDescriptions ,
ModuleDescription const &   
)
inlineinherited

Definition at line 33 of file EventObserverBase.h.

References string.

36  {}
fhicl::ParameterSetID art::EventObserverBase::selectorConfig ( ) const
inlineinherited

Definition at line 56 of file EventObserverBase.h.

References art::EventObserverBase::selector_config_id_.

57  {
58  return selector_config_id_;
59  }
fhicl::ParameterSetID selector_config_id_
void art::Consumer::showMissingConsumes ( ) const
protectedinherited

Referenced by art::RootOutput::endJob().

void art::Consumer::validateConsumedProduct ( BranchType const  bt,
ProductInfo const &  pi 
)
protectedinherited
bool art::EventObserverBase::wantAllEvents ( ) const
inlineinherited

Definition at line 46 of file EventObserverBase.h.

References art::EventObserverBase::wantAllEvents_.

Referenced by art::RootOutput::RootOutput().

47  {
48  return wantAllEvents_;
49  }
bool art::EventObserverBase::wantEvent ( Event const &  e)
inlineinherited

Definition at line 51 of file EventObserverBase.h.

References art::EventObserverBase::selectors_, and art::detail::CachedProducts::wantEvent().

52  {
53  return selectors_.wantEvent(e);
54  }
detail::CachedProducts selectors_
Float_t e
Definition: plot.C:35
bool wantEvent(Event const &)
std::string art::EDAnalyzer::workerType ( ) const
inlineinherited

Definition at line 109 of file EDAnalyzer.h.

References art::EDAnalyzer::currentContext().

110  {
111  return "WorkerT<EDAnalyzer>";
112  }

Member Data Documentation

art::ServiceHandle<beamlineutil::BeamlineChannelMap> beamlinereco::ToFSingleCounterAnalysis::fChannelMap
private

Definition at line 111 of file ToFSingleCounterAnalysis_module.cc.

Referenced by beginJob().

std::string beamlinereco::ToFSingleCounterAnalysis::fClusterTimeMethod
private

Definition at line 55 of file ToFSingleCounterAnalysis_module.cc.

Referenced by analyze(), and reconfigure().

double beamlinereco::ToFSingleCounterAnalysis::fHistdABound
private

Definition at line 58 of file ToFSingleCounterAnalysis_module.cc.

Referenced by beginJob(), and reconfigure().

unsigned int beamlinereco::ToFSingleCounterAnalysis::fHistdAdINBins
private

Definition at line 65 of file ToFSingleCounterAnalysis_module.cc.

Referenced by beginJob(), and reconfigure().

unsigned int beamlinereco::ToFSingleCounterAnalysis::fHistdAdtNBins
private

Definition at line 63 of file ToFSingleCounterAnalysis_module.cc.

Referenced by beginJob(), and reconfigure().

unsigned int beamlinereco::ToFSingleCounterAnalysis::fHistdANBins
private

Definition at line 61 of file ToFSingleCounterAnalysis_module.cc.

Referenced by beginJob(), and reconfigure().

double beamlinereco::ToFSingleCounterAnalysis::fHistdIBound
private

Definition at line 59 of file ToFSingleCounterAnalysis_module.cc.

Referenced by beginJob(), and reconfigure().

unsigned int beamlinereco::ToFSingleCounterAnalysis::fHistdIdtNBins
private

Definition at line 64 of file ToFSingleCounterAnalysis_module.cc.

Referenced by beginJob(), and reconfigure().

unsigned int beamlinereco::ToFSingleCounterAnalysis::fHistdINBins
private

Definition at line 62 of file ToFSingleCounterAnalysis_module.cc.

Referenced by beginJob(), and reconfigure().

double beamlinereco::ToFSingleCounterAnalysis::fHistdtBound
private

Definition at line 57 of file ToFSingleCounterAnalysis_module.cc.

Referenced by beginJob(), and reconfigure().

unsigned int beamlinereco::ToFSingleCounterAnalysis::fHistdtNBins
private

Definition at line 60 of file ToFSingleCounterAnalysis_module.cc.

Referenced by beginJob(), and reconfigure().

double beamlinereco::ToFSingleCounterAnalysis::fHitClusterWindow
private

Definition at line 54 of file ToFSingleCounterAnalysis_module.cc.

Referenced by analyze(), and reconfigure().

double beamlinereco::ToFSingleCounterAnalysis::fSamplingInterval
private

Definition at line 53 of file ToFSingleCounterAnalysis_module.cc.

Referenced by beginJob(), and reconfigure().

art::InputTag beamlinereco::ToFSingleCounterAnalysis::fToFDigitLabel
private

Definition at line 52 of file ToFSingleCounterAnalysis_module.cc.

Referenced by analyze(), and reconfigure().

std::map<beamlinegeo::ChannelID, TH1D*> beamlinereco::ToFSingleCounterAnalysis::hAmplitude_AllHits_channel
private

Definition at line 69 of file ToFSingleCounterAnalysis_module.cc.

Referenced by analyze(), and beginJob().

std::map<beamlinegeo::ChannelID, TH2D*> beamlinereco::ToFSingleCounterAnalysis::hAmplitude_vs_Integral_AllHits_channel
private

Definition at line 73 of file ToFSingleCounterAnalysis_module.cc.

Referenced by analyze(), and beginJob().

std::map<beamlinegeo::ChannelID, TH2D*> beamlinereco::ToFSingleCounterAnalysis::hAmplitude_vs_Width_AllHits_channel
private

Definition at line 74 of file ToFSingleCounterAnalysis_module.cc.

Referenced by analyze(), and beginJob().

TH1D* beamlinereco::ToFSingleCounterAnalysis::hDSClusterTime
private

Definition at line 85 of file ToFSingleCounterAnalysis_module.cc.

Referenced by analyze(), and beginJob().

TH1D* beamlinereco::ToFSingleCounterAnalysis::hDSdA[4][4]
private

Definition at line 96 of file ToFSingleCounterAnalysis_module.cc.

Referenced by analyze(), and beginJob().

TH2D* beamlinereco::ToFSingleCounterAnalysis::hDSdAdI[4][4]
private

Definition at line 100 of file ToFSingleCounterAnalysis_module.cc.

Referenced by analyze(), and beginJob().

TH2D* beamlinereco::ToFSingleCounterAnalysis::hDSdAdt[4][4]
private

Definition at line 98 of file ToFSingleCounterAnalysis_module.cc.

Referenced by analyze(), and beginJob().

TH1D* beamlinereco::ToFSingleCounterAnalysis::hDSdI[4][4]
private

Definition at line 97 of file ToFSingleCounterAnalysis_module.cc.

Referenced by analyze(), and beginJob().

TH2D* beamlinereco::ToFSingleCounterAnalysis::hDSdIdt[4][4]
private

Definition at line 99 of file ToFSingleCounterAnalysis_module.cc.

Referenced by analyze(), and beginJob().

TH1D* beamlinereco::ToFSingleCounterAnalysis::hDSdt[4][4]
private

Definition at line 95 of file ToFSingleCounterAnalysis_module.cc.

Referenced by analyze(), and beginJob().

TH1I* beamlinereco::ToFSingleCounterAnalysis::hDSFirstHitDetector
private

Definition at line 81 of file ToFSingleCounterAnalysis_module.cc.

Referenced by analyze(), and beginJob().

TH1I* beamlinereco::ToFSingleCounterAnalysis::hDSHitMultiplicity
private

Definition at line 77 of file ToFSingleCounterAnalysis_module.cc.

Referenced by analyze(), and beginJob().

std::map<beamlinegeo::ChannelID, TH1D*> beamlinereco::ToFSingleCounterAnalysis::hIntegral_AllHits_channel
private

Definition at line 70 of file ToFSingleCounterAnalysis_module.cc.

Referenced by analyze(), and beginJob().

TH1D* beamlinereco::ToFSingleCounterAnalysis::hSiPMClusterTime
private

Definition at line 86 of file ToFSingleCounterAnalysis_module.cc.

Referenced by analyze(), and beginJob().

TH1D* beamlinereco::ToFSingleCounterAnalysis::hSiPMdA[4][4]
private

Definition at line 103 of file ToFSingleCounterAnalysis_module.cc.

Referenced by analyze(), and beginJob().

TH2D* beamlinereco::ToFSingleCounterAnalysis::hSiPMdAdI[4][4]
private

Definition at line 107 of file ToFSingleCounterAnalysis_module.cc.

Referenced by analyze(), and beginJob().

TH2D* beamlinereco::ToFSingleCounterAnalysis::hSiPMdAdt[4][4]
private

Definition at line 105 of file ToFSingleCounterAnalysis_module.cc.

Referenced by analyze(), and beginJob().

TH1D* beamlinereco::ToFSingleCounterAnalysis::hSiPMdI[4][4]
private

Definition at line 104 of file ToFSingleCounterAnalysis_module.cc.

Referenced by analyze(), and beginJob().

TH2D* beamlinereco::ToFSingleCounterAnalysis::hSiPMdIdt[4][4]
private

Definition at line 106 of file ToFSingleCounterAnalysis_module.cc.

Referenced by analyze(), and beginJob().

TH1D* beamlinereco::ToFSingleCounterAnalysis::hSiPMdt[4][4]
private

Definition at line 102 of file ToFSingleCounterAnalysis_module.cc.

Referenced by analyze(), and beginJob().

TH1I* beamlinereco::ToFSingleCounterAnalysis::hSiPMFirstHitDetector
private

Definition at line 82 of file ToFSingleCounterAnalysis_module.cc.

Referenced by analyze(), and beginJob().

TH1I* beamlinereco::ToFSingleCounterAnalysis::hSiPMHitMultiplicity
private

Definition at line 78 of file ToFSingleCounterAnalysis_module.cc.

Referenced by analyze(), and beginJob().

std::map<beamlinegeo::ChannelID, TH1D*> beamlinereco::ToFSingleCounterAnalysis::hStartTime_AllHits_channel
private

Definition at line 71 of file ToFSingleCounterAnalysis_module.cc.

Referenced by analyze(), and beginJob().

TH1D* beamlinereco::ToFSingleCounterAnalysis::hUSClusterTime
private

Definition at line 84 of file ToFSingleCounterAnalysis_module.cc.

Referenced by analyze(), and beginJob().

TH1D* beamlinereco::ToFSingleCounterAnalysis::hUSdA[4][4]
private

Definition at line 89 of file ToFSingleCounterAnalysis_module.cc.

Referenced by analyze(), and beginJob().

TH2D* beamlinereco::ToFSingleCounterAnalysis::hUSdAdI[4][4]
private

Definition at line 93 of file ToFSingleCounterAnalysis_module.cc.

Referenced by analyze(), and beginJob().

TH2D* beamlinereco::ToFSingleCounterAnalysis::hUSdAdt[4][4]
private

Definition at line 91 of file ToFSingleCounterAnalysis_module.cc.

Referenced by analyze(), and beginJob().

TH1D* beamlinereco::ToFSingleCounterAnalysis::hUSdI[4][4]
private

Definition at line 90 of file ToFSingleCounterAnalysis_module.cc.

Referenced by analyze(), and beginJob().

TH2D* beamlinereco::ToFSingleCounterAnalysis::hUSdIdt[4][4]
private

Definition at line 92 of file ToFSingleCounterAnalysis_module.cc.

Referenced by analyze(), and beginJob().

TH1D* beamlinereco::ToFSingleCounterAnalysis::hUSdt[4][4]
private

Definition at line 88 of file ToFSingleCounterAnalysis_module.cc.

Referenced by analyze(), and beginJob().

TH1I* beamlinereco::ToFSingleCounterAnalysis::hUSFirstHitDetector
private

Definition at line 80 of file ToFSingleCounterAnalysis_module.cc.

Referenced by analyze(), and beginJob().

TH1I* beamlinereco::ToFSingleCounterAnalysis::hUSHitMultiplicity
private

Definition at line 76 of file ToFSingleCounterAnalysis_module.cc.

Referenced by analyze(), and beginJob().

std::map<beamlinegeo::ChannelID, TH1D*> beamlinereco::ToFSingleCounterAnalysis::hWidth_AllHits_channel
private

Definition at line 72 of file ToFSingleCounterAnalysis_module.cc.

Referenced by analyze(), and beginJob().

art::ServiceHandle<art::TFileService> beamlinereco::ToFSingleCounterAnalysis::tfs
private

Definition at line 112 of file ToFSingleCounterAnalysis_module.cc.

Referenced by beginJob().


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