Changeset 3625
- Timestamp:
- 04/01/04 17:02:35 (21 years ago)
- Location:
- trunk/MagicSoft/Mars
- Files:
-
- 10 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/MagicSoft/Mars/Changelog
r3624 r3625 27 27 * manalysis/MGeomApply.cc 28 28 - add average pixels per sector 29 30 * mcalib/MHGausEvents.[h,cc] 31 * mcalib/MHCalibrationChargePix.[h,cc] 32 * mcalib/MHCalibrationRelTimePix.[h,cc] 33 - moved BypassFit() function to MHGausEvents 34 29 35 30 36 2004/03/31: Markus Gaug -
trunk/MagicSoft/Mars/mcalib/MHCalibrationChargeCam.cc
r3624 r3625 848 848 *fLog << warn << "Saturated Hi Gain histogram in pixel: " << pix.GetPixId() << endl; 849 849 pix.SetHiGainSaturation(); 850 // return; 850 hist.CreateFourierSpectrum(); 851 return; 851 852 } 852 853 … … 917 918 bad.SetUncalibrated( MBadPixelsPix::kLoGainSaturation ); 918 919 bad.SetUnsuitable( MBadPixelsPix::kUnsuitableRun ); 919 // return; 920 hist.CreateFourierSpectrum(); 921 return; 920 922 } 921 923 -
trunk/MagicSoft/Mars/mcalib/MHCalibrationChargePix.cc
r3622 r3625 140 140 // - all flags to kFALSE 141 141 // 142 // - executes MHGausEvents::Clear() 142 // Executes: 143 // - MHGausEvents::Clear() 143 144 // 144 145 void MHCalibrationChargePix::Clear(Option_t *o) … … 165 166 // -------------------------------------------------------------------------- 166 167 // 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 168 // Set fPixId to id 169 // 170 // Add id to names and titles of: 171 // - this 172 // - fHGausHist 173 // - fHAbsTime 171 174 // 172 175 void MHCalibrationChargePix::ChangeHistId(Int_t id) … … 185 188 } 186 189 187 190 // -------------------------------------------------------------------------- 191 // 192 // Set Excluded bit from outside 193 // 188 194 void MHCalibrationChargePix::SetExcluded(const Bool_t b) 189 195 { 190 196 b ? SETBIT(fFlags,kExcluded) : CLRBIT(fFlags,kExcluded); 197 } 198 199 const Bool_t MHCalibrationChargePix::IsExcluded() const 200 { 201 return TESTBIT(fFlags,kExcluded); 191 202 } 192 203 … … 200 211 } 201 212 213 // -------------------------------------------------------------------------- 214 // 215 // returns fHAbsTime.GetMean() 216 // 202 217 const Float_t MHCalibrationChargePix::GetAbsTimeMean() const 203 218 { … … 205 220 } 206 221 222 // -------------------------------------------------------------------------- 223 // 224 // returns fHAbsTime.GetRMS() 225 // 207 226 const Float_t MHCalibrationChargePix::GetAbsTimeRms() const 208 227 { 209 228 return fHAbsTime.GetRMS(); 210 }211 212 const Bool_t MHCalibrationChargePix::IsExcluded() const213 {214 return TESTBIT(fFlags,kExcluded);215 229 } 216 230 … … 351 365 352 366 353 // -----------------------------------------------------------------------------354 //355 // Bypasses the Gauss fit by taking mean and RMS from the histogram356 //357 // Errors are determined in the following way:358 // MeanErr = RMS / Sqrt(entries)359 // SigmaErr = RMS / (2.*Sqrt(entries) )360 //361 void MHCalibrationChargePix::BypassFit()362 {363 364 //365 // In case, we do not obtain reasonable values366 // with the fit, we take the histogram values367 //368 SetMean ( fHGausHist.GetMean() );369 SetMeanErr ( fHGausHist.GetRMS() / TMath::Sqrt(fHGausHist.GetEntries()) );370 SetSigma ( fHGausHist.GetRMS() );371 SetSigmaErr ( fHGausHist.GetRMS() / TMath::Sqrt(fHGausHist.GetEntries()) / 2. );372 }373 367 374 368 void MHCalibrationChargePix::CountPickup() -
trunk/MagicSoft/Mars/mcalib/MHCalibrationChargePix.h
r3617 r3625 84 84 85 85 // Fits 86 void BypassFit();87 86 Bool_t RepeatFit(const Option_t *option="RQ0"); 88 87 -
trunk/MagicSoft/Mars/mcalib/MHCalibrationRelTimeCam.cc
r3620 r3625 168 168 MHCalibrationRelTimePix &hist = (*this)[i]; 169 169 hist.ChangeHistId(i); 170 hist.Init Bins();170 hist.Init(); 171 171 hist.SetEventFrequency(fPulserFrequency); 172 172 } -
trunk/MagicSoft/Mars/mcalib/MHCalibrationRelTimeCam.h
r3620 r3625 50 50 void DrawPixelContent(Int_t idx) const; 51 51 52 ClassDef(MHCalibrationRelTimeCam, 1) // Storage Container for all pedestal information of the camera52 ClassDef(MHCalibrationRelTimeCam, 1) // Histogram class for camera relative time calibration 53 53 }; 54 54 -
trunk/MagicSoft/Mars/mcalib/MHCalibrationRelTimePix.cc
r3620 r3625 47 47 // Default Constructor. 48 48 // 49 // Sets: 50 // - the default number for fChargeNbins (fgChargeNbins) 51 // - the default number for fChargeFirst (fgChargeFirst) 52 // - the default number for fChargeLast (fgChargeLast) 53 // 54 // - the default name of the fHGausHist ("HCalibrationRelTime") 55 // - the default title of the fHGausHist ("Distribution of Relative Arrival Times Pixel ") 56 // - the default x-axis title for fHGausHist ("FADC Slice") 57 // - the default y-axis title for fHGausHist ("Nr. of events") 58 // 59 // Initializes: 60 // - fPixId to -1 61 // 62 // Executes: 63 // - MHGausEvents::Clear() 64 // 49 65 MHCalibrationRelTimePix::MHCalibrationRelTimePix(const char *name, const char *title) 50 66 : fPixId(-1) … … 59 75 60 76 // Create a large number of bins, later we will rebin 61 fHGausHist.SetName("HCalibrationRelTime Charge");77 fHGausHist.SetName("HCalibrationRelTime"); 62 78 fHGausHist.SetTitle("Distribution of Relative Arrival Times Pixel "); 63 79 fHGausHist.SetXTitle("FADC Slice"); 64 80 fHGausHist.SetYTitle("Nr. of events"); 65 fHGausHist.Sumw2(); 81 82 Clear(); 66 83 67 84 } 68 85 69 MHCalibrationRelTimePix::~MHCalibrationRelTimePix() 70 { 71 } 72 86 // -------------------------------------------------------------------------- 87 // 88 // Sets: 89 // - fPixId to -1 90 // 91 // Executes: 92 // - MHGausEvents::Clear() 93 // 73 94 void MHCalibrationRelTimePix::Clear(Option_t *o) 74 95 { … … 80 101 81 102 103 // -------------------------------------------------------------------------- 104 // 105 // Empty function to overload MHGausEvents::Reset() 106 // 107 void MHCalibrationRelTimePix::Reset() 108 { 109 } 82 110 83 void MHCalibrationRelTimePix::InitBins() 111 // -------------------------------------------------------------------------- 112 // 113 // Sets: 114 // - fHGausHist.SetBins(fChargeNbins,fChargeFirst,fChargeLast); 115 // 116 void MHCalibrationRelTimePix::Init() 84 117 { 85 118 … … 88 121 } 89 122 90 123 // -------------------------------------------------------------------------- 124 // 125 // - Set fPixId to id 126 // 127 // Add id to names and titles of: 128 // - fHGausHist 129 // 91 130 void MHCalibrationRelTimePix::ChangeHistId(Int_t id) 92 131 { … … 100 139 101 140 102 void MHCalibrationRelTimePix::BypassFit()103 {104 105 //106 // In case, we do not obtain reasonable values107 // with the fit, we take the histogram values108 //109 SetMean( fHGausHist.GetMean() );110 SetMeanErr( fHGausHist.GetRMS() / fHGausHist.GetEntries() );111 SetSigma( fHGausHist.GetRMS() );112 SetSigmaErr( fHGausHist.GetRMS() / fHGausHist.GetEntries() /2. );113 114 }115 116 141 // ---------------------------------------------------------------------- 117 142 // 118 // Renorm the results from FADC slices to times in ns. 143 // Renorm the results from FADC slices to times. 144 // The parameters slicewidth is the inverse of the FADC frequency and has the unit ns. 119 145 // 120 146 void MHCalibrationRelTimePix::Renorm(const Float_t slicewidth) -
trunk/MagicSoft/Mars/mcalib/MHCalibrationRelTimePix.h
r3620 r3625 24 24 25 25 MHCalibrationRelTimePix(const char *name=NULL, const char *title=NULL); 26 ~MHCalibrationRelTimePix(); 26 ~MHCalibrationRelTimePix() {} 27 27 28 28 29 void Clear(Option_t *o=""); 29 void InitBins(); 30 void Reset(); 31 void Init(); 30 32 31 33 // Setters … … 34 36 void SetChargeLast( const Axis_t last =fgChargeLast) { fChargeLast = last; } 35 37 36 // Fits37 void BypassFit();38 39 38 // Others 40 39 void ChangeHistId(Int_t i); -
trunk/MagicSoft/Mars/mcalib/MHGausEvents.cc
r3617 r3625 544 544 } 545 545 546 // ----------------------------------------------------------------------------- 547 // 548 // Bypasses the Gauss fit by taking mean and RMS from the histogram 549 // 550 // Errors are determined in the following way: 551 // MeanErr = RMS / Sqrt(entries) 552 // SigmaErr = RMS / (2.*Sqrt(entries) ) 553 // 554 void MHGausEvents::BypassFit() 555 { 556 557 const Stat_t entries = fHGausHist.GetEntries(); 558 559 if (entries <= 0.) 560 { 561 *fLog << warn << GetDescriptor() << ": Cannot bypass fit. Number of entries smaller or equal 0" << endl; 562 return; 563 } 564 565 SetMean ( fHGausHist.GetMean() ); 566 SetMeanErr ( fHGausHist.GetRMS() / TMath::Sqrt(entries) ); 567 SetSigma ( fHGausHist.GetRMS() ); 568 SetSigmaErr ( fHGausHist.GetRMS() / TMath::Sqrt(entries) / 2. ); 569 } 570 546 571 // ----------------------------------------------------------------------------------- 547 572 // -
trunk/MagicSoft/Mars/mcalib/MHGausEvents.h
r3611 r3625 58 58 Int_t fNDFLimit; // NDF limit for judgement if fit is OK 59 59 60 Float_t *CreateEventXaxis(Int_t n); // Create an x-axis for the Event TGraphs 61 Float_t *CreatePSDXaxis(Int_t n); // Create an x-axis for the PSD TGraphs 62 63 void DrawEvents(); // Draw graph of fEvents 64 void DrawPowerSpectrum(TVirtualPad &pad, Int_t i); // Draw graph of fPowerSpectrum and fHPowerProbability 65 60 66 // Setters 61 67 void SetPowerProbabilityBins ( const Int_t nbins=fgPowerProbabilityBins ) { fPowerProbabilityBins = nbins; } 62 68 void SetBinsAfterStripping ( const Int_t nbins=fgBinsAfterStripping ) { fBinsAfterStripping = nbins; } 63 64 void DrawEvents(); // Draw a graph of the array fEvents65 void DrawPowerSpectrum(TVirtualPad &pad, Int_t i); // Draw a graph of the array fPowerSpectrum and the hist fHPowerProbability66 67 Float_t *CreateEventXaxis(Int_t n); // Create an x-axis for the Event TGraphs68 Float_t *CreatePSDXaxis(Int_t n); // Create an x-axis for the PSD TGraphs69 69 70 70 public: … … 143 143 144 144 // Fits 145 Bool_t FitGaus(Option_t *option="RQ0", const Double_t xmin=0., const Double_t xmax=0.); // Fit the histogram HGausHist with a Gaussian 146 145 Bool_t FitGaus(Option_t *option="RQ0", 146 const Double_t xmin=0., const Double_t xmax=0.); // Fit the histogram HGausHist with a Gaussian 147 void BypassFit(); // Take mean and RMS from the histogram 148 149 147 150 // Draws 148 virtual void Draw(Option_t *option=""); // Default Draw151 virtual void Draw(Option_t *option=""); // Default Draw 149 152 150 153 // Prints
Note:
See TracChangeset
for help on using the changeset viewer.