Changeset 2798 for trunk/MagicSoft/Mars/macros
- Timestamp:
- 01/14/04 09:09:04 (21 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/MagicSoft/Mars/macros/ONOFFAnalysis.C
r2777 r2798 197 197 198 198 // Job A : 199 // - produce MHSigmaTheta plots for ON and OFFdata199 // - produce MHSigmaTheta plots for ON, OFF and MC data 200 200 // - write out (or read in) these MHSigmaTheta plots 201 201 // - read ON (or OFF or MC) data … … 289 289 // Job A 290 290 //========= 291 // read ON data file 292 293 // - produce the 2D-histogram "sigmabar versus Theta" 294 // (SigmaTheta_ON.root) for ON data 295 // (to be used for the padding of the MC gamma data) 296 297 // - write a file of ON events (ON1.root) 291 292 // - produce the histograms "sigmabar versus Theta", etc. 293 // for ON, OFF and MC data (to be used for the padding) 294 // 295 // - write root file of padded ON (OFF, MC) events (ON1.root, ...) 298 296 // (after the standard cuts, before the g/h separation) 299 // (to be used together with the corresponding MC gamma file (MC1.root)300 // for the optimization of the g/h separation)301 297 302 298 … … 304 300 { 305 301 gLog << "=====================================================" << endl; 306 gLog << "Macro MagicAnalysis : Start of Job A" << endl;302 gLog << "Macro ONOFFAnalysis : Start of Job A" << endl; 307 303 gLog << "" << endl; 308 gLog << "Macro MagicAnalysis : JobA, WPad, RPad, Wout = "304 gLog << "Macro ONOFFAnalysis : JobA, WPad, RPad, Wout = " 309 305 << (JobA ? "kTRUE" : "kFALSE") << ", " 310 306 << (WPad ? "kTRUE" : "kFALSE") << ", " … … 318 314 TString fileON = onfile; 319 315 TString fileOFF = offfile; 320 gLog << "fileON, fileOFF = " << fileON << ", " << fileOFF << endl; 316 TString fileMC = mcfile; 317 gLog << "fileON, fileOFF, fileMC = " << fileON << ", " 318 << fileOFF << ", " << fileMC << endl; 321 319 322 320 // name of file to conatin the histograms for the padding … … 353 351 // generate histograms to be used in the padding 354 352 // 355 // read ON and OFFdata files353 // read ON, OFF and MC data files 356 354 // generate (or read in) the padding histograms for ON and OFF data 357 355 // and merge these histograms … … 526 524 527 525 //----------------------------------------- 526 // MC events 527 528 gLog << "------------" << endl; 529 gLog << "MC events :" << endl; 530 gLog << "------------" << endl; 531 532 MTaskList tlistmc; 533 MParList plistmc; 534 535 MReadMarsFile readMC("Events", fileMC); 536 read.DisableAutoScheme(); 537 // MCT1ReadPreProc readMC(fileMC); 538 539 MFSelBasic selthetamc; 540 selthetamc.SetCuts(-100.0, 29.5, 35.5); 541 MContinue contthetamc(&selthetamc); 542 543 MBlindPixelCalc blindmc; 544 blindmc.SetUseBlindPixels(); 545 546 MFSelBasic selbasicmc; 547 MContinue contbasicmc(&selbasicmc); 548 549 MHBlindPixels blindMC("BlindPixelsMC"); 550 MFillH fillblindMC("BlindPixelsMC[MHBlindPixels]", "MBlindPixels"); 551 fillblindMC.SetName("FillBlindMC"); 552 553 MSigmabarCalc sigbarcalcmc; 554 555 MHSigmaTheta sigthMC("SigmaThetaMC"); 556 MFillH fillsigthetaMC ("SigmaThetaMC[MHSigmaTheta]", "MMcEvt"); 557 fillsigthetaMC.SetName("FillSigThetaMC"); 558 559 //***************************** 560 // entries in MParList 561 562 plistmc.AddToList(&tlistmc); 563 InitBinnings(&plistmc); 564 plistmc.AddToList(&blindMC); 565 plistmc.AddToList(&sigthMC); 566 567 568 //***************************** 569 // entries in MTaskList 570 571 tlistmc.AddToList(&readMC); 572 //tlistmc.AddToList(&contthetamc); 573 574 tlistmc.AddToList(&blindmc); 575 576 tlistmc.AddToList(&contbasicmc); 577 tlistmc.AddToList(&fillblindMC); 578 tlistmc.AddToList(&sigbarcalcmc); 579 tlistmc.AddToList(&fillsigthetaMC); 580 581 MProgressBar barmc; 582 MEvtLoop evtloopmc; 583 evtloopmc.SetParList(&plistmc); 584 evtloopmc.SetProgressBar(&barmc); 585 586 Int_t maxeventsmc = -1; 587 //Int_t maxeventsmc = 20000; 588 if ( !evtloopmc.Eventloop(maxeventsmc) ) 589 return; 590 591 tlistmc.PrintStatistics(0, kTRUE); 592 593 blindMC.DrawClone(); 594 sigthMC.DrawClone(); 595 596 // save the histograms for the padding 597 TH2D *sigthmc = sigthMC.GetSigmaTheta(); 598 TH3D *sigpixthmc = sigthMC.GetSigmaPixTheta(); 599 TH3D *diffpixthmc = sigthMC.GetDiffPixTheta(); 600 601 TH2D *blindidthmc = blindMC.GetBlindId(); 602 TH2D *blindnthmc = blindMC.GetBlindN(); 603 604 605 //----------------------------------------- 528 606 529 607 gLog << "End of generating the padding histograms" << endl; … … 762 840 763 841 764 gLog << "Macro MagicAnalysis : End of Job A" << endl;842 gLog << "Macro ONOFFAnalysis : End of Job A" << endl; 765 843 gLog << "===================================================" << endl; 766 844 } … … 786 864 { 787 865 gLog << "=====================================================" << endl; 788 gLog << "Macro MagicAnalysis : Start of Job B_RF_UP" << endl;866 gLog << "Macro ONOFFAnalysis : Start of Job B_RF_UP" << endl; 789 867 790 868 gLog << "" << endl; 791 gLog << "Macro MagicAnalysis : JobB_RF_UP, RTrainRF, CTrainRF, RTree, WRF = "869 gLog << "Macro ONOFFAnalysis : JobB_RF_UP, RTrainRF, CTrainRF, RTree, WRF = " 792 870 << (JobB_RF_UP ? "kTRUE" : "kFALSE") << ", " 793 871 << (RTrainRF ? "kTRUE" : "kFALSE") << ", " … … 1290 1368 1291 1369 gLog << "" << endl; 1292 gLog << "Macro MagicAnalysis : matrix of training events for gammas written onto file "1370 gLog << "Macro ONOFFAnalysis : matrix of training events for gammas written onto file " 1293 1371 << NameGammas << endl; 1294 1372 … … 1302 1380 1303 1381 gLog << "" << endl; 1304 gLog << "Macro MagicAnalysis : matrix of training events for hadrons written onto file "1382 gLog << "Macro ONOFFAnalysis : matrix of training events for hadrons written onto file " 1305 1383 << NameHadrons << endl; 1306 1384 … … 1369 1447 gLog << "" << endl; 1370 1448 gLog << "========================================================" << endl; 1371 gLog << "Macro MagicAnalysis : start growing trees" << endl;1449 gLog << "Macro ONOFFAnalysis : start growing trees" << endl; 1372 1450 1373 1451 MTaskList tlist2; … … 1654 1732 } 1655 1733 1656 gLog << "Macro MagicAnalysis : End of Job B_RF_UP" << endl;1734 gLog << "Macro ONOFFAnalysis : End of Job B_RF_UP" << endl; 1657 1735 gLog << "=======================================================" << endl; 1658 1736 } … … 1674 1752 { 1675 1753 gLog << "=====================================================" << endl; 1676 gLog << "Macro MagicAnalysis : Start of Job B_SC_UP" << endl;1754 gLog << "Macro ONOFFAnalysis : Start of Job B_SC_UP" << endl; 1677 1755 1678 1756 gLog << "" << endl; 1679 gLog << "Macro MagicAnalysis : JobB_SC_UP, CMatrix, RMatrix, WOptimize, RTest, WSC = "1757 gLog << "Macro ONOFFAnalysis : JobB_SC_UP, CMatrix, RMatrix, WOptimize, RTest, WSC = " 1680 1758 << (JobB_SC_UP ? "kTRUE" : "kFALSE") << ", " 1681 1759 << (CMatrix ? "kTRUE" : "kFALSE") << ", " … … 2230 2308 2231 2309 2232 gLog << "Macro MagicAnalysis : End of Job B_SC_UP" << endl;2310 gLog << "Macro ONOFFAnalysis : End of Job B_SC_UP" << endl; 2233 2311 gLog << "=======================================================" << endl; 2234 2312 } … … 2249 2327 { 2250 2328 gLog << "=====================================================" << endl; 2251 gLog << "Macro MagicAnalysis : Start of Job C" << endl;2329 gLog << "Macro ONOFFAnalysis : Start of Job C" << endl; 2252 2330 2253 2331 gLog << "" << endl; 2254 gLog << "Macro MagicAnalysis : JobC = "2332 gLog << "Macro ONOFFAnalysis : JobC = " 2255 2333 << (JobC ? "kTRUE" : "kFALSE") << endl; 2256 2334 … … 2458 2536 DeleteBinnings(&pliston); 2459 2537 2460 gLog << "Macro MagicAnalysis : End of Job C" << endl;2538 gLog << "Macro ONOFFAnalysis : End of Job C" << endl; 2461 2539 gLog << "===================================================" << endl; 2462 2540 } … … 2477 2555 { 2478 2556 gLog << "=====================================================" << endl; 2479 gLog << "Macro MagicAnalysis : Start of Job D" << endl;2557 gLog << "Macro ONOFFAnalysis : Start of Job D" << endl; 2480 2558 2481 2559 gLog << "" << endl; 2482 gLog << "Macro MagicAnalysis : JobD = "2560 gLog << "Macro ONOFFAnalysis : JobD = " 2483 2561 << (JobD ? "kTRUE" : "kFALSE") << endl; 2484 2562 … … 2698 2776 DeleteBinnings(&pliston); 2699 2777 2700 gLog << "Macro MagicAnalysis : End of Job D" << endl;2778 gLog << "Macro ONOFFAnalysis : End of Job D" << endl; 2701 2779 gLog << "=======================================================" << endl; 2702 2780 } … … 2723 2801 { 2724 2802 gLog << "=====================================================" << endl; 2725 gLog << "Macro MagicAnalysis : Start of Job E_XX" << endl;2803 gLog << "Macro ONOFFAnalysis : Start of Job E_XX" << endl; 2726 2804 2727 2805 gLog << "" << endl; 2728 gLog << "Macro MagicAnalysis : JobE_XX, CCollArea, OEEst, WEX = "2806 gLog << "Macro ONOFFAnalysis : JobE_XX, CCollArea, OEEst, WEX = " 2729 2807 << (JobE_XX ? "kTRUE" : "kFALSE") << ", " 2730 2808 << (CCollArea?"kTRUE" : "kFALSE") << ", " … … 2951 3029 // Optimization of energy estimator 2952 3030 // 2953 gLog << "Macro MagicAnalysis.C : calling MagicEEst" << endl;3031 gLog << "Macro ONOFFAnalysis.C : calling MagicEEst" << endl; 2954 3032 2955 3033 TString inpath(""); … … 2960 3038 howMany, maxhadronness, maxalpha, maxdist, 2961 3039 binsE, binsTheta); 2962 gLog << "Macro MagicAnalysis.C : returning from MagicEEst" << endl;3040 gLog << "Macro ONOFFAnalysis.C : returning from MagicEEst" << endl; 2963 3041 } 2964 3042 … … 2972 3050 gLog << "================================================================" 2973 3051 << endl; 2974 gLog << "Macro MagicAnalysis.C : read parameters of energy estimator and migration matrix from file '"3052 gLog << "Macro ONOFFAnalysis.C : read parameters of energy estimator and migration matrix from file '" 2975 3053 << energyParName << "'" << endl; 2976 3054 TFile enparam(energyParName); … … 3307 3385 } 3308 3386 3309 gLog << "Macro Analysis : End of Job E_XX" << endl;3387 gLog << "Macro ONOFFAnalysis : End of Job E_XX" << endl; 3310 3388 gLog << "=======================================================" << endl; 3311 3389 }
Note:
See TracChangeset
for help on using the changeset viewer.