Changeset 3617 for trunk/MagicSoft/Mars/mcalib
- Timestamp:
- 03/31/04 10:52:35 (21 years ago)
- Location:
- trunk/MagicSoft/Mars/mcalib
- Files:
-
- 8 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/MagicSoft/Mars/mcalib/MCalibrationChargePINDiode.cc
r3315 r3617 100 100 SetConversionChargePhotonsErr(); 101 101 102 SetExcluded(kFALSE); 103 SetExcludeQualityCheck(kFALSE); 102 SetOscillating ( kFALSE ); 103 SetExcluded ( kFALSE ); 104 SetExcludeQualityCheck ( kFALSE ); 104 105 } 105 106 … … 154 155 fPedRms = pedrms; 155 156 157 } 158 159 // -------------------------------------------------------------------------- 160 // 161 // Set the Oscillating Bit from outside 162 // 163 void MCalibrationChargePINDiode::SetOscillating( const Bool_t b) 164 { 165 b ? SETBIT(fFlags,kOscillating) : CLRBIT(fFlags,kOscillating); 156 166 } 157 167 -
trunk/MagicSoft/Mars/mcalib/MCalibrationChargePINDiode.h
r3315 r3617 69 69 PulserColor_t fColor; 70 70 71 enum { kExcluded, kExcludeQualityCheck, 71 enum { kExcluded, kExcludeQualityCheck, kOscillating, 72 72 kChargeFitValid, kTimeFitValid, 73 73 kMeanTimeInFirstBin, kMeanTimeInLastBin, … … 106 106 void SetPedestal(Float_t ped, Float_t pedrms); 107 107 108 void SetOscillating ( const Bool_t b=kTRUE); 108 109 void SetExcluded ( const Bool_t b = kTRUE ); 109 110 void SetExcludeQualityCheck( const Bool_t b = kTRUE ); -
trunk/MagicSoft/Mars/mcalib/MHCalibrationChargeBlindPix.cc
r3614 r3617 179 179 // 180 180 // Sets: 181 // - fHGausHist.SetBins(fChargeNbins,fChargeFirst,fChargeLast);182 //183 void MHCalibrationChargeBlindPix::Init()184 {185 fHGausHist.SetBins( fChargeNbins, fChargeFirst, fChargeLast);186 }187 188 // --------------------------------------------------------------------------189 //190 // Sets:191 181 // - all variables to 0., except the fit result variables to -999. 192 182 // - all flags to kFALSE … … 287 277 // - fAPedestalFADCSlices(0); 288 278 // 289 // Calls Init() 279 // Sets Binning of the following histograms: 280 // - fHGausHist.SetBins(fChargeNbins,fChargeFirst,fChargeLast); 290 281 // 291 282 Bool_t MHCalibrationChargeBlindPix::SetupFill(const MParList *pList) … … 309 300 fAPedestalFADCSlices(0); 310 301 311 Init();302 fHGausHist.SetBins( fChargeNbins, fChargeFirst, fChargeLast); 312 303 313 304 return kTRUE; … … 349 340 // - blind Pixel ID 350 341 // 351 // Executes MHGausEvents::FillHistAndArray(signal) 342 // Fills the following histograms: 343 // - MHGausEvents::FillHistAndArray(signal) 352 344 // 353 345 // Creates MRawEvtPixelIter, jumps to blind pixel ID, -
trunk/MagicSoft/Mars/mcalib/MHCalibrationChargeBlindPix.h
r3614 r3617 96 96 97 97 void Clear(Option_t *o=""); 98 void Init();99 98 100 99 Bool_t SetupFill(const MParList *pList); -
trunk/MagicSoft/Mars/mcalib/MHCalibrationChargePINDiode.cc
r3445 r3617 34 34 35 35 #include <TH1.h> 36 #include <TF1.h> 36 37 #include <TPad.h> 37 38 #include <TVirtualPad.h> … … 63 64 // Default Constructor. 64 65 // 66 // Sets: 67 // - the default number for fChargeNbins (fgChargeNbins) 68 // - the default number for fChargeFirst (fgChargeFirst) 69 // - the default number for fChargeLast (fgChargeLast) 70 // - the default number for fRmsChargeNbins (fgRmsChargeNbins) 71 // - the default number for fRmsChargeFirst (fgRmsChargeFirst) 72 // - the default number for fRmsChargeLast (fgRmsChargeLast) 73 // - the default number for fAbsTimeNbins (fgAbsTimeNbins) 74 // - the default number for fAbsTimeFirst (fgAbsTimeFirst) 75 // - the default number for fAbsTimeLast (fgAbsTimeLast) 76 // 77 // - the default name of the fHGausHist ("HCalibrationChargePINDiode") 78 // - the default title of the fHGausHist ("Distribution of Summed FADC slices PIN Diode") 79 // - the default x-axis title for fHGausHist ("Sum FADC Slices") 80 // - the default y-axis title for fHGausHist ("Nr. of events") 81 // - the default name of the fHAbsTime ("HAbsTimePINDiode") 82 // - the default title of the fHAbsTime ("Distribution of Absolute Arrival Times PIN Diode") 83 // - the default x-axis title for fHAbsTime ("Absolute Arrival Time [FADC slice nr]") 84 // - the default y-axis title for fHAbsTime ("Nr. of events") 85 // - the default name of the fHRmsCharge ("HRmsChargePINDiode") 86 // - the default title of the fHRmsCharge ("Distribution of Variances of summed FADC slices PIN Diode") 87 // - the default x-axis title for fHRmsCharge ("RMS (sum) [FADC slices]") 88 // - the default y-axis title for fHRmsCharge ("Nr. of events") 89 // - the default directory of the fHRmsCharge (NULL) 90 // 91 // Initializes: 92 // - fHRmsCharge() 93 // - all pointers to NULL 94 // - all variables to 0. 95 // - all flags to kFALSE 96 // 65 97 MHCalibrationChargePINDiode::MHCalibrationChargePINDiode(const char *name, const char *title) 66 98 : fPINDiode(NULL), fHRmsCharge() … … 82 114 SetAbsTimeLast(); 83 115 84 fHRmsCharge.SetName("HRmsCharge"); 85 fHRmsCharge.SetTitle("Distribution of Variances of summed FADC slices"); 116 fHGausHist.SetName("HCalibrationChargePINDiode"); 117 fHGausHist.SetTitle("Distribution of Summed FADC slices PIN Diode"); 118 fHGausHist.SetXTitle("Sum FADC Slices"); 119 fHGausHist.SetYTitle("Nr. of events"); 120 121 fHAbsTime.SetName("HAbsTimePINDiode"); 122 fHAbsTime.SetTitle("Distribution of Absolute Arrival Times PIN Diode"); 123 fHAbsTime.SetXTitle("Absolute Arrival Time [FADC slice nr]"); 124 fHAbsTime.SetYTitle("Nr. of events"); 125 126 fHRmsCharge.SetName("HRmsChargePINDiode"); 127 fHRmsCharge.SetTitle("Distribution of Variances of summed FADC slices PIN Diode"); 86 128 fHRmsCharge.SetXTitle("RMS (sum) [FADC slices]"); 87 129 fHRmsCharge.SetYTitle("Nr. of events"); … … 92 134 } 93 135 94 95 void MHCalibrationChargePINDiode::Init() 96 { 97 98 fHGausHist.SetName("HCalibrationChargePINDiode"); 99 fHGausHist.SetTitle("Distribution of Summed FADC slices PIN Diode"); 100 fHGausHist.SetXTitle("Sum FADC Slices"); 101 fHGausHist.SetYTitle("Nr. of events"); 136 // -------------------------------------------------------------------------- 137 // 138 // Initializes Binning of the following histograms: 139 // - fHGausHist.SetBins(fChargeNbins,fChargeFirst,fChargeLast); 140 // - fHAbsTime.SetBins(fAbsTimeNbins,fAbsTimeFirst,fAbsTimeLast); 141 // - fHRmsCharge.SetBins(fRmsChargeNbins,fRmsChargeFirst,fRmsChargeLast); 142 // 143 Bool_t MHCalibrationChargePINDiode::SetupFill(const MParList *pList) 144 { 145 102 146 fHGausHist.SetBins(fChargeNbins,fChargeFirst,fChargeLast); 103 // fHGausHist.Sumw2();104 105 fHAbsTime.SetName("HAbsTimePINDiode");106 fHAbsTime.SetTitle("Distribution of Absolute Arrival Times PIN Diode ");107 fHAbsTime.SetXTitle("Absolute Arrival Time [FADC slice nr]");108 fHAbsTime.SetYTitle("Nr. of events");109 147 fHAbsTime.SetBins(fAbsTimeNbins,fAbsTimeFirst,fAbsTimeLast); 110 111 148 fHRmsCharge.SetBins(fRmsChargeNbins,fRmsChargeFirst,fRmsChargeLast); 112 } 113 114 115 void MHCalibrationChargePINDiode::Clear(Option_t *o) 116 { 117 118 fExtractSlices = 0; 119 120 MHCalibrationChargePix::Clear(); 121 return; 122 } 123 124 Bool_t MHCalibrationChargePINDiode::SetupFill(const MParList *pList) 125 { 126 Init(); 149 127 150 return kTRUE; 128 } 129 151 152 } 153 154 // -------------------------------------------------------------------------- 155 // 156 // Gets or creates the pointers to: 157 // - MCalibrationChargePINDiode 158 // 130 159 Bool_t MHCalibrationChargePINDiode::ReInit(MParList *pList) 131 160 { 132 161 133 162 fPINDiode = (MCalibrationChargePINDiode*)pList->FindCreateObj("MCalibrationChargePINDiode"); 134 163 if (!fPINDiode) … … 141 170 } 142 171 172 // -------------------------------------------------------------------------- 173 // 174 // Retrieves from MExtractedSignalPINDiode: 175 // - Number of used FADC samples 176 // - Extracted signal 177 // - Signal Rms 178 // - Arrival Time 179 // 180 // Fills the following histograms: 181 // - MHGausEvents::FillHistAndArray(signal) 182 // - FillAbsTime(time); 183 // - FillRmsCharge(rms); 184 // 143 185 Bool_t MHCalibrationChargePINDiode::Fill(const MParContainer *par, const Stat_t w) 144 186 { … … 161 203 } 162 204 163 if (fExtractSlices != 0. && slices != fExtractSlices )164 {165 *fLog << err << "Number of used signal slices changed in MExtractedSignalCam ... abort."166 << endl;167 return kFALSE;168 }169 170 fExtractSlices = slices;171 172 205 const Float_t signal = (float)extractor->GetExtractedSignal(); 173 206 const Float_t time = extractor->GetExtractedTime(); … … 181 214 } 182 215 216 // -------------------------------------------------------------------------- 217 // 218 // Returns kFALSE, if empty 219 // 220 // Performs the following fits: 221 // - MHGausEvents::FitGaus() 222 // - FitRmsCharge() 223 // 224 // Creates the fourier spectrum and sets bit IsFourierSpectrumOK() 225 // Retrieves the results of the following fits and stores them in MCalibrationChargePINDiode: 226 // - Mean Charge and Error 227 // - Sigma Charge and Error 228 // - Abs Time Mean 229 // - Abs Time Rms 230 // - Rms Charge Mean and Error 231 // - Rms Charge Sigma and Error 232 // 183 233 Bool_t MHCalibrationChargePINDiode::Finalize() 184 234 { … … 189 239 FitGaus(); 190 240 FitRmsCharge(); 241 191 242 CreateFourierSpectrum(); 243 fPINDiode->SetOscillating ( !IsFourierSpectrumOK() ); 192 244 193 245 fPINDiode->SetMeanCharge( GetMean() ); … … 207 259 } 208 260 261 // -------------------------------------------------------------------------- 262 // 263 // Fills fHRmsCharge with q 264 // Returns kFALSE, if overflow or underflow occurred, else kTRUE 265 // 209 266 Bool_t MHCalibrationChargePINDiode::FillRmsCharge(const Float_t q) 210 267 { … … 222 279 223 280 281 // ------------------------------------------------------------------------- 282 // 283 // Draw the histogram 284 // 285 // The following options can be chosen: 286 // 287 // "": displays the fHGausHist with fits and fHRmsCharge 288 // "all": executes additionally MHGausEvents::Draw(), with option "fourierevents" 289 // 224 290 void MHCalibrationChargePINDiode::Draw(const Option_t *opt) 225 291 { … … 230 296 Int_t win = 1; 231 297 232 TVirtualPad * pad = gPad ? gPad : MH::MakeDefCanvas(this,600, 600);233 234 pad->SetTicks(); 235 pad->SetBorderMode(0);298 TVirtualPad *oldpad = gPad ? gPad : MH::MakeDefCanvas(this,900, 600); 299 TVirtualPad *pad = NULL; 300 301 oldpad->SetBorderMode(0); 236 302 237 if (option.Contains("rmscharge")) 238 win++; 239 240 pad->Divide(1,win); 241 pad->cd(1); 303 if (option.Contains("all")) 304 { 305 option.ReplaceAll("all",""); 306 oldpad->Divide(2,1); 307 win = 2; 308 oldpad->cd(1); 309 TVirtualPad *newpad = gPad; 310 pad = newpad; 311 pad->Divide(1,2); 312 pad->cd(1); 313 } 314 else 315 { 316 pad = oldpad; 317 pad->Divide(1,2); 318 pad->cd(1); 319 } 242 320 243 321 if (!IsEmpty()) 244 gPad->SetLogy(); 245 246 MHGausEvents::Draw(opt); 247 248 if (win > 1) 249 { 250 pad->cd(2); 251 fHRmsCharge.Draw(opt); 252 } 253 } 254 255 256 257 322 gPad->SetLogy(); 323 324 gPad->SetTicks(); 325 326 fHGausHist.Draw(opt); 327 if (fFGausFit) 328 { 329 fFGausFit->SetLineColor(IsGausFitOK() ? kGreen : kRed); 330 fFGausFit->Draw("same"); 331 } 332 333 pad->cd(2); 334 fHRmsCharge.Draw(opt); 335 336 oldpad->cd(2); 337 MHGausEvents::Draw("fourierevents"); 338 } 339 340 341 342 -
trunk/MagicSoft/Mars/mcalib/MHCalibrationChargePINDiode.h
r3266 r3617 13 13 private: 14 14 15 MCalibrationChargePINDiode *fPINDiode; //! Storage container of the results 15 static const Int_t fgChargeNbins; // Default for fChargeNBins (now set to: 200 ) 16 static const Axis_t fgChargeFirst; // Default for fChargeFirst (now set to: -0.5 ) 17 static const Axis_t fgChargeLast; // Default for fChargeLast (now set to: 199.5 ) 18 static const Int_t fgRmsChargeNbins; // Default for fChargeNBins (now set to: 100 ) 19 static const Axis_t fgRmsChargeFirst; // Default for fChargeFirst (now set to: 0. ) 20 static const Axis_t fgRmsChargeLast; // Default for fChargeLast (now set to: 100. ) 21 static const Int_t fgAbsTimeNbins; // Default for fChargeNBins (now set to: 30 ) 22 static const Axis_t fgAbsTimeFirst; // Default for fChargeFirst (now set to: -0.5 ) 23 static const Axis_t fgAbsTimeLast; // Default for fChargeLast (now set to: 29.5 ) 16 24 17 TH1F fHRmsCharge; // Variance of summed FADC slices25 MCalibrationChargePINDiode *fPINDiode; //! Storage container of the results 18 26 19 static const Int_t fgChargeNbins; 20 static const Axis_t fgChargeFirst; 21 static const Axis_t fgChargeLast; 27 TH1F fHRmsCharge; // Histogram containing Variance of summed FADC slices 22 28 23 static const Int_t fgRmsChargeNbins;24 static const Axis_t fgRmsChargeFirst;25 static const Axis_t fgRmsChargeLast;29 Int_t fRmsChargeNbins; // Number of bins used for the fHRmsCharge 30 Axis_t fRmsChargeFirst; // Lower bound bin used for the fHRmsCharge 31 Axis_t fRmsChargeLast; // Upper bound bin used for the fHRmsCharge 26 32 27 static const Int_t fgAbsTimeNbins; 28 static const Axis_t fgAbsTimeFirst; 29 static const Axis_t fgAbsTimeLast; 33 Float_t fRmsChargeMean; // Mean of the Gauss fit 34 Float_t fRmsChargeSigma; // Sigma of the Gauss fit 35 Float_t fRmsChargeMeanErr; // Error of the mean of the Gauss fit 36 Float_t fRmsChargeSigmaErr; // Error of the sigma of the Gauss fit 30 37 31 Int_t fRmsChargeNbins;32 Axis_t fRmsChargeFirst;33 Axis_t fRmsChargeLast;34 35 Float_t fRmsChargeMean;36 Float_t fRmsChargeMeanErr;37 Float_t fRmsChargeSigma;38 Float_t fRmsChargeSigmaErr;39 40 Float_t fExtractSlices;41 42 38 public: 43 39 … … 45 41 ~MHCalibrationChargePINDiode(){} 46 42 47 void Clear(Option_t *o="");48 void Init();49 50 43 Bool_t SetupFill(const MParList *pList); 51 44 Bool_t ReInit ( MParList *pList); -
trunk/MagicSoft/Mars/mcalib/MHCalibrationChargePix.h
r3612 r3617 24 24 Int_t fPixId; // The pixel ID 25 25 26 TH1F fHAbsTime; // Histogram to hold the absolute arrival times in number of FADC slices26 TH1F fHAbsTime; // Histogram containing the absolute arrival times 27 27 28 28 Int_t fChargeNbins; // Number of bins used for the fHGausHist -
trunk/MagicSoft/Mars/mcalib/MHGausEvents.cc
r3616 r3617 282 282 Bool_t MHGausEvents::FillHist(const Float_t f) 283 283 { 284 285 if (fHGausHist.Fill(f) == -1) 286 return kFALSE; 287 288 return kTRUE; 284 return fHGausHist.Fill(f) > -1; 289 285 } 290 286
Note:
See TracChangeset
for help on using the changeset viewer.