]>
Commit | Line | Data |
---|---|---|
f6e094bd | 1 | // $Id$ |
2 | ||
3 | const Int_t mode = 0; // 0-->Local, 1-->Grid interactive | |
4 | const Bool_t bIsAOD = kTRUE; | |
5 | const Bool_t bIsMC = kFALSE; | |
6 | ||
7 | const Bool_t bIsPhysSel = kFALSE; | |
8 | const Bool_t bIsCentSel = kFALSE; | |
9 | const Bool_t bIsEvnPSel = kFALSE; | |
10 | const Bool_t bIsRespPID = kFALSE; | |
11 | ||
12 | const TString setData = "dataset.txt"; | |
13 | //============================================================================= | |
14 | ||
15 | const Bool_t bIsEMCalAna = kFALSE; | |
16 | ||
17 | const Bool_t bFastOnly = kTRUE; | |
18 | const Bool_t bHistoW = kTRUE; | |
19 | const Double_t dMinEclus = 5.; | |
20 | const Double_t dMinPtClus = 5.; | |
21 | const Double_t dVz = 10.; | |
22 | const Bool_t bVzDiff = kTRUE; | |
23 | const Double_t dCentMin = -1.; | |
24 | const Double_t dCentMax = -1.; | |
25 | const Double_t dMinScaleCT = -1.; | |
26 | const Double_t dMaxScaleCT = -1.; | |
27 | //============================================================================= | |
28 | ||
29 | void AnalysisTrainCorrJetsLocal() | |
30 | { | |
31 | if (mode==1 && !TGrid::Connect("alien://")) { | |
32 | ::Error("AnalysisTrainCorrJetsLocal.C::AnalysisTrainCorrJetsLocal", "Can not connect to the Grid!"); | |
33 | return; | |
34 | } | |
35 | if (LoadLibraries()) { | |
36 | ::Error("AnalysisTrainCorrJetsLocal.C::AnalysisTrainCorrJetsLocal", "Load libraries failed!"); | |
37 | return; | |
38 | } | |
39 | //============================================================================= | |
40 | ||
41 | TChain *chain = CreateAODFriendChain(setData); | |
42 | if (!chain) { | |
43 | ::Error("AnalysisTrainCorrJetsLocal.C::AnalysisTrainCorrJetsLocal", "Creating input chain failed!"); | |
44 | return; | |
45 | } | |
46 | //============================================================================= | |
47 | ||
48 | const UInt_t triggerMask = AliVEvent::kMB; | |
49 | AliAnalysisManager *mgr = new AliAnalysisManager("AnalysisTrainCorrJetsLocal", "Analysis Train Jet Correlation Local"); | |
50 | ||
51 | if (bIsAOD) { | |
52 | gROOT->LoadMacro("$ALICE_ROOT/ANALYSIS/macros/train/AddAODHandler.C"); | |
53 | AliAODInputHandler *aodIH = AddAODHandler(); | |
54 | } else { | |
55 | gROOT->LoadMacro("$ALICE_ROOT/ANALYSIS/macros/train/AddESDHandler.C"); | |
56 | AliESDInputHandler *esdIH = AddESDHandler(); | |
57 | // esdIH->SetReadFriends(kFALSE); | |
58 | } | |
59 | if (bIsMC && !bIsAOD) { | |
60 | AliMCEventHandler *mctEH = new AliMCEventHandler(); | |
61 | mcH->SetPreReadMode(AliMCEventHandler::kLmPreRead); | |
62 | mcH->SetReadTR(kTRUE); | |
63 | mgr->SetMCtruthEventHandler(mcH); | |
64 | } | |
65 | //============================================================================= | |
66 | ||
67 | if (bIsPhysSel && !bIsAOD && !bIsEMCalAna) { | |
68 | gROOT->LoadMacro("$ALICE_ROOT/ANALYSIS/macros/AddTaskPhysicsSelection.C"); | |
69 | AliPhysicsSelectionTask *taskPhysSel = AddTaskPhysicsSelection(bIsMC); | |
70 | } | |
71 | ||
72 | if (bIsCentSel && !bIsAOD) { | |
73 | gROOT->LoadMacro("$ALICE_ROOT/ANALYSIS/macros/AddTaskCentrality.C"); | |
74 | AliCentralitySelectionTask *taskCentrality = AddTaskCentrality(); | |
75 | if (bIsMC) taskCentrality->SetMCInput(); | |
76 | } | |
77 | ||
78 | if (bIsEvnPSel) { | |
79 | gROOT->LoadMacro("$ALICE_ROOT/ANALYSIS/macros/AddTaskEventplane.C"); | |
80 | AliEPSelectionTask *taskEventPlane = AddTaskEventplane(); | |
81 | if (bIsMC) taskEventPlane->SetUseMCRP(); | |
82 | } | |
83 | ||
84 | if (bIsRespPID) { | |
85 | gROOT->LoadMacro("$ALICE_ROOT/ANALYSIS/macros/AddTaskPIDResponse.C"); | |
86 | AliAnalysisTaskSE *taskRespPID = AddTaskPIDResponse(bIsMC); | |
87 | } | |
88 | //============================================================================= | |
89 | ||
90 | if (bIsEMCalAna) { | |
91 | if (bIsEvnPSel) { | |
92 | gROOT->LoadMacro("$ALICE_ROOT/PWG/EMCAL/macros/AddTaskEmcalPhysicsSelection.C"); | |
93 | AliPhysicsSelectionTask *taskPhysSel = AddTaskEmcalPhysicsSelection(bFastOnly, bHistoW, triggerMask, | |
94 | dMinEclus, dMinPtClus, | |
95 | dVz, bVzDiff, | |
96 | bIsCentSel ? dCentMin : -1., | |
97 | bIsCentSel ? dCentMax : -1., | |
98 | dMinScaleCT, dMaxScaleCT); | |
99 | } | |
100 | ||
101 | gROOT->LoadMacro("$ALICE_ROOT/PWG/EMCAL/macros/AddTaskEmcalSetup.C"); | |
102 | AliEmcalSetupTask *taskSetupEMCal = AddTaskEmcalSetup(); | |
103 | taskSetupEMCal->SetGeoPath("$ALICE_ROOT/OADB/EMCAL"); | |
104 | ||
105 | gROOT->LoadMacro("$ALICE_ROOT/PWGJE/EMCALJetTasks/macros/AddTaskJetPreparation.C"); | |
106 | AddTaskJetPreparation(bIsAOD ? "AOD" : "ESD"); //TODO | |
107 | } | |
108 | //============================================================================= | |
109 | ||
110 | gROOT->LoadMacro("AddTasksFlavorJet.C"); AddTasksFlavorJet(); | |
111 | if (mgr->InitAnalysis()) { mgr->PrintStatus(); mgr->StartAnalysis("local",chain); } | |
112 | return; | |
113 | } | |
114 | ||
115 | //============================================================================= | |
116 | TChain *CreateAODFriendChain(TString setData) | |
117 | { | |
118 | if (!setData.EndsWith(".txt")) return 0; | |
119 | ||
120 | TChain *chain = new TChain("aodTree"); | |
121 | TChain *cFrid = new TChain("aodTree"); | |
122 | ||
123 | TString dataFile; | |
124 | ifstream dataList(setData.Data(), ios::in); | |
125 | while (!dataList.eof()) { | |
126 | dataFile.ReadLine(dataList,kFALSE); | |
127 | if (!dataFile.EndsWith("AliAOD.root")) continue; | |
128 | if (!gSystem->AccessPathName(dataFile.Data())) chain->Add(dataFile.Data()); | |
129 | ||
130 | dataFile.ReplaceAll("AliAOD.root","AliAOD.VertexingHF.root"); | |
131 | if (!gSystem->AccessPathName(dataFile.Data())) cFrid->Add(dataFile.Data()); | |
132 | } dataList.close(); | |
133 | ||
134 | chain->AddFriend(cFrid); | |
135 | return chain; | |
136 | } | |
137 | ||
138 | //============================================================================= | |
139 | Bool_t LoadLibraries() | |
140 | { | |
141 | if (gSystem->Load("libTree") <0) return kTRUE; | |
142 | if (gSystem->Load("libGeom") <0) return kTRUE; | |
143 | if (gSystem->Load("libPhysics") <0) return kTRUE; | |
144 | if (gSystem->Load("libVMC") <0) return kTRUE; | |
145 | if (gSystem->Load("libMinuit") <0) return kTRUE; | |
146 | if (gSystem->Load("libMinuit2") <0) return kTRUE; | |
147 | ||
148 | if (gSystem->Load("libCore") <0) return kTRUE; | |
149 | if (gSystem->Load("libXMLIO") <0) return kTRUE; | |
150 | if (gSystem->Load("libXMLParser") <0) return kTRUE; | |
151 | if (gSystem->Load("libProof") <0) return kTRUE; | |
152 | if (gSystem->Load("libProofPlayer")<0) return kTRUE; | |
153 | if (gSystem->Load("libGui") <0) return kTRUE; | |
154 | //============================================================================= | |
155 | ||
156 | gSystem->AddIncludePath("-Wno-deprecated"); | |
157 | gSystem->AddIncludePath("-I$ALICE_ROOT/include"); | |
158 | gSystem->AddIncludePath("-I$ALICE_ROOT/PWGHF/vertexingHF"); | |
159 | gSystem->AddIncludePath("-I$ALICE_ROOT/EMCAL"); | |
160 | gSystem->AddIncludePath("-I$ALICE_ROOT/JETAN"); | |
161 | gSystem->AddIncludePath("-I$ALICE_ROOT/JETAN/fastjet"); | |
162 | ||
163 | if (gSystem->Load("libSTEERBase") <0) return kTRUE; | |
164 | if (gSystem->Load("libESD") <0) return kTRUE; | |
165 | if (gSystem->Load("libAOD") <0) return kTRUE; | |
166 | if (gSystem->Load("libANALYSIS") <0) return kTRUE; | |
167 | if (gSystem->Load("libOADB") <0) return kTRUE; | |
168 | if (gSystem->Load("libANALYSISalice") <0) return kTRUE; | |
169 | if (gSystem->Load("libCORRFW") <0) return kTRUE; | |
170 | ||
171 | if (gSystem->Load("libPWGTools") <0) return kTRUE; | |
172 | if (gSystem->Load("libPWGflowBase") <0) return kTRUE; | |
173 | if (gSystem->Load("libPWGflowTasks") <0) return kTRUE; | |
174 | if (gSystem->Load("libPWGHFbase") <0) return kTRUE; | |
175 | if (gSystem->Load("libPWGHFvertexingHF") <0) return kTRUE; | |
176 | ||
177 | if (gSystem->Load("libSTAT") <0) return kTRUE; | |
178 | if (gSystem->Load("libEMCALUtils") <0) return kTRUE; | |
179 | //if (gSystem->Load("libPHOSUtils") <0) return kTRUE; | |
180 | ||
181 | if (gSystem->Load("libCDB") <0) return kTRUE; | |
182 | if (gSystem->Load("libRAWDatabase") <0) return kTRUE; | |
183 | if (gSystem->Load("libRAWDatarec") <0) return kTRUE; | |
184 | if (gSystem->Load("libSTEER") <0) return kTRUE; | |
185 | if (gSystem->Load("libITSbase") <0) return kTRUE; | |
186 | if (gSystem->Load("libITSrec") <0) return kTRUE; | |
187 | if (gSystem->Load("libTPCbase") <0) return kTRUE; | |
188 | if (gSystem->Load("libTPCrec") <0) return kTRUE; | |
189 | if (gSystem->Load("libTRDbase") <0) return kTRUE; | |
190 | if (gSystem->Load("libTRDrec") <0) return kTRUE; | |
191 | if (gSystem->Load("libTOFbase") <0) return kTRUE; | |
192 | //if (gSystem->Load("libTOFrec") <0) return kTRUE; | |
193 | if (gSystem->Load("libHMPIDbase") <0) return kTRUE; | |
194 | if (gSystem->Load("libEMCALraw") <0) return kTRUE; | |
195 | if (gSystem->Load("libEMCALbase") <0) return kTRUE; | |
196 | if (gSystem->Load("libEMCALrec") <0) return kTRUE; | |
197 | if (gSystem->Load("libVZERObase") <0) return kTRUE; | |
198 | if (gSystem->Load("libVZEROrec") <0) return kTRUE; | |
199 | if (gSystem->Load("libTENDER") <0) return kTRUE; | |
200 | if (gSystem->Load("libTENDERSupplies") <0) return kTRUE; | |
201 | ||
202 | if (gSystem->Load("libCGAL") <0) return kTRUE; | |
203 | if (gSystem->Load("libfastjet") <0) return kTRUE; | |
204 | if (gSystem->Load("libsiscone") <0) return kTRUE; | |
205 | if (gSystem->Load("libSISConePlugin") <0) return kTRUE; | |
206 | ||
207 | if (gSystem->Load("libJETAN") <0) return kTRUE; | |
208 | if (gSystem->Load("libFASTJETAN") <0) return kTRUE; | |
209 | if (gSystem->Load("libPWGEMCAL") <0) return kTRUE; | |
210 | if (gSystem->Load("libPWGGAEMCALTasks") <0) return kTRUE; | |
211 | if (gSystem->Load("libPWGJEEMCALJetTasks")<0) return kTRUE; | |
212 | ||
213 | if (gROOT->LoadMacro("AliAnalysisTaskSEDmesonsFilterCJ.cxx+") <0) return kTRUE; | |
214 | if (gROOT->LoadMacro("AliAnalysisTaskFlavorJetCorrelations.cxx+")<0) return kTRUE; | |
215 | return kFALSE; | |
216 | } |