1 const char *anatype = "ESD";
5 // Analysis using ESD data
6 // Automatically generated analysis steering macro executed in grid subjobs
11 // Set temporary merging directory to current one
12 gSystem->Setenv("TMPDIR", gSystem->pwd());
14 // Set temporary compilation directory to current one
15 gSystem->SetBuildDir(gSystem->pwd(), kTRUE);
17 // Reset existing include path and add current directory first in the search
18 gSystem->SetIncludePath("-I.");
19 // load base root libraries
20 gSystem->Load("libTree");
21 gSystem->Load("libGeom");
22 gSystem->Load("libVMC");
23 gSystem->Load("libPhysics");
25 gSystem->Load("libMinuit");
27 // Load analysis framework libraries
28 gSystem->Load("libSTEERBase");
29 gSystem->Load("libESD");
30 gSystem->Load("libAOD");
31 gSystem->Load("libANALYSIS");
32 gSystem->Load("libOADB");
33 gSystem->Load("libANALYSISalice");
34 gSystem->Load("libCORRFW");
37 TString intPath = gInterpreter->GetIncludePath();
38 TObjArray *listpaths = intPath.Tokenize(" ");
39 TIter nextpath(listpaths);
41 while ((pname=(TObjString*)nextpath())) {
42 TString current = pname->GetName();
43 if (current.Contains("AliRoot") || current.Contains("ALICE_ROOT")) continue;
44 gSystem->AddIncludePath(current);
46 if (listpaths) delete listpaths;
47 gROOT->ProcessLine(".include $ALICE_ROOT/include");
48 printf("Include path: %s\n", gSystem->GetIncludePath());
50 // Add aditional AliRoot libraries
52 // analysis source to be compiled at runtime (if any)
53 gROOT->ProcessLine(".L AliAnalysisCentralitySelector.cxx+g");
54 gROOT->ProcessLine(".L AliAnalysisTaskPerformanceStrange.cxx+g");
56 // connect to AliEn and make the chain
57 if (!TGrid::Connect("alien://")) return;
58 // read the analysis manager from file
59 AliAnalysisManager *mgr = AliAnalysisAlien::LoadAnalysisManager("analysis.root");
62 AliLog::SetGlobalLogLevel(AliLog::kError);
63 TChain *chain = CreateChain("wn.xml", anatype);
65 mgr->StartAnalysis("localfile", chain);
70 //________________________________________________________________________________
71 TChain* CreateChain(const char *xmlfile, const char *type="ESD")
73 // Create a chain using url's from xml file
76 TString treename = type;
79 printf("***************************************\n");
80 printf(" Getting chain of trees %s\n", treename.Data());
81 printf("***************************************\n");
82 TAlienCollection *coll = TAlienCollection::Open(xmlfile);
84 ::Error("CreateChain", "Cannot create an AliEn collection from %s", xmlfile);
87 AliAnalysisManager *mgr = AliAnalysisManager::GetAnalysisManager();
88 TChain *chain = new TChain(treename);
90 while (coll->Next()) {
91 filename = coll->GetTURL();
93 Int_t nrun = AliAnalysisManager::GetRunFromAlienPath(filename);
94 if (nrun && nrun != run) {
95 printf("### Run number detected from chain: %d\n", nrun);
96 mgr->SetRunFromPath(nrun);
100 chain->Add(filename);
102 if (!chain->GetNtrees()) {
103 ::Error("CreateChain", "No tree found from collection %s", xmlfile);