Changeset 4873
- Timestamp:
- 09/07/04 10:04:04 (20 years ago)
- Location:
- trunk/MagicSoft/Mars
- Files:
-
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/MagicSoft/Mars/Changelog
r4872 r4873 24 24 * mcalib/MHGausEvents.[h,cc] 25 25 - added function IsOnlyUnderflow() 26 27 * mcalib/MHCalibrationCam.[h,cc] 28 - added bool kLoGain which is set if number of LoGain Slices in 29 MRawRunHeader is not 0. This excludes the low gain calculations 30 in case that there is no lowgain at all. 26 31 27 32 -
trunk/MagicSoft/Mars/mcalib/MHCalibrationCam.cc
r4793 r4873 41 41 // dealing with calibration pixels derive from MHGausEvents. 42 42 // 43 // The following flag can be set: 44 // - SetDebug() for debug output. 45 // - SetLoGain() for the case that low-gain slices are available, but 46 // MRawRunHeader::GetNumLoGainSlices() gives still 0. 47 // 48 // The flag fLoGain steers if low-gain signal is treated at all or not. 49 // 43 50 ///////////////////////////////////////////////////////////////////////////// 44 51 #include "MHCalibrationCam.h" … … 91 98 MHCalibrationCam::MHCalibrationCam(const char *name, const char *title) 92 99 : fColor(MCalibrationCam::kNONE), 93 fBadPixels(NULL), fCam(NULL), fGeom(NULL), fRunHeader(NULL), fDebug(kFALSE) 100 fBadPixels(NULL), fCam(NULL), fGeom(NULL), fRunHeader(NULL), 101 fDebug(kFALSE), fLoGain(kFALSE) 94 102 { 95 103 … … 483 491 484 492 if (fRunHeader) 485 fRunNumbers[fRunNumbers.GetSize()-1] = fRunHeader->GetRunNumber(); 493 { 494 fRunNumbers[fRunNumbers.GetSize()-1] = fRunHeader->GetRunNumber(); 495 fLoGain = fRunHeader->GetNumSamplesLoGain(); 496 } 486 497 487 498 if (!ReInitHists(pList)) … … 497 508 } 498 509 499 for (Int_t i=0; i<fLoGainArray->GetEntries(); i++) 500 { 501 TH1F *h = (*this)(i).GetHGausHist(); 502 h->SetTitle( Form("%s%i%s", h->GetTitle(),fRunNumbers[fRunNumbers.GetSize()-1]," ")); 503 } 510 if (fLoGain) 511 for (Int_t i=0; i<fLoGainArray->GetEntries(); i++) 512 { 513 TH1F *h = (*this)(i).GetHGausHist(); 514 h->SetTitle( Form("%s%i%s", h->GetTitle(),fRunNumbers[fRunNumbers.GetSize()-1]," ")); 515 } 504 516 505 517 for (Int_t j=0; j<nareas; j++) … … 509 521 } 510 522 511 for (Int_t j=0; j<nareas; j++) 512 { 513 TH1F *h = GetAverageLoGainArea(j).GetHGausHist(); 514 h->SetTitle( Form("%s%i%s", h->GetTitle(),fRunNumbers[fRunNumbers.GetSize()-1]," ")); 515 } 523 if (fLoGain) 524 for (Int_t j=0; j<nareas; j++) 525 { 526 TH1F *h = GetAverageLoGainArea(j).GetHGausHist(); 527 h->SetTitle( Form("%s%i%s", h->GetTitle(),fRunNumbers[fRunNumbers.GetSize()-1]," ")); 528 } 516 529 517 530 for (Int_t j=0; j<nsectors; j++) … … 521 534 } 522 535 523 for (Int_t j=0; j<nsectors; j++) 524 { 525 TH1F *h = GetAverageLoGainSector(j).GetHGausHist(); 526 h->SetTitle( Form("%s%i%s", h->GetTitle(),fRunNumbers[fRunNumbers.GetSize()-1]," ")); 527 } 528 536 if (fLoGain) 537 for (Int_t j=0; j<nsectors; j++) 538 { 539 TH1F *h = GetAverageLoGainSector(j).GetHGausHist(); 540 h->SetTitle( Form("%s%i%s", h->GetTitle(),fRunNumbers[fRunNumbers.GetSize()-1]," ")); 541 } 542 529 543 return kTRUE; 530 544 } … … 564 578 } 565 579 566 if (fLoGainArray->GetEntries() != npixels) 567 { 568 *fLog << err << "ERROR - Size mismatch... abort." << endl; 569 return kFALSE; 570 } 580 if (fLoGain) 581 if (fLoGainArray->GetEntries() != npixels) 582 { 583 *fLog << err << "ERROR - Size mismatch... abort." << endl; 584 return kFALSE; 585 } 571 586 572 587 if (fAverageHiGainAreas->GetEntries() != nareas) … … 576 591 } 577 592 578 if (fAverageLoGainAreas->GetEntries() != nareas) 579 { 580 *fLog << err << "ERROR - Size mismatch in number of areas ... abort." << endl; 581 return kFALSE; 582 } 583 593 if (fLoGain) 594 if (fAverageLoGainAreas->GetEntries() != nareas) 595 { 596 *fLog << err << "ERROR - Size mismatch in number of areas ... abort." << endl; 597 return kFALSE; 598 } 599 584 600 if (fAverageHiGainSectors->GetEntries() != nsectors) 585 601 { … … 588 604 } 589 605 590 if (fAverageLoGainSectors->GetEntries() != nsectors) 591 { 592 *fLog << err << "ERROR - Size mismatch in number of sectors ... abort." << endl; 593 return kFALSE; 594 } 595 606 if (fLoGain) 607 if (fAverageLoGainSectors->GetEntries() != nsectors) 608 { 609 *fLog << err << "ERROR - Size mismatch in number of sectors ... abort." << endl; 610 return kFALSE; 611 } 612 596 613 return FillHists(par, w); 597 614 } … … 802 819 803 820 804 if (hist.IsEmpty() )821 if (hist.IsEmpty() || hist.IsOnlyOverflow() || hist.IsOnlyUnderflow()) 805 822 return; 806 823 807 824 // 808 825 // 2) Fit the Hi Gain histograms with a Gaussian … … 881 898 { 882 899 883 if (hist.IsEmpty() )900 if (hist.IsEmpty() || hist.IsOnlyOverflow() || hist.IsOnlyUnderflow()) 884 901 return; 885 902 … … 970 987 pad->SetBorderMode(0); 971 988 972 pad->Divide( 2,nareas);989 pad->Divide(fLoGain ? 2 : 1,nareas); 973 990 974 991 for (Int_t i=0; i<nareas;i++) 975 992 { 976 993 977 pad->cd( 2*(i+1)-1);994 pad->cd(fLoGain ? 2*(i+1)-1 : i+1); 978 995 GetAverageHiGainArea(i).Draw(opt); 979 996 … … 983 1000 fAverageAreaRelSigma[i], fAverageAreaRelSigmaVar[i]); 984 1001 985 pad->cd(2*(i+1)); 986 GetAverageLoGainArea(i).Draw(opt); 1002 if (fLoGain) 1003 { 1004 pad->cd(2*(i+1)); 1005 GetAverageLoGainArea(i).Draw(opt); 1006 } 987 1007 988 1008 if (fAverageAreaSat[i]) … … 991 1011 fAverageAreaRelSigma[i], fAverageAreaRelSigmaVar[i]); 992 1012 } 993 1013 994 1014 } 995 1015 -
trunk/MagicSoft/Mars/mcalib/MHCalibrationCam.h
r4793 r4873 80 80 Int_t fPulserFrequency; // Light pulser frequency 81 81 Bool_t fDebug; // Debug option is used? 82 Bool_t fLoGain; // Is Low-Gain available 82 83 83 84 virtual Bool_t SetupHists(const MParList *pList); … … 161 162 void SetColor ( const MCalibrationCam::PulserColor_t color ) { fColor = color; } 162 163 void SetDebug ( const Bool_t b=kTRUE ) { fDebug = b; } 164 void SetLoGain ( const Bool_t b=kTRUE ) { fLoGain = b; } 163 165 void SetAverageNbins ( const Int_t bins=fgAverageNbins ) { fAverageNbins = bins; } 164 166 void SetNumLoGainSaturationLimit( const Float_t lim ) { fNumLoGainSaturationLimit = lim; } -
trunk/MagicSoft/Mars/mcalib/MHGausEvents.cc
r4872 r4873 809 809 810 810 811 // -------------------------------------------------------------------------- 812 // 813 // If fFExpFit exists, returns fit parameter 1 (Slope of Exponential fit), 814 // otherwise 0. 815 // 811 816 const Double_t MHGausEvents::GetSlope() const 812 817 { -
trunk/MagicSoft/Mars/mcalib/MHGausEvents.h
r4872 r4873 125 125 const Bool_t IsGausFitOK() const; 126 126 const Bool_t IsOnlyOverflow() const; 127 const Bool_t Is UnderOverflow() const;127 const Bool_t IsOnlyUnderflow() const; 128 128 129 129 // Fill
Note:
See TracChangeset
for help on using the changeset viewer.