Changeset 5859
- Timestamp:
- 01/16/05 17:34:30 (20 years ago)
- Location:
- trunk/MagicSoft/Mars
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/MagicSoft/Mars/Changelog
r5858 r5859 36 36 * mcalib/MCalibCalcFromPast.[h,cc] 37 37 - committed final version, now also in the Makefile 38 39 40 * mjobs/MJCalibrateSignalFromOutside.[h,cc] 41 * macros/calibration.C 42 - committed final version, now able to calibrate interlaced cal. 43 events. 38 44 39 45 -
trunk/MagicSoft/Mars/macros/calibration.C
r5811 r5859 83 83 using namespace std; 84 84 85 static TString outpath = "./"; 86 static TString inpath = "/home/rootdata/Calib/2004_09_22"; 85 static TString outpath = "."; 86 //static TString inpath = "/home/rootdata/Calib/2004_07_06"; 87 //static TString inpath = "/home/rootdata/Calib/2004_09_22"; 88 static TString inpath = "/home/rootdata/Calib/2004_12_18"; 87 89 static TString badfile; 88 90 //static TString badfile = "badpixels_only0_388_559.dat"; … … 134 136 static Bool_t useIntensity = kFALSE; 135 137 // 138 // Tell if you to calibrated interlaced calibration events 139 // 140 static Bool_t useInterlaced = kTRUE; 141 // 136 142 // Tell if you want to store and read the F0 and F1- files 137 143 // 138 static Bool_t useStorage = kTRUE;144 static Bool_t useStorage = kTRUE; 139 145 // 140 146 // Tell which extractor you want to use. The flags are counted according … … 209 215 210 216 MJPedestal pedloop1; 211 pedloop1.SetNoStorage( !useStorage);217 pedloop1.SetNoStorage(); 212 218 pedloop1.SetEnvDebug(debug); 213 219 pedloop1.SetExtractor(extractor); … … 239 245 240 246 pedloop2.SetUseData(); 241 pedloop2.SetNoStorage( !useStorage);247 pedloop2.SetNoStorage(); 242 248 pedloop2.SetEnvDebug(debug); 243 249 pedloop2.SetExtractor(extractor); … … 365 371 calibloop.SetExtractor(extractor); 366 372 calibloop.SetInput(&druns); 367 // calibloop.SetOutputPath(outpath);373 calibloop.SetPathOut(outpath); 368 374 if (useDisplay) 369 375 calibloop.SetDisplay(display); 370 376 calibloop.SetBadPixels(calloop.GetBadPixels()); 371 377 calibloop.SetNoStorage(!useStorage); 378 calibloop.SetInterlaced(useInterlaced); 372 379 373 380 if (!calibloop.ProcessFile(pedloop1.GetPedestalCam(),timeandcharge ? pedloop2.GetPedestalCam() : pedloop1.GetPedestalCam(), calloop.GetCalibrationCam(),calloop.GetQECam(), calloop.GetRelTimeCam())) -
trunk/MagicSoft/Mars/mcalib/MCalibrateData.h
r5854 r5859 42 42 MBadPixelsCam *fBadPixels; //! Bad Pixels information 43 43 MCalibrationChargeCam *fCalibrations; //! Calibration constants 44 MCalibrationChargeCam *fCalibUpdate; //! Calibration constants update (for interlaced cal events) 44 45 MCalibrationQECam *fQEs; //! Quantum efficiencies 45 46 MExtractedSignalCam *fSignals; //! Integrated charge in FADCs counts … … 111 112 void SetSignalType ( SignalType_t sigtype=kPhot ) { fSignalType =sigtype; } 112 113 114 void SetCalibUpdate ( MCalibrationChargeCam *cam=NULL ) { fCalibUpdate = cam; } 115 113 116 Bool_t UpdateConversionFactors(); 114 117 -
trunk/MagicSoft/Mars/mjobs/MJCalibrateSignalFromOutside.cc
r5810 r5859 22 22 ! 23 23 \* ======================================================================== */ 24 25 24 ///////////////////////////////////////////////////////////////////////////// 26 25 // … … 54 53 #include "MHCamEvent.h" 55 54 #include "MPedestalCam.h" 55 #include "MPedPhotCam.h" 56 #include "MCalibrationHiLoCam.h" 56 57 #include "MBadPixelsCam.h" 57 58 … … 62 63 #include "MCalibrationChargePINDiode.h" 63 64 65 #include "MCalibrationChargeCalc.h" 66 #include "MCalibrationRelTimeCalc.h" 67 68 #include "MCalibrationIntensityChargeCam.h" 69 #include "MCalibrationIntensityBlindCam.h" 70 #include "MCalibrationIntensityRelTimeCam.h" 71 #include "MCalibrationIntensityQECam.h" 72 #include "MBadPixelsIntensityCam.h" 73 74 #include "MHCalibrationChargeCam.h" 75 #include "MHCalibrationChargeBlindCam.h" 76 #include "MHCalibrationChargePINDiode.h" 77 #include "MHCalibrationRelTimeCam.h" 78 79 #include "MCalibCalcFromPast.h" 80 64 81 #include "MReadReports.h" 65 82 #include "MReadMarsFile.h" 66 83 #include "MRawFileRead.h" 84 #include "MTriggerPatternDecode.h" 85 #include "MFTriggerPattern.h" 86 #include "MContinue.h" 67 87 #include "MGeomApply.h" 68 88 #include "MMcPedestalCopy.h" … … 70 90 #include "MPedCalcFromLoGain.h" 71 91 #include "MExtractor.h" 92 #include "MExtractPINDiode.h" 93 #include "MExtractBlindPixel.h" 72 94 #include "MTaskEnv.h" 73 95 #include "MCalibrateData.h" … … 90 112 // 91 113 MJCalibrateSignalFromOutside::MJCalibrateSignalFromOutside(const char *name, const char *title) 92 : fIsDataCheck(kFALSE), fGeometry("MGeomCamMagic") 114 : fIsDataCheck(kFALSE), fGeometry("MGeomCamMagic"), fInterlaced(kFALSE) 93 115 { 94 116 fName = name ? name : "MJCalibrateSignalFromOutside"; … … 121 143 } 122 144 123 Bool_t MJCalibrateSignalFromOutside::ProcessFile(MPedestalCam &pedcamab, MPedestalCam &pedcam rms, MCalibrationChargeCam &chargecam, MCalibrationQECam &qecam, MCalibrationRelTimeCam &relcam, Byte_t filetype)145 Bool_t MJCalibrateSignalFromOutside::ProcessFile(MPedestalCam &pedcamab, MPedestalCam &pedcam2, MCalibrationChargeCam &chargecam, MCalibrationQECam &qecam, MCalibrationRelTimeCam &relcam, Byte_t filetype) 124 146 { 125 147 // -------------------------------------------------------------------------------- … … 153 175 plist.AddToList(this); // take care of fDisplay! 154 176 plist.AddToList(&fBadPixels); 155 plist.AddToList(&pedcamrms); 177 plist.AddToList(&pedcam2); 178 plist.AddToList(&pedcamab); 156 179 plist.AddToList(&chargecam); 157 180 plist.AddToList(&qecam); 158 181 plist.AddToList(&relcam); 159 182 183 MCalibrationIntensityChargeCam intenscharge; 184 MCalibrationIntensityRelTimeCam intensreltime; 185 MCalibrationIntensityQECam intensqe; 186 MCalibrationIntensityBlindCam intensblind; 187 MBadPixelsIntensityCam intensbad; 188 189 MHCalibrationChargeCam hchargecam; 190 MHCalibrationChargeBlindCam hblindcam; 191 MHCalibrationChargePINDiode hpindiode; 192 MHCalibrationRelTimeCam hrelcam; 193 194 // 195 // Calibration Results containers 196 // 197 if (fInterlaced) 198 { 199 plist.AddToList(&intensqe); 200 plist.AddToList(&intenscharge); 201 plist.AddToList(&intensblind); 202 // plist.AddToList(&intensCalibrationPINDiode); 203 plist.AddToList(&intensreltime); 204 plist.AddToList(&intensbad); 205 206 hchargecam.SetLast(499.5); 207 hchargecam.SetNbins(300); 208 209 hchargecam.SetLoGain(kFALSE); 210 hrelcam.SetLoGain(kFALSE); 211 212 hchargecam.SetOscillations(kFALSE); 213 hrelcam.SetOscillations(kFALSE); 214 215 plist.AddToList(&hchargecam); 216 plist.AddToList(&hblindcam); 217 plist.AddToList(&hrelcam); 218 plist.AddToList(&hpindiode); 219 } 220 221 MPedPhotCam pedphotcam; 222 plist.AddToList(&pedphotcam); 223 224 MFillH fillhilo("MHCalibrationHiLoCam", "MExtractedSignalCam", "FillHiLoCam"); 225 fillhilo.SetBit(MFillH::kDoNotDisplay); 226 227 MCalibrationHiLoCam hilocam; 228 plist.AddToList(&hilocam); 160 229 // Setup Tasklist 161 230 MTaskList tlist; … … 181 250 } 182 251 252 // Check for interleaved events 253 MTriggerPatternDecode decode; 254 183 255 MGeomApply apply; // Only necessary to create geometry 184 256 apply.SetGeometry(fGeometry); 185 257 MBadPixelsMerge merge(&fBadPixels); 186 258 187 MPedCalcFromLoGain pedlo1("MPedCalcMeanFromLoGain"); 259 MPedestalCam pedcam; 260 261 pedcamab.SetName("MPedestalFundamental"); 262 pedcam2.SetName("MPedestalFromExtractorRndm"); 263 pedcam.SetName("MPedestalFromExtractor"); 264 plist.AddToList(&pedcam); 265 plist.AddToList(&pedcam2); 266 plist.AddToList(&pedcamab); 267 268 // Do signal and pedestal calculation 269 MPedCalcFromLoGain pedlo1("MPedCalcFundamental"); 188 270 pedlo1.SetPedestalUpdate(kTRUE); 189 pedlo1.Set PedestalsOut(&pedcamab);190 191 MPedCalcFromLoGain pedlo2("MPedCalc RmsFromLoGain");271 pedlo1.SetNamePedestalCamOut("MPedestalFundamental"); 272 273 MPedCalcFromLoGain pedlo2("MPedCalcWithExtractorRndm"); 192 274 pedlo2.SetPedestalUpdate(kTRUE); 193 pedlo2.SetPedestalsIn(&pedcamab); 194 pedlo2.SetPedestalsOut(&pedcamrms); 195 196 if (fExtractor->InheritsFrom("MExtractTimeAndCharge")) 197 pedlo2.SetExtractor((MExtractTimeAndCharge*)fExtractor); 275 pedlo2.SetRandomCalculation(kTRUE); 276 pedlo2.SetNamePedestalCamIn("MPedestalFundamental"); 277 pedlo2.SetNamePedestalCamOut("MPedestalFromExtractorRndm"); 278 279 MPedCalcFromLoGain pedlo3("MPedCalcWithExtractor"); 280 pedlo3.SetPedestalUpdate(kTRUE); 281 pedlo3.SetRandomCalculation(kFALSE); 282 pedlo3.SetNamePedestalCamIn("MPedestalFundamental"); 283 pedlo3.SetNamePedestalCamOut("MPedestalFromExtractor"); 284 285 if (fExtractor) 286 { 287 fExtractor->SetPedestals(&pedcamab); 288 289 if (fExtractor->InheritsFrom("MExtractTimeAndCharge")) 290 { 291 pedlo2.SetExtractor((MExtractTimeAndCharge*)fExtractor); 292 pedlo3.SetExtractor((MExtractTimeAndCharge*)fExtractor); 293 pedlo1.SetExtractWindow(15, 0/*obsolete*/); 294 pedlo2.SetExtractWindow(15, 0/*obsolete*/); 295 pedlo3.SetExtractWindow(15, 0/*obsolete*/); 296 } 297 else 298 { 299 // FIXME: How to get the fixed value 15 automatically? 300 const Int_t f = (Int_t)(15.5+fExtractor->GetHiGainFirst()); 301 const Int_t n = (Int_t)(15.5+fExtractor->GetNumHiGainSamples()); 302 pedlo1.SetExtractWindow(f, n); 303 pedlo2.SetExtractWindow(f, n); 304 pedlo3.SetExtractWindow(f, n); 305 } 306 } 198 307 199 308 MMcPedestalCopy pcopy; … … 205 314 calib.SetCalibrationMode(MCalibrateData::kFfactor); 206 315 calib.SetPedestalFlag(MCalibrateData::kRun); 316 calib.AddPedestal("MPedestalCam", "MPedPhotFundamental"); 317 calib.AddPedestal("MPedestalCam", "MPedPhotFromExtractor"); 318 calib.AddPedestal("MPedestalCam", "MPedPhotFromExtractorRndm"); 207 319 } 208 320 else 209 321 { 210 calib.AddPedestal("MPedestalCam", "MPedPhotFromExtractorRndm");211 322 calib.AddPedestal("Fundamental"); 323 calib.AddPedestal("FromExtractor"); 324 calib.AddPedestal("FromExtractorRndm"); 212 325 calib.SetPedestalFlag(MCalibrateData::kEvent); 213 } 214 326 calib.SetSignalType(MCalibrateData::kPhe); 327 } 328 215 329 MCalibrateRelTimes caltm; 216 330 MBadPixelsCalc bpcal; … … 225 339 MHCamEvent evt6(2, "Unsuitable", "Unsuitable event ratio;;%"); 226 340 MHCamEvent evt7(0, "Times", "Arrival Time;;T [slice]"); 341 MHCamEvent evt8(0, "HiLoConv", "Ratio Hi-Lo Gain Signal;;Ratio [1]"); 342 227 343 evt0.EnableVariance(); 228 344 evt1.EnableVariance(); … … 232 348 evt5.EnableVariance(); 233 349 evt7.EnableVariance(); 234 235 MFillH fill0(&evt0, &pedcamab, "FillPedFLG"); 236 MFillH fill1(&evt1, "MPedestalCam", "FillPedRmsFLG"); 237 MFillH fill2(&evt2, "MExtractedSignalCam", "FillExtracted"); 238 MFillH fill3(&evt3, "MPedPhotCam", "FillPedPhot"); 239 MFillH fill4(&evt4, "MPedPhotCam", "FillPedRMS"); 240 MFillH fill5(&evt5, "MCerPhotEvt", "FillInterpolated"); 350 evt8.EnableVariance(); 351 352 MFillH fill0(&evt0, "MPedestalFundamental", "FillPedFLG"); 353 MFillH fill1(&evt1, "MPedestalFromExtractorRndm", "FillPedRmsFLG"); 354 MFillH fill2(&evt2, "MExtractedSignalCam", "FillExtracted"); 355 MFillH fill3(&evt3, "MPedPhotFundamental", "FillPedPhot"); 356 MFillH fill4(&evt4, "MPedPhotFromExtractorRndm","FillPedRMS"); 357 MFillH fill5(&evt5, "MCerPhotEvt", "FillInterpolated"); 241 358 MFillH fill6(&evt6, "MBadPixelsCam", "FillUnsuitable"); 242 359 MFillH fill7(&evt7, "MArrivalTime", "FillTimes"); 360 MFillH fill8(&evt8, &hilocam, "FillHiLo"); 243 361 244 362 MWriteRootFile write(2, Form("%s{s/_D_/_Y_}", fPathOut.Data()), fOverwrite); … … 288 406 tlist2.AddToList(&apply); 289 407 tlist2.AddToList(&merge); 408 tlist2.AddToList(&decode); 290 409 if (filetype==3) 291 410 tlist2.AddToList(&pcopy); … … 295 414 tlist2.AddToList(&pedlo2); 296 415 } 416 MExtractPINDiode pinext; 417 MExtractBlindPixel blindext; 418 419 MFTriggerPattern fcalib; 420 421 MCalibrationChargeCalc chargecalc; 422 MCalibrationRelTimeCalc relcalc; 423 424 MCalibCalcFromPast pastcalc; 425 426 pinext.SetPedestals(&pedcamab); 427 blindext.SetPedestals(&pedcamab); 428 chargecalc.SetPedestals(&pedcam2); 429 430 pastcalc.SetChargeCalc(&chargecalc); 431 pastcalc.SetRelTimeCalc(&relcalc); 432 pastcalc.SetCalibrate(&calib); 433 297 434 tlist2.AddToList(&fill0); 298 435 tlist2.AddToList(&fill1); 299 436 tlist2.AddToList(&taskenv1); 300 437 tlist2.AddToList(&fill2); 438 tlist2.AddToList(&pinext); 439 tlist2.AddToList(&blindext); 440 // 441 // Calibration histogramming 442 // 443 MFillH fillpin("MHCalibrationChargePINDiode", "MExtractedSignalPINDiode", "FillPINDiode"); 444 MFillH fillbnd("MHCalibrationChargeBlindCam", "MExtractedSignalBlindPixel", "FillBlindCam"); 445 MFillH fillcam("MHCalibrationChargeCam", "MExtractedSignalCam", "FillChargeCam"); 446 MFillH filltme("MHCalibrationRelTimeCam", "MArrivalTimeCam", "FillRelTime"); 447 fillpin.SetBit(MFillH::kDoNotDisplay); 448 fillbnd.SetBit(MFillH::kDoNotDisplay); 449 fillcam.SetBit(MFillH::kDoNotDisplay); 450 filltme.SetBit(MFillH::kDoNotDisplay); 451 452 // 453 // Calibration Results containers 454 // 455 if (fInterlaced) 456 { 457 fcalib.DenyCalibration(); 458 fcalib.SetInverted(); 459 460 chargecalc.SetFilter(&fcalib); 461 pastcalc.SetFilter( &fcalib); 462 fillcam.SetFilter(&fcalib); 463 filltme.SetFilter(&fcalib); 464 fillbnd.SetFilter(&fcalib); 465 fillpin.SetFilter(&fcalib); 466 467 tlist2.AddToList(&fcalib); 468 tlist2.AddToList(&pastcalc); 469 tlist2.AddToList(&fillcam); 470 tlist2.AddToList(&filltme); 471 tlist2.AddToList(&fillbnd); 472 tlist2.AddToList(&fillpin); 473 tlist2.AddToList(&chargecalc); 474 tlist2.AddToList(&relcalc); 475 } 476 301 477 tlist2.AddToList(&calib); 302 478 if (&relcam) 303 479 tlist2.AddToList(&caltm); 480 tlist2.AddToList(&fillhilo); 304 481 tlist2.AddToList(&fill3); 305 482 tlist2.AddToList(&bpcal); … … 309 486 tlist2.AddToList(&fill6); 310 487 tlist2.AddToList(&fill7); 488 tlist2.AddToList(&fill8); 311 489 312 490 // Setup List for Drive-tree … … 316 494 tlist.AddToList(IsDataCheck() ? (MTask*)&rawread : (MTask*)&readreal); 317 495 tlist.AddToList(&tlist2, IsDataCheck()?"All":"Events"); 318 if (!IsDataCheck()) 319 tlist.AddToList(&pcalc, "Drive"); 496 497 // if (!IsDataCheck()) 498 // tlist.AddToList(&pcalc, "Drive"); 499 320 500 tlist.AddToList(&write); 321 501 … … 337 517 tlist.PrintStatistics(); 338 518 519 520 if (fInterlaced) 521 { 522 TObjArray cont; 523 cont.Add(&intensqe); 524 cont.Add(&intenscharge); 525 cont.Add(&intensblind); 526 // cont.Add(&intensCalibrationPINDiode); 527 cont.Add(&intensreltime); 528 cont.Add(&intensbad); 529 WriteContainer(cont); 530 } 531 339 532 if (!WriteResult()) 340 533 return kFALSE;
Note:
See TracChangeset
for help on using the changeset viewer.