#include "hades.h" #include "hloop.h" #include "htaskset.h" #include "hdst.h" #include "htime.h" #include "hcategory.h" #include "hcategorymanager.h" #include "hparticlecand.h" #include "hparticletracksorter.h" #include "hparticlebooker.h" #include "hparticletool.h" #include "hparticledef.h" #include "hparticleevtinfo.h" #include "henergylosscorrpar.h" #include "hphysicsconstants.h" #include "TString.h" #include "TROOT.h" #include "TSystem.h" #include "TFile.h" #include "TH1F.h" #include #include using namespace std; Int_t loopDST_task( TString infileList="/lustre/nyx/hades/dstsim/prop2017/ag1650ag/gen1/phi/root/Ag_Ag_1650MeV_1000evts_1[0-2][0-9][0-9]_1_dst_apr12.root", TString outfile="hanalysis.root",Int_t nEvents=30000) { // infileList : comma seprated file list "file1.root,file2.root" or "something*.root" // outfile : optional (not used here) , used to store hists in root file // nEvents : number of events to processed. if nEvents < entries or < 0 the chain will be processed Bool_t isSimulation = kTRUE; //------------------------------------------------- // create loop obejct and hades HLoop loop(kTRUE); //------------------------------------------------- //------------------------------------------------- // setup the spectrometer for filter tasks // this part is needed if your task needs // detectors or parameter container if(0){ TString beamtime="apr12"; Int_t mdcMods[6][4]= { {1,1,1,1}, {1,1,1,1}, {1,1,1,1}, {1,1,1,1}, {1,1,1,1}, {1,1,1,1} }; TString asciiParFile = ""; TString rootParFile = "/cvmfs/hades.gsi.de/param/real/apr12/allParam_APR12_gen8_10072015.root"; TString paramSource = "root"; // root, ascii, oracle TString paramrelease = "APR12_dst_gen8"; // now, APR12_gen2_dst APR12_gen5_dst HDst::setupSpectrometer(beamtime,mdcMods,"rich,mdc,tof,rpc,shower,wall,start,tbox"); HDst::setupParameterSources(paramSource,asciiParFile,rootParFile,paramrelease); // now, APR12_gen2_dst } //------------------------------------------------- //------------------------------------------------- // list of all files with working sectors if(!isSimulation) loop.readSectorFileList("/lustre/nyx/hades/dst/apr12/gen8/sector_selection/FileListHadron.list",kFALSE,kFALSE); //------------------------------------------------- //------------------------------------------------- // reading input files and decalring containers Bool_t ret =kFALSE; if(infileList.Contains(",")){ ret = loop.addMultFiles(infileList); // file1,file2,file3 } else{ ret = loop.addFiles(infileList); // myroot*.root } if(ret == 0) { cout<<"READBACK: ERROR : cannot find inputfiles : "<getTaskSet("all"); HDEAnaTask* anaTask = new HDEAnaTask(string(outfile)); anaTask->setOutputDir("1ktest3008/"); masterTaskSet->add(anaTask); //------------------------------------------------- HParticleTrackSorter sorter; sorter.setIgnoreInnerMDC(); sorter.init(); //------------------------------------------------- // event loop starts here Int_t entries = loop.getEntries(); if(nEvents < entries && nEvents >= 0 ) entries = nEvents; for (Int_t i = 0; i < entries; i++) { Int_t nbytes = loop.nextEvent(i); // get next event. categories will be cleared before if(nbytes <= 0) { cout<finalizeTasks(); //------------------------------------------------- delete gHades; return 0; }