Changeset 4186
- Timestamp:
- 05/25/04 20:30:33 (21 years ago)
- Location:
- trunk/MagicSoft/Mars/mcalib
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/MagicSoft/Mars/mcalib/MCalibrationChargePix.cc
r4163 r4186 62 62 // Low-Gain variables are stored internally unconverted, i.e. directly from the summed 63 63 // FADC slices extraction results, but can be retrieved converted to High-Gain amplifications 64 // by calls to: GetConverted LoGainMean() or GetConvertedLoGainSigma()64 // by calls to: GetConvertedMean() or GetConvertedSigma() 65 65 // 66 66 // See also: MCalibrationChargeCam, MCalibrationChargeCalc, … … 306 306 // -------------------------------------------------------------------------- 307 307 // 308 // Get the Low Gain Mean converted to High Gain amplification: 309 // Returns fLoGainMean multiplied with fConversionHiLo 310 // 311 Float_t MCalibrationChargePix::GetConvertedLoGainMean() const 312 { 313 return fLoGainMean * fConversionHiLo; 308 // Get the Low Gain Mean Charge converted to High Gain amplification: 309 // Returns fLoGainMean multiplied with fConversionHiLo if IsHiGainSaturation(), 310 // else return fHiGainMean 311 // 312 Float_t MCalibrationChargePix::GetConvertedMean() const 313 { 314 315 if (IsHiGainSaturation()) 316 return fLoGainMean * fConversionHiLo; 317 318 return fHiGainMean; 314 319 } 315 320 … … 321 326 // 322 327 // Returns the square root of the quadratic sum of the relative variances of 323 // the fLoGainMean and fConversionHiLo, mulitplied with GetConvertedLoGainMean() 324 // 325 Float_t MCalibrationChargePix::GetConvertedLoGainMeanErr() const 326 { 327 328 const Float_t logainrelvar = GetLoGainMeanRelVar(); 329 330 if (logainrelvar < 0.) 331 return -1.; 332 333 return TMath::Sqrt(logainrelvar + GetConversionHiLoRelVar()) * GetConvertedLoGainMean(); 328 // the fLoGainMean and fConversionHiLo, mulitplied with GetConvertedMean() 329 // in case of HiGain Saturation, 330 // else return GetMeanErr() 331 // 332 Float_t MCalibrationChargePix::GetConvertedMeanErr() const 333 { 334 335 if (IsHiGainSaturation()) 336 { 337 const Float_t logainrelvar = GetLoGainMeanRelVar(); 338 339 if (logainrelvar < 0.) 340 return -1.; 341 342 return TMath::Sqrt(logainrelvar + GetConversionHiLoRelVar()) * GetConvertedMean(); 343 } 344 else 345 return GetMeanErr(); 346 334 347 } 335 348 … … 337 350 // 338 351 // Get the Low Gain Sigma converted to High Gain amplification: 339 // Returns fLoGainSigma multiplied with fConversionHiLo 340 // 341 Float_t MCalibrationChargePix::GetConvertedLoGainSigma() const 342 { 343 return fLoGainSigma * fConversionHiLo; 344 } 345 346 // -------------------------------------------------------------------------- 347 // 348 // Get the Error of the converted Low Gain Sigma: 352 // Returns fLoGainSigma multiplied with fConversionHiLo if IsHiGainSaturation() 353 // else return fHiGainSigma 354 // 355 Float_t MCalibrationChargePix::GetConvertedSigma() const 356 { 357 358 if (IsHiGainSaturation()) 359 return fLoGainSigma * fConversionHiLo; 360 else 361 return fHiGainSigma; 362 } 363 364 // -------------------------------------------------------------------------- 365 // 366 // Get the Error of the converted Sigma: 349 367 // 350 368 // Returns -1 if the variable fLoGainSigma or fLoGainSigmaVar are smaller than 0. 351 369 // 352 // Returns the square root of the quadratic sum of the relative variances of 353 // the fLoGainSigma and fConversionHiLo, mulitplied with GetConvertedLoGainSigma() 354 // 355 Float_t MCalibrationChargePix::GetConvertedLoGainSigmaErr() const 356 { 357 358 if (fLoGainSigmaVar < 0.) 359 return -1.; 360 361 if (fLoGainSigma < 0.) 362 return -1.; 363 364 const Float_t sigmaRelVar = fLoGainSigmaVar 370 // if IsHiGainSaturatio() 371 // returns the square root of the quadratic sum of the relative variances of 372 // the fLoGainSigma and fConversionHiLo, mulitplied with GetConvertedSigma() 373 // else returns GetSigmaErr() 374 // 375 Float_t MCalibrationChargePix::GetConvertedSigmaErr() const 376 { 377 378 if (IsHiGainSaturation()) 379 { 380 if (fLoGainSigmaVar < 0.) 381 return -1.; 382 383 if (fLoGainSigma < 0.) 384 return -1.; 385 386 const Float_t sigmaRelVar = fLoGainSigmaVar 365 387 /( fLoGainSigma * fLoGainSigma ); 366 388 367 return TMath::Sqrt(sigmaRelVar+GetConversionHiLoRelVar()) * GetConvertedLoGainSigma(); 368 } 369 370 389 return TMath::Sqrt(sigmaRelVar+GetConversionHiLoRelVar()) * GetConvertedSigma(); 390 } 391 else 392 return GetSigmaErr(); 393 394 395 } 396 397 // -------------------------------------------------------------------------- 398 // 399 // Get the converted reduced Sigma: 400 // - If fRSigmaSquare is smaller than 0 (i.e. has not yet been set), return -1. 401 // - Test bit kHiGainSaturation: 402 // If yes, return square root of fRSigmaSquare, multiplied with fConversionHiLo, 403 // If no , return square root of fRSigmaSquare 404 // 405 Float_t MCalibrationChargePix::GetConvertedRSigma() const 406 { 407 if (fRSigmaSquare < 0) 408 return -1; 409 410 const Float_t rsigma = TMath::Sqrt(fRSigmaSquare); 411 412 return IsHiGainSaturation() ? rsigma*fConversionHiLo : rsigma ; 413 } 414 415 // -------------------------------------------------------------------------- 416 // 417 // Get the error of the converted reduced Sigma: 418 // - If fRSigmaSquareVar is smaller than 0 (i.e. has not yet been set), return -1. 419 // - Calculate the absolute variance of the reduced sigma with the formula: 420 // reduced sigma variance = 0.25 * fRSigmaSquareVar / fRSigmaSquare 421 // - Test bit kHiGainSaturation: 422 // If yes, returns the square root of the quadratic sum of the relative variances of the 423 // reduced sigma and fConversionHiLo, mulitplied with GetRSigma() 424 // Else returns the square root of rel. (0.25*fRSigmaSquareVar / fRSigmaSquare) 425 // 426 Float_t MCalibrationChargePix::GetConvertedRSigmaErr() const 427 { 428 429 if (fRSigmaSquareVar < 0) 430 return -1; 431 432 // 433 // SigmaSquareVar = 4. * Sigma * Sigma * Var(sigma) 434 // ==> Var(sigma) = 0.25 * SigmaSquareVar / (Sigma * Sigma) 435 // 436 const Float_t rsigmaVar = 0.25 * fRSigmaSquareVar / fRSigmaSquare; 437 438 if (IsHiGainSaturation()) 439 return TMath::Sqrt(rsigmaVar/fRSigmaSquare + GetConversionHiLoRelVar()) * GetRSigma(); 440 else 441 return TMath::Sqrt(rsigmaVar); 442 443 } 371 444 372 445 // -------------------------------------------------------------------------- … … 383 456 return -1; 384 457 385 const Float_t rsigma = TMath::Sqrt(fRSigmaSquare); 386 387 return IsHiGainSaturation() ? rsigma*fConversionHiLo : rsigma ; 458 return TMath::Sqrt(fRSigmaSquare); 459 388 460 } 389 461 … … 409 481 // ==> Var(sigma) = 0.25 * SigmaSquareVar / (Sigma * Sigma) 410 482 // 411 const Float_t rsigmaVar = 0.25 * fRSigmaSquareVar / fRSigmaSquare; 412 413 if (IsHiGainSaturation()) 414 return TMath::Sqrt(rsigmaVar/fRSigmaSquare + GetConversionHiLoRelVar()) * GetRSigma(); 415 else 416 return TMath::Sqrt(rsigmaVar); 483 return TMath::Sqrt(0.25 * fRSigmaSquareVar / fRSigmaSquare); 417 484 418 485 } … … 475 542 // If no , return fRSigmaSquare 476 543 // 477 Float_t MCalibrationChargePix::Get RSigmaSquare() const544 Float_t MCalibrationChargePix::GetConvertedRSigmaSquare() const 478 545 { 479 546 if (fRSigmaSquare < 0) … … 503 570 // ==> Var(sigma) = 0.25 * SigmaSquareVar / (Sigma * Sigma) 504 571 // 505 const Float_t rsigmaRelVar = 0.25 * fRSigmaSquareVar / ( fRSigmaSquare * fRSigmaSquare ); 506 507 if (IsHiGainSaturation()) 508 return rsigmaRelVar + GetConversionHiLoRelVar(); 509 else 510 return rsigmaRelVar; 572 return 0.25 * fRSigmaSquareVar / ( fRSigmaSquare * fRSigmaSquare ); 573 511 574 } 512 575 … … 699 762 return kFALSE; 700 763 701 fMeanConvFADC2Phe = fPheFFactorMethod / Get Mean();764 fMeanConvFADC2Phe = fPheFFactorMethod / GetConvertedMean(); 702 765 703 766 if (fMeanConvFADC2Phe < 0. ) -
trunk/MagicSoft/Mars/mcalib/MCalibrationChargePix.h
r4130 r4186 75 75 Float_t GetConversionHiLo () const { return fConversionHiLo; } 76 76 Float_t GetConversionHiLoErr () const; 77 Float_t GetConvertedLoGainMean () const; 78 Float_t GetConvertedLoGainMeanErr () const; 79 Float_t GetConvertedLoGainSigma () const; 80 Float_t GetConvertedLoGainSigmaErr () const; 77 Float_t GetConvertedMean () const; 78 Float_t GetConvertedMeanErr () const; 79 Float_t GetConvertedSigma () const; 80 Float_t GetConvertedSigmaErr () const; 81 Float_t GetConvertedRSigma () const; 82 Float_t GetConvertedRSigmaErr () const; 83 Float_t GetConvertedRSigmaSquare () const; 81 84 Float_t GetMeanConvFADC2Phe () const { return fMeanConvFADC2Phe; } 82 85 Float_t GetMeanConvFADC2PheErr () const; … … 95 98 Float_t GetRSigma () const; 96 99 Float_t GetRSigmaErr () const; 100 Float_t GetRSigmaRelVar () const; 97 101 Float_t GetRSigmaPerCharge () const; 98 102 Float_t GetRSigmaPerChargeErr () const; 99 Float_t GetRSigmaSquare () const;100 Float_t GetRSigmaRelVar () const;101 103 102 104 Bool_t IsFFactorMethodValid () const;
Note:
See TracChangeset
for help on using the changeset viewer.