Changeset 3007 for trunk/MagicSoft/Mars/mcalib/MCalibrationCalc.cc
- Timestamp:
- 02/02/04 22:52:53 (21 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/MagicSoft/Mars/mcalib/MCalibrationCalc.cc
r2995 r3007 148 148 CLRBIT(fFlags, kUsePinDiodeFit); 149 149 150 fEvents = 0;151 fCosmics = 0;152 fNumHiGainSamples = 0;153 fNumLoGainSamples = 0;154 fConversionHiLo = 0;150 fEvents = 0; 151 fCosmics = 0; 152 fNumHiGainSamples = 0; 153 fNumLoGainSamples = 0; 154 fConversionHiLo = 0; 155 155 fNumExcludedPixels = 0; 156 156 157 157 fColor = kECT1; 158 158 } … … 287 287 MCalibrationPix &pix = (*fCalibrations)[i]; 288 288 pix.DefinePixId(i); 289 MHCalibrationPixel *hist = pix.GetHist(); 290 291 hist->SetTimeFitRangesHiGain(fSignals->GetFirstUsedSliceHiGain(), 292 fSignals->GetLastUsedSliceHiGain()); 293 hist->SetTimeFitRangesLoGain(fSignals->GetFirstUsedSliceLoGain(), 294 fSignals->GetLastUsedSliceLoGain()); 289 290 pix.SetAbsTimeBordersHiGain(fSignals->GetFirstUsedSliceHiGain(), 291 fSignals->GetLastUsedSliceHiGain()); 292 pix.SetAbsTimeBordersLoGain(fSignals->GetFirstUsedSliceLoGain(), 293 fSignals->GetLastUsedSliceLoGain()); 295 294 296 295 if (!TESTBIT(fFlags,kUseQualityChecks)) 297 296 pix.SetExcludeQualityCheck(); 298 297 299 298 } 300 299 301 300 // … … 431 430 fEvents++; 432 431 433 Int_t overflow = 0; 432 Int_t overflow = 0; 433 Float_t referencetime = 0.; 434 434 435 435 // 436 436 // Create a (second) loop to do fill the calibration histograms 437 // 438 437 // Search for: a signal in MExtractedSignalCam 438 // a time in MArrivalTime. 439 // Fill histograms with: 440 // charge 441 // charge vs. event nr. 442 // relative arrival time w.r.t. pixel 1 443 // 439 444 while (pixel.Next()) 440 445 { … … 452 457 const Float_t sumlo = sig.GetExtractedSignalLoGain(); 453 458 454 Float_t mtime = 0.; 459 Float_t abstime = 0.; 460 Float_t reltime = 0.; 455 461 456 462 if (TESTBIT(fFlags,kUseTimes)) 457 463 { 458 // 459 // first, have a look in MArrivalTime, 464 465 // 466 // Have a look in MArrivalTime, 460 467 // otherwise search the position of maximum bin 461 468 // in MRawEvtData 462 469 // 463 470 if (fArrivalTime) 464 mtime = (*fArrivalTime)[pixid]; 471 { 472 abstime = (*fArrivalTime)[pixid]; 473 reltime = abstime - (*fArrivalTime)[1]; 474 } 475 465 476 else 466 if (sig.IsLoGainUsed()) 467 mtime = (Double_t)pixel.GetIdxMaxLoGainSample(); 468 else 469 mtime = (Double_t)pixel.GetIdxMaxHiGainSample(); 477 { 478 if (pixid == 1) 479 referencetime = (Float_t)pixel.GetIdxMaxHiGainSample(); 480 481 if (sig.IsLoGainUsed()) 482 { 483 abstime = (Float_t)pixel.GetIdxMaxLoGainSample(); 484 reltime = abstime - referencetime; 485 } 486 else 487 { 488 abstime = (Float_t)pixel.GetIdxMaxHiGainSample(); 489 reltime = abstime - referencetime; 490 } 491 } 470 492 } 471 493 … … 481 503 if (TESTBIT(fFlags,kUseTimes)) 482 504 { 483 if (!blindpixel.FillTime( mtime))505 if (!blindpixel.FillTime(reltime)) 484 506 *fLog << warn << 485 "Overflow or Underflow occurred filling Blind Pixel time = " << mtime << endl;507 "Overflow or Underflow occurred filling Blind Pixel time = " << reltime << endl; 486 508 } 487 509 … … 499 521 if (TESTBIT(fFlags,kUseTimes)) 500 522 { 501 if (!pindiode.Fill Time(mtime))523 if (!pindiode.FillAbsTime(abstime)) 502 524 *fLog << warn << 503 "Overflow or Underflow occurred filling PINDiode: time = " << mtime << endl; 525 "Overflow or Underflow occurred filling PINDiode abs. time = " << abstime << endl; 526 if (!pindiode.FillRelTime(reltime)) 527 *fLog << warn << 528 "Overflow or Underflow occurred filling PINDiode rel. time = " << reltime << endl; 504 529 } 505 530 … … 528 553 if (TESTBIT(fFlags,kUseTimes)) 529 554 { 530 if (!pix.FillTimeLoGain(mtime)) 531 *fLog << warn << "Could not fill Lo Gain Time of pixel: " 532 << pixid << " time = " << mtime << endl; 555 if (!pix.FillAbsTimeLoGain(abstime)) 556 *fLog << warn << "Could not fill Lo Gain Abs. Time of pixel: " 557 << pixid << " time = " << abstime << endl; 558 if (!pix.FillRelTimeLoGain(reltime)) 559 *fLog << warn << "Could not fill Lo Gain Rel. Time of pixel: " 560 << pixid << " time = " << reltime << endl; 533 561 } 534 562 } /* if (sig.IsLoGainUsed()) */ … … 541 569 if (TESTBIT(fFlags,kUseTimes)) 542 570 { 543 if (!pix.FillTimeHiGain(mtime)) 544 *fLog << warn << "Could not fill Hi Gain Time of pixel: " 545 << pixid << " time = " << mtime << endl; 571 if (!pix.FillAbsTimeHiGain(abstime)) 572 *fLog << warn << "Could not fill Hi Gain Abs. Time of pixel: " 573 << pixid << " time = " << abstime << endl; 574 if (!pix.FillRelTimeHiGain(reltime)) 575 *fLog << warn << "Could not fill Hi Gain Rel. Time of pixel: " 576 << pixid << " time = " << reltime << endl; 546 577 } 547 578 } /* else (sig.IsLoGainUsed()) */ … … 606 637 MPedestalPix &ped = (*fPedestals)[fBlindPixelId]; 607 638 // 608 // retrieve the blind pixel histogram container639 // retrieve the histogram containers 609 640 // 610 641 MHCalibrationBlindPixel *hist = blindpixel.GetHist(); 642 MHPedestalPixel *pedhist = ped.GetHist(); 611 643 // 612 644 // Set the corresponding values 613 645 // 614 const Float_t peddiff = ped.GetMean() 615 - ped.GetPedestal()*fSignals->GetNumUsedFADCSlices(); 616 const Float_t pederr = ped.GetMeanErr(); 646 const Float_t nslices = (Float_t)fSignals->GetNumUsedFADCSlices(); 647 const Int_t nentries = pedhist->GetTotalEntries(); 648 649 const Float_t peddiff = ped.GetMean() - ped.GetPedestal()*nslices; 650 651 Float_t pederr = ped.GetMeanErr()*ped.GetMeanErr(); 652 pederr += ped.GetPedestalRms()*ped.GetPedestalRms()*nslices*nslices/nentries/nentries; 653 pederr = TMath::Sqrt(pederr); 654 617 655 const Float_t pedsigma = ped.GetSigma(); 618 656 const Float_t pedsigmaerr = ped.GetSigmaErr();
Note:
See TracChangeset
for help on using the changeset viewer.