Ignore:
Timestamp:
01/14/04 09:09:04 (21 years ago)
Author:
wittek
Message:
*** empty log message ***
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/MagicSoft/Mars/macros/ONOFFAnalysis.C

    r2777 r2798  
    197197
    198198    // Job A :
    199     //  - produce MHSigmaTheta plots for ON and OFF data
     199    //  - produce MHSigmaTheta plots for ON, OFF and MC data
    200200    //  - write out (or read in) these MHSigmaTheta plots
    201201    //  - read ON (or OFF or MC) data
     
    289289  // Job A
    290290  //=========
    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, ...)
    298296    //    (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)
    301297
    302298
     
    304300 {
    305301    gLog << "=====================================================" << endl;
    306     gLog << "Macro MagicAnalysis : Start of Job A" << endl;
     302    gLog << "Macro ONOFFAnalysis : Start of Job A" << endl;
    307303    gLog << "" << endl;
    308     gLog << "Macro MagicAnalysis : JobA, WPad, RPad, Wout = "
     304    gLog << "Macro ONOFFAnalysis : JobA, WPad, RPad, Wout = "
    309305         << (JobA ? "kTRUE" : "kFALSE")  << ",  "
    310306         << (WPad ? "kTRUE" : "kFALSE")  << ",  "
     
    318314    TString fileON  = onfile;
    319315    TString fileOFF = offfile;
    320     gLog << "fileON, fileOFF = " << fileON << ",  " << fileOFF << endl;
     316    TString fileMC  = mcfile;
     317    gLog << "fileON, fileOFF, fileMC = " << fileON << ",  "
     318         << fileOFF << ",  " << fileMC   << endl;
    321319
    322320    // name of file to conatin the histograms for the padding
     
    353351    // generate histograms to be used in the padding
    354352    //
    355     // read ON and OFF data files
     353    // read ON, OFF and MC data files
    356354    // generate (or read in) the padding histograms for ON and OFF data
    357355    //                       and merge these histograms
     
    526524
    527525      //-----------------------------------------
     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      //-----------------------------------------
    528606
    529607      gLog << "End of generating the padding histograms" << endl;
     
    762840
    763841
    764     gLog << "Macro MagicAnalysis : End of Job A" << endl;
     842    gLog << "Macro ONOFFAnalysis : End of Job A" << endl;
    765843    gLog << "===================================================" << endl;
    766844 }
     
    786864 {
    787865    gLog << "=====================================================" << endl;
    788     gLog << "Macro MagicAnalysis : Start of Job B_RF_UP" << endl;
     866    gLog << "Macro ONOFFAnalysis : Start of Job B_RF_UP" << endl;
    789867
    790868    gLog << "" << endl;
    791     gLog << "Macro MagicAnalysis : JobB_RF_UP, RTrainRF, CTrainRF, RTree, WRF = "
     869    gLog << "Macro ONOFFAnalysis : JobB_RF_UP, RTrainRF, CTrainRF, RTree, WRF = "
    792870         << (JobB_RF_UP ? "kTRUE" : "kFALSE")  << ",  "
    793871         << (RTrainRF ?   "kTRUE" : "kFALSE")  << ",  "
     
    12901368
    12911369      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 "
    12931371           << NameGammas << endl;
    12941372
     
    13021380
    13031381      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 "
    13051383           << NameHadrons << endl;
    13061384
     
    13691447    gLog << "" << endl;
    13701448    gLog << "========================================================" << endl;
    1371     gLog << "Macro MagicAnalysis : start growing trees" << endl;
     1449    gLog << "Macro ONOFFAnalysis : start growing trees" << endl;
    13721450
    13731451    MTaskList tlist2;
     
    16541732  }
    16551733
    1656     gLog << "Macro MagicAnalysis : End of Job B_RF_UP" << endl;
     1734    gLog << "Macro ONOFFAnalysis : End of Job B_RF_UP" << endl;
    16571735    gLog << "=======================================================" << endl;
    16581736 }
     
    16741752 {
    16751753    gLog << "=====================================================" << endl;
    1676     gLog << "Macro MagicAnalysis : Start of Job B_SC_UP" << endl;
     1754    gLog << "Macro ONOFFAnalysis : Start of Job B_SC_UP" << endl;
    16771755
    16781756    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 = "
    16801758         << (JobB_SC_UP ? "kTRUE" : "kFALSE")  << ",  "
    16811759         << (CMatrix    ? "kTRUE" : "kFALSE")  << ",  "
     
    22302308
    22312309
    2232     gLog << "Macro MagicAnalysis : End of Job B_SC_UP" << endl;
     2310    gLog << "Macro ONOFFAnalysis : End of Job B_SC_UP" << endl;
    22332311    gLog << "=======================================================" << endl;
    22342312 }
     
    22492327 {
    22502328    gLog << "=====================================================" << endl;
    2251     gLog << "Macro MagicAnalysis : Start of Job C" << endl;
     2329    gLog << "Macro ONOFFAnalysis : Start of Job C" << endl;
    22522330
    22532331    gLog << "" << endl;
    2254     gLog << "Macro MagicAnalysis : JobC = "
     2332    gLog << "Macro ONOFFAnalysis : JobC = "
    22552333         << (JobC ? "kTRUE" : "kFALSE")  << endl;
    22562334
     
    24582536    DeleteBinnings(&pliston);
    24592537
    2460     gLog << "Macro MagicAnalysis : End of Job C" << endl;
     2538    gLog << "Macro ONOFFAnalysis : End of Job C" << endl;
    24612539    gLog << "===================================================" << endl;
    24622540 }
     
    24772555 {
    24782556    gLog << "=====================================================" << endl;
    2479     gLog << "Macro MagicAnalysis : Start of Job D" << endl;
     2557    gLog << "Macro ONOFFAnalysis : Start of Job D" << endl;
    24802558
    24812559    gLog << "" << endl;
    2482     gLog << "Macro MagicAnalysis : JobD = "
     2560    gLog << "Macro ONOFFAnalysis : JobD = "
    24832561         << (JobD        ? "kTRUE" : "kFALSE")  << endl;
    24842562
     
    26982776    DeleteBinnings(&pliston);
    26992777
    2700     gLog << "Macro MagicAnalysis : End of Job D" << endl;
     2778    gLog << "Macro ONOFFAnalysis : End of Job D" << endl;
    27012779    gLog << "=======================================================" << endl;
    27022780 }
     
    27232801 {
    27242802    gLog << "=====================================================" << endl;
    2725     gLog << "Macro MagicAnalysis : Start of Job E_XX" << endl;
     2803    gLog << "Macro ONOFFAnalysis : Start of Job E_XX" << endl;
    27262804
    27272805    gLog << "" << endl;
    2728     gLog << "Macro MagicAnalysis : JobE_XX, CCollArea, OEEst, WEX = "
     2806    gLog << "Macro ONOFFAnalysis : JobE_XX, CCollArea, OEEst, WEX = "
    27292807         << (JobE_XX ? "kTRUE" : "kFALSE")  << ",  "
    27302808         << (CCollArea?"kTRUE" : "kFALSE")  << ",  "
     
    29513029    // Optimization of energy estimator
    29523030    //
    2953     gLog << "Macro MagicAnalysis.C : calling MagicEEst" << endl;
     3031    gLog << "Macro ONOFFAnalysis.C : calling MagicEEst" << endl;
    29543032
    29553033    TString inpath("");
     
    29603038            howMany,  maxhadronness, maxalpha, maxdist,
    29613039            binsE, binsTheta);
    2962     gLog << "Macro MagicAnalysis.C : returning from MagicEEst" << endl;
     3040    gLog << "Macro ONOFFAnalysis.C : returning from MagicEEst" << endl;
    29633041 }
    29643042
     
    29723050    gLog << "================================================================"
    29733051         << 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 '"
    29753053         << energyParName << "'" << endl;
    29763054    TFile enparam(energyParName);
     
    33073385  }
    33083386
    3309     gLog << "Macro Analysis : End of Job E_XX" << endl;
     3387    gLog << "Macro ONOFFAnalysis : End of Job E_XX" << endl;
    33103388    gLog << "=======================================================" << endl;
    33113389 }
Note: See TracChangeset for help on using the changeset viewer.