test
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 92 of file SiPixelDigitizerAlgorithm.h.

Constructor & Destructor Documentation

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

Definition at line 95 of file SiPixelDigitizerAlgorithm.h.

References _frac.

95  :
96  _amp(amp), _frac(1, frac), _hitInfo() {
97  //in case of digi from noisypixels
98  //the MC information are removed
99  if (_frac[0]<-0.5) {
100  _frac.pop_back();
101  }
102  }
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 104 of file SiPixelDigitizerAlgorithm.h.

References _frac, and _hitInfo.

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

Member Function Documentation

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

Definition at line 117 of file SiPixelDigitizerAlgorithm.h.

References _amp.

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

Definition at line 141 of file SiPixelDigitizerAlgorithm.h.

References _hitInfo.

141  {
142  return _hitInfo->eventId_;
143  }
std::shared_ptr< SimHitInfoForLinks > _hitInfo
const unsigned int SiPixelDigitizerAlgorithm::Amplitude::hitIndex ( ) const
inline

Definition at line 144 of file SiPixelDigitizerAlgorithm.h.

References _hitInfo.

144  {
145  return _hitInfo->hitIndex_;
146  }
std::shared_ptr< SimHitInfoForLinks > _hitInfo
const std::shared_ptr<SimHitInfoForLinks>& SiPixelDigitizerAlgorithm::Amplitude::hitInfo ( ) const
inline

Definition at line 122 of file SiPixelDigitizerAlgorithm.h.

References _hitInfo.

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

Definition at line 118 of file SiPixelDigitizerAlgorithm.h.

References _frac.

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

Definition at line 116 of file SiPixelDigitizerAlgorithm.h.

References _amp.

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

Definition at line 124 of file SiPixelDigitizerAlgorithm.h.

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

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

Definition at line 150 of file SiPixelDigitizerAlgorithm.h.

References _amp.

150  {
151  _amp += amp;
152  }
void SiPixelDigitizerAlgorithm::Amplitude::set ( const float  amplitude)
inline

Definition at line 154 of file SiPixelDigitizerAlgorithm.h.

References _amp.

154  { // Used to reset the amplitude
155  _amp = amplitude;
156  }
const unsigned int SiPixelDigitizerAlgorithm::Amplitude::tofBin ( ) const
inline

Definition at line 147 of file SiPixelDigitizerAlgorithm.h.

References _hitInfo.

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

Definition at line 119 of file SiPixelDigitizerAlgorithm.h.

References _hitInfo.

Referenced by operator+=().

119  {
120  return _hitInfo->trackIds_;
121  }
std::shared_ptr< SimHitInfoForLinks > _hitInfo

Member Data Documentation

float SiPixelDigitizerAlgorithm::Amplitude::_amp
private

Definition at line 161 of file SiPixelDigitizerAlgorithm.h.

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

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

Definition at line 162 of file SiPixelDigitizerAlgorithm.h.

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

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