- Timestamp:
- 11/05/04 10:21:19 (20 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/MagicSoft/Mars/macros/calibration.C
r4743 r5343 54 54 // "calibrate" it and test the resulting outcome. 55 55 // 56 ///////////////////////////////////////////////////////////////////////////// 56 ////////////////////////////////////////////////////////////////////////////////////////// 57 57 #include "MJPedestal.h" 58 58 #include "MJCalibration.h" … … 66 66 #include "MExtractTimeHighestIntegral.h" 67 67 #include "MExtractTimeFastSpline.h" 68 #include "MExtractTimeAndChargeDigitalFilter.h" 69 #include "MExtractTimeAndChargeSlidingWindow.h" 70 #include "MExtractTimeAndChargeSpline.h" 68 71 #include "MRunIter.h" 69 72 #include "MStatusDisplay.h" 73 #include "MCalibrationQECamMagic.h" 70 74 #include "MCalibrationQECam.h" 71 #include "MHCalibrationTestCam.h"72 #include "MHCalibrationTestPix.h"73 75 #include "MBadPixelsCam.h" 74 76 #include "MArgs.h" … … 87 89 88 90 static TString outpath = "./"; 89 static TString inpath = "/home/rootdata/Calib/2004_07_06 /";91 static TString inpath = "/home/rootdata/Calib/2004_07_06"; 90 92 static TString badfile = ""; 93 //static TString badfile = "badpixels_only0_559_560.dat"; 94 static TString weightfile = "msignal/calibration_weights_UV.dat"; 95 //static TString weightfile = "msignal/cosmics_weights.dat"; 91 96 // 92 97 // the default pedestal run for the calibration … … 101 106 // between calrun1 and calrun2) 102 107 // 108 //static const Int_t calrun2 = 31754; 103 109 static const Int_t calrun2 = 0; 104 110 // … … 110 116 // 111 117 static Bool_t blindpix = kTRUE; 118 // 112 119 // A switch to use the PIN Diode 113 120 // 114 static Bool_t pindiode = k FALSE;121 static Bool_t pindiode = kTRUE; 115 122 // 116 123 // Tell if you want to calibrate times: 117 124 // 118 static Bool_t useTimes = kFALSE; 125 static Bool_t useTimes = kTRUE; 126 // 127 // Tell if you want to use a combined extractor: 128 // 129 static Bool_t useTimeAndCharge = kTRUE; 119 130 // 120 131 // Tell if you want to use the display: … … 124 135 // Tell if you want to test the result afterwards 125 136 // 126 static Bool_t useTest = kTRUE; 137 static Bool_t useTest = kFALSE; 138 // 139 // Tell if you want to test the intensity calibration 140 // 141 static Bool_t useIntensity = kFALSE; 142 // 143 // Tell if you want to use MPedCalcFromLogain for the pedestal calculation 144 // 145 static Bool_t usedata = kTRUE; 146 // 147 // Tell if you want to store and read the F0 and F1- files 148 // 149 static Bool_t usestorage = kFALSE; 127 150 // 128 151 Int_t calibration(const Int_t prun=pedrun, … … 136 159 // Choose the signal Extractor: 137 160 // 138 // MExtractFixedWindowPeakSearch extractor; 139 // MExtractSlidingWindow extractor; 140 // MExtractFixedWindowSpline extractor; 141 MExtractFixedWindow extractor; 142 // MExtractAmplitudeSpline extractor; 143 // MExtractTimeAndChargeSpline extractor; 144 // 145 // Set Ranges or Windows 146 // 147 extractor.SetRange(3,14,4,13); 148 // extractor.SetWindows(8,8); 149 150 // 151 // Choose the arrival time Extractor: 161 // PURE CHARGE EXTRACTORS: 162 // MExtractFixedWindowPeakSearch extractor; 163 // MExtractSlidingWindow extractor; 164 // MExtractFixedWindow extractor; 165 // MExtractFixedWindowSpline extractor; 166 // MExtractAmplitudeSpline extractor; 167 // 168 // PURE TIME EXTRACTORS: 169 // ATTENTION: If an extractor deriving from MExtractTimeAndCharge is 170 // used, you may want to use the timing calculated directly 171 // from there. Use the flag: "useTimeAndCharge" in this case 152 172 // 153 173 // MExtractTimeHighestIntegral timeext; 154 MExtractTimeFastSpline timeext; 155 // 156 // Set Ranges or Windows 157 // 158 timeext.SetRange(0,7,3,8); 174 // MExtractTimeFastSpline timeext; 175 // MExtractTimeSpline timeext; 176 // 177 // COMBINED TIME AND CHARGE EXTRACTORS: 178 // (You have to set the variable "useTimeAndCharge" in order to use the 179 // time calculated by this extractor!) 180 MExtractTimeAndChargeDigitalFilter extractor; 181 // MExtractTimeAndChargeSpline extractor; 182 // MExtractTimeAndChargeSlidingWindow extractor; 183 // 184 // Set Ranges or Windows 185 // 186 // extractor.SetRange(1,14,4,12); 187 // extractor.SetWindowSize(6,6); 188 // timeext.SetRange(1,14,4,12); 189 // timeext.SetWindowSize(6,6); 190 // 191 // Set additional information for some extractors 192 // 193 // Digital Filter: 194 extractor.ReadWeightsFile(weightfile.Data()); 195 // extractor.ReadWeightsFile(""); 196 // TimeAndChargeSpline: 197 // extractor.SetChargeType(MExtractTimeAndChargeSpline::kIntegral); 198 // extractor.SetTimeType(MExtractTimeAndChargeSpline::kHalfMaximum); 159 199 160 200 MRunIter pruns; … … 186 226 /************************************/ 187 227 188 MCalibrationQECam qecam; 189 MBadPixelsCam badcam; 228 // 229 // Hand over to the jobs a QE Cam with Cornings initialized 230 // 231 MCalibrationQECamMagic qecam; 232 MBadPixelsCam badcam; 190 233 // 191 234 // If you want to exclude pixels from the beginning, read … … 195 238 { 196 239 ifstream f(badfile.Data()); 197 badcam.AsciiRead( f);240 badcam.AsciiRead((istream&)f); 198 241 f.close(); 199 242 } 200 243 201 244 MJPedestal pedloop; 245 pedloop.SetUseData(usedata); 246 pedloop.SetNoStorage(!usestorage); 247 pedloop.SetEnvDebug(debug); 202 248 pedloop.SetExtractor(&extractor); 203 249 pedloop.SetInput(&pruns); … … 221 267 if (debug) 222 268 calloop.SetDebug(); 269 calloop.SetEnvDebug(debug); 270 if (useIntensity) 271 calloop.SetIntensity(); 272 // calloop.SetHistsStorage(); 273 calloop.SetNoStorage(!usestorage); 274 // 275 // If you want to set a colour explicitely from outside (not recommanded!) 276 // calloop.SetColor(MCalibrationCam::kUV); 223 277 // 224 278 // If you want to run the data-check on RAW DATA!!!, choose: … … 227 281 // If you want to see the data-check plots only, choose: 228 282 calloop.SetDataCheckDisplay(); 283 //calloop.SetNormalDisplay(); 229 284 // 230 285 // For everything, you have ever dreamed of, choose: 231 // calloop.SetFullDisplay();286 // calloop.SetFullDisplay(); 232 287 233 288 // … … 236 291 calloop.SetRelTimeCalibration(useTimes); 237 292 calloop.SetExtractor(&extractor); 293 calloop.SetTimeAndCharge(useTimeAndCharge); 238 294 calloop.SetTimeExtractor(&timeext); 239 295 calloop.SetInput(&cruns); … … 262 318 badbad.Print(); 263 319 } 264 265 gLog << endl;266 gLog << "Mean number of photons from pulser Inner pixels (F-Factor Method): "267 << calloop.GetCalibrationCam().GetNumPhotonsFFactorMethod()268 << " +- " << calloop.GetCalibrationCam().GetNumPhotonsFFactorMethodErr() << endl;269 gLog << endl;270 320 271 321 /********************************************************************/ … … 297 347 298 348 } 299 349 300 350 /********************************************************************/ 301 351 /* FOURTH LOOP: APPLY CALIBRATION TO THE PEDESTAL FILES */ 302 352 /********************************************************************/ 303 353 354 /* 304 355 MJExtractSignal pedphotloop; 305 356 … … 315 366 return 5; 316 367 317 368 */ 318 369 if (debug) 319 370 TObject::SetObjectStat(kFALSE); … … 324 375 if (debug) 325 376 gObjectTable->Print(); 326 327 //328 // List of useful containers:329 //330 /*331 MPedestalCam &pedcam = pedloop.GetPedestalCam();332 MCalibrationChargeCam &chargecam = calloop.GetCalibrationCam();333 MCalibrationQECam &qecam = calloop.GetCalibrationCam();334 MBadPixelsCam &badcam = calloop.GetBadPixels();335 MCalibrationTestCam &testcam = testloop.GetTestCam();336 MHCalibrationTestTimeCam &testtime = testloop.GetTestTimeCam();337 */338 377 339 378 return 0;
Note:
See TracChangeset
for help on using the changeset viewer.