CMS 3D CMS Logo

List of all members | Public Member Functions | Private Attributes
DigitizerUtility::Amplitude Class Reference

#include <DigitizerUtility.h>

Public Member Functions

float ampl () const
 
 Amplitude ()
 
 Amplitude (float amp, const PSimHit *hitp, float frac=0, float tcor=0, size_t hitIndex=0, uint32_t tofBin=0)
 
 operator float () const
 
void operator+= (const Amplitude &other)
 
void operator+= (const float &amp)
 
void set (const float amplitude)
 
const std::vector< std::pair< float, std::unique_ptr< SimHitInfo > > > & simInfoList () const
 

Private Attributes

float _amp
 
std::vector< std::pair< float, std::unique_ptr< SimHitInfo > > > _simInfoList
 

Detailed Description

Definition at line 33 of file DigitizerUtility.h.

Constructor & Destructor Documentation

◆ Amplitude() [1/2]

DigitizerUtility::Amplitude::Amplitude ( )
inline

Definition at line 35 of file DigitizerUtility.h.

◆ Amplitude() [2/2]

DigitizerUtility::Amplitude::Amplitude ( float  amp,
const PSimHit hitp,
float  frac = 0,
float  tcor = 0,
size_t  hitIndex = 0,
uint32_t  tofBin = 0 
)
inline

Definition at line 36 of file DigitizerUtility.h.

References _simInfoList, and DivergingColor::frac.

37  : _amp(amp) {
38  if (frac > 0) {
39  if (hitp != nullptr)
40  _simInfoList.push_back({frac, std::make_unique<SimHitInfo>(hitp, tcor, hitIndex, tofBin)});
41  else
42  _simInfoList.push_back({frac, nullptr});
43  }
44  }
std::vector< std::pair< float, std::unique_ptr< SimHitInfo > > > _simInfoList

Member Function Documentation

◆ ampl()

float DigitizerUtility::Amplitude::ampl ( ) const
inline

Definition at line 48 of file DigitizerUtility.h.

References _amp.

Referenced by Phase2TrackerDigitizerAlgorithm::digitize().

48 { return _amp; }

◆ operator float()

DigitizerUtility::Amplitude::operator float ( ) const
inline

Definition at line 47 of file DigitizerUtility.h.

References _amp.

47 { return _amp; }

◆ operator+=() [1/2]

void DigitizerUtility::Amplitude::operator+= ( const Amplitude other)
inline

Definition at line 51 of file DigitizerUtility.h.

References _amp, _simInfoList, and trackingPlots::other.

51  {
52  _amp += other._amp;
53  // in case of digi from the noise, the MC information need not be there
54  for (auto const& ic : other.simInfoList()) {
55  if (ic.first > -0.5)
56  _simInfoList.push_back({ic.first, std::make_unique<SimHitInfo>(*ic.second)});
57  }
58  }
std::vector< std::pair< float, std::unique_ptr< SimHitInfo > > > _simInfoList

◆ operator+=() [2/2]

void DigitizerUtility::Amplitude::operator+= ( const float &  amp)
inline

Definition at line 59 of file DigitizerUtility.h.

References _amp.

59 { _amp += amp; }

◆ set()

void DigitizerUtility::Amplitude::set ( const float  amplitude)
inline

Definition at line 60 of file DigitizerUtility.h.

References _amp, and CustomPhysics_cfi::amplitude.

60  { // Used to reset the amplitude
61  _amp = amplitude;
62  }

◆ simInfoList()

const std::vector<std::pair<float, std::unique_ptr<SimHitInfo> > >& DigitizerUtility::Amplitude::simInfoList ( ) const
inline

Definition at line 49 of file DigitizerUtility.h.

References _simInfoList.

Referenced by Phase2TrackerDigitizerAlgorithm::digitize().

49 { return _simInfoList; }
std::vector< std::pair< float, std::unique_ptr< SimHitInfo > > > _simInfoList

Member Data Documentation

◆ _amp

float DigitizerUtility::Amplitude::_amp
private

Definition at line 65 of file DigitizerUtility.h.

Referenced by ampl(), operator float(), operator+=(), and set().

◆ _simInfoList

std::vector<std::pair<float, std::unique_ptr<SimHitInfo> > > DigitizerUtility::Amplitude::_simInfoList
private

Definition at line 66 of file DigitizerUtility.h.

Referenced by Amplitude(), operator+=(), and simInfoList().