]>
Commit | Line | Data |
---|---|---|
647ea9aa | 1 | void AddTasksFlavourJet(const Int_t iCandType = 1 /*0 = D0, 1=Dstar...*/, |
92d9c9cb | 2 | const TString sCutFile = "cutsHF/D0toKpiCutsppRecVtxNoPileupRejNoEMCAL.root", |
3 | const Double_t dJetPtCut = 1., | |
4 | const Double_t dJetAreaCut = 0., | |
5 | const char *acctype = "TPC", | |
6 | const TString sRunPeriod = "LHC10b", | |
7 | const Int_t uBeamType = 0, | |
8 | const UInt_t uTriggerMask = AliVEvent::kMB, /*for jets; the D mesons trigger is defined in the cut object*/ | |
9 | const Bool_t bIsMC = kFALSE, | |
10 | const Bool_t bIsReco = kFALSE, | |
11 | const Bool_t bIsMap = kFALSE, | |
12 | TString sText=""/*completes the name of the candidate task lists*/ | |
34d158dd | 13 | const Bool_t bUseEMCalTrig = kFALSE, |
14 | const Bool_t bIsTrain=kFALSE | |
92d9c9cb | 15 | ) |
f6e094bd | 16 | { |
92d9c9cb | 17 | const TString sInputTrkMC = "MCParticlesSelected"; |
18 | const TString sInputTrkRec = "tracks"; | |
19 | const TString sUsedTrks = "PicoTracks"; | |
20 | const TString sUsedClus = ""; | |
21 | TString sInputTrk = bIsReco ? sInputTrkRec : sInputTrkMC; | |
22 | const Int_t iJetAlgo = 1; | |
23 | const Int_t iJetType = 1; | |
5b64c502 | 24 | |
92d9c9cb | 25 | const Int_t nRadius = 1; |
26 | const Double_t aRadius[] = { 0.4 }; | |
27 | const TString sRadius[] = { "R04" }; | |
28 | ||
29 | //============================================================================= | |
30 | ||
31 | AliAnalysisManager *mgr = AliAnalysisManager::GetAnalysisManager(); | |
32 | ||
33 | if (!mgr) { | |
34 | ::Error("AddTasksFlavourJet.C::AddTasksFlavourJet", "No analysis manager to connect to."); | |
35 | return; | |
36 | } | |
37 | ||
38 | TString type = mgr->GetInputEventHandler()->GetDataType(); | |
39 | if (!type.Contains("ESD") && !type.Contains("AOD")) { | |
40 | ::Error("AddTasksFlavourJet.C::AddTasksFlavourJet", "Task manager to have an ESD or AOD input handler."); | |
41 | return; | |
42 | } | |
43 | ||
44 | if (!mgr->GetInputEventHandler()) { | |
45 | ::Error("AddTasksFlavourJet.C::AddTasksFlavourJet", "This task requires an input event handler"); | |
46 | return; | |
47 | } | |
48 | //============================================================================= | |
49 | ||
50 | UInt_t uAnaType = (((iJetType==0) || (iJetType==2)) ? 1 : 0); | |
51 | Int_t iLeading = ((iJetType==0) ? 3 : ((iJetType==1) ? 0 : 1)); | |
52 | Int_t leadHadType=0; /* 0=charged, 1=neutral, 2=both*/ | |
53 | //D mesons -- PID | |
54 | gROOT->LoadMacro("$ALICE_ROOT/ANALYSIS/macros/AddTaskPIDResponse.C"); | |
55 | AliAnalysisTaskSE *taskRespPID = AddTaskPIDResponse(bIsMC); | |
56 | ||
57 | // -- D meson selection | |
58 | ||
d2f609e4 | 59 | gROOT->LoadMacro("$ALICE_ROOT/PWGJE/FlavourJetTasks/macros/AddTaskDFilterAndCorrelations.C"); |
60 | ||
bbb94467 | 61 | |
92d9c9cb | 62 | // EMCal framework |
63 | // -- Physics selection task | |
a1a0a01b | 64 | if(!bIsMC){ |
65 | gROOT->LoadMacro("$ALICE_ROOT/PWG/EMCAL/macros/AddTaskEmcalPhysicsSelection.C"); | |
66 | AliPhysicsSelectionTask *physSelTask = AddTaskEmcalPhysicsSelection(kTRUE, kTRUE, uTriggerMask, 5, 5, 10, kTRUE, -1, -1, -1, -1); | |
67 | ||
68 | if (!physSelTask) { | |
69 | cout << "no physSelTask"; | |
70 | return; | |
71 | } | |
92d9c9cb | 72 | } |
92d9c9cb | 73 | // -- |
74 | gROOT->LoadMacro("$ALICE_ROOT/PWG/EMCAL/macros/AddTaskEmcalSetup.C"); | |
75 | AliEmcalSetupTask *taskSetupEMCal = AddTaskEmcalSetup(); | |
ad6abcae | 76 | //taskSetupEMCal->SetOcdbPath("raw://"); //needed for period LHC12h and i |
92d9c9cb | 77 | taskSetupEMCal->SetGeoPath("$ALICE_ROOT/OADB/EMCAL"); |
78 | taskSetupEMCal->SelectCollisionCandidates(uTriggerMask); | |
79 | ||
80 | // Jet preparation | |
81 | //gROOT->LoadMacro("/data/Work/jets/testEMCalJetFramework/code/v4/AddTaskJetPreparation.C"); | |
82 | gROOT->LoadMacro("$ALICE_ROOT/PWGJE/EMCALJetTasks/macros/AddTaskJetPreparation.C"); | |
34d158dd | 83 | AddTaskJetPreparation(sRunPeriod,"PicoTracks",bIsMC ? "MCParticlesSelected" : "",/*next 7 emcal default settings*/"","",2.,0.,0.03,0.015,0.15,uTriggerMask, kFALSE /*track cluster*/,kFALSE /*do histos*/,kTRUE /*make pico tracks*/,bUseEMCalTrig /*make emcal trigger*/,bIsTrain /*is emcal train*/); |
92d9c9cb | 84 | |
92d9c9cb | 85 | |
86 | gROOT->LoadMacro("$ALICE_ROOT/PWGJE/EMCALJetTasks/macros/AddTaskEmcalJet.C"); | |
87 | //gROOT->LoadMacro("$ALICE_ROOT/PWGJE/EMCALJetTasks/macros/AddTaskEmcalJetSample.C"); | |
88 | ||
92d9c9cb | 89 | gROOT->LoadMacro("$ALICE_ROOT/PWGJE/EMCALJetTasks/macros/AddTaskJetResponseMaker.C"); |
90 | ||
91 | for (Int_t i=0; i<nRadius; i++) { | |
92 | //jet reconstruction for correlation | |
93 | //AliEmcalJetTask *taskFJ = AddTaskEmcalJet(bIsMC&&!bIsReco ? sInputTrkMC.Data() : sUsedTrks.Data(),sUsedClus.Data(),iJetAlgo,aRadius[i],iJetType); | |
94 | //I think like follows it's fine: sUsedTrks contains the picotracks of MC or reco tracks according to IsReco | |
95 | AliEmcalJetTask *taskFJ = AddTaskEmcalJet(sUsedTrks.Data(),sUsedClus.Data(),iJetAlgo,aRadius[i],iJetType); | |
96 | ||
97 | taskFJ->SelectCollisionCandidates(uTriggerMask); | |
98 | ||
99 | ||
100 | // AliAnalysisTaskEmcalJetSample *taskjetsample=AddTaskEmcalJetSample(sUsedTrks.Data(),"",taskFJ->GetName(), | |
101 | // "Rho",aRadius[i],dJetPtCut,dJetAreaCut,AliAnalysisTaskEmcalJet::kTPC,iLeading, | |
102 | // "AliAnalysisTaskEmcalJetSample"); | |
103 | //taskjetsample->SelectCollisionCandidates(uTriggerMask); | |
104 | ||
bbb94467 | 105 | //Filter and correlation with D meson |
92d9c9cb | 106 | |
d2f609e4 | 107 | AddTaskDFilterAndCorrelations( |
bbb94467 | 108 | iCandType, |
92d9c9cb | 109 | sCutFile, |
110 | bIsMC, | |
111 | bIsReco, | |
bbb94467 | 112 | "", |
92d9c9cb | 113 | taskFJ->GetName(), |
bbb94467 | 114 | //Form("JetR%s",sRadius[i].Data()), |
92d9c9cb | 115 | iLeading, |
116 | leadHadType, | |
117 | aRadius[i], | |
118 | dJetPtCut, | |
119 | acctype | |
bbb94467 | 120 | //percjetareacut=1. |
121 | ); | |
92d9c9cb | 122 | |
123 | AliEmcalJetTask *taskMCJ; | |
124 | //jet reconstruction for correction map | |
125 | if(bIsMap){ | |
d2f609e4 | 126 | taskMCJ = AddTaskEmcalJet(sInputTrkMC.Data(),sUsedClus.Data(),iJetAlgo,aRadius[i], iJetType); |
127 | ||
128 | AddTaskDFilterAndCorrelations( | |
129 | iCandType, | |
130 | sCutFile, | |
131 | bIsMC, | |
132 | kFALSE, | |
133 | sText, | |
134 | taskFJ->GetName(), | |
135 | iLeading, | |
136 | leadHadType, | |
137 | aRadius[i], | |
138 | dJetPtCut, | |
139 | acctype | |
140 | //percjetareacut=1. | |
141 | ); | |
142 | ||
bc985fb9 | 143 | |
d2f609e4 | 144 | // definition of correction map |
145 | Int_t tag=0; | |
146 | if(iCandType == 0) tag=AliEmcalJet::kD0; | |
147 | if(iCandType == 1) tag=AliEmcalJet::kDStar; | |
148 | Printf("************** tag = %d", tag&0x1); | |
149 | AliJetResponseMaker* taskResp=AddTaskJetResponseMaker( | |
150 | sUsedTrks.Data(),sUsedClus.Data(),taskFJ->GetName(),"",aRadius[i], | |
151 | sInputTrkMC.Data(),"",taskMCJ->GetName(),"",aRadius[i],dJetPtCut,dJetAreaCut,5,0,AliJetResponseMaker::kGeometrical, 0.25,0.25,"TPC",-999,-999,-999,"AliJetResponseMaker", kFALSE, 0, -10,10, tag ); | |
152 | taskResp->SetMinJetMCPt(0); //added to bypass a return not needed (feature of PrepareJetTask) | |
153 | //taskResp->SetHistoType(1); | |
bc985fb9 | 154 | |
92d9c9cb | 155 | } |
92d9c9cb | 156 | } |
157 | ||
158 | return; | |
f6e094bd | 159 | } |
5b64c502 | 160 | |
cc5dbb3b | 161 | //run with multiple R |
9dd6fe8c | 162 | void AddTasksFlavourJet( |
5b64c502 | 163 | /*input for Jet Finder*/ |
164 | const UInt_t uTriggerMask = AliVEvent::kMB, /*for jets; the D mesons trigger is defined in the cut object*/ | |
165 | const TString sRunPeriod = "LHC13b", /*for track selection*/ | |
166 | Bool_t tmpoadb2012flag=kFALSE, /*kTRUE for LHC12h and LHC12i*/ | |
167 | const Bool_t bIsMC = kFALSE, | |
168 | /*input for D mesons*/ | |
169 | const Int_t iCandType = 1 /*0 = D0, 1=Dstar...*/, | |
170 | const TString sCutFile = "cutsHF/D0toKpiCutsppRecVtxNoPileupRejNoEMCAL.root", | |
171 | const Double_t dJetPtCut = 1., | |
172 | const Double_t dJetAreaCut = 0., | |
173 | const char *acctype = "TPC", | |
174 | const Bool_t bIsReco = kFALSE, | |
175 | const Bool_t bIsMap = kFALSE, | |
176 | TString sText="",/*completes the name of the candidate task lists*/ | |
34d158dd | 177 | Bool_t triggerOnLeadingJet = kFALSE, |
178 | const Bool_t bUseEMCalTrig = kFALSE, | |
179 | const Bool_t bIsTrain=kFALSE | |
180 | ||
5b64c502 | 181 | ){ |
cc5dbb3b | 182 | Printf("############## JETS WITH RESOLUTION PARAMETER 0.2, 0.4, 0.6 ####################"); |
183 | ||
5b64c502 | 184 | const Int_t nRadius = 3; |
185 | const Double_t aRadius[] = { 0.2, 0.4, 0.6 }; | |
186 | const TString sRadius[] = { "R02", "R04", "R06" }; | |
187 | ||
188 | const TString sInputTrkMC = "MCParticlesSelected"; | |
189 | const TString sInputTrkRec = "tracks"; | |
190 | const TString sUsedTrks = "PicoTracks"; | |
191 | const TString sUsedClus = ""; | |
192 | TString sInputTrk = bIsReco ? sInputTrkRec : sInputTrkMC; | |
193 | const Int_t iJetAlgo = 1; | |
194 | const Int_t iJetType = 1; | |
195 | ||
196 | //============================================================================= | |
197 | ||
198 | UInt_t uAnaType = (((iJetType==0) || (iJetType==2)) ? 1 : 0); | |
199 | Int_t iLeading = ((iJetType==0) ? 3 : ((iJetType==1) ? 0 : 1)); | |
200 | Int_t leadHadType=0; /* 0=charged, 1=neutral, 2=both*/ | |
201 | ||
202 | // EMCal framework | |
203 | // -- Physics selection task | |
204 | if(!bIsMC){ | |
205 | gROOT->LoadMacro("$ALICE_ROOT/PWG/EMCAL/macros/AddTaskEmcalPhysicsSelection.C"); | |
206 | AliPhysicsSelectionTask *physSelTask = AddTaskEmcalPhysicsSelection(kTRUE, kTRUE, uTriggerMask, 5, 5, 10, kTRUE, -1, -1, -1, -1); | |
207 | ||
208 | if (!physSelTask) { | |
209 | cout << "no physSelTask"; | |
210 | return; | |
211 | } | |
212 | } | |
213 | // -- EMCal setup | |
214 | gROOT->LoadMacro("$ALICE_ROOT/PWG/EMCAL/macros/AddTaskEmcalSetup.C"); | |
215 | AliEmcalSetupTask *taskSetupEMCal = AddTaskEmcalSetup(); | |
216 | if(tmpoadb2012flag) taskSetupEMCal->SetOcdbPath("raw://"); //needed for period LHC12h and i | |
217 | else taskSetupEMCal->SetGeoPath("$ALICE_ROOT/OADB/EMCAL"); | |
218 | taskSetupEMCal->SelectCollisionCandidates(uTriggerMask); | |
219 | ||
220 | // Jet preparation | |
221 | gROOT->LoadMacro("$ALICE_ROOT/PWGJE/EMCALJetTasks/macros/AddTaskJetPreparation.C"); | |
34d158dd | 222 | AddTaskJetPreparation(sRunPeriod,"PicoTracks",bIsMC ? "MCParticlesSelected" : "",/*next 7 emcal default settings*/"","",2.,0.,0.03,0.015,0.15,uTriggerMask, kFALSE /*track cluster*/,kFALSE /*do histos*/,kTRUE /*make pico tracks*/,bUseEMCalTrig /*make emcal trigger*/,bIsTrain /*is emcal train*/); |
5b64c502 | 223 | |
224 | ||
225 | gROOT->LoadMacro("$ALICE_ROOT/PWGJE/EMCALJetTasks/macros/AddTaskEmcalJet.C"); | |
226 | ||
cc5dbb3b | 227 | TString jetname[nRadius]; |
228 | ||
229 | for (Int_t i=0; i<nRadius; i++) { | |
5b64c502 | 230 | //jet reconstruction |
231 | AliEmcalJetTask *taskFJ = AddTaskEmcalJet(sUsedTrks.Data(),sUsedClus.Data(),iJetAlgo,aRadius[i],iJetType); | |
232 | ||
233 | taskFJ->SelectCollisionCandidates(uTriggerMask); | |
234 | ||
235 | Printf("Now Jet Finder with R = %f",aRadius[i]); | |
cc5dbb3b | 236 | jetname[i] = taskFJ->GetName(); |
237 | ||
238 | } | |
239 | ||
240 | for (Int_t i=0; i<nRadius; i++) { | |
241 | ||
242 | AddMyAnalysis(jetname[i],aRadius[i],iCandType,sCutFile,dJetPtCut,dJetAreaCut, | |
5b64c502 | 243 | acctype,bIsMC,bIsReco,bIsMap,sText,triggerOnLeadingJet); |
244 | } | |
245 | } | |
246 | ||
cc5dbb3b | 247 | //run with HF tracks cuts (filterbit 4 and 9 -> 16, 512) |
248 | void AddTasksFlavourJet( | |
249 | /*input for Jet Finder*/ | |
250 | const UInt_t uTriggerMask = AliVEvent::kMB, /*for jets; the D mesons trigger is defined in the cut object*/ | |
251 | const Bool_t bIsMC = kFALSE, | |
252 | const Double_t R=0.4, | |
253 | /*input for D mesons*/ | |
5b64c502 | 254 | const Int_t iCandType = 1 /*0 = D0, 1=Dstar...*/, |
255 | const TString sCutFile = "cutsHF/D0toKpiCutsppRecVtxNoPileupRejNoEMCAL.root", | |
256 | const Double_t dJetPtCut = 1., | |
257 | const Double_t dJetAreaCut = 0., | |
258 | const char *acctype = "TPC", | |
5b64c502 | 259 | const Bool_t bIsReco = kFALSE, |
260 | const Bool_t bIsMap = kFALSE, | |
261 | TString sText="",/*completes the name of the candidate task lists*/ | |
262 | Bool_t triggerOnLeadingJet = kFALSE | |
cc5dbb3b | 263 | |
264 | ){ | |
265 | ||
266 | ||
267 | Printf("############## SELECT TRACKS WITH FILTER BIT 4 AND 9 ####################"); | |
268 | //============================================================================= | |
269 | ||
270 | AliAnalysisManager *mgr = AliAnalysisManager::GetAnalysisManager(); | |
271 | ||
272 | if (!mgr) { | |
273 | ::Error("AddTasksFlavourJet.C::AddTasksFlavourJet", "No analysis manager to connect to."); | |
274 | return; | |
275 | } | |
276 | ||
277 | TString type = mgr->GetInputEventHandler()->GetDataType(); | |
278 | if (!type.Contains("ESD") && !type.Contains("AOD")) { | |
279 | ::Error("AddTasksFlavourJet.C::AddTasksFlavourJet", "Task manager to have an ESD or AOD input handler."); | |
280 | return; | |
281 | } | |
282 | ||
283 | if (!mgr->GetInputEventHandler()) { | |
284 | ::Error("AddTasksFlavourJet.C::AddTasksFlavourJet", "This task requires an input event handler"); | |
285 | return; | |
286 | } | |
287 | //============================================================================= | |
288 | ||
289 | // EMCal framework | |
290 | // -- Physics selection task | |
291 | if(!bIsMC){ | |
292 | gROOT->LoadMacro("$ALICE_ROOT/PWG/EMCAL/macros/AddTaskEmcalPhysicsSelection.C"); | |
293 | AliPhysicsSelectionTask *physSelTask = AddTaskEmcalPhysicsSelection(kTRUE, kTRUE, uTriggerMask, 5, 5, 10, kTRUE, -1, -1, -1, -1); | |
294 | ||
295 | if (!physSelTask) { | |
296 | cout << "no physSelTask"; | |
297 | return; | |
298 | } | |
299 | } | |
300 | // -- | |
301 | gROOT->LoadMacro("$ALICE_ROOT/PWG/EMCAL/macros/AddTaskEmcalSetup.C"); | |
302 | AliEmcalSetupTask *taskSetupEMCal = AddTaskEmcalSetup(); | |
303 | //taskSetupEMCal->SetOcdbPath("raw://"); //needed for period LHC12h and i | |
304 | taskSetupEMCal->SetGeoPath("$ALICE_ROOT/OADB/EMCAL"); | |
305 | taskSetupEMCal->SelectCollisionCandidates(uTriggerMask); | |
306 | ||
307 | //define the track sample | |
308 | TString tracksHFname="HFTrackBits"; | |
309 | gROOT->LoadMacro("$ALICE_ROOT/PWG/EMCAL/macros/AddTaskEmcalAodTrackFilter.C"); | |
310 | AliEmcalAodTrackFilterTask *trackfilter=AddTaskEmcalAodTrackFilter(tracksHFname,"tracks","","AliEmcalAodTrackFilterTask4HF" ); | |
311 | trackfilter->SetAODfilterBits(16,512); | |
312 | ||
313 | //transofm into picotracks | |
314 | gROOT->LoadMacro("$ALICE_ROOT/PWG/EMCAL/macros/AddTaskEmcalPicoTrackMaker.C"); | |
315 | AliEmcalPicoTrackMaker* picotracksHF=AddTaskEmcalPicoTrackMaker(Form("Pico%s",tracksHFname.Data()), tracksHFname,0,1000,-10,10,-10,10,1,"AliEmcalPicoTrackMakerHF"); | |
316 | ||
317 | //run the jet finder | |
318 | gROOT->LoadMacro("$ALICE_ROOT/PWGJE/EMCALJetTasks/macros/AddTaskEmcalJet.C"); | |
319 | AliEmcalJetTask* taskFJ=AddTaskEmcalJet(Form("Pico%s",tracksHFname.Data()), "caloClusters", 1, R); | |
320 | TString jetname = taskFJ->GetName(); | |
321 | AddMyAnalysis(jetname,R,iCandType,sCutFile,dJetPtCut,dJetAreaCut, | |
322 | acctype,bIsMC,bIsReco,bIsMap,sText,triggerOnLeadingJet,Form("Pico%s",tracksHFname.Data())); | |
323 | ||
324 | ||
325 | } | |
326 | void AddMyAnalysis(TString& jetname, Double_t aRadius, | |
327 | const Int_t iCandType = 1 /*0 = D0, 1=Dstar...*/, | |
328 | const TString sCutFile = "cutsHF/D0toKpiCutsppRecVtxNoPileupRejNoEMCAL.root", | |
329 | const Double_t dJetPtCut = 1., | |
330 | const Double_t dJetAreaCut = 0., | |
331 | const char *acctype = "TPC", | |
332 | const Bool_t bIsMC = kFALSE, | |
333 | const Bool_t bIsReco = kFALSE, | |
334 | const Bool_t bIsMap = kFALSE, | |
335 | TString sText="",/*completes the name of the candidate task lists*/ | |
336 | Bool_t triggerOnLeadingJet = kFALSE, | |
337 | const TString& trackArrName = "PicoTracks" | |
5b64c502 | 338 | ){ |
339 | ||
340 | AliAnalysisManager* mgr = AliAnalysisManager::GetAnalysisManager(); | |
341 | //D mesons -- PID | |
342 | TString pidTaskName="PIDResponseTask"; | |
343 | if(!mgr->GetTask(pidTaskName)){ | |
344 | gROOT->LoadMacro("$ALICE_ROOT/ANALYSIS/macros/AddTaskPIDResponse.C"); | |
345 | AliAnalysisTaskSE *taskRespPID = AddTaskPIDResponse(bIsMC); | |
346 | } | |
347 | ||
348 | gROOT->LoadMacro("$ALICE_ROOT/PWGJE/FlavourJetTasks/macros/AddTaskDFilterAndCorrelations.C"); | |
349 | ||
350 | //Filter and correlation with D meson | |
351 | ||
352 | AddTaskDFilterAndCorrelations( | |
353 | iCandType, | |
354 | sCutFile, | |
355 | bIsMC, | |
356 | bIsReco, | |
357 | sText, | |
cc5dbb3b | 358 | jetname, |
359 | trackArrName, | |
5b64c502 | 360 | //Form("JetR%s",sRadius[i].Data()), |
361 | triggerOnLeadingJet, | |
362 | 0, | |
363 | aRadius, | |
364 | dJetPtCut, | |
365 | acctype | |
366 | //percjetareacut=1. | |
367 | ); | |
368 | ||
369 | } | |
cc5dbb3b | 370 | |
371 |