Changeset 2581 for trunk/MagicSoft/Mars/manalysis
- Timestamp:
- 12/01/03 18:58:01 (21 years ago)
- Location:
- trunk/MagicSoft/Mars/manalysis
- Files:
-
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/MagicSoft/Mars/manalysis/AnalysisLinkDef.h
r2565 r2581 20 20 #pragma link C++ class MPedestalPix+; 21 21 #pragma link C++ class MPedestalCam+; 22 #pragma link C++ class MPedCalcPedRun+; 22 23 #pragma link C++ class MMcPedestalCopy+; 23 24 #pragma link C++ class MMcPedestalNSBAdd+; -
trunk/MagicSoft/Mars/manalysis/MCalibrationCalc.cc
r2540 r2581 136 136 { 137 137 138 fOverFlow = 0; 139 fNrEvents = 0; 138 fHistOverFlow = 0; 139 fEvents = 0; 140 fCosmics = 0; 140 141 141 142 fRawEvt = (MRawEvtData*)pList->FindObject("MRawEvtData"); … … 235 236 { 236 237 237 fNrEvents++; 238 fEvents++; 239 240 Bool_t cosmic = kFALSE; 238 241 239 242 MCalibrationBlindPix &blindpixel = *(fCalibrations->GetBlindPixel()); … … 267 270 mid = pixel.GetIdxMaxLoGainSample(); 268 271 269 sum = (max == gkSaturationLimit // overflow of LoGain ??? -> GimmeABreak!!!270 ? f OverFlow++, gkLoGainOverFlow // OUCH (Florian was maybe right)271 : sum*gkConversionHiLo ); // OUFF (Florian was wrong) !!272 sum = (max == gkSaturationLimit // overflow of LoGain ??? -> GimmeABreak!!! 273 ? fHistOverFlow++, gkLoGainOverFlow // OUCH (Florian was maybe right) 274 : sum*gkConversionHiLo ); // OUFF (Florian was wrong) !! 272 275 273 276 // *fLog << warn << "Warning: Saturation of HiGain reached in slice " << (int)mid << " !!! " << endl; 274 277 // *fLog << warn << "Max = " << max << endl; 275 278 276 if (f OverFlow)279 if (fHistOverFlow) 277 280 *fLog << err << dbginf << "Warning: Saturation of LoGain reached! " 278 281 << err << dbginf << "sum = " << sum << endl; 279 282 280 283 } 281 282 // 283 // sanity check (old MC files sometimes have pixids>577) 284 // 285 if (fPedestals && !fPedestals->CheckBounds(pixid)) 286 { 287 *fLog << inf << "Pixel ID larger than camera... skipping event." << endl; 288 return kCONTINUE; 289 } 290 284 285 291 286 MPedestalPix &ped = (*fPedestals)[pixid]; 292 287 MCalibrationPix &pix = (*fCalibrations)[pixid]; 293 288 294 Float_t pedes = ped.GetPedestal(); 289 Float_t pedes = ped.GetPedestal(); 290 Float_t pedrms = ped.GetPedestalRms(); 295 291 296 292 // … … 298 294 // Assume pedestals per time slice ==> multiply with number of slices 299 295 // 300 pedes *= (sat ? fNumLoGainSamples : fNumHiGainSamples ); 296 pedes *= (sat ? fNumLoGainSamples : fNumHiGainSamples ); 297 pedrms *= (sat ? fNumLoGainSamples : fNumHiGainSamples ); 298 299 // 300 // This is a very primitive check for the number of cosmics 301 // The cut will be applied in the fit, but for the blind pixel, 302 // we need to remove this event 303 // 304 // FIXME: In the future need a much more sophisticated one!!! 305 // 306 307 if ((float)sum < pedes+5.*pedrms) 308 cosmic = kTRUE; 301 309 302 310 Float_t rsum = (float)sum - pedes; … … 306 314 307 315 case gkCalibrationBlindPixelId: 308 if (!blindpixel.FillQ(sum)) 309 *fLog << warn << 310 "Overflow or Underflow occurred filling Blind Pixel means = " << sum << endl; 316 // 317 // FIXME: This works only when the blind pixel ID is much larger than 318 // the rest of the pixels (which is the case right now) 319 // 320 // if (!cosmic) 321 if (!blindpixel.FillQ(sum)) 322 *fLog << warn << 323 "Overflow or Underflow occurred filling Blind Pixel sum = " << sum << endl; 324 311 325 if (!blindpixel.FillT((int)mid)) 312 326 *fLog << warn << 313 327 "Overflow or Underflow occurred filling Blind Pixel time = " << (int)mid << endl; 314 if (!blindpixel.FillRQvsT(rsum,fNrEvents)) 328 329 if (!blindpixel.FillRQvsT(rsum,fEvents)) 315 330 *fLog << warn << 316 "Overflow or Underflow occurred filling Blind Pixel eventnr = " << f NrEvents << endl;331 "Overflow or Underflow occurred filling Blind Pixel eventnr = " << fEvents << endl; 317 332 318 333 case gkCalibrationPINDiodeId: … … 323 338 *fLog << warn << 324 339 "Overflow or Underflow occurred filling HT: time = " << (int)mid << endl; 325 if (!pindiode.FillRQvsT(rsum,f NrEvents))340 if (!pindiode.FillRQvsT(rsum,fEvents)) 326 341 *fLog << warn << 327 "Overflow or Underflow occurred filling HQvsN: eventnr = " << f NrEvents << endl;342 "Overflow or Underflow occurred filling HQvsN: eventnr = " << fEvents << endl; 328 343 329 344 default: … … 336 351 // Fill the reduced charge into the control histo for better visibility 337 352 // 338 if (!pix.FillRQvsT(rsum,f NrEvents))353 if (!pix.FillRQvsT(rsum,fEvents)) 339 354 *fLog << warn << "Could not fill red. Q vs. EvtNr of pixel: " << pixid 340 << " signal = " << rsum << " event Nr: " << f NrEvents << endl;355 << " signal = " << rsum << " event Nr: " << fEvents << endl; 341 356 342 357 … … 348 363 349 364 } /* while (pixel.Next()) */ 365 366 if (cosmic) 367 fCosmics++; 350 368 351 369 fCalibrations->SetReadyToSave(); … … 398 416 MCalibrationPix &pix = (*fCalibrations)[pixid]; 399 417 418 const Float_t ped = (*fPedestals)[pixid].GetPedestal() * fNumHiGainSamples; 419 const Float_t prms = (*fPedestals)[pixid].GetPedestalRms() * fNumHiGainSamples; 420 421 pix.SetPedestal(ped,prms); 400 422 401 423 if (TESTBIT(fFlags,kUseTFits)) … … 405 427 continue; 406 428 407 const Float_t ped = (*fPedestals)[pixid].GetPedestal();408 const Float_t prms = (*fPedestals)[pixid].GetPedestalRms();409 pix.SetPedestal(ped,prms);410 429 } 411 430 } … … 413 432 fCalibrations->SetReadyToSave(); 414 433 415 if (GetNumExecutions()==0 || fOverFlow==0)434 if (GetNumExecutions()==0) 416 435 return kTRUE; 417 436 418 *fLog << inf << endl; 419 *fLog << GetDescriptor() << " execution statistics:" << endl; 420 *fLog << dec << setfill(' '); 421 *fLog << " " << setw(7) << fOverFlow << " (" << setw(3) << (int)(fOverFlow*100/GetNumExecutions()) << "%) Evts skipped due to: lo gain saturated." << endl; 422 437 *fLog << endl; 438 *fLog << dec << setfill(' ') << fCosmics << " Events presumably cosmics" << endl; 439 423 440 return kTRUE; 424 441 } -
trunk/MagicSoft/Mars/manalysis/MCalibrationCalc.h
r2540 r2581 35 35 MTime *fEvtTime; // Time of the event 36 36 37 Int_t fNrEvents; // Number of events 38 Int_t fOverFlow; // Number of events with saturated Low Gain 37 Int_t fEvents; // Number of events 38 Int_t fHistOverFlow; // Number of events with saturated Low Gain 39 Int_t fCosmics; // Number of events due to supposed cosmics 39 40 40 41 Byte_t fNumHiGainSamples; -
trunk/MagicSoft/Mars/manalysis/MCalibrationPix.cc
r2544 r2581 83 83 return kTRUE; 84 84 85 if (fPed && fPedRms) 86 fHist->SetLowerFitRange(fPed + 3.5*fPedRms); 87 else 88 *fLog << warn << "Cannot set lower fit range to suppress cosmics: Pedestals not available" << endl; 89 85 90 if(!fHist->FitQ()) 86 91 { -
trunk/MagicSoft/Mars/manalysis/Makefile
r2565 r2581 33 33 SRCFILES = MPedestalPix.cc \ 34 34 MPedestalCam.cc \ 35 MPedCalcPedRun.cc \ 35 36 MMcPedestalCopy.cc \ 36 37 MMcPedestalNSBAdd.cc \
Note:
See TracChangeset
for help on using the changeset viewer.