1 void runGrid(Bool_t mcFlag=kFALSE){
3 // Load common libraries
4 gSystem->Load("libCore");
5 gSystem->Load("libTree");
6 gSystem->Load("libGeom");
7 gSystem->Load("libVMC");
8 gSystem->Load("libPhysics");
9 gSystem->Load("libSTEERBase");
10 gSystem->Load("libESD");
11 gSystem->Load("libAOD");
12 gSystem->Load("libANALYSIS");
13 gSystem->Load("libANALYSISalice");
14 // Use AliRoot includes to compile our task
15 gROOT->ProcessLine(".include $ALICE_ROOT/include");
17 // Create and configure the alien handler plugin
18 gROOT->LoadMacro("runWithHandler.C");
19 AliAnalysisGrid *alienHandler = runWithHandler();
20 if (!alienHandler) return;
22 // Create the analysis manager
23 AliAnalysisManager *mgr = new AliAnalysisManager("TrackletsTaskManager");
25 // Connect plug-in to the analysis manager
26 mgr->SetGridHandler(alienHandler);
28 gROOT->LoadMacro("AliTrackletsTask.cxx++g");
29 AliTrackletsTask *task = new AliTrackletsTask();
32 AliESDInputHandler* esdH = new AliESDInputHandler();
33 mgr->SetInputEventHandler(esdH);
35 gROOT->LoadMacro("$ALICE_ROOT/OADB/macros/AddTaskPhysicsSelection.C");
36 printf("The flag for the Physics selection is set to %d\n",(Int_t)mcFlag);
37 AliPhysicsSelectionTask* physSelTask = AddTaskPhysicsSelection(mcFlag);
39 // No need to create a chain - this is handled by the plug-in
40 // gROOT->LoadMacro("$ALICE_ROOT/PWG0/CreateESDChain.C");
41 // TChain* chain = CreateESDChain("ESD82XX_30K.txt", 10);
43 // Create containers for input/output
44 AliAnalysisDataContainer *cinput = mgr->GetCommonInputContainer();
45 AliAnalysisDataContainer *coutput = mgr->CreateContainer("chist", TList::Class(), AliAnalysisManager::kOutputContainer, "TrackletsTaskOutput.root");
47 // Connect input/output
48 mgr->ConnectInput(task, 0, cinput);
49 mgr->ConnectOutput(task, 0, coutput);
51 // Enable debug printouts
52 mgr->SetDebugLevel(2);
54 if (!mgr->InitAnalysis())
58 // Start analysis in grid.
59 mgr->StartAnalysis("grid");