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

Functor to convert tick point into a tick number and a subsample index. More...

Public Types

using SubsampleIndex_t = DiscretePhotoelectronPulse::SubsampleIndex_t
 

Public Member Functions

 TimeToTickAndSubtickConverter (unsigned int nSubsamples)
 
std::tuple< tick,
SubsampleIndex_t
operator() (double const tick_d) const
 Converts the tick_d in a subsample number and tick number. More...
 

Private Attributes

double const fNSubsamples
 Number of subsamples. More...
 

Detailed Description

Functor to convert tick point into a tick number and a subsample index.

Definition at line 536 of file PMTsimulationAlg.h.

Member Typedef Documentation

Definition at line 541 of file PMTsimulationAlg.h.

Constructor & Destructor Documentation

icarus::opdet::PMTsimulationAlg::TimeToTickAndSubtickConverter::TimeToTickAndSubtickConverter ( unsigned int  nSubsamples)
inline

Definition at line 543 of file PMTsimulationAlg.h.

544  : fNSubsamples(static_cast<double>(nSubsamples)) {}

Member Function Documentation

auto icarus::opdet::PMTsimulationAlg::TimeToTickAndSubtickConverter::operator() ( double const  tick_d) const

Converts the tick_d in a subsample number and tick number.

Definition at line 722 of file PMTsimulationAlg.cxx.

723 {
724  double const tickNumber_d = std::floor(tick_d);
725  double const subtick = std::floor((tick_d - tickNumber_d) * fNSubsamples);
726  return {
727  tick::castFrom(tickNumber_d),
728  static_cast<SubsampleIndex_t>(subtick)
729  };
730 } // icarus::opdet::PMTsimulationAlg::TimeToTickAndSubtickConverter::operator()
static constexpr quantity_t castFrom(U value)
Returns a new quantity initialized with the specified value.
Definition: quantities.h:825
tick_as< double > tick_d
Tick number, represented by double.
Definition: electronics.h:87
DiscretePhotoelectronPulse::SubsampleIndex_t SubsampleIndex_t

Member Data Documentation

double const icarus::opdet::PMTsimulationAlg::TimeToTickAndSubtickConverter::fNSubsamples
private

Number of subsamples.

Definition at line 538 of file PMTsimulationAlg.h.


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