Changeset 2932 for trunk/MagicSoft
- Timestamp:
- 01/27/04 20:39:14 (21 years ago)
- Location:
- trunk/MagicSoft/Mars/mcalib
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/MagicSoft/Mars/mcalib/MCalibrationPix.h
r2904 r2932 12 12 private: 13 13 14 Int_t fPixId; 14 Int_t fPixId; // the pixel Id 15 15 16 Float_t fCharge; // The mean reduced charge after the fit 17 Float_t fErrCharge; // The error of reduced mean charge after the fit 18 Float_t fSigmaCharge; // The sigma of the mean charge after the fit 19 Float_t fErrSigmaCharge; // The error of the sigma of the mean charge after the fit 20 Float_t fRSigmaSquare; // The reduced squares of sigmas after the fit 21 Float_t fChargeProb; // The probability of the fit function 16 const Float_t fElectronicPedRms; // The pure electronic component of the RMS 17 const Float_t fErrElectronicPedRms; // The error of the pure electronic component of the RMS 22 18 23 Float_t fPed; // The mean pedestal (from MPedestalPix) 24 Float_t fPedRms; // The pedestal RMS (from MPedestalPix) 25 Float_t fErrPedRms; // The error of the pedestal RMS (from MPedestalPix) 26 Float_t fElectronicPedRms; // The pure electronic component of the RMS 27 Float_t fErrElectronicPedRms; // The error of the pure electronic component of the RMS 19 const Float_t fFactor; // The laboratory F-factor 20 const Float_t fFactorError; // The laboratory F-factor Error 28 21 29 Float_t fTime; // The mean arrival time after the fit30 Float_t fSigmaTime; // The error of the mean arrival time after the fit31 Float_t fTimeChiSquare; // The Chi Square of the fit function32 Float_t fTimeProb; // The probability of the fit function22 const Float_t fChargeLimit; // The limit (in units of PedRMS) for acceptance of the fitted mean charge 23 const Float_t fChargeErrLimit; // The limit (in units of PedRMS) for acceptance of the fitted charge sigma 24 const Float_t fChargeRelErrLimit; // The limit (in units of Error of fitted charge) for acceptance of the fitted mean 25 Byte_t fFlags; // Flag for the set Bits 33 26 34 Float_t fFactor; // The laboratory F-factor 35 Float_t fFactorError; // The laboratory F-factor Error 36 Float_t fPheFFactorMethod; // The number of Phe's calculated (F-factor method) 37 Float_t fPheFFactorMethodError; // The error on the number of Phe's calculated (F-factor method) 27 Float_t fCharge; // The mean reduced charge after the fit 28 Float_t fErrCharge; // The error of reduced mean charge after the fit 29 Float_t fSigmaCharge; // The sigma of the mean charge after the fit 30 Float_t fErrSigmaCharge; // The error of the sigma of the mean charge after the fit 31 Float_t fRSigmaSquare; // The reduced squares of sigmas after the fit 32 Float_t fChargeProb; // The probability of the fit function 38 33 39 Float_t fConversionFFactorMethod; // The conversion factor to Phe's (F-factor method) 40 Float_t fConversionBlindPixelMethod; // The conversion factor to Ph's (Blind Pixel method) 41 Float_t fConversionPINDiodeMethod; // The conversion factor to Ph's (PIN Diode method) 34 Float_t fPed; // The mean pedestal (from MPedestalPix) 35 Float_t fPedRms; // The pedestal RMS (from MPedestalPix) 36 Float_t fErrPedRms; // The error of the pedestal RMS (from MPedestalPix) 37 38 Float_t fTime; // The mean arrival time after the fit 39 Float_t fSigmaTime; // The error of the mean arrival time after the fit 40 Float_t fTimeChiSquare; // The Chi Square of the fit function 41 Float_t fTimeProb; // The probability of the fit function 42 43 Float_t fPheFFactorMethod; // The number of Phe's calculated (F-factor method) 44 Float_t fPheFFactorMethodError; // The error on the number of Phe's calculated (F-factor method) 45 46 Float_t fConversionFFactorMethod; // The conversion factor to Phe's (F-factor method) 47 Float_t fConversionBlindPixelMethod; // The conversion factor to Ph's (Blind Pixel method) 48 Float_t fConversionPINDiodeMethod; // The conversion factor to Ph's (PIN Diode method) 42 49 43 50 Float_t fConversionErrorFFactorMethod; // The error of the conversion factor to Phe's (F-factor method) … … 52 59 Float_t fConversionHiLoError; // The error of the conversion factor between Hi Gain and Lo Gain 53 60 54 Byte_t fFlags; // Flag for the set Bits55 56 61 enum { kHiGainSaturation, 57 62 kExcluded, kExcludeQualityCheck, … … 61 66 MHCalibrationPixel *fHist; //! Pointer to the histograms performing the fits, etc. 62 67 63 Float_t fChargeLimit;64 Float_t fChargeErrLimit;65 Float_t fChargeRelErrLimit;66 67 68 Bool_t CheckChargeFitValidity(); 68 69 Bool_t CheckTimeFitValidity(); … … 144 145 145 146 // Fill histos 146 Bool_t FillChargeHiGain(Float_t q) { return fHist->FillChargeHiGain(q); }147 Bool_t FillTimeHiGain(Float_t t) { return fHist->FillTimeHiGain(t); }148 Bool_t FillRChargevsTimeHiGain(Float_t rq, Int_t t) { return fHist->FillChargevsNHiGain(rq,t); }147 Bool_t FillChargeHiGain(Float_t q) const { return fHist->FillChargeHiGain(q); } 148 Bool_t FillTimeHiGain(Float_t t) const { return fHist->FillTimeHiGain(t); } 149 Bool_t FillRChargevsTimeHiGain(Float_t rq, Int_t t) const { return fHist->FillChargevsNHiGain(rq,t); } 149 150 150 Bool_t FillChargeLoGain(Float_t q) { return fHist->FillChargeLoGain(q); }151 Bool_t FillTimeLoGain(Float_t t) { return fHist->FillTimeLoGain(t); }152 Bool_t FillRChargevsTimeLoGain(Float_t rq, Int_t t) { return fHist->FillChargevsNLoGain(rq,t); }151 Bool_t FillChargeLoGain(Float_t q) const { return fHist->FillChargeLoGain(q); } 152 Bool_t FillTimeLoGain(Float_t t) const { return fHist->FillTimeLoGain(t); } 153 Bool_t FillRChargevsTimeLoGain(Float_t rq, Int_t t) const { return fHist->FillChargevsNLoGain(rq,t); } 153 154 154 Bool_t FillChargesInGraph(Float_t qhi,Float_t qlo) { return fHist->FillPointInGraph(qhi,qlo); }155 Bool_t FillChargesInGraph(Float_t qhi,Float_t qlo) const { return fHist->FillPointInGraph(qhi,qlo); } 155 156 156 157 void DefinePixId(Int_t i); -
trunk/MagicSoft/Mars/mcalib/MHCalibrationPixel.cc
r2922 r2932 56 56 MHCalibrationPixel::MHCalibrationPixel(const char *name, const char *title) 57 57 : fPixId(-1), 58 fTotalEntries(0),59 f HChargeHiGain(NULL),60 f HTimeHiGain(NULL),61 f HChargevsNHiGain(NULL),62 f HChargeLoGain(NULL),63 f HTimeLoGain(NULL),64 fHChargevsNLoGain(NULL),65 fChargeGausFit(NULL), 58 fChargeNbinsHiGain(2100), 59 fChargeNbinsLoGain(1010), 60 fTimeNbins(32), 61 fChargevsNbins(1000), 62 fTimeFirst(-0.25), 63 fTimeLast(15.75), 64 fHivsLoGain(NULL), 65 fChargeGausFit(NULL), 66 66 fTimeGausFit(NULL), 67 fHivsLoGain(NULL), 68 fFitLegend(NULL), 69 fChargeFirstHiGain(-100.5), 70 fChargeLastHiGain(1999.5), 71 fChargeNbinsHiGain(2100), 72 fChargeFirstLoGain(-100.5), 73 fChargeLastLoGain(9999.5), 74 fChargeNbinsLoGain(1010), 75 fChargeChisquare(-1.), 76 fChargeProb(-1.), 77 fChargeNdf(-1), 78 fTimeChisquare(-1.), 79 fTimeProb(-1.), 80 fTimeNdf(-1), 81 fTimeMean(-1.), 82 fTimeSigma(-1.), 83 fTimeLowerFitRangeHiGain(0), 84 fTimeUpperFitRangeHiGain(0), 85 fTimeLowerFitRangeLoGain(0), 86 fTimeUpperFitRangeLoGain(0), 87 fOffset(0.), 88 fSlope(0.) 67 fFitLegend(NULL) 89 68 { 90 69 91 70 fName = name ? name : "MHCalibrationPixel"; 92 71 fTitle = title ? title : "Fill the accumulated charges and times of all events and perform fits"; 72 73 fChargeFirstHiGain = -100.5; 74 fChargeLastHiGain = 1999.5; 75 fChargeFirstLoGain = -100.5; 76 fChargeLastLoGain = 9999.5; 93 77 94 78 // Create a large number of bins, later we will rebin 95 79 fHChargeHiGain = new TH1F("HChargeHiGain","Distribution of Summed FADC Hi Gain Slices Pixel ", 96 80 fChargeNbinsHiGain,fChargeFirstHiGain,fChargeLastHiGain); 97 fHChargeHiGain->SetXTitle("Sum FADC Slices (Hi Gain)");98 fHChargeHiGain->SetYTitle("Nr. of events");99 fHChargeHiGain->Sumw2();100 101 fHChargeHiGain->SetDirectory(NULL);102 103 81 fHChargeLoGain = new TH1F("HChargeLoGain","Distribution of Summed FADC Lo Gain Slices Pixel ", 104 82 fChargeNbinsLoGain,fChargeFirstLoGain,fChargeLastLoGain); 83 105 84 fHChargeLoGain->SetXTitle("Sum FADC Slices (Lo Gain)"); 85 fHChargeHiGain->SetXTitle("Sum FADC Slices (Hi Gain)"); 86 106 87 fHChargeLoGain->SetYTitle("Nr. of events"); 88 fHChargeHiGain->SetYTitle("Nr. of events"); 89 90 fHChargeHiGain->Sumw2(); 107 91 fHChargeLoGain->Sumw2(); 108 92 93 fHTimeHiGain = new TH1F("HTimeHiGain","Distribution of Mean Arrival Hi Gain Times Pixel ", 94 fTimeNbins,fTimeFirst,fTimeLast); 95 fHTimeLoGain = new TH1F("HTimeLoGain","Distribution of Mean Arrival Lo Gain Times Pixel ", 96 fTimeNbins,fTimeFirst,fTimeLast); 97 98 fHTimeHiGain->SetXTitle("Mean Arrival Times [Hi Gain FADC slice nr]"); 99 fHTimeLoGain->SetXTitle("Mean Arrival Times [Lo Gain FADC slice nr]"); 100 101 fHTimeHiGain->SetYTitle("Nr. of events"); 102 fHTimeLoGain->SetYTitle("Nr. of events"); 103 104 // We define a reasonable number and later enlarge it if necessary 105 fHChargevsNHiGain = new TH1I("HChargevsNHiGain","Sum of Hi Gain Charges vs. Event Number Pixel ", 106 fChargevsNbins,-0.5,(Axis_t)fChargevsNbins - 0.5); 107 fHChargevsNLoGain = new TH1I("HChargevsNLoGain","Sum of Lo Gain Charges vs. Event Number Pixel ", 108 fChargevsNbins,-0.5,(Axis_t)fChargevsNbins - 0.5); 109 110 fHChargevsNHiGain->SetXTitle("Event Nr."); 111 fHChargevsNLoGain->SetXTitle("Event Nr."); 112 113 fHChargevsNHiGain->SetYTitle("Sum of Hi Gain FADC slices"); 114 fHChargevsNLoGain->SetYTitle("Sum of Lo Gain FADC slices"); 115 116 fHChargeHiGain->SetDirectory(NULL); 109 117 fHChargeLoGain->SetDirectory(NULL); 110 111 Axis_t tfirst = -0.5;112 Axis_t tlast = 15.5;113 Int_t ntbins = 32;114 115 fHTimeHiGain = new TH1F("HTimeHiGain","Distribution of Mean Arrival Hi Gain Times Pixel ",116 ntbins,tfirst,tlast);117 fHTimeHiGain->SetXTitle("Mean Arrival Times [Hi Gain FADC slice nr]");118 fHTimeHiGain->SetYTitle("Nr. of events");119 118 fHTimeHiGain->SetDirectory(NULL); 120 121 fHTimeLoGain = new TH1F("HTimeLoGain","Distribution of Mean Arrival Lo Gain Times Pixel ",122 ntbins,tfirst,tlast);123 fHTimeLoGain->SetXTitle("Mean Arrival Times [Lo Gain FADC slice nr]");124 fHTimeLoGain->SetYTitle("Nr. of events");125 119 fHTimeLoGain->SetDirectory(NULL); 126 127 // We define a reasonable number and later enlarge it if necessary128 Int_t nqbins = 20000;129 Axis_t nfirst = -0.5;130 Axis_t nlast = (Axis_t)nqbins - 0.5;131 132 fHChargevsNHiGain = new TH1I("HChargevsNHiGain","Sum of Hi Gain Charges vs. Event Number Pixel ",133 nqbins,nfirst,nlast);134 fHChargevsNHiGain->SetXTitle("Event Nr.");135 fHChargevsNHiGain->SetYTitle("Sum of Hi Gain FADC slices");136 137 120 fHChargevsNHiGain->SetDirectory(NULL); 138 139 fHChargevsNLoGain = new TH1I("HChargevsNLoGain","Sum of Lo Gain Charges vs. Event Number Pixel ",140 nqbins,nfirst,nlast);141 fHChargevsNLoGain->SetXTitle("Event Nr.");142 fHChargevsNLoGain->SetYTitle("Sum of Lo Gain FADC slices");143 144 121 fHChargevsNLoGain->SetDirectory(NULL); 145 122 146 123 fHiGains = new TArrayF(); 147 124 fLoGains = new TArrayF(); 125 126 Clear(); 148 127 149 128 } … … 171 150 if (fHivsLoGain) 172 151 delete fHivsLoGain; 173 174 } 152 } 153 154 155 void MHCalibrationPixel::Clear(Option_t *o) 156 { 157 158 fTotalEntries = 0; 159 160 fChargeFirstHiGain = -100.5; 161 fChargeLastHiGain = 1999.5; 162 fChargeFirstLoGain = -100.5; 163 fChargeLastLoGain = 9999.5; 164 165 fChargeChisquare = -1.; 166 fChargeProb = -1.; 167 fChargeNdf = -1; 168 fTimeChisquare = -1.; 169 fTimeProb = -1.; 170 fTimeNdf = -1; 171 fTimeMean = -1.; 172 fTimeSigma = -1.; 173 174 fTimeLowerFitRangeHiGain = 0; 175 fTimeUpperFitRangeHiGain = 0; 176 fTimeLowerFitRangeLoGain = 0; 177 fTimeUpperFitRangeLoGain = 0; 178 179 fOffset = 0.; 180 fSlope = 0; 181 182 if (fChargeGausFit) 183 delete fChargeGausFit; 184 if (fTimeGausFit) 185 delete fTimeGausFit; 186 if (fFitLegend) 187 delete fFitLegend; 188 if (fHivsLoGain) 189 delete fHivsLoGain; 190 if (fHPSD) 191 delete fHPSD; 192 193 return; 194 } 195 196 197 void MHCalibrationPixel::Reset() 198 { 199 200 Clear(); 201 202 fHChargeHiGain->Reset(); 203 fHChargeLoGain->Reset(); 204 fHTimeHiGain->Reset(); 205 fHTimeLoGain->Reset(); 206 fHChargevsNHiGain->Reset(); 207 fHChargevsNLoGain->Reset(); 208 209 fHChargeHiGain->SetName("HChargeHiGain"); 210 fHChargeLoGain->SetName("HChargeLoGain"); 211 fHTimeHiGain->SetName("HTimeHiGain"); 212 fHTimeLoGain->SetName("HTimeLoGain"); 213 fHChargevsNHiGain->SetName("HChargevsNHiGain"); 214 fHChargevsNLoGain->SetName("HChargevsNLoGain"); 215 216 fHiGains->Reset(); 217 fLoGains->Reset(); 218 219 } 220 221 175 222 176 223 Bool_t MHCalibrationPixel::IsEmpty() const … … 295 342 296 343 return kTRUE; 297 }298 299 300 void MHCalibrationPixel::Reset()301 {302 303 for (Int_t i = fHChargeHiGain->FindBin(fChargeFirstHiGain);304 i <= fHChargeHiGain->FindBin(fChargeLastHiGain); i++)305 fHChargeHiGain->SetBinContent(i, 1.e-20);306 307 for (Int_t i = 0; i < 16; i++)308 fHTimeHiGain->SetBinContent(i, 1.e-20);309 310 fChargeFirstHiGain = -100.5;311 fChargeLastHiGain = 1999.5;312 313 fHChargeHiGain->GetXaxis()->UnZoom();314 315 for (Int_t i = fHChargeLoGain->FindBin(fChargeFirstLoGain);316 i <= fHChargeLoGain->FindBin(fChargeLastLoGain); i++)317 fHChargeLoGain->SetBinContent(i, 1.e-20);318 319 for (Int_t i = 0; i < 16; i++)320 fHTimeLoGain->SetBinContent(i, 1.e-20);321 322 fChargeFirstLoGain = -100.5;323 fChargeLastLoGain = 9999.5;324 325 fHChargeLoGain->GetXaxis()->UnZoom();326 327 return;328 344 } 329 345 … … 866 882 fChargeLastHiGain = fHChargeHiGain->GetBinLowEdge(fHChargeHiGain->GetXaxis()->GetLast()) 867 883 +fHChargeHiGain->GetBinWidth(0); 868 fChargeNbinsHiGain = nbins;869 884 870 885 CutEdges(fHChargeLoGain,nbins); … … 873 888 fChargeLastLoGain = fHChargeLoGain->GetBinLowEdge(fHChargeLoGain->GetXaxis()->GetLast()) 874 889 +fHChargeLoGain->GetBinWidth(0); 875 fChargeNbinsLoGain = nbins;876 890 877 891 CutEdges(fHChargevsNHiGain,0); -
trunk/MagicSoft/Mars/mcalib/MHCalibrationPixel.h
r2931 r2932 4 4 #ifndef MARS_MH 5 5 #include "MH.h" 6 #endif 7 8 #ifndef MARS_MFFT 9 #include "MFFT.h" 6 10 #endif 7 11 … … 12 16 class TProfile; 13 17 class TPaveText; 18 class MFFT; 14 19 15 20 class MHCalibrationPixel : public MH … … 23 28 TArrayF *fLoGains; //-> 24 29 30 const Int_t fChargeNbinsHiGain; 31 const Int_t fChargeNbinsLoGain; 32 const Int_t fTimeNbins; 33 const Int_t fChargevsNbins; 34 35 const Axis_t fTimeFirst; 36 const Axis_t fTimeLast; 37 38 TProfile* fHivsLoGain; 39 40 Double_t fOffset; 41 Double_t fSlope; 42 25 43 protected: 26 27 Int_t fTotalEntries; // Number of entries28 44 29 45 TH1F* fHChargeHiGain; // Summed FADC slices High Gain … … 35 51 TH1I* fHChargevsNLoGain; // Summed Charge vs. Event Nr. 36 52 53 TH1F* fHPSD; // Power spectrum density of fHBlindPixelChargevsN 54 37 55 TF1* fChargeGausFit; 38 56 TF1* fTimeGausFit; 39 57 40 TProfile* fHivsLoGain;41 42 58 TPaveText *fFitLegend; 43 59 60 Int_t fTotalEntries; // Number of entries 61 44 62 Axis_t fChargeFirstHiGain; 45 63 Axis_t fChargeLastHiGain; 46 Int_t fChargeNbinsHiGain;47 48 64 Axis_t fChargeFirstLoGain; 49 65 Axis_t fChargeLastLoGain; 50 Int_t fChargeNbinsLoGain;51 66 52 67 Double_t fChargeChisquare; … … 75 90 enum { kUseLoGain, kFitOK }; 76 91 77 Double_t fOffset;78 Double_t fSlope;79 80 92 virtual void DrawLegend(); 81 93 … … 84 96 MHCalibrationPixel(const char *name=NULL, const char *title=NULL); 85 97 ~MHCalibrationPixel(); 98 99 void Clear(Option_t *o=""); 100 void Reset(); 86 101 87 102 void ChangeHistId(Int_t i); … … 97 112 98 113 // Getters 99 const TH1F *GetHCharge() { return fHChargeHiGain; }100 114 const TH1F *GetHCharge() const { return fHChargeHiGain; } 101 115 … … 167 181 // Others 168 182 virtual void CutAllEdges(); 169 virtual void Reset();170 183 171 ClassDef(MHCalibrationPixel, 1) // Histograms for each calibrated pixel184 ClassDef(MHCalibrationPixel, 0) // Histograms for each calibrated pixel 172 185 }; 173 186
Note:
See TracChangeset
for help on using the changeset viewer.