CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
List of all members | Public Member Functions | Private Attributes
SiPixelDigitizerAlgorithm::Amplitude Class Reference

Public Member Functions

float ampl () const
 
 Amplitude ()
 
 Amplitude (float amp, float frac)
 
 Amplitude (float amp, const PSimHit *hitp, float frac)
 
const EncodedEventIdeventId () const
 
const std::shared_ptr
< SimHitInfoForLinks > & 
hitInfo () const
 
std::vector< float > individualampl () const
 
 operator float () const
 
void operator+= (const Amplitude &other)
 
void operator+= (const float &amp)
 
void set (const float amplitude)
 
const std::vector< unsigned int > & trackIds () const
 

Private Attributes

float _amp
 
std::vector< float > _frac
 
std::shared_ptr
< SimHitInfoForLinks
_hitInfo
 

Detailed Description

Definition at line 84 of file SiPixelDigitizerAlgorithm.h.

Constructor & Destructor Documentation

SiPixelDigitizerAlgorithm::Amplitude::Amplitude ( )
inline
SiPixelDigitizerAlgorithm::Amplitude::Amplitude ( float  amp,
float  frac 
)
inline

Definition at line 87 of file SiPixelDigitizerAlgorithm.h.

References _frac.

87  :
88  _amp(amp), _frac(1, frac), _hitInfo() {
89  //in case of digi from noisypixels
90  //the MC information are removed
91  if (_frac[0]<-0.5) {
92  _frac.pop_back();
93  }
94  }
std::shared_ptr< SimHitInfoForLinks > _hitInfo
SiPixelDigitizerAlgorithm::Amplitude::Amplitude ( float  amp,
const PSimHit hitp,
float  frac 
)
inline

Definition at line 96 of file SiPixelDigitizerAlgorithm.h.

References _frac, and _hitInfo.

96  :
97  _amp(amp), _frac(1, frac), _hitInfo(new SimHitInfoForLinks(hitp)) {
98 
99  //in case of digi from noisypixels
100  //the MC information are removed
101  if (_frac[0]<-0.5) {
102  _frac.pop_back();
103  _hitInfo->trackIds_.pop_back();
104  }
105  }
std::shared_ptr< SimHitInfoForLinks > _hitInfo

Member Function Documentation

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

Definition at line 109 of file SiPixelDigitizerAlgorithm.h.

References _amp.

const EncodedEventId& SiPixelDigitizerAlgorithm::Amplitude::eventId ( ) const
inline

Definition at line 133 of file SiPixelDigitizerAlgorithm.h.

References _hitInfo.

133  {
134  return _hitInfo->eventId_;
135  }
std::shared_ptr< SimHitInfoForLinks > _hitInfo
const std::shared_ptr<SimHitInfoForLinks>& SiPixelDigitizerAlgorithm::Amplitude::hitInfo ( ) const
inline

Definition at line 114 of file SiPixelDigitizerAlgorithm.h.

References _hitInfo.

114 {return _hitInfo;}
std::shared_ptr< SimHitInfoForLinks > _hitInfo
std::vector<float> SiPixelDigitizerAlgorithm::Amplitude::individualampl ( ) const
inline

Definition at line 110 of file SiPixelDigitizerAlgorithm.h.

References _frac.

110 {return _frac;}
SiPixelDigitizerAlgorithm::Amplitude::operator float ( ) const
inline

Definition at line 108 of file SiPixelDigitizerAlgorithm.h.

References _amp.

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

Definition at line 116 of file SiPixelDigitizerAlgorithm.h.

References _amp, _frac, _hitInfo, and trackIds().

116  {
117  _amp += other._amp;
118  //in case of contribution of noise to the digi
119  //the MC information are removed
120  if (other._frac[0]>-0.5){
121  if(other._hitInfo) {
122  std::vector<unsigned int>& otherTrackIds = other._hitInfo->trackIds_;
123  if(_hitInfo) {
124  std::vector<unsigned int>& trackIds = _hitInfo->trackIds_;
125  trackIds.insert(trackIds.end(), otherTrackIds.begin(), otherTrackIds.end());
126  } else {
127  _hitInfo.reset(new SimHitInfoForLinks(*other._hitInfo));
128  }
129  }
130  _frac.insert(_frac.end(), other._frac.begin(), other._frac.end());
131  }
132  }
std::shared_ptr< SimHitInfoForLinks > _hitInfo
const std::vector< unsigned int > & trackIds() const
void SiPixelDigitizerAlgorithm::Amplitude::operator+= ( const float &  amp)
inline

Definition at line 136 of file SiPixelDigitizerAlgorithm.h.

References _amp.

136  {
137  _amp += amp;
138  }
void SiPixelDigitizerAlgorithm::Amplitude::set ( const float  amplitude)
inline

Definition at line 140 of file SiPixelDigitizerAlgorithm.h.

References _amp.

Referenced by betterConfigParser.BetterConfigParser::getGeneral().

140  { // Used to reset the amplitude
141  _amp = amplitude;
142  }
const std::vector<unsigned int>& SiPixelDigitizerAlgorithm::Amplitude::trackIds ( ) const
inline

Definition at line 111 of file SiPixelDigitizerAlgorithm.h.

References _hitInfo.

Referenced by operator+=().

111  {
112  return _hitInfo->trackIds_;
113  }
std::shared_ptr< SimHitInfoForLinks > _hitInfo

Member Data Documentation

float SiPixelDigitizerAlgorithm::Amplitude::_amp
private

Definition at line 147 of file SiPixelDigitizerAlgorithm.h.

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

std::vector<float> SiPixelDigitizerAlgorithm::Amplitude::_frac
private

Definition at line 148 of file SiPixelDigitizerAlgorithm.h.

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

std::shared_ptr<SimHitInfoForLinks> SiPixelDigitizerAlgorithm::Amplitude::_hitInfo
private

Definition at line 149 of file SiPixelDigitizerAlgorithm.h.

Referenced by Amplitude(), eventId(), hitInfo(), operator+=(), and trackIds().