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, size_t hitIndex=0, unsigned int 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< SimHitInfoForLinks > > > & simInfoList () const
 

Private Attributes

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

Detailed Description

Definition at line 14 of file DigitizerUtility.h.

Constructor & Destructor Documentation

DigitizerUtility::Amplitude::Amplitude ( )
inline

Definition at line 16 of file DigitizerUtility.h.

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

Definition at line 17 of file DigitizerUtility.h.

References _simInfoList, and cropTnPTrees::frac.

17  :
18  _amp(amp) {
19  if (frac > 0) {
20  if (hitp != nullptr) _simInfoList.push_back({frac, std::make_unique<SimHitInfoForLinks>(hitp,hitIndex,tofBin)});
21  else _simInfoList.push_back({frac, nullptr});
22  }
23  }
std::vector< std::pair< float, std::unique_ptr< SimHitInfoForLinks > > > _simInfoList

Member Function Documentation

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

Definition at line 27 of file DigitizerUtility.h.

References _amp.

Referenced by Phase2TrackerDigitizerAlgorithm::digitize().

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

Definition at line 26 of file DigitizerUtility.h.

References _amp.

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

Definition at line 30 of file DigitizerUtility.h.

References _amp, _simInfoList, and simInfoList().

30  {
31  _amp += other._amp;
32  // in case of digi from the noise, the MC information need not be there
33  for (auto const& ic : other.simInfoList()) {
34  if (ic.first > -0.5) _simInfoList.push_back({ic.first, std::make_unique<SimHitInfoForLinks>(*ic.second)});
35  }
36  }
std::vector< std::pair< float, std::unique_ptr< SimHitInfoForLinks > > > _simInfoList
void DigitizerUtility::Amplitude::operator+= ( const float &  amp)
inline

Definition at line 37 of file DigitizerUtility.h.

References _amp.

37  {
38  _amp += amp;
39  }
void DigitizerUtility::Amplitude::set ( const float  amplitude)
inline

Definition at line 40 of file DigitizerUtility.h.

References _amp, and CustomPhysics_cfi::amplitude.

40  { // Used to reset the amplitude
41  _amp = amplitude;
42  }
const std::vector<std::pair<float, std::unique_ptr<SimHitInfoForLinks> > >& DigitizerUtility::Amplitude::simInfoList ( ) const
inline

Definition at line 28 of file DigitizerUtility.h.

References _simInfoList.

Referenced by Phase2TrackerDigitizerAlgorithm::digitize(), and operator+=().

28 {return _simInfoList;}
std::vector< std::pair< float, std::unique_ptr< SimHitInfoForLinks > > > _simInfoList

Member Data Documentation

float DigitizerUtility::Amplitude::_amp
private

Definition at line 48 of file DigitizerUtility.h.

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

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

Definition at line 49 of file DigitizerUtility.h.

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