X-Git-Url: http://git.uio.no/git/?p=u%2Fmrichter%2FAliRoot.git;a=blobdiff_plain;f=PWG4%2Fmacros%2Fana.C;h=dadbfe2e0f4a84916257431157325b7746214eb9;hp=4aaed1b330bb5233a08ab0bb0cc62f9398cf0ce0;hb=7175a03a8491717e0441d4cd448cd4aa6052fe88;hpb=3e0577a21c5c3c91448fb6bb1808e9d468041113 diff --git a/PWG4/macros/ana.C b/PWG4/macros/ana.C index 4aaed1b330b..dadbfe2e0f4 100644 --- a/PWG4/macros/ana.C +++ b/PWG4/macros/ana.C @@ -36,7 +36,9 @@ const Int_t kNumberOfEventsPerFile = 100; //--------------------------------------------------------------------------- const Bool_t kMC = kTRUE; //With real data kMC = kFALSE -const TString kInputData = "ESD"; +const TString kInputData = "ESD";//ESD, AOD, MC +TString kTreeName = "esdTree"; + void ana(Int_t mode=mLocal, TString configName = "ConfigAnalysisPhoton") { // Main @@ -51,7 +53,15 @@ void ana(Int_t mode=mLocal, TString configName = "ConfigAnalysisPhoton") //------------------------------------------------------------------------------------------------- //Create chain from ESD and from cross sections files, look below for options. //------------------------------------------------------------------------------------------------- - TChain *chain = new TChain("esdTree") ; + if(kInputData == "ESD") kTreeName = "esdTree" ; + else if(kInputData == "AOD") kTreeName = "aodTree" ; + else if (kInputData == "MC") kTreeName = "TE" ; + else { + cout<<"Wrong data type "<SetReadTR(kFALSE);//Do not search TrackRef file mgr->SetMCtruthEventHandler(mcHandler); @@ -336,6 +346,11 @@ void CreateChain(const anaModes mode, TChain * chain, TChain * chainxs){ cout<<"NEVENT : "<Get("esdTree") ) { + if ( fESD->Get(kTreeName) ) { printf("++++ Adding %s\n", file) ; chain->AddFile(file); chainxs->Add(filexs) ;