Changeset 4164
- Timestamp:
- 05/25/04 10:52:15 (21 years ago)
- Location:
- trunk/MagicSoft/Mars
- Files:
-
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/MagicSoft/Mars/Changelog
r4163 r4164 18 18 19 19 -*-*- END OF LINE -*-*- 20 21 2004/05/25: Markus Gaug 22 23 * mjobs/MJCalibration.[h,cc] 24 - add possibility to switch on and off the blind pixel or pin diode 25 calibration 20 26 21 27 2004/05/24: Javier Rico -
trunk/MagicSoft/Mars/mcalib/MCalibrationChargeCalc.cc
r4159 r4164 223 223 using namespace std; 224 224 225 const Float_t MCalibrationChargeCalc::fgChargeLimit = 3.;225 const Float_t MCalibrationChargeCalc::fgChargeLimit = 2.5 226 226 const Float_t MCalibrationChargeCalc::fgChargeErrLimit = 0.; 227 227 const Float_t MCalibrationChargeCalc::fgChargeRelErrLimit = 1.; … … 421 421 fBlindPixel = (MCalibrationChargeBlindPix*)pList->FindObject("MCalibrationChargeBlindPix"); 422 422 if (!fBlindPixel) 423 *fLog << warn << GetDescriptor() 424 << ": MCalibrationChargeBlindPix not found... no blind pixel method! " << endl; 423 { 424 *fLog << endl; 425 *fLog << warn << GetDescriptor() 426 << ": MCalibrationChargeBlindPix not found... no Blind Pixel method! " << endl; 427 } 425 428 426 429 fPINDiode = (MCalibrationChargePINDiode*)pList->FindObject("MCalibrationChargePINDiode"); 427 430 if (!fPINDiode) 428 *fLog << warn << GetDescriptor() 429 << "MCalibrationChargePINDiode not found... no PIN Diode method! " << endl; 431 { 432 *fLog << endl; 433 *fLog << warn << GetDescriptor() 434 << ": MCalibrationChargePINDiode not found... no PIN Diode method! " << endl; 435 } 430 436 431 437 -
trunk/MagicSoft/Mars/mjobs/MJCalibration.cc
r4134 r4164 52 52 // 53 53 // If the flag SetDataCheck() is set, the calibration is used as in the data check at 54 // La Palma, which mean especially running iton raw data files.54 // La Palma, which mean especially running on raw data files. 55 55 // 56 // The absolute light calibration devices Blind Pixel and PIN Diode can be switched on 57 // and off with the commands: 58 // 59 // - SetUseBlindPixel(Bool_t ) 60 // - SetUsePINDiode(Bool_t ) 61 // 56 62 // See also: MHCalibrationChargePix, MHCalibrationChargeCam, MHGausEvents 57 63 // MHCalibrationChargeBlindPix, MHCalibrationChargePINDiode … … 72 78 //End_Html 73 79 // 74 // Different arrival time extractors can be chosen via the command SetArrivalTimeLevel(UInt_t i) 75 // Up to now, the following extractors are available: 76 // i=1: Use MArrivalTimeCalc (using MCubicSpline, arrival time == position at half maximum) 77 // i=2: Use MArrivalTimeCalc2 (mean time of fWindowSize time slices with the highest integral content: default) 80 // Different arrival time extractors can be set directly with the command SetTimeExtractor(MExtractor *) 78 81 // 79 82 // See also: MHCalibrationRelTimePix, MHCalibrationRelTimeCam, MHGausEvents … … 144 147 // Default constructor. 145 148 // 146 // Sets fRuns to 0, fExtractor to NULL, fTimeExtractor to NULL, fColor to kNONE, 147 // fDisplay to kNormalDisplay, fRelTime to kFALSE, fDataCheck to kFALSE 149 // - Sets fRuns to 0, fExtractor to NULL, fTimeExtractor to NULL, fColor to kNONE, 150 // fDisplay to kNormalDisplay, fRelTime to kFALSE, fDataCheck to kFALSE, 151 // - SetUseBlindPixel() 152 // - SetUsePINDiode() 148 153 // 149 154 MJCalibration::MJCalibration(const char *name, const char *title) … … 152 157 fRelTimes(kFALSE), fDataCheck(kFALSE) 153 158 { 159 154 160 fName = name ? name : "MJCalibration"; 155 161 fTitle = title ? title : "Tool to create the calibration constants for one calibration run"; 162 163 SetUseBlindPixel(); 164 SetUsePINDiode(); 156 165 157 166 } … … 728 737 } 729 738 739 if (filenames.Contains("_26568_")) 740 if (fColor == MCalibrationCam::kNONE) 741 { 742 *fLog << "Found colour: kGREEN in " << filenames << endl; 743 fColor = MCalibrationCam::kGREEN; 744 } 745 else if (fColor != MCalibrationCam::kGREEN) 746 { 747 *fLog << err << "Different colour found in " << filenames << "... abort" << endl; 748 return kFALSE; 749 } 730 750 // 731 751 // Here start the runs where the shifter put … … 807 827 return Form("%s/%s-F1.root", (const char*)fOutputPath, (const char*)fRuns->GetRunsAsFileName()); 808 828 } 829 830 831 Bool_t MJCalibration::IsUseBlindPixel() const 832 { 833 return TESTBIT(fDevices,kUseBlindPixel); 834 } 835 836 837 Bool_t MJCalibration::IsUsePINDiode() const 838 { 839 return TESTBIT(fDevices,kUsePINDiode); 840 } 841 842 843 809 844 810 845 … … 909 944 plist.AddToList(&fCalibrationCam); 910 945 plist.AddToList(&fRelTimeCam); 911 plist.AddToList(&pindiode); 912 plist.AddToList(&blindpix); 946 if (IsUsePINDiode()) 947 plist.AddToList(&pindiode); 948 if (IsUseBlindPixel()) 949 plist.AddToList(&blindpix); 913 950 914 951 MGeomApply apply; … … 981 1018 982 1019 tlist.AddToList(&fillcam); 983 tlist.AddToList(&fillpin); 984 tlist.AddToList(&fillbnd); 1020 1021 if (IsUsePINDiode()) 1022 tlist.AddToList(&fillpin); 1023 if (IsUseBlindPixel()) 1024 tlist.AddToList(&fillbnd); 1025 985 1026 tlist.AddToList(&calcalc); 986 1027 … … 1026 1067 Bool_t MJCalibration::ReadCalibrationCam() 1027 1068 { 1028 const TString fname = GetOutputFile(); 1029 1030 if (gSystem->AccessPathName(fname, kFileExists)) 1031 { 1032 *fLog << err << "Input file " << fname << " doesn't exist." << endl; 1033 return kFALSE; 1034 } 1035 1036 *fLog << inf << "Reading from file: " << fname << endl; 1037 1038 TFile file(fname, "READ"); 1039 if (fCalibrationCam.Read()<=0) 1040 { 1041 *fLog << err << "Unable to read MCalibrationChargeCam from " << fname << endl; 1042 return kFALSE; 1043 } 1044 1045 if (fQECam.Read()<=0) 1046 { 1047 *fLog << err << "Unable to read MCalibrationQECam from " << fname << endl; 1048 return kFALSE; 1049 } 1050 1051 if (fRelTimeCam.Read()<=0) 1052 { 1053 *fLog << err << "Unable to read MCalibrationRelTimeCam from " << fname << endl; 1054 return kFALSE; 1055 } 1056 1057 if (file.FindKey("MBadPixelsCam")) 1058 { 1059 MBadPixelsCam bad; 1060 if (bad.Read()<=0) 1069 1070 const TString fname = GetOutputFile(); 1071 1072 if (gSystem->AccessPathName(fname, kFileExists)) 1073 { 1074 *fLog << err << "Input file " << fname << " doesn't exist." << endl; 1075 return kFALSE; 1076 } 1077 1078 *fLog << inf << "Reading from file: " << fname << endl; 1079 1080 TFile file(fname, "READ"); 1081 if (fCalibrationCam.Read()<=0) 1082 { 1083 *fLog << err << "Unable to read MCalibrationChargeCam from " << fname << endl; 1084 return kFALSE; 1085 } 1086 1087 if (fQECam.Read()<=0) 1088 { 1089 *fLog << err << "Unable to read MCalibrationQECam from " << fname << endl; 1090 return kFALSE; 1091 } 1092 1093 if (fRelTimeCam.Read()<=0) 1094 { 1095 *fLog << err << "Unable to read MCalibrationRelTimeCam from " << fname << endl; 1096 return kFALSE; 1097 } 1098 1099 if (file.FindKey("MBadPixelsCam")) 1100 { 1101 MBadPixelsCam bad; 1102 if (bad.Read()<=0) 1061 1103 { 1062 1063 1104 *fLog << err << "Unable to read MBadPixelsCam from " << fname << endl; 1105 return kFALSE; 1064 1106 } 1065 1066 } 1067 1068 1069 1070 1071 1107 fBadPixels.Merge(bad); 1108 } 1109 1110 if (fDisplay /*&& !fDisplay->GetCanvas("Pedestals")*/) // FIXME! 1111 fDisplay->Read(); 1112 1113 return kTRUE; 1072 1114 } 1073 1115 … … 1084 1126 } 1085 1127 1128 // -------------------------------------------------------------------------- 1129 // 1130 // Set the useage of the Blind Pixel device 1131 // 1132 void MJCalibration::SetUseBlindPixel(const Bool_t b) 1133 { 1134 b ? SETBIT(fDevices,kUseBlindPixel) : CLRBIT(fDevices,kUseBlindPixel); 1135 } 1136 1137 // -------------------------------------------------------------------------- 1138 // 1139 // Set the useage of the PIN Diode device 1140 // 1141 void MJCalibration::SetUsePINDiode(const Bool_t b) 1142 { 1143 b ? SETBIT(fDevices,kUsePINDiode) : CLRBIT(fDevices,kUsePINDiode); 1144 } 1086 1145 1087 1146 // -------------------------------------------------------------------------- … … 1141 1200 } 1142 1201 1143 1144 1145 1146 1147 1148 -
trunk/MagicSoft/Mars/mjobs/MJCalibration.h
r4134 r4164 46 46 Display_t fDisplayType; // Chosen Display type 47 47 48 enum Device_t { kUseBlindPixel, kUsePINDiode }; // Possible devices for calibration 49 50 Byte_t fDevices; // Bit-field for used devices for calibration 51 48 52 Bool_t fRelTimes; // Flag if relative times have to be calibrated 49 53 Bool_t fDataCheck; // Flag if the data check is run on raw data … … 58 62 ~MJCalibration() {} 59 63 60 void SetInput(MRunIter *iter) { fRuns=iter; }61 void SetOutputPath(const char *path=".");62 63 64 const char* GetOutputFile() const; 64 65 … … 67 68 MCalibrationQECam &GetQECam() { return fQECam; } 68 69 MBadPixelsCam &GetBadPixels() { return fBadPixels; } 70 71 Bool_t IsUseBlindPixel() const; 72 Bool_t IsUsePINDiode() const; 69 73 70 74 void SetBadPixels(const MBadPixelsCam &bad) { bad.Copy(fBadPixels); } … … 74 78 void SetColor (const MCalibrationCam::PulserColor_t color) { fColor = color; } 75 79 80 void SetInput(MRunIter *iter) { fRuns=iter; } 81 void SetOutputPath(const char *path="."); 82 76 83 // Displays 77 84 void SetFullDisplay() { fDisplayType = kFullDisplay; } … … 85 92 void SetDataCheck (const Bool_t b=kTRUE) { fDataCheck = b; SetDataCheckDisplay(); } 86 93 94 // Devices 95 void SetUseBlindPixel( const Bool_t b=kTRUE ); 96 void SetUsePINDiode ( const Bool_t b=kTRUE ); 97 87 98 Bool_t ReadCalibrationCam(); 88 99 Bool_t ProcessFile( MPedestalCam &pedcam ); -
trunk/MagicSoft/Mars/mjobs/MJPedestal.cc
r4134 r4164 79 79 const char* MJPedestal::GetOutputFile() const 80 80 { 81 81 82 if (!fRuns) 82 83 return ""; 83 84 84 85 return Form("%s/%s-F0.root", (const char*)fOutputPath, (const char*)fRuns->GetRunsAsFileName()); 86 85 87 } 86 88 87 89 Bool_t MJPedestal::ReadPedestalCam() 88 90 { 91 89 92 const TString fname = GetOutputFile(); 90 93
Note:
See TracChangeset
for help on using the changeset viewer.