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
LASModuleProfile operator-(const LASModuleProfile &)
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:118
LASModuleProfile & operator=(const LASModuleProfile &)
LASModuleProfile operator+(const LASModuleProfile &)
void SetData(double *)