TENDER becomes Tender
[u/mrichter/AliRoot.git] / PWGLF / SPECTRA / ChargedHadrons / dNdPt / macros / run.C
CommitLineData
e7736c97 1void run(const char* esdList = "esds.list", Bool_t bUseMCInfo = kFALSE, Int_t nFiles=100, Int_t nEvents=500, Int_t firstEvent =0) {
2 TStopwatch timer;
3 timer.Start();
4 gSystem->SetIncludePath("-I$ROOTSYS/include -I$ALICE_ROOT/include -I$ALICE_ROOT/ITS -I$ALICE_ROOT -I$ALICE_ROOT/TRD");
5 gSystem->Load("libANALYSIS.so");
6 gSystem->Load("libANALYSISalice.so");
af472fff 7 gSystem->Load("libTender.so");
e7736c97 8 gSystem->Load("libCORRFW.so");
9 gSystem->Load("libPWG0base.so");
10 gSystem->Load("libPWG0dep.so");
11 gSystem->Load("libPWG0selectors.so");
12
13 Bool_t dodNdPtCutAnalysis = kTRUE; // AlidNdPtTask (data/MCtruth)
14
15 //____________________________________________//
16 // Make the analysis manager
17 AliAnalysisManager *mgr = new AliAnalysisManager("TestManager");
18 mgr->SetDebugLevel(0);
19
20 AliESDInputHandlerRP* esdH = new AliESDInputHandlerRP();
21 esdH->SetReadFriends(0);
22 mgr->SetInputEventHandler(esdH);
23
24 if(bUseMCInfo) {
25 // Enable MC event handler
26 AliMCEventHandler* handler = new AliMCEventHandler;
27 //handler->SetReadTR(kFALSE);
28 mgr->SetMCtruthEventHandler(handler);
29 }
30
31 // Chain
32 // TGrid::Connect("alien://");
33
34 //TChain* chain = new TChain("esdTree");
35 //chain->AddFile("inFile");
36
37 // Create input chain
38 gROOT->LoadMacro("$ALICE_ROOT/PWG0/CreateESDChain.C");
39 TChain* chain = CreateESDChain(esdList,nFiles);
40 if(!chain) {
41 printf("ERROR: chain cannot be created\n");
42 return;
43 }
44 chain->Lookup();
45
46 //
47 // Wagons to run
48 //
49 // dNdPtCutAnalysis (Jacek Otwinowski)
50 //
51 if (dodNdPtCutAnalysis) {
52 //
53 // Optionally MC information can be used by setting the 1st argument to true
54 //
55 gROOT->LoadMacro("$ALICE_ROOT/PWG0/dNdPt/macros/AddTask_dNdPtCutAnalysisPbPb.C");
56 AddTask_dNdPtCutAnalysisPbPb();
57 }
58
59 // Init
60 if (!mgr->InitAnalysis())
61 mgr->PrintStatus();
62 mgr->PrintStatus();
63 // Run on dataset
64 //
65
66 mgr->StartAnalysis("local",chain,nEvents, firstEvent);
67
68 timer.Stop();
69 timer.Print();
70}
71