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  double theArray[512];
109  for (unsigned int i = 0; i < 512; ++i) {
110  theArray[i] = this->GetValue(i) + anotherProfile.GetValue(i);
111  }
112 
113  return (LASModuleProfile(theArray));
114 }
115 
120 
121  double theArray[512];
122  for (unsigned int i = 0; i < 512; ++i) {
123  theArray[i] = this->GetValue(i) - anotherProfile.GetValue(i);
124  }
125 
126  return (LASModuleProfile(theArray));
127 }
128 
133 
134  double theArray[512];
135  for (unsigned int i = 0; i < 512; ++i) {
136  theArray[i] = this->GetValue(i) + b[i];
137  }
138 
139  return (LASModuleProfile(theArray));
140 }
141 
146 
147  double theArray[512];
148  for (unsigned int i = 0; i < 512; ++i) {
149  theArray[i] = this->GetValue(i) - b[i];
150  }
151 
152  return (LASModuleProfile(theArray));
153 }
154 
159 
160  for (unsigned int i = 0; i < 512; ++i) {
161  data.at(i) += anotherProfile.GetValue(i);
162  }
163 
164  return *this;
165 }
166 
171 
172  for (unsigned int i = 0; i < 512; ++i) {
173  data.at(i) -= anotherProfile.GetValue(i);
174  }
175 
176  return *this;
177 }
178 
183 
184  for (unsigned int i = 0; i < 512; ++i) {
185  data.at(i) += b[i];
186  }
187 
188  return *this;
189 }
190 
195 
196  for (unsigned int i = 0; i < 512; ++i) {
197  data.at(i) -= b[i];
198  }
199 
200  return *this;
201 }
202 
208 
209  for (unsigned int i = 0; i < 512; ++i) {
210  data.at(i) += b[i];
211  }
212 
213  return *this;
214 }
215 
221 
222  for (unsigned int i = 0; i < 512; ++i) {
223  data.at(i) -= b[i];
224  }
225 
226  return *this;
227 }
228 
233 
234  for (unsigned int i = 0; i < 512; ++i) {
235  data.at(i) /= divisor;
236  }
237 
238  return *this;
239 }
240 
241 #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:120
LASModuleProfile operator+(const LASModuleProfile &)
void SetData(double *)