]> git.uio.no Git - u/mrichter/AliRoot.git/blame - PWGCF/EBYE/PIDFluctuation/task/SteerAODAnalysisTaskPIDFluctuation.C
some modification to suppress text outputs (Deepika Rathee <deepika.rathee@cern.ch>)
[u/mrichter/AliRoot.git] / PWGCF / EBYE / PIDFluctuation / task / SteerAODAnalysisTaskPIDFluctuation.C
CommitLineData
a6fd3cfe 1SteerAODAnalysisTaskPIDFluctuation(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("aodTree");
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("PIDFluctuation");
50
51 /* define input event handler */
52 AliAODInputHandler *aodh = new AliAODInputHandler();
53 mgr->SetInputEventHandler(aodh);
54
55 gROOT->LoadMacro("AddAnalysisTaskPIDFluctuation.C");
56 AddAnalysisTaskPIDFluctuation(AliAODTrack::kTrkGlobal, 0., 10., -0.8, 0.8);
57 AddAnalysisTaskPIDFluctuation(AliAODTrack::kTrkTPCOnly, 0., 10., -0.8, 0.8);
58 AddAnalysisTaskPIDFluctuation(AliAODTrack::kTrkTPCOnly, 0.3, 1.5, -0.8, 0.8);
59 AddAnalysisTaskPIDFluctuation(AliAODTrack::kTrkTPCOnly, 0.3, 1.5, -0.4, 0.4);
60
61 /* start analysis */
62 mgr->SetDebugLevel(0);
63 if (!mgr->InitAnalysis()) return;
64 mgr->PrintStatus();
65 mgr->StartAnalysis("local", chain, maxEv);
66
67 /* create dummy file to tell we are done */
68 gSystem->Exec("touch done");
69
70}