Split: fix refs to AddTaskCentrality.C
[u/mrichter/AliRoot.git] / PWGCF / EBYE / PIDFluctuation / task / SteerAnalysisTaskPIDFluctuation.C
CommitLineData
a6fd3cfe 1SteerAnalysisTaskPIDFluctuation(const Char_t *inputfilename, Int_t maxFiles = kMaxInt, Int_t maxEv = kMaxInt)
2{
3
4 /* include path for ACLic */
5 gSystem->AddIncludePath("-I$ALICE_ROOT/include");
6 gSystem->AddIncludePath("-I$ALICE_ROOT/TOF");
7 /* load libraries */
8 gSystem->Load("libANALYSIS");
9 gSystem->Load("libANALYSISalice");
10 /* build analysis task class */
11 gROOT->LoadMacro("AliAnalysisTaskPIDFluctuation.cxx+g");
12
13 /* setup input chain */
14 TString str = inputfilename;
15 const Char_t *filename;
16 TChain *chain = new TChain("esdTree");
17 if (str.EndsWith(".xml")) {
18 TGrid::Connect("alien://");
19 Info("", "reading data list from collection:");
20 TAlienCollection coll(inputfilename, maxFiles);
21 coll.Reset();
22 while (coll.Next()) {
23 filename = coll.GetTURL();
24 Info("", Form("%s", filename));
25 chain->Add(filename);
26 }
27 }
28 else if (str.EndsWith(".txt")) {
29 Info("", "reading data list from text file:");
30 ifstream is(inputfilename);
31 Char_t buf[4096];
32 while(!is.eof()) {
33 is.getline(buf, 4096);
34 if (is.eof()) break;
35 chain->Add(buf);
36 Info("", Form("%s", buf));
37 }
38 is.close();
39 }
40 else {
41 Info("", "single file:");
42 filename = inputfilename;
43 Info("", Form("%s", filename));
44 chain->Add(filename);
45 }
46 Info("", Form("chain is ready: %d events", chain->GetEntries()));
47
48 /* create analysis manager */
49 AliAnalysisManager *mgr = new AliAnalysisManager("EbyEFluctuationPID");
50
51 /* define input event handler */
52 AliESDInputHandler *esdh = new AliESDInputHandler();
53 esdh->SetReadFriends(kFALSE);
54 mgr->SetInputEventHandler(esdh);
55
56 /* add tasks */
57 gROOT->LoadMacro("$ALICE_ROOT/ANALYSIS/macros/AddTaskPhysicsSelection.C");
58 AliPhysicsSelectionTask* physSelTask = AddTaskPhysicsSelection(kFALSE);
1c06a186 59 gROOT->LoadMacro("$ALICE_ROOT/OADB/macros/AddTaskCentrality.C");
a6fd3cfe 60 AliCentralitySelectionTask *centralityTask = AddTaskCentrality();
61 gROOT->LoadMacro("AddAnalysisTaskPIDFluctuation.C");
62 AliAnalysisTaskPIDFluctuation *thisTask = AddAnalysisTaskPIDFluctuation();
63
64 printf("ready-steady-go\n");
65
66 /* start analysis */
67 mgr->SetDebugLevel(0);
68 if (!mgr->InitAnalysis()) return;
69 mgr->PrintStatus();
70 mgr->StartAnalysis("local", chain, maxEv);
71
72 /* create dummy file to tell we are done */
73 gSystem->Exec("touch done");
74
75}