//______________________________________________________________________________ TChain* CreateChain(Int_t mode, Char_t* inputPath, Char_t* aodFilename = "AliAOD.root") { printf("*******************************\n"); printf("*** Getting the Chain ***\n"); printf("*******************************\n"); TChain *chain = 0x0; if(mode==kMgridInteractive || mode==kMgridBatch){ AliTagAnalysis *analysis = new AliTagAnalysis(); chain = analysis->GetChainFromCollection(inputPath,"aodTree"); } else{ chain = new TChain("aodTree"); TString inFileName(aodFilename); inFileName.Prepend(Form("%s/",inputPath)); chain->Add(inFileName); } //if (chain) chain->ls(); return chain; }
void runLocal(const char *chainlistfile, int dataFromAlien=0) { TStopwatch timer; timer.Start(); printf("*** Connect to AliEn ***\n"); if (dataFromAlien) TGrid::Connect("alien://"); gSystem->Load("libProofPlayer"); //____________________________________________________// //_____________Setting up STEERBase.par_______________// //____________________________________________________// setupPar("STEERBase"); gSystem->Load("libSTEERBase"); //____________________________________________________// //_____________Setting up ESD.par_____________________// //____________________________________________________// setupPar("ESD"); gSystem->Load("libVMC"); gSystem->Load("libESD"); //____________________________________________________// //_____________Setting up AOD.par_____________________// //____________________________________________________// setupPar("AOD"); gSystem->Load("libAOD"); //_________________________________________________________// //_____________Setting up ANALYSIS.par_____________________// //_________________________________________________________// setupPar("ANALYSIS"); gSystem->Load("libANALYSIS"); //_________________________________________________________// //_____________Setting up ANALYSISalice.par________________// //_________________________________________________________// setupPar("ANALYSISalice"); gSystem->Load("libANALYSISalice"); //____________________________________________________// //_____________Setting up PWG2AOD.par_________________// //____________________________________________________// setupPar("PWG2AOD"); gSystem->Load("libPWG2AOD"); //____________________________________________________// //_____________Setting up PWG2femtoscopy.par__________// //____________________________________________________// setupPar("PWG2femtoscopy"); gSystem->Load("libPWG2femtoscopy"); //____________________________________________________// //_____________Setting up PWG2femtoscopyUser.par______// //____________________________________________________// setupPar("PWG2femtoscopyUser"); gSystem->Load("libPWG2femtoscopyUser"); //ANALYSIS PART gSystem->SetIncludePath("-I$ROOTSYS/include -I\"/usr/local/CERN/root/include\" -I./PWG2femtoscopy/FEMTOSCOPY/AliFemto -I./PWG2femtoscopyUser/FEMTOSCOPY/AliFemtoUser -I./ESD -I./AOD -I./ANALYSIS -I./PWG2AOD/AOD"); gROOT->LoadMacro("ConfigFemtoAnalysis.C++"); //____________________________________________// //Usage of event tags AliTagAnalysis *analysis = new AliTagAnalysis(); TChain *chain = 0x0; // chain = analysis->GetChainFromCollection(collectionfile,"esdTree"); if (dataFromAlien) { AliTagAnalysis *analysis = new AliTagAnalysis(); chain = analysis->GetChainFromCollection(chainlistfile,"esdTree"); } else { gROOT->LoadMacro("CreateESDChain.C"); chain = CreateESDChain(chainlistfile,500); } //____________________________________________// // Make the analysis manager AliAnalysisManager *mgr = new AliAnalysisManager("TestManager"); AliESDInputHandler* esdH = new AliESDInputHandler; AliMCEventHandler *mcH = new AliMCEventHandler; esdH->SetInactiveBranches("FMD CaloCluster"); mgr->SetInputEventHandler(esdH); mgr->SetMCtruthEventHandler(mcH); //____________________________________________// // 1st Pt task AliAnalysisTaskFemto *task1 = new AliAnalysisTaskFemto("TaskFemto"); mgr->AddTask(task1); // Create containers for input/output // AliAnalysisDataContainer *cinput1 = mgr->GetCommonInputContainer(); AliAnalysisDataContainer *cinput1 = mgr->CreateContainer("input0", TTree::Class(), AliAnalysisManager::kInputContainer); AliAnalysisDataContainer *coutput1 = mgr->CreateContainer("clist1", TList::Class(),AliAnalysisManager::kOutputContainer,"Femto.ESD.root"); //____________________________________________// cinput1->SetData(chain); mgr->ConnectInput(task1,0,cinput1); mgr->ConnectOutput(task1,0,coutput1); if (!mgr->InitAnalysis()) return; mgr->PrintStatus(); mgr->StartAnalysis("local",chain); timer.Stop(); timer.Print(); }