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.

35 : _amp(0.0) {}

◆ 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.

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  }

References _simInfoList, and DivergingColor::frac.

Member Function Documentation

◆ ampl()

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

Definition at line 48 of file DigitizerUtility.h.

48 { return _amp; }

References _amp.

Referenced by Phase2TrackerDigitizerAlgorithm::digitize().

◆ operator float()

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

Definition at line 47 of file DigitizerUtility.h.

47 { return _amp; }

References _amp.

◆ operator+=() [1/2]

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

Definition at line 51 of file DigitizerUtility.h.

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  }

References _amp, _simInfoList, and trackingPlots::other.

◆ operator+=() [2/2]

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

Definition at line 59 of file DigitizerUtility.h.

59 { _amp += amp; }

References _amp.

◆ set()

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

Definition at line 60 of file DigitizerUtility.h.

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

References _amp, and CustomPhysics_cfi::amplitude.

◆ simInfoList()

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

Definition at line 49 of file DigitizerUtility.h.

49 { return _simInfoList; }

References _simInfoList.

Referenced by Phase2TrackerDigitizerAlgorithm::digitize().

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().

CustomPhysics_cfi.amplitude
amplitude
Definition: CustomPhysics_cfi.py:12
DigitizerUtility::Amplitude::_simInfoList
std::vector< std::pair< float, std::unique_ptr< SimHitInfo > > > _simInfoList
Definition: DigitizerUtility.h:66
DivergingColor.frac
float frac
Definition: DivergingColor.py:175
trackingPlots.other
other
Definition: trackingPlots.py:1467
DigitizerUtility::Amplitude::_amp
float _amp
Definition: DigitizerUtility.h:65