Changeset 3612 for trunk/MagicSoft
- Timestamp:
- 03/30/04 20:10:03 (21 years ago)
- Location:
- trunk/MagicSoft/Mars
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/MagicSoft/Mars/Changelog
r3611 r3612 22 22 23 23 * mcalib/MHGausEvents.[h,cc] 24 * mcalib/MHCalibrationChargePix.[h,cc] 24 25 - updated and enlarged documentation 25 26 -
trunk/MagicSoft/Mars/mcalib/MHCalibrationChargePix.cc
r3609 r3612 56 56 const Axis_t MHCalibrationChargePix::fgAbsTimeFirst = -0.5; 57 57 const Axis_t MHCalibrationChargePix::fgAbsTimeLast = 14.5; 58 59 58 const Float_t MHCalibrationChargePix::fgPickupLimit = 5.; 60 59 // -------------------------------------------------------------------------- 61 60 // 62 61 // Default Constructor. 62 // 63 // Sets: 64 // - the default number for fChargeNbins (fgChargeNbins) 65 // - the default number for fChargeFirst (fgChargeFirst) 66 // - the default number for fChargeLast (fgChargeLast) 67 // - the default number for fAbsTimeNbins (fgAbstTimeNbins) 68 // - the default number for fAbsTimeFirst (fgAbsTimeFirst) 69 // - the default number for fAbsTimeLast (fgAbsTimeLast) 70 // - the default number for fPickupLimit (fgPickupLimit) 71 // 72 // - the default name of the fHGausHist ("HCalibrationCharge") 73 // - the default title of the fHGausHist ("Distribution of Summed FADC slices Pixel ") 74 // - the default x-axis title for fHGausHist ("Sum FADC Slices") 75 // - the default y-axis title for fHGausHist ("Nr. of events") 76 // 77 // - the default name of the fHAbsTime ("HAbsTimePixel") 78 // - the default title of the fHAbsTime ("Distribution of Absolute Arrival Times Pixel ") 79 // - the default x-axis title for fHAbsTime ("Absolute Arrival Time [FADC slice nr]") 80 // - the default y-axis title for fHAbsTime ("Nr. of events"); 81 // - the default directory of the fHAbsTime (NULL) 82 // 83 // Initializes: 84 // - fHAbsTime() 85 // - fPixId to -1 86 // - all variables to 0. 87 // - all flags to kFALSE 63 88 // 64 89 MHCalibrationChargePix::MHCalibrationChargePix(const char *name, const char *title) … … 67 92 68 93 fName = name ? name : "MHCalibrationChargePix"; 69 fTitle = title ? title : " Fill the FADC sums of calibration events and perform the fits";94 fTitle = title ? title : "Statistics of the FADC sums of calibration events"; 70 95 71 96 SetChargeNbins(); … … 96 121 } 97 122 123 // -------------------------------------------------------------------------- 124 // 125 // Sets: 126 // - fHGausHist.SetBins(fChargeNbins,fChargeFirst,fChargeLast); 127 // - fHAbsTime.SetBins(fAbsTimeNbins,fAbsTimeFirst,fAbsTimeLast); 128 // 98 129 void MHCalibrationChargePix::Init() 99 130 { … … 103 134 } 104 135 105 136 // -------------------------------------------------------------------------- 137 // 138 // Sets: 139 // - all variables to 0., except fPixId to -1 140 // - all flags to kFALSE 141 // 142 // - executes MHGausEvents::Clear() 143 // 106 144 void MHCalibrationChargePix::Clear(Option_t *o) 107 145 { … … 117 155 } 118 156 119 157 // -------------------------------------------------------------------------- 158 // 159 // Empty function to overload MHGausEvents::Reset() 160 // 120 161 void MHCalibrationChargePix::Reset() 121 162 { 122 163 } 123 164 124 165 // -------------------------------------------------------------------------- 166 // 167 // - Set fPixId to id 168 // - Add id to name and title of this 169 // - Add id to names of fHGausHist and fHAbsTime 170 // - Add id to the titles of fHGausHist and fHAbsTime 171 // 125 172 void MHCalibrationChargePix::ChangeHistId(Int_t id) 126 173 { … … 144 191 } 145 192 193 // -------------------------------------------------------------------------- 194 // 195 // returns fHGausHist.Integral("width") 196 // 146 197 const Float_t MHCalibrationChargePix::GetIntegral() const 147 198 { … … 159 210 } 160 211 161 Bool_t MHCalibrationChargePix::IsExcluded() const212 const Bool_t MHCalibrationChargePix::IsExcluded() const 162 213 { 163 214 return TESTBIT(fFlags,kExcluded); 164 215 } 165 216 217 // -------------------------------------------------------------------------- 218 // 219 // Fills fHAbsTime with t 220 // Returns kFALSE, if overflow or underflow occurred, else kTRUE 221 // 166 222 Bool_t MHCalibrationChargePix::FillAbsTime(Float_t t) 167 223 { … … 169 225 } 170 226 171 227 // ----------------------------------------------------------------------------- 228 // 229 // Default draw: 230 // 231 // The following options can be chosen: 232 // 233 // "": displays the fHGausHist and the fHAbsTime 234 // "all": executes additionally MHGausEvents::Draw(), with options 235 // 172 236 void MHCalibrationChargePix::Draw(const Option_t *opt) 173 237 { … … 240 304 } 241 305 306 // ----------------------------------------------------------------------------- 307 // 308 // Repeats the Gauss fit in a smaller range, defined by: 309 // 310 // min = GetMean() - fPickupLimit * GetSigma(); 311 // max = GetMean() + fPickupLimit * GetSigma(); 312 // 242 313 Bool_t MHCalibrationChargePix::RepeatFit(const Option_t *option) 243 314 { … … 279 350 } 280 351 352 353 // ----------------------------------------------------------------------------- 354 // 355 // Bypasses the Gauss fit by taking mean and RMS from the histogram 356 // 357 // Errors are determined in the following way: 358 // MeanErr = RMS / Sqrt(entries) 359 // SigmaErr = RMS / (2.*Sqrt(entries) ) 360 // 281 361 void MHCalibrationChargePix::BypassFit() 282 362 { … … 287 367 // 288 368 SetMean ( fHGausHist.GetMean() ); 289 SetMeanErr ( fHGausHist.GetRMS() / fHGausHist.GetEntries() );369 SetMeanErr ( fHGausHist.GetRMS() / TMath::Sqrt(fHGausHist.GetEntries()) ); 290 370 SetSigma ( fHGausHist.GetRMS() ); 291 SetSigmaErr ( fHGausHist.GetRMS() / fHGausHist.GetEntries() / 2. );371 SetSigmaErr ( fHGausHist.GetRMS() / TMath::Sqrt(fHGausHist.GetEntries()) / 2. ); 292 372 } 293 373 294 374 void MHCalibrationChargePix::CountPickup() 295 375 { 296 376 fPickup = (Int_t)GetHGausHist()->Integral(GetHGausHist()->GetXaxis()->FindBin(GetMean()+fPickupLimit*GetSigma()), 297 377 GetHGausHist()->GetXaxis()->GetLast(), 298 378 "width"); -
trunk/MagicSoft/Mars/mcalib/MHCalibrationChargePix.h
r3609 r3612 12 12 private: 13 13 14 static const Int_t fgChargeNbins; 15 static const Axis_t fgChargeFirst; 16 static const Axis_t fgChargeLast; 17 18 static const Int_t fgAbsTimeNbins; 19 static const Axis_t fgAbsTimeFirst; 20 static const Axis_t fgAbsTimeLast; 21 22 static const Float_t fgPickupLimit; 14 static const Int_t fgChargeNbins; // Default for fChargeNBins (now set to: 2000 ) 15 static const Axis_t fgChargeFirst; // Default for fChargeFirst (now set to: -0.5 ) 16 static const Axis_t fgChargeLast; // Default for fChargeLast (now set to: 1999.5) 17 static const Int_t fgAbsTimeNbins; // Default for fAbsTimeNbins (now set to: 15 ) 18 static const Axis_t fgAbsTimeFirst; // Default for fAbsTimeFirst (now set to: -0.5 ) 19 static const Axis_t fgAbsTimeLast; // Default for fAbsTimeLast (now set to: 14.5 ) 20 static const Float_t fgPickupLimit; // Default for fPickupLimit (now set to: 5. ) 23 21 24 22 protected: 25 23 26 Int_t fPixId; 24 Int_t fPixId; // The pixel ID 27 25 28 TH1F fHAbsTime; 26 TH1F fHAbsTime; // Histogram to hold the absolute arrival times in number of FADC slices 29 27 30 Int_t fChargeNbins; 31 Axis_t fChargeFirst; 32 Axis_t fChargeLast; 28 Int_t fChargeNbins; // Number of bins used for the fHGausHist 29 Axis_t fChargeFirst; // Lower bound bin used for the fHGausHist 30 Axis_t fChargeLast; // Upper bound bin used for the fHGausHist 33 31 34 Int_t fAbsTimeNbins; 35 Axis_t fAbsTimeFirst; 36 Axis_t fAbsTimeLast; 32 Int_t fAbsTimeNbins; // Number of bins used for the fHAbsTime 33 Axis_t fAbsTimeFirst; // Lower bound bin used for the fHAbsTime 34 Axis_t fAbsTimeLast; // Upper bound bin used for the fHAbsTime 37 35 38 Float_t fPickupLimit; // The limit innumber of sigmas from the fitted mean above which events are considered as pickup36 Float_t fPickupLimit; // Upper number of sigmas from the fitted mean above which events are considered as pickup 39 37 40 Float_t fSaturated; 41 Float_t fPickup; 38 Float_t fSaturated; // Number of events classified as saturated 39 Float_t fPickup; // Number of events classified as pick-up 42 40 43 Byte_t fFlags; 44 enum { kExcluded }; 41 Byte_t fFlags; // Bit-field for the flags 42 enum { kExcluded }; // Possible bits to be set 45 43 46 44 public: … … 54 52 virtual void ChangeHistId(Int_t i); 55 53 56 // Setters 57 virtual void SetChargeNbins(const Int_t bins =fgChargeNbins) { fChargeNbins = bins; }58 virtual void SetChargeFirst(const Axis_t first=fgChargeFirst) { fChargeFirst = first; }59 virtual void SetChargeLast( const Axis_t last =fgChargeLast) { fChargeLast = last; }54 // Setters 55 virtual void SetChargeNbins(const Int_t bins =fgChargeNbins) { fChargeNbins = bins; } 56 virtual void SetChargeFirst(const Axis_t first=fgChargeFirst) { fChargeFirst = first; } 57 virtual void SetChargeLast( const Axis_t last =fgChargeLast) { fChargeLast = last; } 60 58 61 virtual void SetAbsTimeNbins(const Int_t bins =fgAbsTimeNbins) { fAbsTimeNbins = bins; }59 virtual void SetAbsTimeNbins(const Int_t bins =fgAbsTimeNbins) { fAbsTimeNbins = bins; } 62 60 virtual void SetAbsTimeFirst(const Axis_t first=fgAbsTimeFirst) { fAbsTimeFirst = first; } 63 virtual void SetAbsTimeLast( const Axis_t last =fgAbsTimeLast) { fAbsTimeLast = last; }61 virtual void SetAbsTimeLast( const Axis_t last =fgAbsTimeLast) { fAbsTimeLast = last; } 64 62 65 virtual void SetPickupLimit( const Float_t lim =fgPickupLimit) { fPickupLimit = lim;}63 virtual void SetPickupLimit( const Float_t lim =fgPickupLimit) { fPickupLimit = lim; } 66 64 67 void SetSaturated ( const Float_t f ) { fSaturated += f;}68 void SetExcluded ( const Bool_t b=kTRUE );65 void SetSaturated ( const Float_t f ) { fSaturated += f; } 66 void SetExcluded ( const Bool_t b=kTRUE ); 69 67 70 68 // Getters 71 TH1F *GetHAbsTime() { return &fHAbsTime; }72 const TH1F *GetHAbsTime() const { return &fHAbsTime; }69 TH1F *GetHAbsTime() { return &fHAbsTime; } 70 const TH1F *GetHAbsTime() const { return &fHAbsTime; } 73 71 74 const Float_t GetIntegral() const;72 const Float_t GetIntegral() const; 75 73 76 const Float_t GetAbsTimeMean( ) const;77 const Float_t GetAbsTimeRms() const;74 const Float_t GetAbsTimeMean( ) const; 75 const Float_t GetAbsTimeRms() const; 78 76 79 const Float_t GetSaturated()const { return fSaturated; }80 const Float_t GetPickup()const { return fPickup; }77 const Float_t GetSaturated() const { return fSaturated; } 78 const Float_t GetPickup() const { return fPickup; } 81 79 82 Bool_t IsExcluded()const;80 const Bool_t IsExcluded() const; 83 81 84 82 // Fill histos … … 95 93 void CountPickup(); 96 94 97 ClassDef(MHCalibrationChargePix, 1) // Base class for charge calibrated pixel95 ClassDef(MHCalibrationChargePix, 1) // Base Histogram class for a Calibration Pixel 98 96 }; 99 97
Note:
See TracChangeset
for help on using the changeset viewer.