Changeset 6699 for trunk/MagicSoft
- Timestamp:
- 03/02/05 11:44:43 (20 years ago)
- Location:
- trunk/MagicSoft/Mars
- Files:
-
- 9 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/MagicSoft/Mars/Changelog
r6689 r6699 21 21 22 22 -*-*- END OF LINE -*-*- 23 2005/03/02 Markus Gaug 24 25 * mjobs/MJCalib.[h,cc] 26 * mjobs/MJPedestal.[h,cc] 27 * mjobs/MJCalibration.[h,cc] 28 * mjobs/MJCalibrateSignal.[h,cc] 29 - put the storage types in the base class 30 23 31 2005/02/25 Markus Gaug 24 32 -
trunk/MagicSoft/Mars/mjobs/MJCalib.cc
r6569 r6699 48 48 // - fPixelCheck to kFALSE 49 49 // 50 MJCalib::MJCalib() : fDataFlag(kIsUseRootData), f PixelCheck(kFALSE), fRuns(NULL)50 MJCalib::MJCalib() : fDataFlag(kIsUseRootData), fStorage(0), fPixelCheck(kFALSE), fRuns(NULL) 51 51 { 52 52 SetCheckedPixId(); -
trunk/MagicSoft/Mars/mjobs/MJCalib.h
r6480 r6699 24 24 Byte_t fDataFlag; // Bit-field to store the data type 25 25 26 enum Storage_t // Possible devices for calibration 27 { 28 kNoStorage, 29 kHistsStorage 30 }; // Possible flags for the storage of results 31 32 Byte_t fStorage; // Bit-field for chosen storage type 33 26 34 protected: 27 35 … … 34 42 Byte_t GetDataFlag() { return fDataFlag; } 35 43 44 Bool_t IsNoStorage () const { return TESTBIT(fStorage,kNoStorage); } 45 Bool_t IsHistsStorage () const { return TESTBIT(fStorage,kHistsStorage); } 46 36 47 public: 48 37 49 MJCalib(); 38 50 … … 52 64 void SetCheckedPixId( const Int_t i=fgCheckedPixId ) { fCheckedPixId = i; } 53 65 66 void SetNoStorage ( const Bool_t b=kTRUE ) { b ? SETBIT(fStorage,kNoStorage) : CLRBIT(fStorage,kNoStorage); } 67 void SetHistsStorage ( const Bool_t b=kTRUE ) { b ? SETBIT(fStorage,kHistsStorage) : CLRBIT(fStorage,kHistsStorage); } 68 54 69 ClassDef(MJCalib, 0) // Base class for calibration jobs 55 70 }; -
trunk/MagicSoft/Mars/mjobs/MJCalibrateSignal.cc
r6680 r6699 129 129 fTitle = title ? title : "Tool to calibrate data"; 130 130 131 //fCruns = NULL; 132 } 133 134 const char* MJCalibrateSignal::GetInputFile() const 135 { 136 const TString name(GetInputFileName()); 137 if (name.IsNull()) 138 return ""; 139 140 return Form("%s/%s", fPathIn.Data(), name.Data()); 141 } 142 143 const char* MJCalibrateSignal::GetInputFileName() const 144 { 145 146 if (fSequence.IsValid()) 147 return Form("calib%08d.root", fSequence.GetSequence()); 148 149 if (!fRuns) 150 return ""; 151 152 // return Form("%s-F1.root", (const char*)fCruns->GetRunsAsFileName()); 131 153 } 132 154 … … 139 161 Bool_t MJCalibrateSignal::ReadCalibration(TObjArray &l, MBadPixelsCam &cam, MExtractor* &ext1, MExtractor* &ext2, TString &geom) const 140 162 { 141 const TString fname = Form("%s/calib%08d.root", fPathIn.Data(), fSequence.GetSequence()); 163 164 const TString fname = GetInputFile(); 142 165 143 166 *fLog << inf << "Reading from file: " << fname << endl; … … 751 774 if (fPixelCheck) 752 775 { 753 MHCalibrationPulseTimeCam *pcam = (MHCalibrationPulseTimeCam*)plist.FindObject("MHCalibrationPulse Cam");776 MHCalibrationPulseTimeCam *pcam = (MHCalibrationPulseTimeCam*)plist.FindObject("MHCalibrationPulseTimeCam"); 754 777 MHCalibrationPix &pix1 = (*pcam)[fCheckedPixId]; 755 778 pix1.DrawClone(""); … … 757 780 if (fIsHiLoCalibration) 758 781 { 759 MHCalibrationHiLoCam *hcam = (MHCalibrationHiLoCam*)plist.FindObject("MHCalibration PulseCam");782 MHCalibrationHiLoCam *hcam = (MHCalibrationHiLoCam*)plist.FindObject("MHCalibrationHiLoCam"); 760 783 MHCalibrationPix &pix2 = (*hcam)[fCheckedPixId]; 761 784 pix2.DrawClone(""); 762 785 } 763 } 764 786 } 765 787 766 788 if (!WriteResult(interlacedcont)) … … 773 795 addcont.Add(&hilcam); 774 796 797 if (IsHistsStorage()) 798 { 799 addcont.Add(plist.FindObject("MHCalibrationHiLoCam")); 800 addcont.Add(plist.FindObject("MHCalibrationPulseTimeCam")); 801 } 802 775 803 if (!WriteResult(addcont)) 776 804 return kFALSE; 805 777 806 778 807 // return if job went ok -
trunk/MagicSoft/Mars/mjobs/MJCalibrateSignal.h
r6281 r6699 15 15 class MPedestalCam; 16 16 class MBadPixelsCam; 17 class MRunIter; 17 18 18 19 class MJCalibrateSignal : public MJCalib … … 20 21 private: 21 22 23 // MRunIter *fCruns; // Calibration run iter 24 22 25 Bool_t fIsInterlaced; // Distinguish interlaced from other calibration 23 26 Bool_t fIsRelTimesUpdate; // Choose to update relative times from interlaced … … 32 35 MExtractor* &ext1, MExtractor* &ext2, TString &geom) const; 33 36 37 const char* GetInputFileName() const; 38 const char* GetInputFile() const; 39 34 40 public: 35 41 … … 42 48 void SetHiLoCalibration( const Bool_t b=kTRUE ) { fIsHiLoCalibration = b; } 43 49 50 // void SetInputCal ( MRunIter *iter ) { fCruns = iter; } 51 44 52 ClassDef(MJCalibrateSignal, 0) // Tool to create a pedestal file (MPedestalCam) 45 53 }; -
trunk/MagicSoft/Mars/mjobs/MJCalibration.cc
r6689 r6699 200 200 SetDebug(kFALSE); 201 201 SetIntensity(kFALSE); 202 203 SetNoStorage(kFALSE);204 SetHistsStorage(kFALSE);205 202 206 203 SetReferenceFile(); -
trunk/MagicSoft/Mars/mjobs/MJCalibration.h
r6281 r6699 131 131 Byte_t fDevices; // Bit-field for used devices for calibration 132 132 133 enum Storage_t // Possible devices for calibration134 {135 kNoStorage,136 kHistsStorage137 }; // Possible flags for the storage of results138 139 Byte_t fStorage; // Bit-field for chosen storage type140 141 133 enum { kRelTimes, kDebug, kIntensity }; // Possible flags 142 134 … … 151 143 Bool_t IsDebug () const { return TESTBIT(fFlags,kDebug); } 152 144 Bool_t IsIntensity () const { return TESTBIT(fFlags,kIntensity); } 153 154 Bool_t IsNoStorage () const { return TESTBIT(fStorage,kNoStorage); }155 Bool_t IsHistsStorage () const { return TESTBIT(fStorage,kHistsStorage); }156 145 157 146 void DrawTab(MParList &plist, const char *cont, const char *name, Option_t *opt); … … 218 207 219 208 // Storage 220 void SetNoStorage ( const Bool_t b=kTRUE ) { b ? SETBIT(fStorage,kNoStorage) : CLRBIT(fStorage,kNoStorage); }221 void SetHistsStorage ( const Bool_t b=kTRUE ) { b ? SETBIT(fStorage,kHistsStorage) : CLRBIT(fStorage,kHistsStorage); }222 223 209 void SetReferenceFile( const TString ref=fgReferenceFile ) { fReferenceFile = ref; } 224 210 -
trunk/MagicSoft/Mars/mjobs/MJPedestal.cc
r6569 r6699 101 101 MJPedestal::MJPedestal(const char *name, const char *title) 102 102 : fExtractor(NULL), fDisplayType(kDisplayDataCheck), 103 fExtractType(kUsePedRun), fExtractionType(kFundamental) , fIsUseHists(kFALSE)103 fExtractType(kUsePedRun), fExtractionType(kFundamental) 104 104 { 105 105 fName = name ? name : "MJPedestal"; 106 106 fTitle = title ? title : "Tool to create a pedestal file (MPedestalCam)"; 107 107 108 SetNormalStorage();109 108 SetUsePedRun(); 110 109 SetPathIn(""); … … 954 953 // 955 954 if (!fBadPixelsFile.IsNull()) 956 {955 { 957 956 *fLog << inf << "Excluding: " << fBadPixelsFile << endl; 958 957 ifstream fin(fBadPixelsFile.Data()); 959 958 fBadPixels.AsciiRead((istream&)fin); 960 }959 } 961 960 962 961 MGeomApply geomapl; … … 1037 1036 { 1038 1037 1038 if (fExtractionType!=kFundamental) 1039 { 1040 pedcalc.SetRandomCalculation(fExtractionType==kWithExtractorRndm); 1041 pedlogain.SetRandomCalculation(fExtractionType==kWithExtractorRndm); 1042 1043 pedcalc.SetExtractor((MExtractTimeAndCharge*)fExtractor); 1044 pedlogain.SetExtractor((MExtractTimeAndCharge*)fExtractor); 1045 } 1046 1039 1047 if (fExtractor->InheritsFrom("MExtractTimeAndCharge")) 1040 1048 { 1041 1049 1042 const Float_t f = 0. 5+fExtractor->GetHiGainFirst();1050 const Float_t f = 0.1+fExtractor->GetHiGainFirst(); 1043 1051 const Int_t win = ((MExtractTimeAndCharge*)fExtractor)->GetWindowSizeHiGain(); 1044 1052 pedcalc.SetExtractWindow((Int_t)f, win); … … 1048 1056 else 1049 1057 { 1050 const Float_t f = 0. 5+fExtractor->GetHiGainFirst();1051 const Float_t n = 0. 5+fExtractor->GetNumHiGainSamples();1058 const Float_t f = 0.1+fExtractor->GetHiGainFirst(); 1059 const Float_t n = 0.1+fExtractor->GetNumHiGainSamples(); 1052 1060 pedcalc.SetExtractWindow((Int_t)f, (Int_t)n); 1053 1061 pedlogain.SetExtractWindow((Int_t)(15+f), (Int_t)n); … … 1063 1071 1064 1072 1065 if (fExtractionType!=kFundamental)1066 {1067 pedcalc.SetRandomCalculation(fExtractionType==kWithExtractorRndm);1068 pedlogain.SetRandomCalculation(fExtractionType==kWithExtractorRndm);1069 1070 pedcalc.SetExtractor((MExtractTimeAndCharge*)fExtractor);1071 pedlogain.SetExtractor((MExtractTimeAndCharge*)fExtractor);1072 }1073 1073 } 1074 1074 else -
trunk/MagicSoft/Mars/mjobs/MJPedestal.h
r6331 r6699 60 60 Display_t fDisplayType; // Chosen Display type 61 61 62 enum Storage_t { kNoStorage }; // Possible flags for the storage of results63 Byte_t fStorage; // Bit-field for chosen storage type64 65 62 enum Extract_t { kUseData, kUsePedRun }; // Possible flags for the extraction of the pedestal 66 63 Extract_t fExtractType; // Chosen extractor type … … 80 77 void DisplayOutliers(TH1D *hist) const; 81 78 void FixDataCheckHist(TH1D *hist) const; 82 83 Bool_t IsNoStorage() const { return TESTBIT(fStorage, kNoStorage); }84 79 85 80 Bool_t CheckEnvLocal(); … … 124 119 MExtractor *GetExtractor() const { return fExtractor; } 125 120 126 // Storage127 void SetNoStorage(const Bool_t b=kTRUE) { b ? SETBIT(fStorage, kNoStorage) : CLRBIT(fStorage,kNoStorage); }128 void SetNormalStorage() { CLRBIT(fStorage, kNoStorage); }129 130 121 ClassDef(MJPedestal, 0) // Tool to create a pedestal file (MPedestalCam) 131 122 };
Note:
See TracChangeset
for help on using the changeset viewer.