Changeset 2386 for trunk/MagicSoft/Mars/manalysis
- Timestamp:
- 10/15/03 19:15:13 (21 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/MagicSoft/Mars/manalysis/MCerPhotAnal2.cc
r2265 r2386 24 24 25 25 ////////////////////////////////////////////////////////////////////////////// 26 // //27 // MCerPhotAnal2 //28 // //29 // This is a task which calculates the number of photons from the FADC //30 // time slices. At the moment it integrates simply the FADC values. //31 // //32 // Input Containers: //33 // MRawEvtData, MPedes dtalCam //34 // //35 // Output Containers: //36 // MCerPhotEvt //37 // //26 // 27 // MCerPhotAnal2 28 // 29 // This is a task which calculates the number of photons from the FADC 30 // time slices. At the moment it integrates simply the FADC values. 31 // 32 // Input Containers: 33 // MRawEvtData, MPedestalCam 34 // 35 // Output Containers: 36 // MCerPhotEvt 37 // 38 38 ////////////////////////////////////////////////////////////////////////////// 39 39 … … 134 134 while (pixel.Next()) 135 135 { 136 Byte_t max = pixel.GetNumMaxHiGainSample(); 137 Byte_t num = fRawEvt->GetNumHiGainSamples(); 138 139 Byte_t *ptr = pixel.GetHiGainSamples(); 136 Byte_t *ptr = pixel.GetHiGainSamples(); 137 Byte_t *max = ptr+pixel.GetIdxMaxHiGainSample(); 138 Byte_t *end = ptr+fRawEvt->GetNumHiGainSamples(); 139 Byte_t *first = max-fBefore; 140 Byte_t *last = max+fAfter; 140 141 141 142 ULong_t sumb = 0; // sum background … … 147 148 Int_t nb = 0; 148 149 Int_t nsb = 0; 149 for (int i=0; i<num; i++) 150 151 if (*max==255) 152 sat++; 153 154 while (ptr<end) 150 155 { 151 if (ptr[i]==255) 152 sat++; 153 154 //if (sat>1) 155 // continue; 156 157 if (i<max-fBefore || i>max+fAfter) 158 { 159 sumb += ptr[i]; 160 sqb += ptr[i]*ptr[i]; 156 if (ptr<first || ptr>last) 157 { 158 sumb += *ptr; 159 sqb += *ptr* *ptr; 161 160 nb++; 162 161 } 163 162 else 164 163 { 165 sumsb += ptr[i];166 sqsb += ptr[i]*ptr[i];164 sumsb += *ptr; 165 sqsb += *ptr* *ptr; 167 166 nsb++; 168 167 } 168 ptr++; 169 169 } 170 170 … … 172 172 { 173 173 // Area: x9 174 max = pixel.GetNumMaxLoGainSample();175 num = fRawEvt->GetNumLoGainSamples();176 177 174 ptr = pixel.GetLoGainSamples(); 175 max = ptr+pixel.GetIdxMaxLoGainSample(); 176 177 if (*max>250) 178 { 179 fSkip++; 180 return kCONTINUE; 181 } 182 183 end = ptr+fRawEvt->GetNumLoGainSamples(); 184 first = max-fBefore; 185 last = max+fAfter; 178 186 179 187 sumsb = 0; // sum signal+background … … 184 192 //nb = 0; 185 193 nsb = 0; 186 for (int i=0; i<num; i++) 187 { 188 if (ptr[i]>250) 189 { 190 fSkip++; 191 return kCONTINUE; 192 } 193 if (i<max-fBefore || i>max+fAfter) 194 while (ptr<end) 195 { 196 if (ptr<first || ptr>last) 194 197 { 195 198 /* 199 // Background already calced from hi-gains! 196 200 sumb += ptr[i]; 197 201 sqb += ptr[i]*ptr[i]; … … 200 204 else 201 205 { 202 sumsb += ptr[i];203 sqsb += ptr[i]*ptr[i];206 sumsb += *ptr; 207 sqsb += *ptr* *ptr; 204 208 nsb++; 205 209 } 210 ptr++; 206 211 } 207 212 }
Note:
See TracChangeset
for help on using the changeset viewer.