Changeset 5049 for trunk/MagicSoft
- Timestamp:
- 09/15/04 22:46:03 (20 years ago)
- Location:
- trunk/MagicSoft/Mars/mhcalib
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/MagicSoft/Mars/mhcalib/MHCalibrationChargeBlindCam.cc
r5048 r5049 31 31 ///////////////////////////////////////////////////////////////////////////// 32 32 #include "MHCalibrationChargeBlindCam.h" 33 #include "MHCalibrationChargeBlindPix.h"34 33 35 34 #include <TVirtualPad.h> … … 200 199 pix.SetLast ( integ ? ((fLast+0.5)*samples)-0.5 : fLast ); 201 200 pix.SetSinglePheCut ( integ ? fSPheCut * samples : fSPheCut ); 202 pix.SetFitFunc ( integ ? kEPoisson5: fFitFunc );201 pix.SetFitFunc ( integ ? MHCalibrationChargeBlindPix::kEPoisson5 : fFitFunc ); 203 202 204 203 h = pix.GetHGausHist(); -
trunk/MagicSoft/Mars/mhcalib/MHCalibrationChargeBlindCam.h
r5047 r5049 4 4 #ifndef MARS_MHCalibrationCam 5 5 #include "MHCalibrationCam.h" 6 #endif 7 8 #ifndef MARS_MHCalibrationChargeBlindPix 9 #include "MHCalibrationChargeBlindPix.h" 6 10 #endif 7 11 … … 23 27 static const TString gsHistXTitle; //! Default Histogram x-axis titles 24 28 static const TString gsHistYTitle; //! Default Histogram y-axis titles 29 static const MHCalibrationChargeBlindPix::FitFunc_t fgFitFunc 30 = MHCalibrationChargeBlindPix::kEPoisson4; //! Default for fFitFunc 25 31 26 32 Axis_t fSPheCut; // Signal value upon which event considered as single-phe … … 28 34 MRawEvtData *fRawEvt; //! Raw event data 29 35 30 public: 31 32 enum FitFunc_t { kEPoisson4, kEPoisson5, 33 kEPoisson6, kEPoisson7, 34 kEPolya, kEMichele }; // Possible fit functions types (see MHCalibrationChargeBlindPix) 35 36 static const FitFunc_t fgFitFunc = kEPoisson4; //! Default for fFitFunc 37 38 private: 39 40 FitFunc_t fFitFunc; // The actual fit function type 36 MHCalibrationChargeBlindPix::FitFunc_t fFitFunc; // The actual fit function type 41 37 42 38 Bool_t SetupHists (const MParList *pList ); … … 58 54 // Draw 59 55 void Draw(Option_t *opt=""); 60 void SetFitFunc( const FitFunc_t func=fgFitFunc ) { fFitFunc = func; }56 void SetFitFunc( const MHCalibrationChargeBlindPix::FitFunc_t func=fgFitFunc ) { fFitFunc = func; } 61 57 void SetSPheCut( const Axis_t a =fgSPheCut ) { fSPheCut = a; } 62 58 -
trunk/MagicSoft/Mars/mhcalib/MHCalibrationChargeBlindPix.cc
r4986 r5049 69 69 ////////////////////////////////////////////////////////////////////////////// 70 70 #include "MHCalibrationChargeBlindPix.h" 71 #include "MHCalibrationChargeBlindCam.h"72 71 73 72 #include <TStyle.h> … … 192 191 fLambdaCheckErr = gkSignalInitializer; 193 192 194 fFitFunc = MHCalibrationChargeBlindCam::kEPoisson5;193 fFitFunc = kEPoisson5; 195 194 196 195 fNumSinglePhes = 0; … … 519 518 switch (fFitFunc) 520 519 { 521 case MHCalibrationChargeBlindCam::kEPoisson4:520 case kEPoisson4: 522 521 fSinglePheFit = new TF1("SinglePheFit",&fPoissonKto4,rmin,rmax,6); 523 522 rmin += 6.5; 524 523 break; 525 case MHCalibrationChargeBlindCam::kEPoisson5:524 case kEPoisson5: 526 525 fSinglePheFit = new TF1("SinglePheFit",&fPoissonKto5,rmin,rmax,6); 527 526 rmin = 0.; 528 527 break; 529 case MHCalibrationChargeBlindCam::kEPoisson6:528 case kEPoisson6: 530 529 fSinglePheFit = new TF1("SinglePheFit",&fPoissonKto6,rmin,rmax,6); 531 530 break; 532 case MHCalibrationChargeBlindCam::kEPolya:531 case kEPolya: 533 532 fSinglePheFit = new TF1("SinglePheFit",&fPolya,rmin,rmax,8); 534 533 break; 535 case MHCalibrationChargeBlindCam::kEMichele:534 case kEMichele: 536 535 fSinglePheFit = new TF1("SinglePheFit",&fFitFuncMichele,rmin,rmax,9); 537 536 break; … … 572 571 { 573 572 574 case MHCalibrationChargeBlindCam::kEPoisson4:573 case kEPoisson4: 575 574 fSinglePheFit->SetParNames( "#lambda", "#mu_{0}", "#mu_{1}", "#sigma_{0}", "#sigma_{1}","Area"); 576 575 fSinglePheFit->SetParameters(lambda_guess,mu_0_guess,mu_1_guess,si_0_guess,si_1_guess,norm); … … 582 581 fSinglePheFit->SetParLimits(5,norm-(0.5*norm),norm+(0.7*norm)); 583 582 break; 584 case MHCalibrationChargeBlindCam::kEPoisson5:585 case MHCalibrationChargeBlindCam::kEPoisson6:583 case kEPoisson5: 584 case kEPoisson6: 586 585 fSinglePheFit->SetParNames("#lambda","#mu_{0}","#mu_{1}","#sigma_{0}","#sigma_{1}","Area"); 587 586 fSinglePheFit->SetParameters(lambda_guess,mu_0_guess,800.,si_0_guess,500.,norm); … … 594 593 break; 595 594 596 case MHCalibrationChargeBlindCam::kEPolya:595 case kEPolya: 597 596 fSinglePheFit->SetParameters(lambda_guess, excessPoisson_guess, 598 597 delta1_guess,delta2_guess, … … 615 614 fSinglePheFit->SetParLimits(7,-10.,10.); 616 615 break; 617 case MHCalibrationChargeBlindCam::kEMichele:616 case kEMichele: 618 617 fSinglePheFit->SetParNames("#lambda_{cat}","#lambda_{dyn}", 619 618 "#mu_{0}","#mu_{1cat}","#mu_{1dyn}", … … 661 660 { 662 661 663 case MHCalibrationChargeBlindCam::kEPoisson4:664 case MHCalibrationChargeBlindCam::kEPoisson5:665 case MHCalibrationChargeBlindCam::kEPoisson6:666 case MHCalibrationChargeBlindCam::kEPoisson7:662 case kEPoisson4: 663 case kEPoisson5: 664 case kEPoisson6: 665 case kEPoisson7: 667 666 fLambda = fSinglePheFit->GetParameter(0); 668 667 fMu0 = fSinglePheFit->GetParameter(1); … … 677 676 fSigma1Err = fSinglePheFit->GetParError(4); 678 677 break; 679 case MHCalibrationChargeBlindCam::kEPolya:678 case kEPolya: 680 679 fLambda = fSinglePheFit->GetParameter(0); 681 680 fMu0 = fSinglePheFit->GetParameter(7); … … 689 688 fSigma0Err = fSinglePheFit->GetParError(5); 690 689 fSigma1Err = 0.; 691 case MHCalibrationChargeBlindCam::kEMichele:690 case kEMichele: 692 691 fLambda = fSinglePheFit->GetParameter(0); 693 692 fMu0 = fSinglePheFit->GetParameter(2); … … 819 818 fFitLegend = new TPaveText(0.05,0.05,0.95,0.95); 820 819 fFitLegend->SetLabel(Form("%s%s", "Results of the single PhE Fit (", 821 (fFitFunc == MHCalibrationChargeBlindCam::kEPoisson4) ? "Poisson(k=4))" :822 (fFitFunc == MHCalibrationChargeBlindCam::kEPoisson5) ? "Poisson(k=5))" :823 (fFitFunc == MHCalibrationChargeBlindCam::kEPoisson6) ? "Poisson(k=6))" :824 (fFitFunc == MHCalibrationChargeBlindCam::kEPolya ) ? "Polya(k=4))" :825 (fFitFunc == MHCalibrationChargeBlindCam::kEMichele ) ? "Michele)"820 (fFitFunc == kEPoisson4) ? "Poisson(k=4))" : 821 (fFitFunc == kEPoisson5) ? "Poisson(k=5))" : 822 (fFitFunc == kEPoisson6) ? "Poisson(k=6))" : 823 (fFitFunc == kEPolya ) ? "Polya(k=4))" : 824 (fFitFunc == kEMichele ) ? "Michele)" 826 825 : " none )" )); 827 826 fFitLegend->SetTextSize(0.05); -
trunk/MagicSoft/Mars/mhcalib/MHCalibrationChargeBlindPix.h
r4986 r5049 2 2 #define MARS_MHCalibrationChargeBlindPix 3 3 4 5 4 #ifndef MARS_MHCalibrationPix 6 5 #include "MHCalibrationPix.h" 7 #endif8 9 #ifndef MARS_MHCalibrationChargeBlindCam10 #include "MHCalibrationChargeBlindCam.h"11 6 #endif 12 7 … … 65 60 enum { kSinglePheFitOK, kPedestalFitOK }; // Possible bits to be set 66 61 67 MHCalibrationChargeBlindCam::FitFunc_t fFitFunc; 68 62 public: 63 64 enum FitFunc_t { kEPoisson4, kEPoisson5, 65 kEPoisson6, kEPoisson7, 66 kEPolya, kEMichele }; // Possible fit functions types (see MHCalibrationChargeBlindPix) 67 68 private: 69 70 FitFunc_t fFitFunc; 71 69 72 TPaveText *fFitLegend; //! Some legend to display the fit results 70 73 TH1F *fHSinglePheFADCSlices; //! A histogram created and deleted only in Draw() … … 112 115 113 116 // Setters 114 void SetFitFunc (const MHCalibrationChargeBlindCam::FitFunc_t func){ fFitFunc = func; }117 void SetFitFunc ( const FitFunc_t func ) { fFitFunc = func; } 115 118 void SetSinglePheCut ( const Float_t cut = 0. ) { fSinglePheCut = cut; } 116 119 void SetNumSinglePheLimit ( const Float_t lim =fgNumSinglePheLimit ) { fNumSinglePheLimit = lim; }
Note:
See TracChangeset
for help on using the changeset viewer.