CMS 3D CMS Logo

List of all members | Public Member Functions | Private Member Functions | Private Attributes
LASModuleProfile Class Reference

#include <LASModuleProfile.h>

Public Member Functions

void DumpToArray (double[512])
 
double GetValue (unsigned int theStripNumber) const
 
 LASModuleProfile ()
 
 LASModuleProfile (double *)
 
 LASModuleProfile (int *)
 
LASModuleProfile operator+ (const LASModuleProfile &)
 
LASModuleProfile operator+ (const double[512])
 
LASModuleProfileoperator+= (const LASModuleProfile &)
 
LASModuleProfileoperator+= (const double[512])
 
LASModuleProfileoperator+= (const int[512])
 
LASModuleProfile operator- (const LASModuleProfile &)
 
LASModuleProfile operator- (const double[512])
 
LASModuleProfileoperator-= (const LASModuleProfile &)
 
LASModuleProfileoperator-= (const double[512])
 
LASModuleProfileoperator-= (const int[512])
 
LASModuleProfileoperator/= (const double)
 
LASModuleProfileoperator= (const LASModuleProfile &)
 
void SetAllValuesTo (const double &)
 
void SetData (double *)
 
void SetData (int *)
 
void SetValue (unsigned int theStripNumber, const double &theValue)
 

Private Member Functions

void Init (void)
 

Private Attributes

std::vector< double > data
 

Detailed Description

Definition at line 7 of file LASModuleProfile.h.

Constructor & Destructor Documentation

LASModuleProfile::LASModuleProfile ( )

container class for a LAS SiStrip module's 512 strip signals

def constructor

Definition at line 7 of file LASModuleProfile.cc.

References data, mps_fire::i, Init(), and SetData().

Referenced by operator+(), and operator-().

7  {
11 
12  Init();
13 }
LASModuleProfile::LASModuleProfile ( double *  )
LASModuleProfile::LASModuleProfile ( int *  )

Member Function Documentation

void LASModuleProfile::DumpToArray ( double  array[512])

fill array

Definition at line 85 of file LASModuleProfile.cc.

References data, and mps_fire::i.

Referenced by SetValue().

85  {
89 
90  for (unsigned int i = 0; i < 512; ++i) {
91  array[i] = data.at(i);
92  }
93 }
std::vector< double > data
double LASModuleProfile::GetValue ( unsigned int  theStripNumber) const
inline
void LASModuleProfile::Init ( void  )
private

everything needed for initialization

Definition at line 95 of file LASModuleProfile.cc.

References data.

Referenced by LASModuleProfile(), and SetValue().

95  {
99 
100  data.resize(512);
101 }
std::vector< double > data
LASModuleProfile LASModuleProfile::operator+ ( const LASModuleProfile anotherProfile)

Definition at line 118 of file LASModuleProfile.cc.

References GetValue(), mps_fire::i, and LASModuleProfile().

Referenced by SetValue().

118  {
122 
123  double theArray[512];
124  for (unsigned int i = 0; i < 512; ++i) {
125  theArray[i] = this->GetValue(i) + anotherProfile.GetValue(i);
126  }
127 
128  return (LASModuleProfile(theArray));
129 }
double GetValue(unsigned int theStripNumber) const
LASModuleProfile LASModuleProfile::operator+ ( const double  b[512])

add a double[512]

Definition at line 144 of file LASModuleProfile.cc.

References GetValue(), mps_fire::i, and LASModuleProfile().

144  {
148 
149  double theArray[512];
150  for (unsigned int i = 0; i < 512; ++i) {
151  theArray[i] = this->GetValue(i) + b[i];
152  }
153 
154  return (LASModuleProfile(theArray));
155 }
double GetValue(unsigned int theStripNumber) const
double b
Definition: hdecay.h:118
LASModuleProfile & LASModuleProfile::operator+= ( const LASModuleProfile anotherProfile)

Definition at line 170 of file LASModuleProfile.cc.

References data, GetValue(), and mps_fire::i.

Referenced by SetValue().

170  {
174 
175  for (unsigned int i = 0; i < 512; ++i) {
176  data.at(i) += anotherProfile.GetValue(i);
177  }
178 
179  return *this;
180 }
double GetValue(unsigned int theStripNumber) const
std::vector< double > data
LASModuleProfile & LASModuleProfile::operator+= ( const double  b[512])

Definition at line 194 of file LASModuleProfile.cc.

References data, and mps_fire::i.

194  {
198 
199  for (unsigned int i = 0; i < 512; ++i) {
200  data.at(i) += b[i];
201  }
202 
203  return *this;
204 }
std::vector< double > data
double b
Definition: hdecay.h:118
LASModuleProfile & LASModuleProfile::operator+= ( const int  b[512])

temporary workaround as long as data is provided in int arrays

Definition at line 218 of file LASModuleProfile.cc.

References data, and mps_fire::i.

218  {
223 
224  for (unsigned int i = 0; i < 512; ++i) {
225  data.at(i) += b[i];
226  }
227 
228  return *this;
229 }
std::vector< double > data
double b
Definition: hdecay.h:118
LASModuleProfile LASModuleProfile::operator- ( const LASModuleProfile anotherProfile)

Definition at line 131 of file LASModuleProfile.cc.

References GetValue(), mps_fire::i, and LASModuleProfile().

Referenced by SetValue().

131  {
135 
136  double theArray[512];
137  for (unsigned int i = 0; i < 512; ++i) {
138  theArray[i] = this->GetValue(i) - anotherProfile.GetValue(i);
139  }
140 
141  return (LASModuleProfile(theArray));
142 }
double GetValue(unsigned int theStripNumber) const
LASModuleProfile LASModuleProfile::operator- ( const double  b[512])

subtract a double[512]

Definition at line 157 of file LASModuleProfile.cc.

References GetValue(), mps_fire::i, and LASModuleProfile().

157  {
161 
162  double theArray[512];
163  for (unsigned int i = 0; i < 512; ++i) {
164  theArray[i] = this->GetValue(i) - b[i];
165  }
166 
167  return (LASModuleProfile(theArray));
168 }
double GetValue(unsigned int theStripNumber) const
double b
Definition: hdecay.h:118
LASModuleProfile & LASModuleProfile::operator-= ( const LASModuleProfile anotherProfile)

Definition at line 182 of file LASModuleProfile.cc.

References data, GetValue(), and mps_fire::i.

Referenced by SetValue().

182  {
186 
187  for (unsigned int i = 0; i < 512; ++i) {
188  data.at(i) -= anotherProfile.GetValue(i);
189  }
190 
191  return *this;
192 }
double GetValue(unsigned int theStripNumber) const
std::vector< double > data
LASModuleProfile & LASModuleProfile::operator-= ( const double  b[512])

Definition at line 206 of file LASModuleProfile.cc.

References data, and mps_fire::i.

206  {
210 
211  for (unsigned int i = 0; i < 512; ++i) {
212  data.at(i) -= b[i];
213  }
214 
215  return *this;
216 }
std::vector< double > data
double b
Definition: hdecay.h:118
LASModuleProfile & LASModuleProfile::operator-= ( const int  b[512])

temporary workaround as long as data is provided in int arrays

Definition at line 231 of file LASModuleProfile.cc.

References data, and mps_fire::i.

231  {
236 
237  for (unsigned int i = 0; i < 512; ++i) {
238  data.at(i) -= b[i];
239  }
240 
241  return *this;
242 }
std::vector< double > data
double b
Definition: hdecay.h:118
LASModuleProfile & LASModuleProfile::operator/= ( const double  divisor)

handle with care!!

Definition at line 244 of file LASModuleProfile.cc.

References data, and mps_fire::i.

Referenced by SetValue().

244  {
248 
249  for (unsigned int i = 0; i < 512; ++i) {
250  data.at(i) /= divisor;
251  }
252 
253  return *this;
254 }
std::vector< double > data
LASModuleProfile & LASModuleProfile::operator= ( const LASModuleProfile anotherProfile)

Definition at line 103 of file LASModuleProfile.cc.

References data, GetValue(), and mps_fire::i.

Referenced by SetValue().

103  {
107 
108  // check for self-assignment
109  if (this != &anotherProfile) {
110  for (unsigned int i = 0; i < 512; ++i) {
111  data.at(i) = anotherProfile.GetValue(i);
112  }
113  }
114 
115  return *this;
116 }
double GetValue(unsigned int theStripNumber) const
std::vector< double > data
void LASModuleProfile::SetAllValuesTo ( const double &  theValue)

Definition at line 76 of file LASModuleProfile.cc.

References data, and mps_fire::i.

Referenced by LaserAlignment::beginJob(), LaserAlignment::fillDataProfiles(), and SetValue().

76  {
80 
81  for (unsigned int i = 0; i < data.size(); ++i)
82  data.at(i) = theValue;
83 }
std::vector< double > data
void LASModuleProfile::SetData ( double *  )

Referenced by LASModuleProfile().

void LASModuleProfile::SetData ( int *  )
void LASModuleProfile::SetValue ( unsigned int  theStripNumber,
const double &  theValue 
)
inline

Definition at line 20 of file LASModuleProfile.h.

References data, DumpToArray(), Init(), operator+(), operator+=(), operator-(), operator-=(), operator/=(), operator=(), and SetAllValuesTo().

Referenced by LaserAlignment::fillDataProfiles(), and LaserAlignment::fillPedestalProfiles().

20 { data.at(theStripNumber) = theValue; }
std::vector< double > data

Member Data Documentation

std::vector<double> LASModuleProfile::data
private