CMS 3D CMS Logo

LASModuleProfile.cc
Go to the documentation of this file.
1 
2 #ifndef __LASMODULEPROFILE_C
3 #define __LASMODULEPROFILE_C
4 
6 
11 
12  Init();
13 }
14 
15 LASModuleProfile::LASModuleProfile(double theData[512]) {
19 
20  Init();
21  for (unsigned int i = 0; i < 512; ++i)
22  data[i] = theData[i];
23 }
24 
25 LASModuleProfile::LASModuleProfile(int theData[512]) {
29 
30  Init();
31  for (unsigned int i = 0; i < 512; ++i)
32  data[i] = theData[i];
33 }
34 
35 void LASModuleProfile::SetData(double theData[512]) {
39 
40  for (unsigned int i = 0; i < 512; ++i)
41  data[i] = theData[i];
42 }
43 
44 void LASModuleProfile::SetData(int theData[512]) {
51 
52  for (unsigned int i = 0; i < 512; ++i)
53  data[i] = theData[i];
54 }
55 
56 // MADE INLINE
57 // double LASModuleProfile::GetValue( unsigned int theStripNumber ) const {
58 // ///
59 // /// return an element of the data
60 // ///
61 
62 // return( data[theStripNumber] );
63 
64 // }
65 
66 // MADE INLINE
67 // void LASModuleProfile::SetValue( unsigned int theStripNumber, const double& theValue ) {
68 // ///
69 // ///
70 // ///
71 
72 // data.at( theStripNumber ) = theValue;
73 
74 // }
75 
76 void LASModuleProfile::SetAllValuesTo(const double& theValue) {
80 
81  for (unsigned int i = 0; i < data.size(); ++i)
82  data.at(i) = theValue;
83 }
84 
89 
90  for (unsigned int i = 0; i < 512; ++i) {
91  array[i] = data.at(i);
92  }
93 }
94 
99 
100  data.resize(512);
101 }
102 
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 }
117 
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 }
130 
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 }
143 
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 }
156 
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 }
169 
174 
175  for (unsigned int i = 0; i < 512; ++i) {
176  data.at(i) += anotherProfile.GetValue(i);
177  }
178 
179  return *this;
180 }
181 
186 
187  for (unsigned int i = 0; i < 512; ++i) {
188  data.at(i) -= anotherProfile.GetValue(i);
189  }
190 
191  return *this;
192 }
193 
198 
199  for (unsigned int i = 0; i < 512; ++i) {
200  data.at(i) += b[i];
201  }
202 
203  return *this;
204 }
205 
210 
211  for (unsigned int i = 0; i < 512; ++i) {
212  data.at(i) -= b[i];
213  }
214 
215  return *this;
216 }
217 
223 
224  for (unsigned int i = 0; i < 512; ++i) {
225  data.at(i) += b[i];
226  }
227 
228  return *this;
229 }
230 
236 
237  for (unsigned int i = 0; i < 512; ++i) {
238  data.at(i) -= b[i];
239  }
240 
241  return *this;
242 }
243 
248 
249  for (unsigned int i = 0; i < 512; ++i) {
250  data.at(i) /= divisor;
251  }
252 
253  return *this;
254 }
255 
256 #endif
mps_fire.i
i
Definition: mps_fire.py:428
LASModuleProfile::GetValue
double GetValue(unsigned int theStripNumber) const
Definition: LASModuleProfile.h:19
LASModuleProfile::operator+
LASModuleProfile operator+(const LASModuleProfile &)
Definition: LASModuleProfile.cc:118
LASModuleProfile::SetData
void SetData(double *)
LASModuleProfile::LASModuleProfile
LASModuleProfile()
Definition: LASModuleProfile.cc:7
mps_check.array
array
Definition: mps_check.py:216
LASModuleProfile::operator-
LASModuleProfile operator-(const LASModuleProfile &)
Definition: LASModuleProfile.cc:131
LASModuleProfile.h
LASModuleProfile::operator=
LASModuleProfile & operator=(const LASModuleProfile &)
Definition: LASModuleProfile.cc:103
b
double b
Definition: hdecay.h:118
LASModuleProfile::SetAllValuesTo
void SetAllValuesTo(const double &)
Definition: LASModuleProfile.cc:76
LASModuleProfile::operator-=
LASModuleProfile & operator-=(const LASModuleProfile &)
Definition: LASModuleProfile.cc:182
LASModuleProfile::operator+=
LASModuleProfile & operator+=(const LASModuleProfile &)
Definition: LASModuleProfile.cc:170
LASModuleProfile::data
std::vector< double > data
Definition: LASModuleProfile.h:38
LASModuleProfile::DumpToArray
void DumpToArray(double[512])
Definition: LASModuleProfile.cc:85
LASModuleProfile
Definition: LASModuleProfile.h:7
LASModuleProfile::operator/=
LASModuleProfile & operator/=(const double)
Definition: LASModuleProfile.cc:244
LASModuleProfile::Init
void Init(void)
Definition: LASModuleProfile.cc:95