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

Constructor & Destructor Documentation

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

Definition at line 85 of file SiPixelDigitizerAlgorithm.h.

References _frac.

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

Definition at line 94 of file SiPixelDigitizerAlgorithm.h.

References _frac, and _hitInfo.

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

Member Function Documentation

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

Definition at line 107 of file SiPixelDigitizerAlgorithm.h.

References _amp.

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

Definition at line 131 of file SiPixelDigitizerAlgorithm.h.

References _hitInfo.

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

Definition at line 112 of file SiPixelDigitizerAlgorithm.h.

References _hitInfo.

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

Definition at line 108 of file SiPixelDigitizerAlgorithm.h.

References _frac.

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

Definition at line 106 of file SiPixelDigitizerAlgorithm.h.

References _amp.

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

Definition at line 114 of file SiPixelDigitizerAlgorithm.h.

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

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

Definition at line 134 of file SiPixelDigitizerAlgorithm.h.

References _amp.

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

Definition at line 138 of file SiPixelDigitizerAlgorithm.h.

References _amp.

Referenced by betterConfigParser.BetterConfigParser::getGeneral().

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

Definition at line 109 of file SiPixelDigitizerAlgorithm.h.

References _hitInfo.

Referenced by operator+=().

109  {
110  return _hitInfo->trackIds_;
111  }
std::shared_ptr< SimHitInfoForLinks > _hitInfo

Member Data Documentation

float SiPixelDigitizerAlgorithm::Amplitude::_amp
private

Definition at line 145 of file SiPixelDigitizerAlgorithm.h.

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

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

Definition at line 146 of file SiPixelDigitizerAlgorithm.h.

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

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

Definition at line 147 of file SiPixelDigitizerAlgorithm.h.

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