Changeset 3642 for trunk/MagicSoft/Mars/manalysis
- Timestamp:
- 04/04/04 17:50:30 (21 years ago)
- Location:
- trunk/MagicSoft/Mars/manalysis
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/MagicSoft/Mars/manalysis/MHPedestalCam.h
r3176 r3642 2 2 #define MARS_MHPedestalCam 3 3 4 #ifndef ROOT_TObjArray5 #include <TObjArray.h>4 #ifndef MARS_MHCalibrationCam 5 #include "MHCalibrationCam.h" 6 6 #endif 7 7 8 #ifndef MARS_MH 9 #include "MH.h" 10 #endif 11 #ifndef MARS_MCamEvent 12 #include "MCamEvent.h" 13 #endif 14 8 class MGeomCam; 9 class MPedestalCam; 15 10 class MHPedestalPix; 16 class MPedestalCam; 17 class MHPedestalCam : public MH, public MCamEvent 11 class MHPedestalCam : public MHCalibrationCam 18 12 { 19 13 20 14 private: 21 15 22 TObjArray *fArray; //-> List of MHPedestalPix's 16 void InitPedHists(MHPedestalPix &hist, const Int_t i, const Float_t nslices); 17 18 Bool_t ReInitHists(MParList *pList); 19 Bool_t FillHists(const MParContainer *par, const Stat_t w=1); 20 Bool_t FinalizeHists(); 21 22 Float_t fExtractHiGainSlices; // Number of FADC slices used for high gain signal extraction 23 Float_t fExtractLoGainSlices; // Number of FADC slices used for low gain signal extraction 23 24 24 MPedestalCam *fPedestals; //! need to initialize MPedestalCam to zero (which is not default!) 25 26 Float_t fExtractSlices; 25 MPedestalCam *fPedestals; //! Pedestal Cam filled by MPedCalcPedRun 27 26 28 27 public: 29 28 MHPedestalCam(const char *name=NULL, const char *title=NULL); 30 ~MHPedestalCam(); 31 32 MHPedestalPix &operator[](UInt_t i); 33 const MHPedestalPix &operator[](UInt_t i) const; 34 35 Bool_t SetupFill(const MParList *pList); 36 Bool_t Fill(const MParContainer *par, const Stat_t w=1); 37 Bool_t Finalize(); 38 39 TObject *Clone(const char *) const; 29 ~MHPedestalCam() {} 40 30 41 31 Bool_t GetPixelContent(Double_t &val, Int_t idx, const MGeomCam &cam, Int_t type=0) const; -
trunk/MagicSoft/Mars/manalysis/MHPedestalPix.cc
r3165 r3642 27 27 // MHPedestalPix 28 28 // 29 // Histogram class for pedestal analysis. Holds the histogrammed pedestals, 30 // derives from MHGausEvents, perform Fourier analysis 29 // Histogram class for pedestal analysis. 30 // Stores and fits the pedestals taken from MPedestalPix on an event-by-event 31 // basis. The results are re-normalized to a value per slice with the formulae: 32 // 33 // - Mean Pedestal / slice = Mean Pedestal / Number slices 34 // - Mean Pedestal Error / slice = Mean Pedestal Error / Number slices 35 // - Sigma Pedestal / slice = Sigma Pedestal / Sqrt (Number slices) 36 // - Sigma Pedestal Error / slice = Sigma Pedestal Error / Sqrt (Number slices) 37 // 38 // Derives from MHGausEvents, fits the pedestals to a Gaussian and performs 39 // a Fourier analysis. 31 40 // 32 41 ////////////////////////////////////////////////////////////////////////////// … … 46 55 // Default Constructor. 47 56 // 57 // Sets: 58 // - the default number for fNbins (fgChargeNbins) 59 // - the default number for fFirst (fgChargeFirst) 60 // - the default number for fLast (fgChargeLast) 61 // 62 // - the default name of the fHGausHist ("HPedestalCharge") 63 // - the default title of the fHGausHist ("Distribution of Summed FADC Pedestal slices Pixel ") 64 // - the default x-axis title for fHGausHist ("Sum FADC Slices") 65 // - the default y-axis title for fHGausHist ("Nr. of events") 66 // - TH1::Sumw2() for fHGausHist 67 // 68 // Initializes: 69 // - fNSlices to 1 70 // 48 71 MHPedestalPix::MHPedestalPix(const char *name, const char *title) 49 : f PixId(-1)72 : fNSlices(1) 50 73 { 51 74 … … 53 76 fTitle = title ? title : "Histogrammed Pedestal events"; 54 77 55 Set ChargeNbins();56 Set ChargeFirst();57 Set ChargeLast();78 SetNbins( fgChargeNbins ); 79 SetFirst( fgChargeFirst ); 80 SetLast( fgChargeLast ); 58 81 59 82 // Create a large number of bins, later we will rebin … … 66 89 } 67 90 68 MHPedestalPix::~MHPedestalPix() 69 { 70 } 71 72 void MHPedestalPix::Clear(Option_t *o) 91 // -------------------------------------------------------------------------- 92 // 93 // If mean and sigma have not yet been set, returns. 94 // 95 // Renormalizes the pedestal fit results by the following formulae: 96 // 97 // - Mean Pedestal / slice = Mean Pedestal / Number slices 98 // - Mean Pedestal Error / slice = Mean Pedestal Error / Number slices 99 // - Sigma Pedestal / slice = Sigma Pedestal / Sqrt (Number slices) 100 // - Sigma Pedestal Error / slice = Sigma Pedestal Error / Sqrt (Number slices) 101 // 102 void MHPedestalPix::Renorm() 73 103 { 74 104 75 fPixId = -1; 76 MHGausEvents::Clear(); 77 return; 78 } 79 80 81 82 void MHPedestalPix::InitBins() 83 { 84 85 fHGausHist.SetBins(fChargeNbins,fChargeFirst,fChargeLast); 86 87 } 88 89 90 void MHPedestalPix::ChangeHistId(Int_t id) 91 { 92 93 fPixId = id; 94 95 fHGausHist.SetName(Form("%s%d", fHGausHist.GetName(), id)); 96 fHGausHist.SetTitle(Form("%s%d", fHGausHist.GetTitle(), id)); 97 } 98 99 100 void MHPedestalPix::Renorm(const Float_t nslices) 101 { 102 103 if (!IsGausFitOK()) 105 if (fMean == fMeanErr == fSigma == fSigmaErr == 0.) 104 106 return; 105 107 106 Float_t sqslices = TMath::Sqrt(nslices); 108 // 109 // One never knows... 110 // 111 if (fNSlices <= 0) 112 return; 107 113 108 SetMean(GetMean()/nslices); 114 const Float_t sqslices = TMath::Sqrt(fNSlices); 115 116 SetMean ( GetMean() / fNSlices ); 109 117 // 110 118 // Mean error goes with PedestalRMS/Sqrt(entries) -> scale with slices 111 119 // 112 SetMeanErr (GetMeanErr()/nslices);120 SetMeanErr ( GetMeanErr() / fNSlices ); 113 121 // 114 122 // Sigma goes like PedestalRMS -> scale with sqrt(slices) 115 123 // 116 SetSigma (GetSigma()/sqslices);124 SetSigma ( GetSigma() / sqslices ); 117 125 // 118 // Sigma error goes like PedestalRMS/2.(entries) -> scale with s lices126 // Sigma error goes like PedestalRMS/2.(entries) -> scale with sqrt(slices) 119 127 // 120 SetSigmaErr (GetSigmaErr()/nslices);128 SetSigmaErr ( GetSigmaErr() / sqslices ); 121 129 122 130 } -
trunk/MagicSoft/Mars/manalysis/MHPedestalPix.h
r3165 r3642 11 11 private: 12 12 13 static const Int_t fgChargeNbins; 14 static const Axis_t fgChargeFirst; 15 static const Axis_t fgChargeLast; 13 static const Int_t fgChargeNbins; // Default for fNBins (now set to: 450 ) 14 static const Axis_t fgChargeFirst; // Default for fFirst (now set to: -0.5 ) 15 static const Axis_t fgChargeLast; // Default for fLast (now set to: 449.5) 16 16 17 Int_t fChargeNbins; 18 Axis_t fChargeFirst; 19 Axis_t fChargeLast; 20 21 Int_t fPixId; // Pixel Nr 22 17 Float_t fNSlices; // Number of FADC slices summed in extraction 18 23 19 public: 24 20 25 21 MHPedestalPix(const char *name=NULL, const char *title=NULL); 26 ~MHPedestalPix() ;22 ~MHPedestalPix() {} 27 23 28 void Clear(Option_t *o="");29 void InitBins();24 // Setters 25 void SetNSlices( const Float_t n) { fNSlices = n ; } 30 26 31 // Setters 32 void SetChargeNbins(const Int_t bins =fgChargeNbins) { fChargeNbins = bins; } 33 void SetChargeFirst(const Axis_t first=fgChargeFirst) { fChargeFirst = first; } 34 void SetChargeLast( const Axis_t last =fgChargeLast) { fChargeLast = last; } 27 // Getters 28 Float_t GetNSlices() const { return fNSlices; } 35 29 36 30 // Others 37 void ChangeHistId(Int_t i); 38 void Renorm(const Float_t nslices); 31 void Renorm(); 39 32 40 // TObject *DrawClone(Option_t *opt="") const;41 42 33 ClassDef(MHPedestalPix, 1) // Histograms for each calibrated pixel 43 34 };
Note:
See TracChangeset
for help on using the changeset viewer.