All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
Public Types | Public Member Functions | Public Attributes | List of all members
icarus::opdet::OpDetWaveformMakerClass< SampleType > Class Template Reference

Helper class to cut a raw::OpDetWaveform from a longer waveform data. More...

#include <PMTsimulationAlg.h>

Public Types

using Sample_t = SampleType
 
using WaveformData_t = std::vector< Sample_t >
 Type of waveform data. More...
 
using BufferRange_t = std::pair< detinfo::timescales::optical_tick, detinfo::timescales::optical_tick >
 

Public Member Functions

 OpDetWaveformMakerClass (WaveformData_t const &waveform, detinfo::timescales::electronics_time PMTstartTime, util::quantities::nanosecond samplingPeriod)
 Sampling period. More...
 
raw::OpDetWaveform create (raw::Channel_t opChannel, BufferRange_t const &bufferRange) const
 Returns an raw::OpDetWaveform with data at the bufferRange. More...
 
raw::OpDetWaveform operator() (raw::Channel_t opChannel, BufferRange_t const &bufferRange) const
 

Public Attributes

WaveformData_t const & fWaveform
 Full data from the PMT channel. More...
 
detinfo::timescales::electronics_time
const 
fPMTstartTime
 Time of the first sample in waveform. More...
 
util::quantities::nanosecond fSamplingPeriod
 

Detailed Description

template<typename SampleType>
class icarus::opdet::OpDetWaveformMakerClass< SampleType >

Helper class to cut a raw::OpDetWaveform from a longer waveform data.

Definition at line 70 of file PMTsimulationAlg.h.

Member Typedef Documentation

Definition at line 91 of file PMTsimulationAlg.h.

template<typename SampleType >
using icarus::opdet::OpDetWaveformMakerClass< SampleType >::Sample_t = SampleType

Definition at line 85 of file PMTsimulationAlg.h.

template<typename SampleType >
using icarus::opdet::OpDetWaveformMakerClass< SampleType >::WaveformData_t = std::vector<Sample_t>

Type of waveform data.

Definition at line 88 of file PMTsimulationAlg.h.

Constructor & Destructor Documentation

template<typename SampleType >
icarus::opdet::OpDetWaveformMakerClass< SampleType >::OpDetWaveformMakerClass ( WaveformData_t const &  waveform,
detinfo::timescales::electronics_time  PMTstartTime,
util::quantities::nanosecond  samplingPeriod 
)

Sampling period.

Constructor: waveform data, start time and sampling period

Definition at line 1019 of file PMTsimulationAlg.h.

1024  : fWaveform(waveform)
1025  , fPMTstartTime(PMTstartTime)
1026  , fSamplingPeriod(samplingPeriod)
1027 {}
util::quantities::nanosecond fSamplingPeriod
WaveformData_t const & fWaveform
Full data from the PMT channel.
detinfo::timescales::electronics_time const fPMTstartTime
Time of the first sample in waveform.

Member Function Documentation

template<typename SampleType >
raw::OpDetWaveform icarus::opdet::OpDetWaveformMakerClass< SampleType >::create ( raw::Channel_t  opChannel,
BufferRange_t const &  bufferRange 
) const

Returns an raw::OpDetWaveform with data at the bufferRange.

Definition at line 1033 of file PMTsimulationAlg.h.

1034 {
1035  std::size_t const start
1036  = std::min(std::size_t(bufferRange.first.value()), fWaveform.size());
1037  std::size_t const end
1038  = std::min(std::size_t(bufferRange.second.value()), fWaveform.size());
1039  assert(start <= end);
1040 
1041  // start of the waveform (tick #0) in the full optical reading
1042  raw::TimeStamp_t const timeStamp { fPMTstartTime + start * fSamplingPeriod };
1043 
1044  // create a new waveform preallocating enough room for the full buffer
1045  raw::OpDetWaveform outputWaveform(timeStamp, opChannel, end - start);
1046 
1047  // copy the buffer (need to unwrap the ADCcount value)
1049  fWaveform.begin() + start,
1050  fWaveform.begin() + end,
1051  std::back_inserter(outputWaveform),
1052  [](auto sample){ return sample.value(); }
1053  );
1054 
1055  return outputWaveform;
1056 } // icarus::opdet::OpDetWaveformMakerClass<>::create()
util::quantities::nanosecond fSamplingPeriod
static constexpr Sample_t transform(Sample_t sample)
double TimeStamp_t
us since 1970, based on TimeService
WaveformData_t const & fWaveform
Full data from the PMT channel.
auto end(FixedBins< T, C > const &) noexcept
Definition: FixedBins.h:585
detinfo::timescales::electronics_time const fPMTstartTime
Time of the first sample in waveform.
template<typename SampleType >
raw::OpDetWaveform icarus::opdet::OpDetWaveformMakerClass< SampleType >::operator() ( raw::Channel_t  opChannel,
BufferRange_t const &  bufferRange 
) const
inline

Definition at line 112 of file PMTsimulationAlg.h.

113  { return create(opChannel, bufferRange); }
raw::OpDetWaveform create(raw::Channel_t opChannel, BufferRange_t const &bufferRange) const
Returns an raw::OpDetWaveform with data at the bufferRange.

Member Data Documentation

template<typename SampleType >
detinfo::timescales::electronics_time const icarus::opdet::OpDetWaveformMakerClass< SampleType >::fPMTstartTime

Time of the first sample in waveform.

Definition at line 96 of file PMTsimulationAlg.h.

template<typename SampleType >
util::quantities::nanosecond icarus::opdet::OpDetWaveformMakerClass< SampleType >::fSamplingPeriod

Definition at line 98 of file PMTsimulationAlg.h.

template<typename SampleType >
WaveformData_t const& icarus::opdet::OpDetWaveformMakerClass< SampleType >::fWaveform

Full data from the PMT channel.

Definition at line 93 of file PMTsimulationAlg.h.


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