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 double[512])
 
LASModuleProfile operator+ (const LASModuleProfile &)
 
LASModuleProfileoperator+= (const double[512])
 
LASModuleProfileoperator+= (const int[512])
 
LASModuleProfileoperator+= (const LASModuleProfile &)
 
LASModuleProfile operator- (const double[512])
 
LASModuleProfile operator- (const LASModuleProfile &)
 
LASModuleProfileoperator-= (const double[512])
 
LASModuleProfileoperator-= (const int[512])
 
LASModuleProfileoperator-= (const LASModuleProfile &)
 
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() [1/3]

LASModuleProfile::LASModuleProfile ( )

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

def constructor

Definition at line 7 of file LASModuleProfile.cc.

7  {
11 
12  Init();
13 }

References Init().

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

◆ LASModuleProfile() [2/3]

LASModuleProfile::LASModuleProfile ( double *  )

◆ LASModuleProfile() [3/3]

LASModuleProfile::LASModuleProfile ( int *  )

Member Function Documentation

◆ DumpToArray()

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

fill array

Definition at line 85 of file LASModuleProfile.cc.

85  {
89 
90  for (unsigned int i = 0; i < 512; ++i) {
91  array[i] = data.at(i);
92  }
93 }

References mps_check::array, data, and mps_fire::i.

◆ GetValue()

double LASModuleProfile::GetValue ( unsigned int  theStripNumber) const
inline

◆ Init()

void LASModuleProfile::Init ( void  )
private

everything needed for initialization

Definition at line 95 of file LASModuleProfile.cc.

95  {
99 
100  data.resize(512);
101 }

References data.

Referenced by LASModuleProfile().

◆ operator+() [1/2]

LASModuleProfile LASModuleProfile::operator+ ( const double  b[512])

add a double[512]

Definition at line 144 of file LASModuleProfile.cc.

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 }

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

◆ operator+() [2/2]

LASModuleProfile LASModuleProfile::operator+ ( const LASModuleProfile anotherProfile)

Definition at line 118 of file LASModuleProfile.cc.

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 }

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

◆ operator+=() [1/3]

LASModuleProfile & LASModuleProfile::operator+= ( const double  b[512])

Definition at line 194 of file LASModuleProfile.cc.

194  {
198 
199  for (unsigned int i = 0; i < 512; ++i) {
200  data.at(i) += b[i];
201  }
202 
203  return *this;
204 }

References b, data, and mps_fire::i.

◆ operator+=() [2/3]

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.

218  {
223 
224  for (unsigned int i = 0; i < 512; ++i) {
225  data.at(i) += b[i];
226  }
227 
228  return *this;
229 }

References b, data, and mps_fire::i.

◆ operator+=() [3/3]

LASModuleProfile & LASModuleProfile::operator+= ( const LASModuleProfile anotherProfile)

Definition at line 170 of file LASModuleProfile.cc.

170  {
174 
175  for (unsigned int i = 0; i < 512; ++i) {
176  data.at(i) += anotherProfile.GetValue(i);
177  }
178 
179  return *this;
180 }

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

◆ operator-() [1/2]

LASModuleProfile LASModuleProfile::operator- ( const double  b[512])

subtract a double[512]

Definition at line 157 of file LASModuleProfile.cc.

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 }

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

◆ operator-() [2/2]

LASModuleProfile LASModuleProfile::operator- ( const LASModuleProfile anotherProfile)

Definition at line 131 of file LASModuleProfile.cc.

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 }

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

◆ operator-=() [1/3]

LASModuleProfile & LASModuleProfile::operator-= ( const double  b[512])

Definition at line 206 of file LASModuleProfile.cc.

206  {
210 
211  for (unsigned int i = 0; i < 512; ++i) {
212  data.at(i) -= b[i];
213  }
214 
215  return *this;
216 }

References b, data, and mps_fire::i.

◆ operator-=() [2/3]

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.

231  {
236 
237  for (unsigned int i = 0; i < 512; ++i) {
238  data.at(i) -= b[i];
239  }
240 
241  return *this;
242 }

References b, data, and mps_fire::i.

◆ operator-=() [3/3]

LASModuleProfile & LASModuleProfile::operator-= ( const LASModuleProfile anotherProfile)

Definition at line 182 of file LASModuleProfile.cc.

182  {
186 
187  for (unsigned int i = 0; i < 512; ++i) {
188  data.at(i) -= anotherProfile.GetValue(i);
189  }
190 
191  return *this;
192 }

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

◆ operator/=()

LASModuleProfile & LASModuleProfile::operator/= ( const double  divisor)

handle with care!!

Definition at line 244 of file LASModuleProfile.cc.

244  {
248 
249  for (unsigned int i = 0; i < 512; ++i) {
250  data.at(i) /= divisor;
251  }
252 
253  return *this;
254 }

References data, and mps_fire::i.

◆ operator=()

LASModuleProfile & LASModuleProfile::operator= ( const LASModuleProfile anotherProfile)

Definition at line 103 of file LASModuleProfile.cc.

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 }

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

◆ SetAllValuesTo()

void LASModuleProfile::SetAllValuesTo ( const double &  theValue)

Definition at line 76 of file LASModuleProfile.cc.

76  {
80 
81  for (unsigned int i = 0; i < data.size(); ++i)
82  data.at(i) = theValue;
83 }

References data, and mps_fire::i.

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

◆ SetData() [1/2]

void LASModuleProfile::SetData ( double *  )

◆ SetData() [2/2]

void LASModuleProfile::SetData ( int *  )

◆ SetValue()

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

Definition at line 20 of file LASModuleProfile.h.

20 { data.at(theStripNumber) = theValue; }

References data.

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

Member Data Documentation

◆ data

std::vector<double> LASModuleProfile::data
private
mps_fire.i
i
Definition: mps_fire.py:355
LASModuleProfile::GetValue
double GetValue(unsigned int theStripNumber) const
Definition: LASModuleProfile.h:19
LASModuleProfile::LASModuleProfile
LASModuleProfile()
Definition: LASModuleProfile.cc:7
mps_check.array
array
Definition: mps_check.py:216
b
double b
Definition: hdecay.h:118
LASModuleProfile::data
std::vector< double > data
Definition: LASModuleProfile.h:38
LASModuleProfile::Init
void Init(void)
Definition: LASModuleProfile.cc:95