CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
LASModuleProfile.cc
Go to the documentation of this file.
1 
2 #ifndef __LASMODULEPROFILE_C
3 #define __LASMODULEPROFILE_C
4 
5 
7 
8 
13 
14  Init();
15 
16 }
17 
18 
19 
20 
21 LASModuleProfile::LASModuleProfile( double theData[512] ) {
25 
26  Init();
27  for( unsigned int i = 0; i < 512; ++i ) data[i] = theData[i];
28 
29 }
30 
31 
32 
33 
34 
35 LASModuleProfile::LASModuleProfile( int theData[512] ) {
39 
40  Init();
41  for( unsigned int i = 0; i < 512; ++i ) data[i] = theData[i];
42 
43 }
44 
45 
46 
47 
48 
49 void LASModuleProfile::SetData( double theData[512] ) {
53 
54  for( unsigned int i = 0; i < 512; ++i ) data[i] = theData[i];
55 
56 }
57 
58 
59 
60 
61 
62 void LASModuleProfile::SetData( int theData[512] ) {
69 
70  for( unsigned int i = 0; i < 512; ++i ) data[i] = theData[i];
71 
72 }
73 
74 
75 
76 
77 // MADE INLINE
78 // double LASModuleProfile::GetValue( unsigned int theStripNumber ) const {
79 // ///
80 // /// return an element of the data
81 // ///
82 
83 // return( data[theStripNumber] );
84 
85 // }
86 
87 
88 
89 // MADE INLINE
90 // void LASModuleProfile::SetValue( unsigned int theStripNumber, const double& theValue ) {
91 // ///
92 // ///
93 // ///
94 
95 // data.at( theStripNumber ) = theValue;
96 
97 // }
98 
99 
100 
101 
102 
103 void LASModuleProfile::SetAllValuesTo( const double& theValue ) {
107 
108  for( unsigned int i = 0; i < data.size(); ++i ) data.at( i ) = theValue;
109 
110 }
111 
112 
113 
114 
115 
116 void LASModuleProfile::DumpToArray( double array[512] ) {
120 
121  for( unsigned int i = 0; i < 512; ++i ) {
122  array[i] = data.at( i );
123  }
124 
125 }
126 
127 
128 
129 
130 
135 
136  data.resize( 512 );
137 
138 }
139 
140 
141 
142 
143 
148 
149  // check for self-assignment
150  if( this != &anotherProfile ) {
151 
152  for( unsigned int i = 0; i < 512; ++i ) {
153  data.at( i ) = anotherProfile.GetValue( i );
154  }
155 
156  }
157 
158  return *this;
159 
160 }
161 
162 
163 
164 
165 
170 
171  double theArray[512];
172  for( unsigned int i = 0; i < 512; ++i ) {
173  theArray[i] = this->GetValue( i ) + anotherProfile.GetValue( i );
174  }
175 
176  return( LASModuleProfile( theArray ) );
177 
178 }
179 
180 
181 
182 
183 
188 
189  double theArray[512];
190  for( unsigned int i = 0; i < 512; ++i ) {
191  theArray[i] = this->GetValue( i ) - anotherProfile.GetValue( i );
192  }
193 
194  return( LASModuleProfile( theArray ) );
195 
196 }
197 
198 
199 
200 
201 
206 
207  double theArray[512];
208  for( unsigned int i = 0; i < 512; ++i ) {
209  theArray[i] = this->GetValue( i ) + b[i];
210  }
211 
212  return( LASModuleProfile( theArray ) );
213 
214 }
215 
216 
217 
218 
219 
224 
225  double theArray[512];
226  for( unsigned int i = 0; i < 512; ++i ) {
227  theArray[i] = this->GetValue( i ) - b[i];
228  }
229 
230  return( LASModuleProfile( theArray ) );
231 
232 }
233 
234 
235 
236 
237 
242 
243  for( unsigned int i = 0; i < 512; ++i ) {
244  data.at( i ) += anotherProfile.GetValue( i );
245  }
246 
247  return *this;
248 
249 }
250 
251 
252 
253 
254 
259 
260  for( unsigned int i = 0; i < 512; ++i ) {
261  data.at( i ) -= anotherProfile.GetValue( i );
262  }
263 
264  return *this;
265 
266 }
267 
268 
269 
270 
271 
276 
277  for( unsigned int i = 0; i < 512; ++i ) {
278  data.at( i ) += b[i];
279  }
280 
281  return *this;
282 
283 }
284 
285 
286 
287 
288 
293 
294  for( unsigned int i = 0; i < 512; ++i ) {
295  data.at( i ) -= b[i];
296  }
297 
298  return *this;
299 
300 }
301 
302 
303 
304 
310 
311  for( unsigned int i = 0; i < 512; ++i ) {
312  data.at( i ) += b[i];
313  }
314 
315  return *this;
316 
317 }
318 
319 
320 
321 
322 
328 
329  for( unsigned int i = 0; i < 512; ++i ) {
330  data.at( i ) -= b[i];
331  }
332 
333  return *this;
334 
335 }
336 
337 
338 
339 
340 
345 
346  for( unsigned int i = 0; i < 512; ++i ) {
347  data.at( i ) /= divisor;
348  }
349 
350  return *this;
351 
352 }
353 
354 
355 
356 
357 #endif
LASModuleProfile operator-(const LASModuleProfile &)
int i
Definition: DBlmapReader.cc:9
void SetAllValuesTo(const double &)
double GetValue(unsigned int theStripNumber) const
LASModuleProfile & operator+=(const LASModuleProfile &)
LASModuleProfile & operator-=(const LASModuleProfile &)
std::vector< double > data
LASModuleProfile & operator/=(const double)
void DumpToArray(double[512])
double b
Definition: hdecay.h:120
LASModuleProfile & operator=(const LASModuleProfile &)
LASModuleProfile operator+(const LASModuleProfile &)
void SetData(double *)