1 const char *anatype = "ESD";
3 void macro_HighPtDeDx_lhc10b_Data_ESDs()
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 analysis framework libraries
20 gSystem->Load("libANALYSIS");
21 gSystem->Load("libOADB");
22 gSystem->Load("libANALYSISalice");
23 gSystem->Load("libCORRFW");
26 TString intPath = gInterpreter->GetIncludePath();
27 TObjArray *listpaths = intPath.Tokenize(" ");
28 TIter nextpath(listpaths);
30 while ((pname=(TObjString*)nextpath())) {
31 TString current = pname->GetName();
32 if (current.Contains("AliRoot") || current.Contains("ALICE_ROOT")) continue;
33 gSystem->AddIncludePath(current);
35 if (listpaths) delete listpaths;
36 gSystem->AddIncludePath("-I$ROOTSYS/include -I$ALICE_ROOT/include ");
37 gROOT->ProcessLine(".include $ALICE_ROOT/include");
38 printf("Include path: %s\n", gSystem->GetIncludePath());
40 // Add aditional AliRoot libraries
42 // analysis source to be compiled at runtime (if any)
43 gROOT->ProcessLine(".L DebugClasses.C+g");
44 gROOT->ProcessLine(".L AliAnalysisTaskHighPtDeDx.cxx+g");
45 gROOT->ProcessLine(".L AliAnalysisTaskHighPtDeDxV0.cxx+g");
47 // fast xrootd reading enabled
48 printf("!!! You requested FastRead option. Using xrootd flags to reduce timeouts. Note that this may skip some files that could be accessed !!!");
49 gEnv->SetValue("XNet.ConnectTimeout",50);
50 gEnv->SetValue("XNet.RequestTimeout",50);
51 gEnv->SetValue("XNet.MaxRedirectCount",2);
52 gEnv->SetValue("XNet.ReconnectTimeout",50);
53 gEnv->SetValue("XNet.FirstConnectMaxCnt",1);
55 // connect to AliEn and make the chain
56 if (!TGrid::Connect("alien://")) return;
57 // read the analysis manager from file
58 AliAnalysisManager *mgr = AliAnalysisAlien::LoadAnalysisManager("HighPtDeDx_lhc10b_Data_ESDs.root");
61 AliLog::SetGlobalLogLevel(AliLog::kError);
62 TChain *chain = CreateChain("wn.xml", anatype);
64 mgr->StartAnalysis("localfile", chain);
69 //________________________________________________________________________________
70 TChain* CreateChain(const char *xmlfile, const char *type="ESD")
72 // Create a chain using url's from xml file
75 TString treename = type;
78 printf("***************************************\n");
79 printf(" Getting chain of trees %s\n", treename.Data());
80 printf("***************************************\n");
81 TAlienCollection *coll = TAlienCollection::Open(xmlfile);
83 ::Error("CreateChain", "Cannot create an AliEn collection from %s", xmlfile);
86 AliAnalysisManager *mgr = AliAnalysisManager::GetAnalysisManager();
87 TChain *chain = new TChain(treename);
89 while (coll->Next()) {
90 filename = coll->GetTURL();
92 Int_t nrun = AliAnalysisManager::GetRunFromAlienPath(filename);
93 if (nrun && nrun != run) {
94 printf("### Run number detected from chain: %d\n", nrun);
95 mgr->SetRunFromPath(nrun);
101 if (!chain->GetNtrees()) {
102 ::Error("CreateChain", "No tree found from collection %s", xmlfile);