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, size_t hitIndex, unsigned int tofBin, float frac)
 
const EncodedEventIdeventId () const
 
const unsigned int hitIndex () 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 unsigned int tofBin () const
 
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 87 of file SiPixelDigitizerAlgorithm.h.

Constructor & Destructor Documentation

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

Definition at line 90 of file SiPixelDigitizerAlgorithm.h.

References _frac.

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

Definition at line 99 of file SiPixelDigitizerAlgorithm.h.

References _frac, and _hitInfo.

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

Member Function Documentation

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

Definition at line 112 of file SiPixelDigitizerAlgorithm.h.

References _amp.

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

Definition at line 136 of file SiPixelDigitizerAlgorithm.h.

References _hitInfo.

136  {
137  return _hitInfo->eventId_;
138  }
std::shared_ptr< SimHitInfoForLinks > _hitInfo
const unsigned int SiPixelDigitizerAlgorithm::Amplitude::hitIndex ( ) const
inline

Definition at line 139 of file SiPixelDigitizerAlgorithm.h.

References _hitInfo.

139  {
140  return _hitInfo->hitIndex_;
141  }
std::shared_ptr< SimHitInfoForLinks > _hitInfo
const std::shared_ptr<SimHitInfoForLinks>& SiPixelDigitizerAlgorithm::Amplitude::hitInfo ( ) const
inline

Definition at line 117 of file SiPixelDigitizerAlgorithm.h.

References _hitInfo.

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

Definition at line 113 of file SiPixelDigitizerAlgorithm.h.

References _frac.

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

Definition at line 111 of file SiPixelDigitizerAlgorithm.h.

References _amp.

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

Definition at line 119 of file SiPixelDigitizerAlgorithm.h.

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

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

Definition at line 145 of file SiPixelDigitizerAlgorithm.h.

References _amp.

145  {
146  _amp += amp;
147  }
void SiPixelDigitizerAlgorithm::Amplitude::set ( const float  amplitude)
inline

Definition at line 149 of file SiPixelDigitizerAlgorithm.h.

References _amp.

Referenced by betterConfigParser.BetterConfigParser::getGeneral().

149  { // Used to reset the amplitude
150  _amp = amplitude;
151  }
const unsigned int SiPixelDigitizerAlgorithm::Amplitude::tofBin ( ) const
inline

Definition at line 142 of file SiPixelDigitizerAlgorithm.h.

References _hitInfo.

142  {
143  return _hitInfo->tofBin_;
144  }
std::shared_ptr< SimHitInfoForLinks > _hitInfo
const std::vector<unsigned int>& SiPixelDigitizerAlgorithm::Amplitude::trackIds ( ) const
inline

Definition at line 114 of file SiPixelDigitizerAlgorithm.h.

References _hitInfo.

Referenced by operator+=().

114  {
115  return _hitInfo->trackIds_;
116  }
std::shared_ptr< SimHitInfoForLinks > _hitInfo

Member Data Documentation

float SiPixelDigitizerAlgorithm::Amplitude::_amp
private

Definition at line 156 of file SiPixelDigitizerAlgorithm.h.

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

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

Definition at line 157 of file SiPixelDigitizerAlgorithm.h.

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

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