WaveformAnalyzerBase Class Reference

Ratpac-two: RAT::WaveformAnalyzerBase Class Reference
Ratpac-two
RAT::WaveformAnalyzerBase Class Referenceabstract
Inheritance diagram for RAT::WaveformAnalyzerBase:
RAT::Processor RAT::WaveformAnalysisGaussian RAT::WaveformAnalysisLognormal RAT::WaveformAnalysisLucyDDM RAT::WaveformAnalysisRAVEN RAT::WaveformAnalysisSinc

Public Member Functions

 WaveformAnalyzerBase ()=delete
 
 WaveformAnalyzerBase (std::string _procname, std::string config_name)
 
virtual void Configure (const std::string &config_name)
 
virtual void SetS (std::string param, std::string value) override
 
virtual void SetD (std::string param, double value) override
 
virtual void SetI (std::string param, int value) override
 
virtual void RunAnalysis (DS::DigitPMT *digitpmt, int pmtID, Digitizer *fDigitizer)
 
virtual void RunAnalysis (DS::DigitPMT *digitpmt, int pmtID, DS::Digit *dsdigit)
 
Processor::Result Event (DS::Root *ds, DS::EV *ev) override
 
virtual void DoAnalysis (DS::DigitPMT *digitpmt, const std::vector< UShort_t > &digitwfm)=0
 
virtual std::string GetAnalyzerName () const
 
- Public Member Functions inherited from RAT::Processor
 Processor (std::string _name)
 
virtual ~Processor ()
 
std::string GetName () const
 
virtual void SetF (std::string param, float value)
 
virtual Processor::Result DSEvent (DS::Root *ds)
 
virtual void BeginOfRun (DS::Run *run)
 
virtual void EndOfRun (DS::Run *run)
 

Protected Attributes

double fTimeStep
 
double fVoltageRes
 
double fTermOhms
 
double fMinTotalCharge = std::numeric_limits<double>::lowest()
 
double fMaxTotalCharge = std::numeric_limits<double>::max()
 
- Protected Attributes inherited from RAT::Processor
std::string name
 

Additional Inherited Members

- Public Types inherited from RAT::Processor
enum  Result { OK = 0 , FAIL = 1 , ABORT = 2 }
 

Constructor & Destructor Documentation

◆ WaveformAnalyzerBase() [1/2]

RAT::WaveformAnalyzerBase::WaveformAnalyzerBase ( )
delete

Default constructor. Disabled as this class should only be inherited, not instantiated.

◆ WaveformAnalyzerBase() [2/2]

RAT::WaveformAnalyzerBase::WaveformAnalyzerBase ( std::string  _procname,
std::string  config_name 
)
inline

Create a new waveform analyzer.

Parameters
_procnameName of the processor. It correspond the processor registered in ProcBlockManager, as well as the one called in macros.
_procnameA configuration index used to specify a set of parameters. See Configure().

Member Function Documentation

◆ Configure()

void WaveformAnalyzerBase::Configure ( const std::string &  config_name)
virtual

Configure the processor. This method will be called upon processor instantiation.

Parameters
config_nameAn index that is typically used to index table DIGITIZER_ANALYSIS in ratdb. Although technically you can use it for anything. In the base class this does nothing for now. But stuff can be added in the future if we would like to set parameters for all processors.

Reimplemented in RAT::WaveformAnalysisSinc, RAT::WaveformAnalysisRAVEN, RAT::WaveformAnalysisLucyDDM, RAT::WaveformAnalysisLognormal, and RAT::WaveformAnalysisGaussian.

◆ DoAnalysis()

virtual void RAT::WaveformAnalyzerBase::DoAnalysis ( DS::DigitPMT digitpmt,
const std::vector< UShort_t > &  digitwfm 
)
pure virtual

Implementation of the waveform analysis.

Parameters
digitpmtPointer to the digitpmt where analysis results are written to.
digitwfmWaveform to analyze, in ADC units.

See WaveformAnalysisLognormal for a concrete example. In order to write results, instantiate a RAT::DS::WaveformAnalysisResult object via digitpmt->GetOrCreateWaveformAnalysisResult("procName").

Implemented in RAT::WaveformAnalysisSinc, RAT::WaveformAnalysisLucyDDM, RAT::WaveformAnalysisLognormal, RAT::WaveformAnalysisGaussian, and RAT::WaveformAnalysisRAVEN.

◆ Event()

Processor::Result WaveformAnalyzerBase::Event ( DS::Root ds,
DS::EV ev 
)
overridevirtual

Main function called for each event.

Reimplemented from RAT::Processor.

◆ GetAnalyzerName()

std::string WaveformAnalyzerBase::GetAnalyzerName ( ) const
virtual

Short name under which this analyzer's WaveformAnalysisResult is stored (e.g. "Lognormal"). Used both inside DoAnalysis() and to guarantee a result is always created, even when analysis is skipped (e.g. due to the charge thresholds). By default this is the processor name with the leading "WaveformAnalysis" stripped (so WaveformAnalysisLognormal -> "Lognormal"). Override if an analyzer's processor name does not follow that convention.

◆ RunAnalysis() [1/2]

void WaveformAnalyzerBase::RunAnalysis ( DS::DigitPMT digitpmt,
int  pmtID,
Digitizer fDigitizer 
)
virtual

Function that sets up the digitizer object and calls DoAnalysis() appropriately.

Parameters
digitpmtPointer to the digitpmt that the current waveform correspond to.
pmtIDThe ID of the current PMT. These may not correspond to real PMTs, should an analysis is requested by a channel (LCN) that does not map to a PMT.
fDigitizerdigitizer that contains the waveforms. This function sets up the following class variables: fTimeStep: nanoseconds that correspond to a time step in the waveform. fVoltageRes: mV that correespond to one ADC in the waveform. fTermOhms: termination resistance of the voltage. Recall that charge is voltage / termination integrated over time.

◆ RunAnalysis() [2/2]

void WaveformAnalyzerBase::RunAnalysis ( DS::DigitPMT digitpmt,
int  pmtID,
DS::Digit dsdigit 
)
virtual

Function that sets up the digitizer object and calls DoAnalysis() appropriately.

Parameters
digitpmtPointer to the digitpmt that the current waveform correspond to.
pmtIDThe ID of the current PMT. These may not correspond to real PMTs, should an analysis is requested by a channel (LCN) that does not map to a PMT.
dsdigitdigitizer that contains the waveforms.

This function sets up the following class variables: fTimeStep: nanoseconds that correspond to a time step in the waveform. fVoltageRes: mV that correespond to one ADC in the waveform. fTermOhms: termination resistance of the voltage. Recall that charge is voltage / termination integrated over time.

◆ SetD()

void WaveformAnalyzerBase::SetD ( std::string  param,
double  value 
)
overridevirtual

Functions that gets called for /procset lines in the macro. Base class does nothing.

Reimplemented from RAT::Processor.

Reimplemented in RAT::WaveformAnalysisSinc, RAT::WaveformAnalysisRAVEN, RAT::WaveformAnalysisLognormal, and RAT::WaveformAnalysisGaussian.

◆ SetI()

void WaveformAnalyzerBase::SetI ( std::string  param,
int  value 
)
overridevirtual

Set integer parameter.

Parameters
[in]paramName of parameter.
[in]valueValue of parameter.
Exceptions
ParamUnknownif param is not recognized.
ParamInvalidif value is not allowed for param.

Reimplemented from RAT::Processor.

Reimplemented in RAT::WaveformAnalysisSinc, and RAT::WaveformAnalysisRAVEN.

◆ SetS()

void WaveformAnalyzerBase::SetS ( std::string  param,
std::string  value 
)
overridevirtual

Functions that gets called for /procset lines in the macro. Base class calls allows you to set a config name and call Configure().

Reimplemented from RAT::Processor.


The documentation for this class was generated from the following files:
  • /home/docs/checkouts/readthedocs.org/user_builds/ratpac/checkouts/latest/src/daq/include/RAT/WaveformAnalyzerBase.hh
  • /home/docs/checkouts/readthedocs.org/user_builds/ratpac/checkouts/latest/src/daq/src/WaveformAnalyzerBase.cc