TENDER becomes Tender, removing .so
[u/mrichter/AliRoot.git] / PWG / DevNanoAOD / runLocalCorrelations.C
1 #if !defined (__CINT__) || (defined(__MAKECINT__))
2 #include <iostream>
3 #include "AliAnalysisGrid.h"
4 #include "TSystem.h"
5 #include "TROOT.h"
6 #include "AliAnalysisManager.h"
7 #include "AliAnalysisGrid.h"
8 #include "AliVEventHandler.h"
9 #include "AliAODInputHandler.h"
10 #include "AliAnalysisAlien.h"
11 #include "AliMCEventHandler.h"
12 #include "AliPhysicsSelectionTask.h"
13 #include "TRegexp.h"
14 #include "AliTriggerAnalysis.h"
15 #include "TChain.h"
16 #include "AliAnalysisTaskPIDResponse.h"
17 #include "AliAODHandler.h"
18 #include "AliAnalysisTaskNanoAODFilter.h"
19 #include "AliESEHelpers.h"
20
21 #endif
22 void LoadLibs();
23
24 class AliAnalysisGrid;
25
26
27
28 //______________________________________________________________________________
29 void runLocalCorrelations(
30                           const int iMCtruth = 2, 
31                           const char * addTaskString = ".x AddTaskNanoAODFilter.C(%d,1)" // 
32                           )
33 {
34   LoadLibs();
35   // analysis manager
36   AliAnalysisManager* mgr = new AliAnalysisManager("NanoAOD Filter", "NanoAOD filter for nanoAOD production");
37     
38   AliAODInputHandler* iH = new AliAODInputHandler();
39   mgr->SetInputEventHandler(iH);
40
41   // Define aod output handler
42   AliAODHandler* aodOutputHandler = new AliAODHandler();
43   aodOutputHandler->SetOutputFileName("AliAOD.NanoAOD.root");
44   mgr->SetOutputEventHandler(aodOutputHandler);
45   
46   gROOT->LoadMacro("$ALICE_ROOT/ANALYSIS/macros/AddTaskPIDResponse.C");
47   AliAnalysisTaskPIDResponse *taskPID=AddTaskPIDResponse(iMCtruth);
48   taskPID->SetUseTPCEtaCorrection(kTRUE); 
49
50   // create task
51   cout << "Macro: "<< addTaskString << " " << Form(addTaskString, iMCtruth) << endl;
52
53   AliAnalysisTaskNanoAODFilter * task = (AliAnalysisTaskNanoAODFilter*) gROOT->ProcessLine(Form(addTaskString, iMCtruth));
54
55   // Set Track event and vertex cuts here!
56   AliAnalysisNanoAODTrackCuts* trk = new AliAnalysisNanoAODTrackCuts;
57   //  trk->SetBitMask((1 << 4) | (1 << 8)); // hybrid 2010
58   trk->SetBitMask((1 << 9)); // ???
59   trk->SetMaxEta(0.9);
60   trk->SetMinPt(0.5);
61
62   AliAnalysisNanoAODEventCuts* evt = new AliAnalysisNanoAODEventCuts;
63   evt->SetVertexRange(7);
64
65   task->SetTrkCuts(trk);
66   task->SetEvtCuts(evt);
67   task->SetSetter(new AliNanoAODSimpleSetter);
68   task->SetVarList("pt,theta,phi");
69   task->SetVarListHead("cstCentr,cstMagField");
70
71   task->SelectCollisionCandidates(AliVEvent::kMB);
72
73
74   //task->SelectCollisionCandidates(AliVEvent::kMB);// FIXME
75   // enable debug printouts
76   mgr->SetDebugLevel(10);
77   //    mgr->SetNSysInfo(100);
78   if (!mgr->InitAnalysis()) return;
79   mgr->PrintStatus();
80   
81   // start analysis
82   // Always read the same file:
83   TChain * chain = new TChain("aodTree");
84   chain->Add("./AliAOD.root");
85
86   Printf("Starting Analysis....");
87   mgr->StartAnalysis("local", chain,123456789);
88
89 }
90
91 //______________________________________________________________________________
92
93 void LoadLibs() {
94   gSystem->Load("libCore");  
95   gSystem->Load("libGeom");
96   gSystem->Load("libPhysics");
97   gSystem->Load("libVMC");
98   gSystem->Load("libTree");
99   gSystem->Load("libProof");
100   gSystem->Load("libMatrix");
101   gSystem->Load("libMinuit");
102   gSystem->Load("libSTEERBase");
103   gSystem->Load("libESD");
104   gSystem->Load("libAOD");
105   gSystem->Load("libANALYSIS");
106   //  return;
107   gSystem->Load("libOADB");
108   gSystem->Load("libANALYSISalice");
109   gSystem->Load("libTender");
110   gSystem->Load("libCORRFW");
111
112   //  gSystem->Load("libNanoAOD");
113   gSystem->Load("libPWGLFspectra");
114   gSystem->Load("libPWGDevNanoAOD");
115
116 }