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.

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

Member Function Documentation

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

Definition at line 29 of file DigitizerUtility.h.

References _amp.

Referenced by Phase2TrackerDigitizerAlgorithm::digitize().

29 { return _amp; }
DigitizerUtility::Amplitude::operator float ( ) const
inline

Definition at line 28 of file DigitizerUtility.h.

References _amp.

28 { return _amp; }
void DigitizerUtility::Amplitude::operator+= ( const Amplitude other)
inline

Definition at line 34 of file DigitizerUtility.h.

References _amp, _simInfoList, and simInfoList().

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

Definition at line 42 of file DigitizerUtility.h.

References _amp.

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

Definition at line 43 of file DigitizerUtility.h.

References _amp, and CustomPhysics_cfi::amplitude.

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

Definition at line 30 of file DigitizerUtility.h.

References _simInfoList.

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

30  {
31  return _simInfoList;
32  }
std::vector< std::pair< float, std::unique_ptr< SimHitInfoForLinks > > > _simInfoList

Member Data Documentation

float DigitizerUtility::Amplitude::_amp
private

Definition at line 51 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 52 of file DigitizerUtility.h.

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