Changeset 8497 for trunk/MagicSoft/Mars/mcalib
- Timestamp:
- 05/11/07 14:35:35 (18 years ago)
- Location:
- trunk/MagicSoft/Mars/mcalib
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/MagicSoft/Mars/mcalib/MCalibrationChargeCam.cc
r8452 r8497 1 1 /* ======================================================================== *\ 2 ! $Name: not supported by cvs2svn $:$Id: MCalibrationChargeCam.cc,v 1.7 0 2007-04-27 10:04:46tbretz Exp $2 ! $Name: not supported by cvs2svn $:$Id: MCalibrationChargeCam.cc,v 1.71 2007-05-11 13:33:40 tbretz Exp $ 3 3 ! -------------------------------------------------------------------------- 4 4 ! … … 460 460 Bool_t MCalibrationChargeCam::GetPixelContent(Double_t &val, Int_t idx, const MGeomCam &cam, Int_t type) const 461 461 { 462 463 if (idx > GetSize()) 464 return kFALSE; 465 466 Float_t area = cam[idx].GetA(); 467 468 if (area == 0) 469 return kFALSE; 470 471 MCalibrationChargePix &pix = (MCalibrationChargePix&)(*this)[idx]; 472 473 switch (type) 462 if (idx > GetSize()) 463 return kFALSE; 464 465 const Float_t area = cam[idx].GetA(); 466 if (area == 0) 467 return kFALSE; 468 469 const MCalibrationChargePix &pix = (MCalibrationChargePix&)(*this)[idx]; 470 switch (type) 474 471 { 475 472 case 0: 476 if (pix.IsExcluded()) 473 if (pix.IsExcluded() || pix.GetConvertedMeanErr()<0) 474 return kFALSE; 475 val = pix.GetConvertedMean(); 476 return kTRUE; 477 case 1: 478 if (pix.IsExcluded() || pix.GetConvertedMeanErr()<0) 479 return kFALSE; 480 val = pix.GetConvertedMeanErr(); 481 return kTRUE; 482 case 2: 483 if (pix.IsExcluded() || pix.GetConvertedSigmaErr()<0) 484 return kFALSE; 485 val = pix.GetConvertedSigma(); 486 return kTRUE; 487 case 3: 488 if (pix.IsExcluded() || pix.GetConvertedSigmaErr()<0) 489 return kFALSE; 490 val = pix.GetConvertedSigmaErr(); 491 return kTRUE; 492 case 4: 493 if (pix.IsExcluded()) 494 return kFALSE; 495 val = pix.GetProb(); 496 return val>=0; 497 case 5: 498 if (!pix.IsFFactorMethodValid()) 499 return kFALSE; 500 if (pix.GetRSigma() == -1.) 501 return kFALSE; 502 val = pix.GetConvertedRSigma(); 503 break; 504 case 6: 505 if (!pix.IsFFactorMethodValid()) 506 return kFALSE; 507 if (pix.GetRSigma() == -1.) 508 return kFALSE; 509 val = pix.GetConvertedRSigmaErr(); 510 break; 511 case 7: 512 if (!pix.IsFFactorMethodValid()) 513 return kFALSE; 514 val = pix.GetRSigmaPerCharge(); 515 break; 516 case 8: 517 if (!pix.IsFFactorMethodValid()) 518 return kFALSE; 519 val = pix.GetRSigmaPerChargeErr(); 520 break; 521 case 9: 522 // if (!pix.IsFFactorMethodValid()) 523 // return kFALSE; 524 if (pix.IsExcluded() || pix.GetPheFFactorMethodErr()<0) 525 return kFALSE; 526 val = pix.GetPheFFactorMethod(); 527 return kTRUE; 528 case 10: 529 // if (!pix.IsFFactorMethodValid()) 530 // return kFALSE; 531 if (pix.IsExcluded() || pix.GetPheFFactorMethodErr()<=0) 532 return kFALSE; 533 val = pix.GetPheFFactorMethodErr(); 534 return kTRUE; 535 case 11: 536 // if (!pix.IsFFactorMethodValid()) 537 // return kFALSE; 538 if (pix.IsExcluded() || pix.GetMeanConvFADC2PheErr()<0) 539 return kFALSE; 540 val = pix.GetMeanConvFADC2Phe(); 541 return kTRUE; 542 case 12: 543 // if (!pix.IsFFactorMethodValid()) 544 // return kFALSE; 545 if (pix.IsExcluded() || pix.GetMeanConvFADC2PheErr()<=0) 546 return kFALSE; 547 val = pix.GetMeanConvFADC2PheErr(); 548 return kTRUE; 549 case 13: 550 // if (!pix.IsFFactorMethodValid()) 551 // return kFALSE; 552 if (pix.IsExcluded()) 553 return kFALSE; 554 val = pix.GetMeanFFactorFADC2Phot(); 555 break; 556 case 14: 557 // if (!pix.IsFFactorMethodValid()) 558 // return kFALSE; 559 if (pix.IsExcluded()) 560 return kFALSE; 561 val = pix.GetMeanFFactorFADC2PhotErr(); 562 if (val <= 0.) 563 val = 0.00001; 564 break; 565 case 15: 566 if (pix.IsExcluded()) 567 return kFALSE; 568 if (!pix.IsFFactorMethodValid()) 569 return kFALSE; 570 val = 1; 571 return kTRUE; 572 case 16: 573 if (pix.IsExcluded()) 574 return kFALSE; 575 val = pix.GetHiLoMeansDivided(); 576 break; 577 case 17: 578 if (pix.IsExcluded()) 579 return kFALSE; 580 val = pix.GetHiLoMeansDividedErr(); 581 break; 582 case 18: 583 if (pix.IsExcluded()) 584 return kFALSE; 585 val = pix.GetHiLoSigmasDivided(); 586 break; 587 case 19: 588 if (pix.IsExcluded()) 589 return kFALSE; 590 val = pix.GetHiLoSigmasDividedErr(); 591 break; 592 case 20: 593 if (!pix.IsExcluded()) 594 return kFALSE; 595 val = 1.; 596 return kTRUE; 597 case 21: 598 if (pix.IsExcluded()) 599 return kFALSE; 600 val = pix.GetHiGainNumPickup(); 601 break; 602 case 22: 603 if (pix.IsExcluded()) 604 return kFALSE; 605 val = pix.GetLoGainNumPickup(); 606 break; 607 case 23: 608 if (pix.IsExcluded()) 609 return kFALSE; 610 val = pix.GetHiGainNumBlackout(); 611 break; 612 case 24: 613 if (pix.IsExcluded()) 614 return kFALSE; 615 val = pix.GetLoGainNumBlackout(); 616 break; 617 case 25: 618 if (pix.IsExcluded()) 619 return kFALSE; 620 val = pix.IsHiGainSaturation(); 621 break; 622 case 26: 623 if (pix.IsExcluded()) 624 return kFALSE; 625 val = pix.GetAbsTimeMean(); 626 break; 627 case 27: 628 if (pix.IsExcluded()) 629 return kFALSE; 630 val = pix.GetAbsTimeRms(); 631 break; 632 case 28: 633 if (pix.IsExcluded()) 634 return kFALSE; 635 val = pix.GetPed(); 636 break; 637 case 29: 638 if (pix.IsExcluded()) 639 return kFALSE; 640 val = pix.GetPedErr(); 641 break; 642 case 30: 643 if (pix.IsExcluded()) 644 return kFALSE; 645 val = pix.GetPedRms(); 646 break; 647 case 31: 648 if (pix.IsExcluded()) 649 return kFALSE; 650 val = pix.GetPedErr()/2.; 651 break; 652 case 32: 653 if (pix.IsExcluded() || pix.GetRms()<0) 654 return kFALSE; 655 val = pix.GetMean() == 0. ? 0. : pix.GetRms()/pix.GetMean(); 656 return kTRUE; 657 case 33: 658 if (pix.IsExcluded() || pix.GetRms()<0) 659 return kFALSE; 660 if (pix.GetMean() == 0.) 661 val = 0.; 662 else 663 val = pix.GetSigmaErr()/pix.GetMean() + pix.GetRms()*pix.GetMeanErr()/pix.GetMean()/pix.GetMean(); 664 return kTRUE; 665 default: 477 666 return kFALSE; 478 val = pix.GetConvertedMean(); 479 break; 480 case 1: 481 if (pix.IsExcluded()) 482 return kFALSE; 483 val = pix.GetConvertedMeanErr(); 484 break; 485 case 2: 486 if (pix.IsExcluded()) 487 return kFALSE; 488 val = pix.GetConvertedSigma(); 489 break; 490 case 3: 491 if (pix.IsExcluded()) 492 return kFALSE; 493 val = pix.GetConvertedSigmaErr(); 494 break; 495 case 4: 496 if (pix.IsExcluded()) 497 return kFALSE; 498 val = pix.GetProb(); 499 break; 500 case 5: 501 if (!pix.IsFFactorMethodValid()) 502 return kFALSE; 503 if (pix.GetRSigma() == -1.) 504 return kFALSE; 505 val = pix.GetConvertedRSigma(); 506 break; 507 case 6: 508 if (!pix.IsFFactorMethodValid()) 509 return kFALSE; 510 if (pix.GetRSigma() == -1.) 511 return kFALSE; 512 val = pix.GetConvertedRSigmaErr(); 513 break; 514 case 7: 515 if (!pix.IsFFactorMethodValid()) 516 return kFALSE; 517 val = pix.GetRSigmaPerCharge(); 518 break; 519 case 8: 520 if (!pix.IsFFactorMethodValid()) 521 return kFALSE; 522 val = pix.GetRSigmaPerChargeErr(); 523 break; 524 case 9: 525 // if (!pix.IsFFactorMethodValid()) 526 // return kFALSE; 527 if (pix.IsExcluded()) 528 return kFALSE; 529 val = pix.GetPheFFactorMethod(); 530 break; 531 case 10: 532 // if (!pix.IsFFactorMethodValid()) 533 // return kFALSE; 534 if (pix.IsExcluded()) 535 return kFALSE; 536 val = pix.GetPheFFactorMethodErr(); 537 if (val < 0.) 538 val = 0.00001; 539 break; 540 case 11: 541 // if (!pix.IsFFactorMethodValid()) 542 // return kFALSE; 543 if (pix.IsExcluded()) 544 return kFALSE; 545 val = pix.GetMeanConvFADC2Phe(); 546 break; 547 case 12: 548 // if (!pix.IsFFactorMethodValid()) 549 // return kFALSE; 550 if (pix.IsExcluded()) 551 return kFALSE; 552 val = pix.GetMeanConvFADC2PheErr(); 553 if (val < 0.) 554 val = 0.00001; 555 break; 556 case 13: 557 // if (!pix.IsFFactorMethodValid()) 558 // return kFALSE; 559 if (pix.IsExcluded()) 560 return kFALSE; 561 val = pix.GetMeanFFactorFADC2Phot(); 562 break; 563 case 14: 564 // if (!pix.IsFFactorMethodValid()) 565 // return kFALSE; 566 if (pix.IsExcluded()) 567 return kFALSE; 568 val = pix.GetMeanFFactorFADC2PhotErr(); 569 if (val < 0.) 570 val = 0.00001; 571 break; 572 case 15: 573 if (pix.IsExcluded()) 574 return kFALSE; 575 if (pix.IsFFactorMethodValid()) 576 val = 1; 577 else 578 return kFALSE; 579 break; 580 case 16: 581 if (pix.IsExcluded()) 582 return kFALSE; 583 val = pix.GetHiLoMeansDivided(); 584 break; 585 case 17: 586 if (pix.IsExcluded()) 587 return kFALSE; 588 val = pix.GetHiLoMeansDividedErr(); 589 break; 590 case 18: 591 if (pix.IsExcluded()) 592 return kFALSE; 593 val = pix.GetHiLoSigmasDivided(); 594 break; 595 case 19: 596 if (pix.IsExcluded()) 597 return kFALSE; 598 val = pix.GetHiLoSigmasDividedErr(); 599 break; 600 case 20: 601 if (pix.IsExcluded()) 602 val = 1.; 603 else 604 return kFALSE; 605 break; 606 case 21: 607 if (pix.IsExcluded()) 608 return kFALSE; 609 val = pix.GetHiGainNumPickup(); 610 break; 611 case 22: 612 if (pix.IsExcluded()) 613 return kFALSE; 614 val = pix.GetLoGainNumPickup(); 615 break; 616 case 23: 617 if (pix.IsExcluded()) 618 return kFALSE; 619 val = pix.GetHiGainNumBlackout(); 620 break; 621 case 24: 622 if (pix.IsExcluded()) 623 return kFALSE; 624 val = pix.GetLoGainNumBlackout(); 625 break; 626 case 25: 627 if (pix.IsExcluded()) 628 return kFALSE; 629 val = pix.IsHiGainSaturation(); 630 break; 631 case 26: 632 if (pix.IsExcluded()) 633 return kFALSE; 634 val = pix.GetAbsTimeMean(); 635 break; 636 case 27: 637 if (pix.IsExcluded()) 638 return kFALSE; 639 val = pix.GetAbsTimeRms(); 640 break; 641 case 28: 642 if (pix.IsExcluded()) 643 return kFALSE; 644 val = pix.GetPed(); 645 break; 646 case 29: 647 if (pix.IsExcluded()) 648 return kFALSE; 649 val = pix.GetPedErr(); 650 break; 651 case 30: 652 if (pix.IsExcluded()) 653 return kFALSE; 654 val = pix.GetPedRms(); 655 break; 656 case 31: 657 if (pix.IsExcluded()) 658 return kFALSE; 659 val = pix.GetPedErr()/2.; 660 break; 661 case 32: 662 if (pix.IsExcluded()) 663 return kFALSE; 664 val = pix.GetMean() == 0. ? 0. : pix.GetRms()/pix.GetMean(); 665 break; 666 case 33: 667 if (pix.IsExcluded()) 668 return kFALSE; 669 if (pix.GetMean() == 0.) 670 val = 0.; 671 else 672 val = pix.GetSigmaErr()/pix.GetMean() + pix.GetRms()/pix.GetMean()/pix.GetMean()*pix.GetMeanErr(); 673 break; 674 default: 675 return kFALSE; 676 } 677 678 return val!=-1.; 679 } 680 667 } 668 669 return val!=-1.; 670 } 681 671 682 672 Bool_t MCalibrationChargeCam::GetConversionFactorFFactor(Int_t ipx, Float_t &mean, Float_t &ferr, Float_t &ffactor) -
trunk/MagicSoft/Mars/mcalib/MCalibrationRelTimeCam.cc
r8452 r8497 219 219 Bool_t MCalibrationRelTimeCam::GetPixelContent(Double_t &val, Int_t idx, const MGeomCam &cam, Int_t type) const 220 220 { 221 222 if (idx > GetSize()) 223 return kFALSE; 224 225 Float_t area = cam[idx].GetA(); 226 227 if (area == 0) 228 return kFALSE; 229 230 MCalibrationRelTimePix &pix = (MCalibrationRelTimePix&)(*this)[idx]; 231 232 switch (type) 221 if (idx > GetSize()) 222 return kFALSE; 223 224 const Float_t area = cam[idx].GetA(); 225 if (area == 0) 226 return kFALSE; 227 228 const MCalibrationRelTimePix &pix = (MCalibrationRelTimePix&)(*this)[idx]; 229 switch (type) 233 230 { 234 231 case 0: 235 if (pix.IsExcluded()) 232 if (pix.IsExcluded() || pix.GetMeanErr()<0) 233 return kFALSE; 234 val = pix.GetMean(); 235 return kTRUE; 236 case 1: 237 if (pix.IsExcluded() || pix.GetMeanErr()<0) 238 return kFALSE; 239 val = pix.GetMeanErr(); 240 return kTRUE; 241 case 2: 242 if (pix.IsExcluded() || pix.GetSigmaErr()<0) 243 return kFALSE; 244 val = pix.GetSigma(); 245 return kTRUE; 246 case 3: 247 if (pix.IsExcluded() || pix.GetSigmaErr()<0) 248 return kFALSE; 249 val = pix.GetSigmaErr(); 250 return kTRUE; 251 case 4: 252 if (pix.IsExcluded()) 253 return kFALSE; 254 val = pix.GetProb(); 255 return val>=0; 256 default: 236 257 return kFALSE; 237 val = pix.GetMean();238 return val!=-1.;239 case 1:240 if (pix.IsExcluded())241 return kFALSE;242 val = pix.GetMeanErr();243 break;244 case 2:245 if (pix.IsExcluded())246 return kFALSE;247 val = pix.GetSigma();248 break;249 case 3:250 if (pix.IsExcluded())251 return kFALSE;252 val = pix.GetSigmaErr();253 break;254 case 4:255 if (pix.IsExcluded())256 return kFALSE;257 val = pix.GetProb();258 break;259 default:260 return kFALSE;261 258 } 262 259 263 return val>=0;264 265 } 266 260 return kFALSE; 261 262 } 263
Note:
See TracChangeset
for help on using the changeset viewer.