#include "DSelector/DPROOFLiteManager.h" #include using namespace std; void Build_AndProcess(string locFileBaseName, string locTreeName, string locSelectorName, string locOutputFileName, unsigned int locNumThreads); TChain* Build_Chain(string locPath, string locFileBaseName, string locTreeName, unsigned int locMinRunNumber, unsigned int locMaxRunNumber); /* //MODERN .x Load_DSelector.C .L Process_Chain_analysis.C+ //CASCADE SEARCH Build_AndProcess("/cache/halld/home/pmatt/analysis_spring2016/ver05/tree_cascade/", "tree_cascade", "cascade_Tree", "selectors_analysis/DSelector_cascade_vertp4.C+", 4); Build_AndProcess("/cache/halld/home/pmatt/analysis_spring2016/ver05/tree_cascade/", "tree_cascade", "cascade_mm_Tree", "selectors_analysis/DSelector_cascade_mm.C+", 4); //ASYMMETRIES Build_AndProcess("/cache/halld/home/pmatt/analysis_spring2016/ver05.1/tree_klambda_merge/", "tree_klambda", "klambda_Tree", "selectors_analysis/DSelector_klambda.C+", 6); Build_AndProcess("/cache/halld/home/pmatt/analysis_spring2016/ver05/tree_ksigma0/", "tree_ksigma0", "ksigma0_Tree", "selectors_analysis/DSelector_ksigma0.C+", 4); */ void Build_AndProcess(string locFilePath, string locFileBaseName, string locTreeName, string locSelectorName, unsigned int locNumThreads) { unsigned int locMinRunNumber = 10391, locMaxRunNumber = 11663;// 11366; //full: 10391 - 11663 //1350: 11597 - 11663 //1200: 11366 - 11596 // unsigned int locMinRunNumber = 11366, locMaxRunNumber = 11663; // unsigned int locMinRunNumber = 11529, locMaxRunNumber = 11529; TChain* locChain = Build_Chain(locFilePath, locFileBaseName, locTreeName, locMinRunNumber, locMaxRunNumber); DPROOFLiteManager::Process_Chain(locChain, locSelectorName, locNumThreads); } TChain* Build_Chain(string locPath, string locFileBaseName, string locTreeName, unsigned int locMinRunNumber, unsigned int locMaxRunNumber) { //ASSUMES FILE NAME IN FORMAT: _.root TChain* locChain = new TChain(locTreeName.c_str()); for(unsigned int locRunNumber = locMinRunNumber; locRunNumber <= locMaxRunNumber; ++locRunNumber) { ostringstream locFileName; locFileName << locPath << "/" << locFileBaseName << "_0" << locRunNumber << ".root"; TFile* locFile = new TFile(locFileName.str().c_str(), "READ"); if(locFile->IsZombie()) { delete locFile; continue; } locChain->Add(locFileName.str().c_str()); locFile->Close(); delete locFile; } return locChain; } /* //MODERN .x Load_DSelector.C .L Process_Chain_analysis.C+ Test(); */ void Test(void) { // string locTreeName = "p2gamma_hists_Tree"; // string locTreeName = "kmkp_Tree"; string locTreeName = "2pi0pimpip_Tree"; TChain* locChain = new TChain(locTreeName.c_str()); locChain->Add("/cache/halld/RunPeriod-2016-02/analysis/ver05/tree_2pi0pimpip/010391/tree_2pi0pimpip_010391_000.root"); locChain->Add("/cache/halld/RunPeriod-2016-02/analysis/ver05/tree_2pi0pimpip/010391/tree_2pi0pimpip_010391_001.root"); /* locChain->Add("/cache/halld/RunPeriod-2016-02/analysis/ver05/tree_kmkp/011156/tree_kmkp_011156_000.root"); locChain->Add("/cache/halld/RunPeriod-2016-02/analysis/ver05/tree_kmkp/011156/tree_kmkp_011156_001.root"); locChain->Add("/cache/halld/RunPeriod-2016-02/analysis/ver05/tree_kmkp/011156/tree_kmkp_011156_002.root"); locChain->Add("/cache/halld/RunPeriod-2016-02/analysis/ver05/tree_kmkp/011156/tree_kmkp_011156_003.root"); */ /* locChain->Add("/cache/halld/RunPeriod-2016-02/analysis/ver05/tree_p2gamma_hists/011366/tree_p2gamma_hists_011366_000.root"); locChain->Add("/cache/halld/RunPeriod-2016-02/analysis/ver05/tree_p2gamma_hists/011366/tree_p2gamma_hists_011366_001.root"); locChain->Add("/cache/halld/RunPeriod-2016-02/analysis/ver05/tree_p2gamma_hists/011366/tree_p2gamma_hists_011366_002.root"); locChain->Add("/cache/halld/RunPeriod-2016-02/analysis/ver05/tree_p2gamma_hists/011366/tree_p2gamma_hists_011366_003.root"); locChain->Add("/cache/halld/RunPeriod-2016-02/analysis/ver05/tree_p2gamma_hists/011366/tree_p2gamma_hists_011366_004.root"); locChain->Add("/cache/halld/RunPeriod-2016-02/analysis/ver05/tree_p2gamma_hists/011366/tree_p2gamma_hists_011366_005.root"); locChain->Add("/cache/halld/RunPeriod-2016-02/analysis/ver05/tree_p2gamma_hists/011366/tree_p2gamma_hists_011366_006.root"); locChain->Add("/cache/halld/RunPeriod-2016-02/analysis/ver05/tree_p2gamma_hists/011366/tree_p2gamma_hists_011366_007.root"); locChain->Add("/cache/halld/RunPeriod-2016-02/analysis/ver05/tree_p2gamma_hists/011366/tree_p2gamma_hists_011366_008.root"); locChain->Add("/cache/halld/RunPeriod-2016-02/analysis/ver05/tree_p2gamma_hists/011366/tree_p2gamma_hists_011366_009.root"); locChain->Add("/cache/halld/RunPeriod-2016-02/analysis/ver05/tree_p2gamma_hists/011366/tree_p2gamma_hists_011366_010.root"); locChain->Add("/cache/halld/RunPeriod-2016-02/analysis/ver05/tree_p2gamma_hists/011366/tree_p2gamma_hists_011366_011.root"); locChain->Add("/cache/halld/RunPeriod-2016-02/analysis/ver05/tree_p2gamma_hists/011366/tree_p2gamma_hists_011366_012.root"); locChain->Add("/cache/halld/RunPeriod-2016-02/analysis/ver05/tree_p2gamma_hists/011366/tree_p2gamma_hists_011366_013.root"); locChain->Add("/cache/halld/RunPeriod-2016-02/analysis/ver05/tree_p2gamma_hists/011366/tree_p2gamma_hists_011366_014.root"); locChain->Add("/cache/halld/RunPeriod-2016-02/analysis/ver05/tree_p2gamma_hists/011366/tree_p2gamma_hists_011366_015.root"); locChain->Add("/cache/halld/RunPeriod-2016-02/analysis/ver05/tree_p2gamma_hists/011366/tree_p2gamma_hists_011366_016.root"); locChain->Add("/cache/halld/RunPeriod-2016-02/analysis/ver05/tree_p2gamma_hists/011366/tree_p2gamma_hists_011366_017.root"); locChain->Add("/cache/halld/RunPeriod-2016-02/analysis/ver05/tree_p2gamma_hists/011366/tree_p2gamma_hists_011366_018.root"); locChain->Add("/cache/halld/RunPeriod-2016-02/analysis/ver05/tree_p2gamma_hists/011366/tree_p2gamma_hists_011366_019.root"); */ string locSelectorName = "/home/pmatt/Scratch/gluex/DSelector_test.C+"; // locChain->Process(locSelectorName.c_str()); // return; int locNumThreads = 1; DPROOFLiteManager::Process_Chain(locChain, locSelectorName, locNumThreads); } //TChain, 2 files, 1 thread, no tree output, no custom branches: OK //TChain, 2 files, 1 thread, tree output, no custom branches: Crash /* POSSIBLE: Build_AndProcess("tree_cascade", "cascade_mm_lambda_Tree", "selectors_analysis/DSelector_cascade_mm_lambda.C+", "cascade_mm_lambda.root", 4); */ /* OLD .x Load_DSelector.C .L Process_Chain_analysis.C+ Build_AndProcess("tree_ksigma0", "ksigma0_Tree", "selectors_analysis/DSelector_ksigma0.C+", "ksigma0.root", 6); Build_AndProcess("tree_cascade", "cascade_p4fit_Tree", "selectors_analysis/DSelector_cascade_p4.C+", "cascade_p4.root", 6); Build_AndProcess("tree_2kp", "2kp_Tree", "selectors_analysis/DSelector_2kp.C+", "2kp.root", 6); Build_AndProcess("tree_k2pilambda", "k2pilambda_Tree", "selectors_analysis/DSelector_k2pilambda.C+", "k2pilambda.root", 6); Build_AndProcess("tree_kpisigmaplus", "kpisigmaplus_Tree", "selectors_analysis/DSelector_kpisigmaplus.C+", "kpisigmaplus.root", 6); Build_AndProcess("tree_kpi0sigma0", "kpi0sigma0_Tree", "selectors_analysis/DSelector_kpi0sigma0.C+", "kpi0sigma0.root", 6); Build_AndProcess("tree_cascade", "cascade_Tree", "selectors_analysis/DSelector_cascade_vertp4.C+", "cascade_vertp4.root", 6); Build_AndProcess("tree_3kqlambda", "3kqlambda_Tree", "selectors_analysis/DSelector_3kqlambda.C+", "3kqlambda.root", 6); Build_AndProcess("tree_cascade0", "cascade0_Tree", "selectors_analysis/DSelector_cascade0_vertp4.C+", "cascade0_vertp4.root", 6); Build_AndProcess("tree_cascade0", "cascade0_p4fit_Tree", "selectors_analysis/DSelector_cascade0_p4.C+", "cascade0_p4.root", 6); Build_AndProcess("tree_kpi0lambda", "kpi0lambda_Tree", "selectors_analysis/DSelector_kpi0lambda.C+", "kpi0lambda.root", 6); */