Changeset 4641 for trunk/MagicSoft
- Timestamp:
- 08/17/04 09:50:03 (20 years ago)
- Location:
- trunk/MagicSoft/Mars
- Files:
-
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/MagicSoft/Mars/mbadpixels/MBadPixelsCam.cc
r4637 r4641 474 474 return (*this)[idx].GetInfo()[0]; 475 475 case 1: 476 if ((*this)[idx].IsUnsuitable(MBadPixelsPix::kUnsuitableRun)) 477 val = 1; 478 else 479 return kFALSE; 476 if (!(*this)[idx].IsUnsuitable(MBadPixelsPix::kUnsuitableRun)) 477 return kFALSE; 478 val = 1; 480 479 break; 481 480 case 2: 482 if ((*this)[idx].IsUnsuitable(MBadPixelsPix::kUnsuitableEvt)) 483 val = 1; 484 else 485 return kFALSE; 481 if (!(*this)[idx].IsUnsuitable(MBadPixelsPix::kUnsuitableEvt)) 482 return kFALSE; 483 val = 1; 486 484 break; 487 485 case 3: 488 if ((*this)[idx].IsUnsuitable(MBadPixelsPix::kUnreliableRun)) 489 val = 1; 490 else 491 return kFALSE; 486 if (!(*this)[idx].IsUnsuitable(MBadPixelsPix::kUnreliableRun)) 487 return kFALSE; 488 val = 1; 492 489 break; 493 490 case 4: 494 if ((*this)[idx].IsHiGainBad()) 495 val = 1; 496 else 497 return kFALSE; 491 if (!(*this)[idx].IsHiGainBad()) 492 return kFALSE; 493 val = 1; 498 494 break; 499 495 case 5: 500 if ((*this)[idx].IsLoGainBad()) 501 val = 1; 502 else 503 return kFALSE; 496 if (!(*this)[idx].IsLoGainBad()) 497 return kFALSE; 498 val = 1; 504 499 break; 505 500 case 6: … … 516 511 break; 517 512 case 8: 518 if ((*this)[idx].IsUncalibrated(MBadPixelsPix::kHiGainNotFitted)) 519 val = 1; 520 else 521 return kFALSE; 513 if (!(*this)[idx].IsUncalibrated(MBadPixelsPix::kHiGainNotFitted)) 514 return kFALSE; 515 val = 1; 522 516 break; 523 517 case 9: 524 if ((*this)[idx].IsUncalibrated(MBadPixelsPix::kLoGainNotFitted)) 525 val = 1; 526 else 527 return kFALSE; 518 if (!(*this)[idx].IsUncalibrated(MBadPixelsPix::kLoGainNotFitted)) 519 return kFALSE; 520 val = 1; 528 521 break; 529 522 case 10: 530 if ((*this)[idx].IsUncalibrated(MBadPixelsPix::kHiGainOscillating)) 531 val = 1; 532 else 533 return kFALSE; 523 if (!(*this)[idx].IsUncalibrated(MBadPixelsPix::kHiGainOscillating)) 524 return kFALSE; 525 val = 1; 534 526 break; 535 527 case 11: 536 if ((*this)[idx].IsUncalibrated(MBadPixelsPix::kLoGainOscillating)) 537 val = 1; 538 else 539 return kFALSE; 528 if (!(*this)[idx].IsUncalibrated(MBadPixelsPix::kLoGainOscillating)) 529 return kFALSE; 530 val = 1; 540 531 break; 541 532 case 12: 542 if ((*this)[idx].IsUncalibrated(MBadPixelsPix::kLoGainSaturation )) 543 val = 1; 544 else 545 return kFALSE; 533 if (!(*this)[idx].IsUncalibrated(MBadPixelsPix::kLoGainSaturation )) 534 return kFALSE; 535 val = 1; 546 536 break; 547 537 case 13: 548 if ((*this)[idx].IsUncalibrated(MBadPixelsPix::kChargeIsPedestal )) 549 val = 1; 550 else 551 return kFALSE; 538 if (!(*this)[idx].IsUncalibrated(MBadPixelsPix::kChargeIsPedestal )) 539 return kFALSE; 540 val = 1; 552 541 break; 553 542 case 14: 554 if ((*this)[idx].IsUncalibrated(MBadPixelsPix::kChargeErrNotValid)) 555 val = 1; 556 else 557 return kFALSE; 543 if (!(*this)[idx].IsUncalibrated(MBadPixelsPix::kChargeErrNotValid)) 544 return kFALSE; 545 val = 1; 558 546 break; 559 547 case 15: 560 if ((*this)[idx].IsUncalibrated(MBadPixelsPix::kChargeRelErrNotValid)) 561 val = 1; 562 else 563 return kFALSE; 548 if (!(*this)[idx].IsUncalibrated(MBadPixelsPix::kChargeRelErrNotValid)) 549 return kFALSE; 550 val = 1; 564 551 break; 565 552 case 16: 566 if ((*this)[idx].IsUncalibrated(MBadPixelsPix::kChargeSigmaNotValid )) 567 val = 1; 568 else 569 return kFALSE; 553 if (!(*this)[idx].IsUncalibrated(MBadPixelsPix::kChargeSigmaNotValid )) 554 return kFALSE; 555 val = 1; 570 556 break; 571 557 case 17: 572 if ((*this)[idx].IsUncalibrated(MBadPixelsPix::kMeanTimeInFirstBin )) 573 val = 1; 574 else 575 return kFALSE; 558 if (!(*this)[idx].IsUncalibrated(MBadPixelsPix::kMeanTimeInFirstBin )) 559 return kFALSE; 560 val = 1; 576 561 break; 577 562 case 18: 578 if ((*this)[idx].IsUncalibrated(MBadPixelsPix::kMeanTimeInLast2Bins )) 579 val = 1; 580 else 581 return kFALSE; 563 if (!(*this)[idx].IsUncalibrated(MBadPixelsPix::kMeanTimeInLast2Bins )) 564 return kFALSE; 565 val = 1; 582 566 break; 583 567 case 19: 584 if ((*this)[idx].IsUncalibrated(MBadPixelsPix::kDeviatingNumPhes )) 585 val = 1; 586 else 587 return kFALSE; 568 if (!(*this)[idx].IsUncalibrated(MBadPixelsPix::kDeviatingNumPhes )) 569 return kFALSE; 570 val = 1; 588 571 break; 589 572 case 20: 590 if ((*this)[idx].IsUncalibrated(MBadPixelsPix::kRelTimeNotFitted )) 591 val = 1; 592 else 593 return kFALSE; 573 if (!(*this)[idx].IsUncalibrated(MBadPixelsPix::kRelTimeNotFitted )) 574 return kFALSE; 575 val = 1; 594 576 break; 595 577 case 21: 596 if ((*this)[idx].IsUncalibrated(MBadPixelsPix::kRelTimeOscillating)) 597 val = 1; 598 else 599 return kFALSE; 578 if (!(*this)[idx].IsUncalibrated(MBadPixelsPix::kRelTimeOscillating)) 579 return kFALSE; 580 val = 1; 600 581 break; 601 582 default: -
trunk/MagicSoft/Mars/mcalib/MHCalibrationChargeBlindPix.cc
r4607 r4641 632 632 const Stat_t entries = fHGausHist.Integral("width"); 633 633 const Double_t lambda_guess = 0.5; 634 const Double_t maximum_bin = fHGausHist.GetBinCenter(fHGausHist.GetMaximumBin());634 //const Double_t maximum_bin = fHGausHist.GetBinCenter(fHGausHist.GetMaximumBin()); 635 635 const Double_t norm = entries/TMath::Sqrt(TMath::TwoPi()); 636 636 -
trunk/MagicSoft/Mars/mjobs/MJCalibration.cc
r4638 r4641 686 686 pave->ConvertNDCtoPad(); 687 687 pave->SetTextSize(0.05); 688 TText *t0 = pave->AddText(" ");689 688 TText *t1 = pave->AddText("Signal smaller 3 Pedestal RMS"); 690 689 t1->SetTextColor(gStyle->GetColorPalette(Int_t(1./max*numcol))); … … 739 738 pave2->ConvertNDCtoPad(); 740 739 pave2->SetTextSize(0.05); 741 TText *tt0 = pave2->AddText(" ");742 740 TText *tt1 = pave2->AddText("High Gain Signals could not be fitted"); 743 741 tt1->SetTextColor(gStyle->GetColorPalette(Int_t(1./max2*numcol))); … … 1761 1759 TFile file(oname, "UPDATE"); 1762 1760 1761 *fLog << inf << " - MStatusDisplay..." << flush; 1763 1762 if (fDisplay && fDisplay->Write()<=0) 1764 1763 { … … 1766 1765 return kFALSE; 1767 1766 } 1768 1767 *fLog << inf << "ok." << endl; 1768 1769 *fLog << inf << " - MCalibrationChargeCam..." << flush; 1769 1770 if (fCalibrationCam.Write()<=0) 1770 1771 { … … 1772 1773 return kFALSE; 1773 1774 } 1774 1775 *fLog << inf << "ok." << endl; 1776 1777 *fLog << inf << " - MCalibrationChargeBlindCam..." << flush; 1775 1778 if (fCalibrationBlindCam.Write()<=0) 1776 1779 { … … 1778 1781 return kFALSE; 1779 1782 } 1780 1783 *fLog << inf << "ok." << endl; 1784 1785 *fLog << inf << " - MCalibrationChargePINDiode..." << flush; 1781 1786 if (fCalibrationPINDiode.Write()<=0) 1782 1787 { … … 1784 1789 return kFALSE; 1785 1790 } 1786 1791 *fLog << inf << "ok." << endl; 1792 1793 *fLog << inf << " - MCalibrationQECam..." << flush; 1787 1794 if (fQECam.Write()<=0) 1788 1795 { … … 1790 1797 return kFALSE; 1791 1798 } 1799 *fLog << inf << "ok." << endl; 1800 1801 *fLog << inf << " - MBadPixelsCam..." << flush; 1802 if (fBadPixels.Write()<=0) 1803 { 1804 *fLog << err << "Unable to write MBadPixelsCam to " << oname << endl; 1805 return kFALSE; 1806 } 1807 *fLog << inf << "ok." << endl; 1792 1808 1793 1809 if (fRelTimes) 1810 { 1811 *fLog << inf << " - MCalibrationRelTimeCam..." << flush; 1794 1812 if (fRelTimeCam.Write()<=0) 1795 1813 { … … 1797 1815 return kFALSE; 1798 1816 } 1799 1800 if (fBadPixels.Write()<=0) 1801 { 1802 *fLog << err << "Unable to write MBadPixelsCam to " << oname << endl; 1803 return kFALSE; 1817 *fLog << inf << "ok." << endl; 1804 1818 } 1805 1819 -
trunk/MagicSoft/Mars/mjobs/MJPedestal.cc
r4616 r4641 91 91 MJPedestal::MJPedestal(const char *name, const char *title) 92 92 : fEnv(0), fRuns(0), fSequence(0), fExtractor(NULL), fDisplayType(kNormalDisplay), 93 fDataCheck(kFALSE) 93 fDataCheck(kFALSE), fUseData(kFALSE), fMaxEvents(0) 94 94 { 95 95 fName = name ? name : "MJPedestal"; … … 507 507 SetOutputPath(e1); 508 508 } 509 510 fMaxEvents = fEnv->GetValue("MJPedestal.MaxEvents", fMaxEvents); 511 fUseData = fEnv->GetValue("MJPedestal.UseData", fUseData); 509 512 } 510 513 … … 545 548 MDirIter iter; 546 549 if (fSequence) 547 f Sequence->SetupPedRuns(iter);550 fUseData ? fSequence->SetupDatRuns(iter) : fSequence->SetupPedRuns(iter); 548 551 549 552 if (fDataCheck) … … 603 606 604 607 // Execute first analysis 605 if (!evtloop.Eventloop( ))608 if (!evtloop.Eventloop(fMaxEvents)) 606 609 { 607 610 *fLog << err << GetDescriptor() << ": Failed." << endl; -
trunk/MagicSoft/Mars/mjobs/MJPedestal.h
r4622 r4641 21 21 { 22 22 private: 23 static const Double_t fgPedestalMin; 24 static const Double_t fgPedestalMax; 25 static const Double_t fgPedRmsMin; 26 static const Double_t fgPedRmsMax; 23 27 24 static const Double_t fgPedestalMin; 25 static const Double_t fgPedestalMax; 26 static const Double_t fgPedRmsMin; 27 static const Double_t fgPedRmsMax; 28 29 static const Float_t fgRefPedClosedLids; 30 static const Float_t fgRefPedExtraGalactic; 31 static const Float_t fgRefPedGalactic; 28 static const Float_t fgRefPedClosedLids; 29 static const Float_t fgRefPedExtraGalactic; 30 static const Float_t fgRefPedGalactic; 32 31 33 static const Float_t fgRefPedRmsClosedLidsInner; 34 static const Float_t fgRefPedRmsExtraGalacticInner; 35 static const Float_t fgRefPedRmsGalacticInner; 36 37 static const Float_t fgRefPedRmsClosedLidsOuter; 38 static const Float_t fgRefPedRmsExtraGalacticOuter; 39 static const Float_t fgRefPedRmsGalacticOuter; 40 41 TString fOutputPath; // Directory where the F0-files get stored 42 43 TEnv *fEnv; // Input setup-file 44 MRunIter *fRuns; // Used pedestal runs 45 MSequence *fSequence; // Sequence 32 static const Float_t fgRefPedRmsClosedLidsInner; 33 static const Float_t fgRefPedRmsExtraGalacticInner; 34 static const Float_t fgRefPedRmsGalacticInner; 46 35 47 MExtractor *fExtractor; // Signal extractor, used to find the nr. of used FADC slices 48 49 MPedestalCam fPedestalCam; // Created pedestal results 50 MBadPixelsCam fBadPixels; // Bad Pixels 51 52 enum Display_t { kDataCheckDisplay, kNormalDisplay }; // Possible Display types 36 static const Float_t fgRefPedRmsClosedLidsOuter; 37 static const Float_t fgRefPedRmsExtraGalacticOuter; 38 static const Float_t fgRefPedRmsGalacticOuter; 39 40 TString fOutputPath; // Directory where the F0-files get stored 53 41 54 Display_t fDisplayType; // Chosen Display type 55 56 Bool_t fDataCheck; // Flag if the data check is run on raw data 57 58 Bool_t ReadPedestalCam(); 59 Bool_t WriteResult(); 60 61 void DisplayResult(MParList &plist); 62 void DisplayReferenceLines(MHCamera *cam, const Int_t what) const; 63 void DisplayOutliers(TH1D *hist) const; 64 void FixDataCheckHist(TH1D *hist) const; 65 66 void CheckEnv(); 67 42 TEnv *fEnv; // Input setup-file 43 MRunIter *fRuns; // Used pedestal runs 44 MSequence *fSequence; // Sequence 45 46 MExtractor *fExtractor; // Signal extractor, used to find the nr. of used FADC slices 47 48 MPedestalCam fPedestalCam; // Created pedestal results 49 MBadPixelsCam fBadPixels; // Bad Pixels 50 51 enum Display_t { kDataCheckDisplay, kNormalDisplay }; // Possible Display types 52 53 Display_t fDisplayType; // Chosen Display type 54 55 Bool_t fDataCheck; // Flag if the data check is run on raw data 56 Bool_t fUseData; // Use data-runs from sequence instead of pedestal runs 57 58 Int_t fMaxEvents; // Maximum number of events 59 60 Bool_t ReadPedestalCam(); 61 Bool_t WriteResult(); 62 63 void DisplayResult(MParList &plist); 64 void DisplayReferenceLines(MHCamera *cam, const Int_t what) const; 65 void DisplayOutliers(TH1D *hist) const; 66 void FixDataCheckHist(TH1D *hist) const; 67 68 void CheckEnv(); 69 68 70 public: 71 MJPedestal(const char *name=NULL, const char *title=NULL); 72 ~MJPedestal(); 69 73 70 MJPedestal(const char *name=NULL, const char *title=NULL); 71 ~MJPedestal(); 72 73 MPedestalCam &GetPedestalCam() { return fPedestalCam; } 74 const MBadPixelsCam &GetBadPixels() const { return fBadPixels; } 75 76 const char* GetOutputFile() const; 77 const Bool_t IsDataCheck() const { return fDataCheck; } 78 79 Bool_t Process(); 80 Bool_t ProcessFile(); 81 82 void SetBadPixels(const MBadPixelsCam &bad) { bad.Copy(fBadPixels); } 83 void SetExtractor(MExtractor* ext) { fExtractor = ext; } 84 void SetInput(MRunIter *iter) { fRuns = iter; } 85 void SetSequence(MSequence *seq) { fSequence = seq; } 86 void SetOutputPath(const char *path="."); 87 void SetEnv(const char *env); 88 89 void SetDataCheck(const Bool_t b=kTRUE) { fDataCheck = b; SetDataCheckDisplay(); } 90 91 void SetDataCheckDisplay() { fDisplayType = kDataCheckDisplay; } 92 void SetNormalDisplay() { fDisplayType = kNormalDisplay; } 93 94 ClassDef(MJPedestal, 0) // Tool to create a pedestal file (MPedestalCam) 74 MPedestalCam &GetPedestalCam() { return fPedestalCam; } 75 const MBadPixelsCam &GetBadPixels() const { return fBadPixels; } 76 77 const char* GetOutputFile() const; 78 const Bool_t IsDataCheck() const { return fDataCheck; } 79 80 Bool_t Process(); 81 Bool_t ProcessFile(); 82 83 void SetBadPixels(const MBadPixelsCam &bad) { bad.Copy(fBadPixels); } 84 void SetExtractor(MExtractor* ext) { fExtractor = ext; } 85 void SetInput(MRunIter *iter) { fRuns = iter; } 86 void SetSequence(MSequence *seq, Bool_t usedata=kFALSE) { fSequence = seq; } 87 void SetOutputPath(const char *path="."); 88 void SetEnv(const char *env); 89 void SetMaxEvents(Int_t max) { fMaxEvents = max; } 90 91 void SetDataCheck(const Bool_t b=kTRUE) { fDataCheck = b; SetDataCheckDisplay(); } 92 93 void SetDataCheckDisplay() { fDisplayType = kDataCheckDisplay; } 94 void SetNormalDisplay() { fDisplayType = kNormalDisplay; } 95 96 ClassDef(MJPedestal, 0) // Tool to create a pedestal file (MPedestalCam) 95 97 }; 96 98
Note:
See TracChangeset
for help on using the changeset viewer.