All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
Classes | Public Types | Public Member Functions | Private Member Functions | Static Private Member Functions | Private Attributes | List of all members
icarus::PMTWaveformBaselinesFromChannelData Class Reference

Extracts a baseline from PMT waveforms. More...

Inheritance diagram for icarus::PMTWaveformBaselinesFromChannelData:

Classes

struct  BaselineInfo_t
 Record of baseline information to be written. More...
 
struct  Config
 

Public Types

using Parameters = art::SharedProducer::Table< Config >
 

Public Member Functions

 PMTWaveformBaselinesFromChannelData (Parameters const &config, art::ProcessingFrame const &)
 
virtual void beginJob (art::ProcessingFrame const &frame) override
 Prepares the plots to be filled. More...
 
virtual void beginRun (art::Run &run, art::ProcessingFrame const &) override
 Reads needed PMT configuration. More...
 
virtual void produce (art::Event &event, art::ProcessingFrame const &) override
 Creates the data products. More...
 
virtual void endJob (art::ProcessingFrame const &frame) override
 Remove empty plots. More...
 

Private Member Functions

unsigned int removeWaveformsAround (std::vector< raw::OpDetWaveform const * > &waveforms, double time) const
 Removes waveforms containing time, retuning how many were removed. More...
 
unsigned int getPretriggerBuffer (sbn::PMTconfiguration const &PMTconfig) const
 Returns the smallest pre-trigger buffer size available among all boards. More...
 
void setupPlots (art::ProcessingFrame const &frame)
 Creates all the plots to be filled by the module. More...
 
void buildBaselineGraphs (art::ProcessingFrame const &frame)
 Removes the empty plots. More...
 

Static Private Member Functions

static std::vector
< std::vector
< raw::OpDetWaveform const * > > 
groupByChannel (std::vector< raw::OpDetWaveform > const &waveforms)
 

Private Attributes

art::InputTag const fOpDetWaveformTag
 Input optical waveform tag. More...
 
unsigned int fExcludeSpillTimeIfMoreThan
 Minimum number of waveforms when excluding trigger one is allowed. More...
 
unsigned int fPretriggerSamples
 Samples in the pre-trigger buffer. More...
 
std::optional< art::InputTag > fPMTconfigTag
 Tag for PMT configuration data product. More...
 
float const fSampleFraction
 Fraction of pretrigger buffer to use. More...
 
opdet::SharedWaveformBaseline::Params_t fAlgoParams
 Parameters for the baseline algorithm. More...
 
bool const fPlotBaselines
 Whether to produce plots. More...
 
double const fBaselineTimeAverage { 0.0 }
 Width of baseline time profile binning [s]. More...
 
std::string const fLogCategory
 Category name for the console output stream. More...
 
util::quantities::intervals::nanoseconds fOpticalTick
 Duration of a PMT digitizer tick. More...
 
std::size_t fNPlotChannels = 0U
 Number of plotted channels. More...
 
TH2 * fHBaselines = nullptr
 All baselines, per channel. More...
 
std::vector< std::vector
< std::pair< double, double > > > 
fBaselinesVsTime
 For each channel, all event times and their baselines. More...
 

Detailed Description

Extracts a baseline from PMT waveforms.

This module produces a baseline data product for each optical detector waveform. The algorithm extracts a baseline per channel per event, considering all the waveforms from one channel together, under the assumptions that:

  1. the baseline is not going to change during the few milliseconds of readout
  2. the beginning of the waveform is on its baseline level

The algorithm

The core of the algorithm is described in its own class, opdet::SharedWaveformBaseline.

On each event independently, the waveforms are grouped by channel. For each waveform, opdet::SharedWaveformBaseline considers their first part for baseline calculation. The number of samples of that part is specified as a fraction of the pre-trigger buffer. The pre-trigger buffer includes the samples that were collected before the physics activity that causes the data acquisition happened, and as such is expected to be almost completely free of physics signal and to be made of just electronics noise. The size of this prebuffer is determined in data by the readout configuration, which can be accessed by specifying the parameter PMTconfigurationTag, and in simulation by a digitization module parameter, which can be replicated here by the parameter PretriggerBufferSize. The fraction of such buffer used for the baseline estimation is also specified by a configuration parameter (PretriggerBufferFractionForBaseline). Depending on the value of the configuration parameter ExcludeSpillTimeIfMoreThan, the one waveform that covers the trigger time may be excluded and not used; the rationale is that there is a conspicuous number of events triggered by the late light of a cosmic ray happening before the beam spill, in which case the activity may contaminate the pre-trigger buffer and could bias the estimation of the baseline.

The result of the opdet::SharedWaveformBaseline is currently used directly as the baseline for all the waveforms on the channel on that event.

Todo:
Add run-level information and checks.

Output data products

Output plots

Input data products

Service requirements

Configuration parameters

A terse description of the parameters is printed by running lar --print-description PMTWaveformBaselinesFromChannelData.

Definition at line 206 of file PMTWaveformBaselinesFromChannelData_module.cc.

Member Typedef Documentation

Constructor & Destructor Documentation

icarus::PMTWaveformBaselinesFromChannelData::PMTWaveformBaselinesFromChannelData ( Parameters const &  config,
art::ProcessingFrame const &  frame 
)
explicit

Definition at line 462 of file PMTWaveformBaselinesFromChannelData_module.cc.

463  : art::SharedProducer(config)
464  // configuration
465  , fOpDetWaveformTag(config().OpticalWaveforms())
466  , fExcludeSpillTimeIfMoreThan(config().ExcludeSpillTimeIfMoreThan())
467  , fPretriggerSamples(config().PretriggerBufferSize().value_or(0U))
468  , fPMTconfigTag(config().PMTconfigurationTag())
469  , fSampleFraction(config().PretriggerBufferFractionForBaseline())
470  , fAlgoParams(config().AlgoParams())
471  , fPlotBaselines(config().PlotBaselines())
472  , fBaselineTimeAverage(config().BaselineTimeAverage())
473  , fLogCategory(config().OutputCategory())
474  // service caching
475  , fOpticalTick(
477  { frame.serviceHandle<detinfo::DetectorClocksService>()->DataForJob() }
478  .OpticalClockPeriod()
479  )
480  // algorithms
481 {
482 
483  if (fPlotBaselines)
484 // serialize<art::InEvent>(art::TFileService::resource_name()); // TODO isn't art supposed to provide this method?
485  serializeExternal<art::InEvent>(std::string{ "TFileService" });
486  else
487  async<art::InEvent>();
488 
489 
490  //
491  // optional configuration parameters
492  //
493  if (fPMTconfigTag.has_value() == (fPretriggerSamples != 0)) {
494  throw art::Exception(art::errors::Configuration)
495  << "Exactly one between parameters '"
496  << config().PMTconfigurationTag.name() << "' and '"
497  << config().PretriggerBufferFractionForBaseline.name()
498  << "' (with a positive value) must be specified!\n";
499  }
500 
501  //
502  // configuration report
503  //
504  {
505  mf::LogInfo log{ fLogCategory };
506  log << "Using the standard (median) algorithm, waveform by waveform, on '"
507  << fOpDetWaveformTag.encode() << "'";
508  }
509 
510  //
511  // declaration of input
512  //
513  consumes<std::vector<raw::OpDetWaveform>>(fOpDetWaveformTag);
514  if (fPMTconfigTag) consumes<sbn::PMTconfiguration>(*fPMTconfigTag);
515 
516  //
517  // declaration of output
518  //
519  produces<std::vector<icarus::WaveformBaseline>>();
520  produces<std::vector<icarus::WaveformRMS>>();
521  produces<art::Assns<icarus::WaveformBaseline, raw::OpDetWaveform>>();
522  produces<art::Assns<icarus::WaveformRMS, raw::OpDetWaveform>>();
523 
524 } // icarus::PMTWaveformBaselinesFromChannelData::PMTWaveformBaselinesFromChannelData()
float const fSampleFraction
Fraction of pretrigger buffer to use.
art::InputTag const fOpDetWaveformTag
Input optical waveform tag.
opdet::SharedWaveformBaseline::Params_t fAlgoParams
Parameters for the baseline algorithm.
util::quantities::intervals::nanoseconds fOpticalTick
Duration of a PMT digitizer tick.
std::string const fLogCategory
Category name for the console output stream.
std::optional< art::InputTag > fPMTconfigTag
Tag for PMT configuration data product.
physics producers discrimopdaq OpticalWaveforms
A class exposing an upgraded interface of detinfo::DetectorClocksData.
double const fBaselineTimeAverage
Width of baseline time profile binning [s].
unsigned int fExcludeSpillTimeIfMoreThan
Minimum number of waveforms when excluding trigger one is allowed.
unsigned int fPretriggerSamples
Samples in the pre-trigger buffer.

Member Function Documentation

void icarus::PMTWaveformBaselinesFromChannelData::beginJob ( art::ProcessingFrame const &  frame)
overridevirtual

Prepares the plots to be filled.

Definition at line 529 of file PMTWaveformBaselinesFromChannelData_module.cc.

530 {
531 
532  //
533  // set up the plots, if needed
534  //
535  if (fPlotBaselines) setupPlots(frame);
536 
537 } // icarus::PMTWaveformBaselinesFromChannelData::beginJob()
void setupPlots(art::ProcessingFrame const &frame)
Creates all the plots to be filled by the module.
void icarus::PMTWaveformBaselinesFromChannelData::beginRun ( art::Run &  run,
art::ProcessingFrame const &   
)
overridevirtual

Reads needed PMT configuration.

Definition at line 542 of file PMTWaveformBaselinesFromChannelData_module.cc.

543 {
544 
545  if (fPMTconfigTag) { // update the pretrigger samples number
547  (run.getProduct<sbn::PMTconfiguration>(*fPMTconfigTag));
548  }
549  assert(fPretriggerSamples > 0U);
550 
551  fAlgoParams.nSample = std::max(
552  1U,
553  static_cast<unsigned int>(std::round(fSampleFraction * fPretriggerSamples))
554  );
555 
556  {
557  // not clear whether this is debug or info level
558  mf::LogInfo log{ fLogCategory };
559  log << run.id() << ": baseline algorithm configuration:\n";
560  fAlgoParams.dump(log, " - ");
561  }
562 
563 } // icarus::PMTWaveformBaselinesFromChannelData::beginRun()
float const fSampleFraction
Fraction of pretrigger buffer to use.
unsigned int getPretriggerBuffer(sbn::PMTconfiguration const &PMTconfig) const
Returns the smallest pre-trigger buffer size available among all boards.
std::size_t nSample
Number of samples to use from each waveform.
opdet::SharedWaveformBaseline::Params_t fAlgoParams
Parameters for the baseline algorithm.
std::string const fLogCategory
Category name for the console output stream.
std::optional< art::InputTag > fPMTconfigTag
Tag for PMT configuration data product.
void dump(Stream &out, std::string const &indent, std::string const &firstIndent) const
Dumps this configuration into the output stream out.
unsigned int fPretriggerSamples
Samples in the pre-trigger buffer.
Class containing configuration for PMT readout.
void icarus::PMTWaveformBaselinesFromChannelData::buildBaselineGraphs ( art::ProcessingFrame const &  frame)
private

Removes the empty plots.

Definition at line 799 of file PMTWaveformBaselinesFromChannelData_module.cc.

800 {
801 
802  auto& tfs = *(frame.serviceHandle<art::TFileService>());
803 
804  art::TFileDirectory graphDir = tfs.mkdir("graphs", "Baseline vs. time");
805  art::TFileDirectory profileDir
806  = tfs.mkdir("profiles", "Baseline profiles vs. time");
807 
808  for (auto const channel: util::counter(fBaselinesVsTime.size())) {
809 
810  auto& timeAndBaselines = fBaselinesVsTime[channel];
811  if (timeAndBaselines.empty()) continue;
812 
813  // sort by time (entries with the same time would be sorted by baseline,
814  // but that does not really happen nor it mattered if it happened)
815  std::sort(timeAndBaselines.begin(), timeAndBaselines.end());
816 
817  // graph, one point per event
818  auto* const graph = graphDir.makeAndRegister<TGraph>(
819  "BaselineCh" + std::to_string(channel),
820  "PMT channel #" + std::to_string(channel) + ": baseline vs. run time",
821  timeAndBaselines.size()
822  );
823  assert(graph->GetXaxis());
824  assert(graph->GetYaxis());
825  graph->GetXaxis()->SetTitle("event time");
826  graph->GetYaxis()->SetTitle("baseline [ ADC ]");
827 
828 
829  // profile, one point every 10 minutes (or best offer)
830  double const startTime = timeAndBaselines.front().first;
831  double const totalTime = timeAndBaselines.back().first - startTime;
832  auto const nBins = std::max(1U,
833  static_cast<unsigned int>(std::ceil(totalTime / fBaselineTimeAverage))
834  );
835  double const endTime = startTime + nBins * fBaselineTimeAverage;
836 
837  auto* const profile = profileDir.make<TProfile>(
838  ("BaselineCh" + std::to_string(channel) + "profile").c_str(),
839  ("PMT channel #" + std::to_string(channel) + ": baseline vs. run time")
840  .c_str(),
841  nBins, startTime, endTime
842  );
843  assert(profile->GetXaxis());
844  assert(profile->GetYaxis());
845  profile->GetXaxis()->SetTitle(
846  ("event time [ / " + std::to_string(fBaselineTimeAverage) + " s ]")
847  .c_str()
848  );
849  profile->GetYaxis()->SetTitle("average baseline [ ADC ]");
850 
851  for (auto const& [ i, data ]: util::enumerate(timeAndBaselines)) {
852  auto const [ time, baseline ] = data;
853  graph->SetPoint(i, time, baseline);
854  profile->Fill(time, baseline);
855  } // for
856 
857  } // for
858 
859 } // icarus::PMTWaveformBaselinesFromChannelData::buildBaselineGraphs()
std::vector< std::vector< std::pair< double, double > > > fBaselinesVsTime
For each channel, all event times and their baselines.
auto enumerate(Iterables &&...iterables)
Range-for loop helper tracking the number of iteration.
Definition: enumerate.h:69
auto counter(T begin, T end)
Returns an object to iterate values from begin to end in a range-for loop.
Definition: counter.h:285
BEGIN_PROLOG baseline
std::string to_string(WindowPattern const &pattern)
double const fBaselineTimeAverage
Width of baseline time profile binning [s].
art::ServiceHandle< art::TFileService > tfs
void icarus::PMTWaveformBaselinesFromChannelData::endJob ( art::ProcessingFrame const &  frame)
overridevirtual

Remove empty plots.

Definition at line 698 of file PMTWaveformBaselinesFromChannelData_module.cc.

699 {
700 
702 
703 } // icarus::PMTWaveformBaselinesFromChannelData::endJob()
void buildBaselineGraphs(art::ProcessingFrame const &frame)
Removes the empty plots.
unsigned int icarus::PMTWaveformBaselinesFromChannelData::getPretriggerBuffer ( sbn::PMTconfiguration const &  PMTconfig) const
private

Returns the smallest pre-trigger buffer size available among all boards.

Definition at line 734 of file PMTWaveformBaselinesFromChannelData_module.cc.

735 {
737  for (sbn::V1730Configuration const& board: PMTconfig.boards)
738  prebuffer.add(board.preTriggerTicks());
739  if (!prebuffer.has_data()) {
740  throw art::Exception{ art::errors::Unknown }
741  << "No boards found in the PMT configuration!\n";
742  }
743  else if (prebuffer.max() > prebuffer.min()) {
744  throw art::Exception{ art::errors::Unknown }
745  << "Found different pre-trigger readout buffer sizes between "
746  << prebuffer.min() << " and " << prebuffer.max() << " ticks.\n";
747  }
748  return prebuffer.min();
749 } // icarus::PMTWaveformBaselinesFromChannelData::getPretriggerBuffer()
Data_t max() const
Returns the accumulated maximum, or a very small number if no values.
bool has_data() const
Returns whether at least one datum has been added.
This_t & add(Data_t value)
Include a single value in the statistics.
unsigned int preTriggerTicks() const
Ticks in the waveform before the trigger.
Keeps track of the minimum and maximum value we observed.
Data_t min() const
Returns the accumulated minimum, or a very large number if no values.
process_name PMTconfig
Class containing configuration for a V1730 board.
std::vector< std::vector< raw::OpDetWaveform const * > > icarus::PMTWaveformBaselinesFromChannelData::groupByChannel ( std::vector< raw::OpDetWaveform > const &  waveforms)
staticprivate

Returns a common baseline for all the specified waveforms. Returns a vector of waveforms per channel (which is the index).

Definition at line 755 of file PMTWaveformBaselinesFromChannelData_module.cc.

756 {
757 
758  std::vector<std::vector<raw::OpDetWaveform const*>> groups;
759  VectorExpander groupForChannel { groups };
760 
761  for (raw::OpDetWaveform const& waveform: waveforms) {
762  groupForChannel(waveform.ChannelNumber()).push_back(&waveform);
763  }
764 
765  return groups;
766 } // icarus::PMTWaveformBaselinesFromChannelData::groupByChannel()
void icarus::PMTWaveformBaselinesFromChannelData::produce ( art::Event &  event,
art::ProcessingFrame const &  frame 
)
overridevirtual

Creates the data products.

Definition at line 568 of file PMTWaveformBaselinesFromChannelData_module.cc.

569 {
570 
572  frame.serviceHandle<detinfo::DetectorClocksService const>()->DataFor(event)
573  };
574 
575  detinfo::timescales::electronics_time const triggerTime
576  = detTimings.TriggerTime();
577 
578  mf::LogDebug{ fLogCategory }
579  << event.id() << " trigger time: " << triggerTime;
580 
581  //
582  // fetch input
583  //
584  auto const& waveformHandle
585  = event.getValidHandle<std::vector<raw::OpDetWaveform>>(fOpDetWaveformTag);
586  auto const& waveforms = *waveformHandle;
587 
588  //
589  // compute all the baselines (and plot them)
590  //
591  opdet::SharedWaveformBaseline const sharedWaveformBaselineAlgo
593 
594  double const eventTime = static_cast<double>(event.time().timeHigh())
595  + static_cast<double>(event.time().timeHigh()) * 1e-9;
596 
597  std::vector<BaselineInfo_t> channelBaselines;
598  VectorExpander baselineForChannel { channelBaselines };
599 
600  auto waveformsByChannel = groupByChannel(waveforms);
601 
602  for (auto const& [ channel, waveforms ]: util::enumerate(waveformsByChannel))
603  {
604  if (waveforms.empty()) continue;
605 
606  mf::LogTrace{ fLogCategory }
607  << "Processing " << waveforms.size() << " waveforms for channel "
608  << channel;
609 
610  //
611  // remove global trigger waveform
612  //
613  if (waveforms.size() >= fExcludeSpillTimeIfMoreThan) {
614 
615  unsigned int const nExcluded
616  = removeWaveformsAround(waveforms, triggerTime.value());
617  if (nExcluded > 0U) {
618  mf::LogTrace{ fLogCategory }
619  << "Removed " << nExcluded << "/" << (waveforms.size() + nExcluded)
620  << " waveforms at trigger time " << triggerTime;
621  }
622 
623  } // if many waveforms
624 
625  //
626  // extract baseline
627  //
629  = sharedWaveformBaselineAlgo(waveforms);
630 
631  mf::LogTrace{ fLogCategory }
632  << "Channel " << channel << ": baseline " << baseline.baseline
633  << " ADC# from " << baseline.nSamples << " samples in "
634  << baseline.nWaveforms << "/" << waveforms.size()
635  << " waveforms; found RMS=" << baseline.RMS << " ADC#";
636 
637  auto const chIndex = static_cast<std::size_t>(channel);
638  baselineForChannel(chIndex) = { baseline.baseline, baseline.RMS };
639 
640  if (fHBaselines) fHBaselines->Fill(double(channel), baseline.baseline);
641  if (chIndex < fBaselinesVsTime.size())
642  fBaselinesVsTime[chIndex].emplace_back(eventTime, baseline.baseline);
643 
644  } // for grouped waveforms
645 
646  //
647  // assign baselines to waveforms
648  //
649 
650  std::vector<icarus::WaveformBaseline> baselines;
651  baselines.reserve(waveforms.size());
652  art::Assns<icarus::WaveformBaseline, raw::OpDetWaveform> baselineToWaveforms;
653  art::PtrMaker<icarus::WaveformBaseline> const makeBaselinePtr(event);
654 
655  std::vector<icarus::WaveformRMS> RMSs;
656  RMSs.reserve(waveforms.size());
657  art::Assns<icarus::WaveformRMS, raw::OpDetWaveform> RMStoWaveforms;
658  art::PtrMaker<icarus::WaveformRMS> const makeRMSPtr(event);
659 
660  for (auto const& [ iWaveform, waveform ]: util::enumerate(waveforms)) {
661 
662  BaselineInfo_t baselineInfo
663  = channelBaselines[static_cast<std::size_t>(waveform.ChannelNumber())];
664 
665  art::Ptr<raw::OpDetWaveform> const waveformPtr{ waveformHandle, iWaveform };
666 
667  baselines.push_back(baselineInfo.baseline);
668  RMSs.push_back(baselineInfo.RMS);
669  baselineToWaveforms.addSingle(makeBaselinePtr(iWaveform), waveformPtr);
670  RMStoWaveforms.addSingle(makeRMSPtr(iWaveform), waveformPtr);
671 
672  } // for
673 
674  //
675  // output
676  //
677  event.put(
678  std::make_unique<std::vector<icarus::WaveformBaseline>>
679  (std::move(baselines))
680  );
681  event.put
682  (std::make_unique<std::vector<icarus::WaveformRMS>>(std::move(RMSs)));
683  event.put(
684  std::make_unique<art::Assns<icarus::WaveformBaseline, raw::OpDetWaveform>>
685  (std::move(baselineToWaveforms))
686  );
687  event.put(
688  std::make_unique<art::Assns<icarus::WaveformRMS, raw::OpDetWaveform>>
689  (std::move(RMStoWaveforms))
690  );
691 
692 
693 } // icarus::PMTWaveformBaselinesFromChannelData::produce()
art::InputTag const fOpDetWaveformTag
Input optical waveform tag.
std::vector< std::vector< std::pair< double, double > > > fBaselinesVsTime
For each channel, all event times and their baselines.
double RMS
The RMS found during the extraction.
static std::vector< std::vector< raw::OpDetWaveform const * > > groupByChannel(std::vector< raw::OpDetWaveform > const &waveforms)
opdet::SharedWaveformBaseline::Params_t fAlgoParams
Parameters for the baseline algorithm.
unsigned int nSamples
Number of samples used for the extraction.
auto enumerate(Iterables &&...iterables)
Range-for loop helper tracking the number of iteration.
Definition: enumerate.h:69
Extracts a common baseline from waveforms.
std::string const fLogCategory
Category name for the console output stream.
BEGIN_PROLOG baseline
A class exposing an upgraded interface of detinfo::DetectorClocksData.
do i e
unsigned int nWaveforms
Number of waveforms used for the extraction.
unsigned int fExcludeSpillTimeIfMoreThan
Minimum number of waveforms when excluding trigger one is allowed.
fDetProps &fDetProps fDetProps &fDetProps detTimings
double baseline
Value of the baseline [ADC#].
timescale_traits< ElectronicsTimeCategory >::time_point_t electronics_time
A point in time on the electronics time scale.
unsigned int removeWaveformsAround(std::vector< raw::OpDetWaveform const * > &waveforms, double time) const
Removes waveforms containing time, retuning how many were removed.
unsigned int icarus::PMTWaveformBaselinesFromChannelData::removeWaveformsAround ( std::vector< raw::OpDetWaveform const * > &  waveforms,
double  time 
) const
private

Removes waveforms containing time, retuning how many were removed.

Definition at line 771 of file PMTWaveformBaselinesFromChannelData_module.cc.

772 {
773 
774  // tick duration in the same unit as the electronics time scale times
775  // (that is microseconds, actually)
776  double const tickDuration
777  = detinfo::timescales::electronics_time::interval_t{ fOpticalTick }.value();
778 
779  auto const hasTriggerTime
780  = [tickDuration,time](raw::OpDetWaveform const* waveform)
781  {
782  double const relTime = time - waveform->TimeStamp();
783  return (relTime >= 0.0) && (relTime < (waveform->size() * tickDuration));
784  };
785 
786  auto const iLast
787  = std::remove_if(waveforms.begin(), waveforms.end(), hasTriggerTime);
788 
789  unsigned int const nRemoved = std::distance(iLast, waveforms.end());
790  waveforms.erase(iLast, waveforms.end());
791 
792  return nRemoved;
793 
794 } // icarus::PMTWaveformBaselinesFromChannelData::removeWaveformsAround()
util::quantities::intervals::nanoseconds fOpticalTick
Duration of a PMT digitizer tick.
double distance(geo::Point_t const &point, CathodeDesc_t const &cathode)
Returns the distance of a point from the cathode.
void icarus::PMTWaveformBaselinesFromChannelData::setupPlots ( art::ProcessingFrame const &  frame)
private

Creates all the plots to be filled by the module.

Definition at line 708 of file PMTWaveformBaselinesFromChannelData_module.cc.

709 {
710 
711  auto const& tfs = *(frame.serviceHandle<art::TFileService>());
712  auto const& geom = *(frame.serviceHandle<geo::Geometry>()->provider());
713 
714  fNPlotChannels = geom.NOpChannels();
715 
716  fHBaselines = tfs.make<TH2F>(
717  "Baselines",
718  "PMT baseline;channel;baseline per channel [ / 8 ADC ]",
719  fNPlotChannels, 0.0, double(fNPlotChannels),
720  256, 13312.0, 15360.0
721  );
722 
723  // these are graphs, and it is more convenient to carry around their data
724  // in a vector than carrying around the graphs themselves;
725  // `buildBaselineGraphs()` will turn that data into graph at end of the job;
726  // here we just declare which channels we are going to plot.
727  fBaselinesVsTime.resize(fNPlotChannels);
728 
729 } // icarus::PMTWaveformBaselinesFromChannelData::setupPlots()
std::vector< std::vector< std::pair< double, double > > > fBaselinesVsTime
For each channel, all event times and their baselines.
The geometry of one entire detector, as served by art.
Definition: Geometry.h:181
art::ServiceHandle< art::TFileService > tfs

Member Data Documentation

opdet::SharedWaveformBaseline::Params_t icarus::PMTWaveformBaselinesFromChannelData::fAlgoParams
private

Parameters for the baseline algorithm.

Definition at line 346 of file PMTWaveformBaselinesFromChannelData_module.cc.

std::vector<std::vector<std::pair<double, double> > > icarus::PMTWaveformBaselinesFromChannelData::fBaselinesVsTime
private

For each channel, all event times and their baselines.

Definition at line 380 of file PMTWaveformBaselinesFromChannelData_module.cc.

double const icarus::PMTWaveformBaselinesFromChannelData::fBaselineTimeAverage { 0.0 }
private

Width of baseline time profile binning [s].

Definition at line 351 of file PMTWaveformBaselinesFromChannelData_module.cc.

unsigned int icarus::PMTWaveformBaselinesFromChannelData::fExcludeSpillTimeIfMoreThan
private

Minimum number of waveforms when excluding trigger one is allowed.

Definition at line 334 of file PMTWaveformBaselinesFromChannelData_module.cc.

TH2* icarus::PMTWaveformBaselinesFromChannelData::fHBaselines = nullptr
private

All baselines, per channel.

Definition at line 377 of file PMTWaveformBaselinesFromChannelData_module.cc.

std::string const icarus::PMTWaveformBaselinesFromChannelData::fLogCategory
private

Category name for the console output stream.

Definition at line 353 of file PMTWaveformBaselinesFromChannelData_module.cc.

std::size_t icarus::PMTWaveformBaselinesFromChannelData::fNPlotChannels = 0U
private

Number of plotted channels.

Definition at line 376 of file PMTWaveformBaselinesFromChannelData_module.cc.

art::InputTag const icarus::PMTWaveformBaselinesFromChannelData::fOpDetWaveformTag
private

Input optical waveform tag.

Definition at line 331 of file PMTWaveformBaselinesFromChannelData_module.cc.

util::quantities::intervals::nanoseconds icarus::PMTWaveformBaselinesFromChannelData::fOpticalTick
private

Duration of a PMT digitizer tick.

Definition at line 361 of file PMTWaveformBaselinesFromChannelData_module.cc.

bool const icarus::PMTWaveformBaselinesFromChannelData::fPlotBaselines
private

Whether to produce plots.

Definition at line 348 of file PMTWaveformBaselinesFromChannelData_module.cc.

std::optional<art::InputTag> icarus::PMTWaveformBaselinesFromChannelData::fPMTconfigTag
private

Tag for PMT configuration data product.

Definition at line 340 of file PMTWaveformBaselinesFromChannelData_module.cc.

unsigned int icarus::PMTWaveformBaselinesFromChannelData::fPretriggerSamples
private

Samples in the pre-trigger buffer.

Definition at line 337 of file PMTWaveformBaselinesFromChannelData_module.cc.

float const icarus::PMTWaveformBaselinesFromChannelData::fSampleFraction
private

Fraction of pretrigger buffer to use.

Definition at line 342 of file PMTWaveformBaselinesFromChannelData_module.cc.


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