Changeset 2658 for trunk/MagicSoft/Mars/manalysis
- Timestamp:
- 12/11/03 17:42:25 (21 years ago)
- Location:
- trunk/MagicSoft/Mars/manalysis
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/MagicSoft/Mars/manalysis/MCalibrationCalc.cc
r2642 r2658 252 252 { 253 253 254 fEvents++;255 256 254 Int_t cosmicpix = 0; 257 255 … … 273 271 while (pixel.Next()) 274 272 { 275 276 const Int_t pixid = pixel.GetPixelId(); 277 278 Int_t sum = pixel.GetSumHiGainSamples(); 279 280 MPedestalPix &ped = (*fPedestals)[pixid]; 281 282 Float_t pedes = ped.GetPedestal(); 273 274 const UInt_t pixid = pixel.GetPixelId(); 275 276 MExtractedSignalPix &sig = (*fSignals)[pixid]; 277 MPedestalPix &ped = (*fPedestals)[pixid]; 283 278 Float_t pedrms = ped.GetPedestalRms(); 279 Float_t sumhi = sig.GetExtractedSignalHiGain(); 284 280 285 if ( (float)sum < ((pedes*fNumHiGainSamples)+(2.*fNumHiGainSamples*pedrms)) )286 281 if (sumhi < 15.*pedrms ) // cut at 3.5 sigma 282 cosmicpix++; 287 283 } 288 284 289 290 if (cosmicpix > 50.) 285 if (cosmicpix > 100.) 291 286 { 292 287 fCosmics++; … … 295 290 296 291 pixel.Reset(); 292 fEvents++; 297 293 298 294 // … … 304 300 305 301 const UInt_t pixid = pixel.GetPixelId(); 306 302 307 303 MExtractedSignalPix &sig = (*fSignals)[pixid]; 308 304 309 305 Float_t sumhi = sig.GetExtractedSignalHiGain(); 310 306 Float_t sumlo = sig.GetExtractedSignalLoGain(); 311 307 Bool_t logain = sig.IsLoGainUsed(); 312 308 313 Byte_t mid; 314 315 if (logain) 316 mid = pixel.GetIdxMaxLoGainSample(); 317 else 318 mid = pixel.GetIdxMaxHiGainSample(); 309 Float_t mtime = sig.GetMeanArrivalTime(); 319 310 320 311 MCalibrationPix &pix = (*fCalibrations)[pixid]; … … 329 320 "Overflow or Underflow occurred filling Blind Pixel sum = " << sumhi << endl; 330 321 331 if (!blindpixel.FillTime((int)m id))322 if (!blindpixel.FillTime((int)mtime)) 332 323 *fLog << warn << 333 "Overflow or Underflow occurred filling Blind Pixel time = " << (int)mid<< endl;324 "Overflow or Underflow occurred filling Blind Pixel time = " << mtime << endl; 334 325 335 326 if (!blindpixel.FillRChargevsTime(sumhi,fEvents)) 336 327 *fLog << warn << 337 328 "Overflow or Underflow occurred filling Blind Pixel eventnr = " << fEvents << endl; 329 break; 338 330 339 331 case gkCalibrationPINDiodeId: … … 341 333 *fLog << warn << 342 334 "Overflow or Underflow occurred filling HCharge: means = " << sumhi << endl; 343 if (!pindiode.FillTime((int)m id))335 if (!pindiode.FillTime((int)mtime)) 344 336 *fLog << warn << 345 "Overflow or Underflow occurred filling HTime: time = " << (int)mid<< endl;337 "Overflow or Underflow occurred filling HTime: time = " << mtime << endl; 346 338 if (!pindiode.FillRChargevsTime(sumhi,fEvents)) 347 339 *fLog << warn << 348 340 "Overflow or Underflow occurred filling HChargevsN: eventnr = " << fEvents << endl; 341 break; 349 342 350 343 default: … … 359 352 << " signal = " << sumlo << endl; 360 353 361 if (!pix.FillTimeLoGain((int)m id))354 if (!pix.FillTimeLoGain((int)mtime)) 362 355 *fLog << warn << "Could not fill Lo Gain Time of pixel: " 363 << pixid << " time = " << (int)mid<< endl;356 << pixid << " time = " << mtime << endl; 364 357 365 //366 // Fill the reduced charge into the control histo for better visibility367 //368 358 if (!pix.FillRChargevsTimeLoGain(sumlo,fEvents)) 369 359 *fLog << warn << "Could not fill Lo Gain Charge vs. EvtNr of pixel: " … … 377 367 << " signal = " << sumhi << endl; 378 368 379 if (!pix.FillTimeHiGain((int)m id))369 if (!pix.FillTimeHiGain((int)mtime)) 380 370 *fLog << warn << "Could not fill Hi Gain Time of pixel: " 381 << pixid << " time = " << (int)mid<< endl;371 << pixid << " time = " << mtime << endl; 382 372 383 373 if (!pix.FillRChargevsTimeHiGain(sumhi,fEvents)) … … 385 375 << pixid << " signal = " << sumhi << " event Nr: " << fEvents << endl; 386 376 } 377 break; 387 378 388 379 } /* switch(pixid) */ … … 449 440 pix.SetPedestal(ped,prms); 450 441 442 pix.FitCharge(); 443 451 444 if (TESTBIT(fFlags,kUseTimeFits)) 452 445 pix.FitTime(); 453 446 454 pix.FitCharge();455 447 } 456 448 -
trunk/MagicSoft/Mars/manalysis/MCalibrationPix.cc
r2642 r2658 110 110 if (fHist->UseLoGain()) 111 111 { 112 112 113 SetHiGainSaturation(); 113 114 -
trunk/MagicSoft/Mars/manalysis/MExtractSignal.cc
r2646 r2658 163 163 164 164 Byte_t *ptr = pixel.GetHiGainSamples(); 165 Byte_t *max = ptr + pixel.GetIdxMaxHiGainSample(); 166 Byte_t *end = ptr + fRawEvt->GetNumHiGainSamples(); 167 Byte_t *first; 168 Byte_t *last; 165 Byte_t *first = ptr + 3; 166 Byte_t *last = ptr + 9; 169 167 170 168 UInt_t sumHi = 0; … … 178 176 const Float_t pedrms = ped.GetPedestalRms(); 179 177 180 181 if (max-3 < ptr) 182 { 183 first = ptr+3; 184 last = ptr+3+fAfter+fBefore; 185 } 186 else if (max+fAfter-1 > end) 187 { 188 first = end-fAfter-fBefore-1; 189 last = end-1; 190 } 191 else 192 { 193 first = max-fBefore; 194 last = max+fAfter; 195 } 178 Byte_t maxhi = 0; 179 Byte_t midhi = 0; 196 180 197 181 for (ptr=first;ptr<last;ptr++) 198 182 { 183 184 if (*ptr > maxhi) 185 { 186 maxhi = *ptr; 187 midhi = ptr-first; 188 } 189 199 190 sumHi += *ptr; 191 200 192 if (*ptr >= fSaturationLimit) 201 193 satHi++; 194 202 195 } 203 196 204 197 ptr = pixel.GetLoGainSamples(); 205 max = ptr+pixel.GetIdxMaxLoGainSample(); 206 end = ptr+fRawEvt->GetNumLoGainSamples(); 207 208 if (max-4 < ptr) 209 { 210 first = ptr+4; 211 last = ptr+4+fAfter+fBefore; 212 } 213 else if (max+fAfter > end) 214 { 215 first = end-fAfter-fBefore; 216 last = end; 217 } 218 else 219 { 220 first = max-fBefore; 221 last = max+fAfter; 222 } 223 198 first = ptr + 3; 199 last = ptr + 9; 200 Byte_t maxlo = 0; 201 Byte_t midlo = 0; 202 224 203 for (ptr=first;ptr<last;ptr++) 225 204 { 205 206 if (*ptr > maxlo) 207 { 208 maxlo = *ptr; 209 midlo = ptr-first; 210 } 211 226 212 sumLo += *ptr; 227 213 if (*ptr >= fSaturationLimit) … … 233 219 } 234 220 } 235 236 //237 // FIXME: This is preliminary, we will change to pedestals per slice!!!238 // Assume pedestals per time slice ==> multiply with number of slices239 //240 241 221 pix.SetExtractedSignal((float)sumHi - pedes*(float)fNumHiGainSamples, 242 222 pedrms*fSqrtHiGainSamples, … … 247 227 pix.SetGainSaturation((satHi),satHi,satLo); 248 228 229 if (satHi) 230 pix.SetArrivalTimes((float)(midlo+3),0.); 231 else 232 pix.SetArrivalTimes((float)(midhi+3),0.); 233 249 234 } /* while (pixel.Next()) */ 250 235 -
trunk/MagicSoft/Mars/manalysis/MExtractedSignalPix.h
r2641 r2658 33 33 Float_t GetExtractedSignalLoGainError() const { return fExtractedSignalLoGainError; } 34 34 35 Float_t GetMeanArrivalTime() const { return fMeanArrivalTime; }36 Float_t GetWidthArrivalTime() const { return fWidthArrivalTime; }35 Float_t GetMeanArrivalTime() const { return fMeanArrivalTime; } 36 Float_t GetWidthArrivalTime() const { return fWidthArrivalTime; } 37 37 38 38 void SetExtractedSignal(Float_t sig, Float_t sigerr)
Note:
See TracChangeset
for help on using the changeset viewer.