Changeset 2641 for trunk/MagicSoft
- Timestamp:
- 12/11/03 14:01:52 (21 years ago)
- Location:
- trunk/MagicSoft/Mars
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/MagicSoft/Mars/Changelog
r2640 r2641 9 9 - calculate signal with only 6 most significant slices (2 before, 4 after the maximum) 10 10 11 * mhist/MHCalibrationBlindPixel: 12 - do the consistency check fitting the pedestal 13 14 * mhist/MHCalibrationPixel: 15 - store Hi Gain vs. Lo Gain values to extract the conversion factor 11 16 12 17 2003/12/11: Thomas Bretz -
trunk/MagicSoft/Mars/manalysis/MExtractedSignalPix.cc
r2627 r2641 41 41 42 42 MExtractedSignalPix::MExtractedSignalPix(const char* name, const char* title) 43 : fExtractedSignal(-1.), 44 fExtractedSignalError(-1.), 43 : fExtractedSignalHiGain(-1.), 44 fExtractedSignalHiGainError(-1.), 45 fExtractedSignalLoGain(-1.), 46 fExtractedSignalLoGainError(-1.), 45 47 fIsLoGainUsed(kFALSE), 46 48 fNumHiGainSaturated(0), … … 62 64 { 63 65 64 fExtractedSignal = -1.;65 fExtractedSignal Error = -1.;66 fExtractedSignalHiGain = -1.; 67 fExtractedSignalHiGainError = -1.; 66 68 fIsLoGainUsed = kFALSE; 67 69 fNumHiGainSaturated = 0; … … 75 77 *fLog << all << GetDescriptor() << ":" << endl; 76 78 77 *fLog << " Signal: " << fExtractedSignal 78 << " +- " << fExtractedSignal Error79 *fLog << " Signal: " << fExtractedSignalHiGain 80 << " +- " << fExtractedSignalHiGainError 79 81 << " LoGain? " << fIsLoGainUsed 80 82 << " Nr. Sat. Hi Gain: " << fNumHiGainSaturated -
trunk/MagicSoft/Mars/manalysis/MExtractedSignalPix.h
r2634 r2641 10 10 private: 11 11 12 Float_t fExtractedSignal; // mean value of the extracted signal 13 Float_t fExtractedSignalError; // error of the mean value of the extracted signal 12 Float_t fExtractedSignalHiGain; // mean value of the extracted signal 13 Float_t fExtractedSignalHiGainError; // error of the mean value of the extracted signal 14 Float_t fExtractedSignalLoGain; // mean value of the extracted signal 15 Float_t fExtractedSignalLoGainError; // error of the mean value of the extracted signal 14 16 Bool_t fIsLoGainUsed; 15 17 Byte_t fNumHiGainSaturated; … … 25 27 void Clear(Option_t *o=""); 26 28 27 Float_t GetExtractedSignal() const { return fExtractedSignal; } 28 Float_t GetExtractedSignalError() const { return fExtractedSignalError; } 29 Float_t GetExtractedSignalHiGain() const { return fExtractedSignalHiGain; } 30 Float_t GetExtractedSignalHiGainError() const { return fExtractedSignalHiGainError; } 31 32 Float_t GetExtractedSignalLoGain() const { return fExtractedSignalLoGain; } 33 Float_t GetExtractedSignalLoGainError() const { return fExtractedSignalLoGainError; } 29 34 30 35 Float_t GetMeanArrivalTime() const { return fMeanArrivalTime; } … … 33 38 void SetExtractedSignal(Float_t sig, Float_t sigerr) 34 39 { 35 fExtractedSignal = sig; 36 fExtractedSignalError = sigerr; 40 fExtractedSignalHiGain = sig; 41 fExtractedSignalHiGainError = sigerr; 42 } 43 44 void SetExtractedSignal(Float_t sighi, Float_t sighierr,Float_t siglo, Float_t sigloerr) 45 { 46 fExtractedSignalHiGain = sighi; 47 fExtractedSignalHiGainError = sighierr; 48 fExtractedSignalLoGain = siglo; 49 fExtractedSignalLoGainError = sigloerr; 37 50 } 38 51 … … 49 62 Bool_t IsLoGainUsed() { return fIsLoGainUsed; } 50 63 51 Bool_t IsValid() const { return fExtractedSignal >= 0 || fExtractedSignalError >= 0; }64 Bool_t IsValid() const { return fExtractedSignalHiGain >= 0. || fExtractedSignalHiGainError >= 0.; } 52 65 53 66 void PrintOut(); -
trunk/MagicSoft/Mars/mhist/MHCalibrationBlindPixel.cc
r2627 r2641 62 62 // 63 63 MHCalibrationBlindPixel::MHCalibrationBlindPixel(const char *name, const char *title) 64 : fSinglePheFit(NULL), fTimeGausFit(NULL) 64 : fSinglePheFit(NULL), fTimeGausFit(NULL), fSinglePhePedFit(NULL), 65 fLambda(0.), fMu0(0.), fMu1(0.), fSigma0(0.), fSigma1(0.), 66 fLambdaErr(0.), fMu0Err(0.), fMu1Err(0.), fSigma0Err(0.), fSigma1Err(0.), 67 fChisquare(0.), fProb(0.), fNdf(0), 68 fMeanTime(0.), fMeanTimeErr(0.), fSigmaTime(0.), fSigmaTimeErr(0.), 69 fLambdaCheck(0.), fLambdaCheckErr(0.) 65 70 { 66 71 … … 77 82 fHBlindPixelCharge->SetXTitle("Sum FADC Slices"); 78 83 fHBlindPixelCharge->SetYTitle("Nr. of events"); 79 fHBlindPixelCharge->Sumw2();84 // fHBlindPixelCharge->Sumw2(); 80 85 81 86 fErrBlindPixelChargefirst = 0.; … … 120 125 if (fSinglePheFit) 121 126 delete fSinglePheFit; 127 if (fSinglePhePedFit) 128 delete fSinglePhePedFit; 122 129 if (fTimeGausFit) 123 130 delete fTimeGausFit; … … 155 162 fFitLegend->AddText(line1); 156 163 164 const TString line6 = 165 Form("Mean #lambda (check) = %2.2f #pm %2.2f",GetLambdaCheck(),GetLambdaCheckErr()); 166 fFitLegend->AddText(line6); 167 157 168 const TString line2 = 158 169 Form("Pedestal: #mu_{0} = %2.2f #pm %2.2f",GetMu0(),GetMu0Err()); … … 215 226 { 216 227 if (fFitOK) 217 228 fSinglePheFit->SetLineColor(kGreen); 218 229 else 219 230 fSinglePheFit->SetLineColor(kRed); … … 222 233 c->Modified(); 223 234 c->Update(); 235 236 if (fSinglePhePedFit) 237 { 238 fSinglePhePedFit->SetLineColor(kBlue); 239 fSinglePhePedFit->DrawCopy("same"); 240 } 224 241 } 242 225 243 226 244 c->cd(2); … … 311 329 // otherwise the fit goes gaga because of high number of dimensions ... 312 330 // 313 const Stat_t entries = fHBlindPixelCharge->Get SumOfWeights();314 const Double_t lambda_guess = 0. 2;331 const Stat_t entries = fHBlindPixelCharge->GetEntries(); 332 const Double_t lambda_guess = 0.5; 315 333 const Double_t mu_0_guess = fHBlindPixelCharge->GetBinCenter(fHBlindPixelCharge->GetMaximumBin()); 316 const Double_t si_0_guess = mu_0_guess/5.;317 const Double_t mu_1_guess = mu_0_guess + 50.;334 const Double_t si_0_guess = 20.; 335 const Double_t mu_1_guess = mu_0_guess + 100.; 318 336 const Double_t si_1_guess = si_0_guess + si_0_guess; 319 337 … … 321 339 fSinglePheFit->SetParameters(lambda_guess,mu_0_guess,mu_1_guess,si_0_guess,si_1_guess,entries); 322 340 fSinglePheFit->SetParNames("#lambda","#mu_0","#mu_1","#sigma_0","#sigma_1","area"); 323 fSinglePheFit->SetParLimits(0,0., 5.);341 fSinglePheFit->SetParLimits(0,0.,3.); 324 342 fSinglePheFit->SetParLimits(1,rmin,rmax); 325 343 fSinglePheFit->SetParLimits(2,rmin,rmax); 326 344 fSinglePheFit->SetParLimits(3,1.0,rmax-rmin); 327 345 fSinglePheFit->SetParLimits(4,1.7,rmax-rmin); 328 fSinglePheFit->SetParLimits(5,0., 2.5*entries);346 fSinglePheFit->SetParLimits(5,0.,1.5*entries); 329 347 // 330 348 // Normalize the histogram to facilitate faster fitting of the area … … 355 373 356 374 fHBlindPixelCharge->Fit(fSinglePheFit,opt); 375 fHBlindPixelCharge->Fit(fSinglePheFit,opt); 357 376 358 377 fLambda = fSinglePheFit->GetParameter(0); … … 372 391 fNdf = fSinglePheFit->GetNDF(); 373 392 393 // Perform the cross-check fitting only the pedestal: 394 fSinglePhePedFit = new TF1("GausPed","gaus",rmin,fMu0); 395 fHBlindPixelCharge->Fit(fSinglePhePedFit,opt); 396 397 Double_t pedarea = fSinglePhePedFit->GetParameter(0)*gkSq2Pi*fSinglePhePedFit->GetParameter(2); 398 cout << "Parameter0: " << fSinglePhePedFit->GetParameter(0) << endl; 399 cout << "Parameter2: " << fSinglePhePedFit->GetParameter(2) << endl; 400 cout << "Pedarea: " << pedarea << endl; 401 cout << "entries: " << entries << endl; 402 fLambdaCheck = TMath::Log((double)entries/pedarea); 403 fLambdaCheckErr = fSinglePhePedFit->GetParError(0)/fSinglePhePedFit->GetParameter(0) 404 + fSinglePhePedFit->GetParError(2)/fSinglePhePedFit->GetParameter(2); 405 374 406 *fLog << "Results of the Blind Pixel Fit: " << endl; 375 407 *fLog << "Chisquare: " << fChisquare << endl; … … 380 412 // 381 413 // The fit result is accepted under condition 382 // The Probability is greater than gkProbLimit (default 0.01 == 99%) 414 // The fit result is accepted under condition 415 // The Probability is greater than gkProbLimit (default 0.001 == 99.7%) 383 416 // 384 417 if (fProb < gkProbLimit)
Note:
See TracChangeset
for help on using the changeset viewer.