AliPhysics  c7b8e89 (c7b8e89)
AliAnalysisTaskEmcalHfeTagging.cxx
Go to the documentation of this file.
1 //
2 // HFE tagged jet shape analysis task.
3 //
4 // Authors: D. Caffarri, L. Cunqueiro (jet); D. Godoy (HFE)
5 //
6 #include <TClonesArray.h>
7 #include <TH1F.h>
8 #include <TH2F.h>
9 #include <TH3F.h>
10 #include <THnSparse.h>
11 #include <TTree.h>
12 #include <TList.h>
13 #include <TLorentzVector.h>
14 #include <TProfile.h>
15 #include <TChain.h>
16 #include <TSystem.h>
17 #include <TFile.h>
18 #include <TKey.h>
19 #include <AliAnalysisDataSlot.h>
20 #include <AliAnalysisDataContainer.h>
21 #include "TMatrixD.h"
22 #include "TMatrixDSym.h"
23 #include "TMatrixDSymEigen.h"
24 #include "TVector3.h"
25 #include "TVector2.h"
26 #include "AliVCluster.h"
27 #include "AliVTrack.h"
28 #include "AliEmcalJet.h"
29 #include "AliRhoParameter.h"
30 #include "AliLog.h"
31 #include "AliEmcalParticle.h"
32 #include "AliMCEvent.h"
33 #include "AliGenPythiaEventHeader.h"
34 #include "AliAODMCHeader.h"
35 #include "AliAODHandler.h"
36 #include "AliAODEvent.h"
37 #include "AliMCEvent.h"
38 #include "AliAnalysisManager.h"
39 #include "AliJetContainer.h"
40 #include "AliParticleContainer.h"
41 #include "AliEmcalPythiaInfo.h"
42 #include "TRandom3.h"
43 #include "AliAODInputHandler.h"
44 #include "AliPIDResponse.h"
45 #include "AliCFContainer.h"
46 #include "AliCFManager.h"
47 #include "AliMultiEventInputHandler.h"
48 #include "AliKFParticle.h"
49 #include "AliKFVertex.h"
50 #include "AliMultSelection.h"
51 #include "AliAnalysisUtils.h"
52 
53 #include "AliAODEvent.h"
55 
56 using std::cout;
57 using std::endl;
58 
60 
61 //________________________________________________________________________
64 fAOD(0),
65 fVevent(0),
66 fpidResponse(0),
67 fTracksTender(0),
68 pVtx(0),
69 spdVtx(0),
70 fMC(0),
71 fStack(0),
72 fMCparticle(0),
73 fMCarray(0),
74 fMCheader(0),
75 fContainer(0),
76 fMinFractionShared(0),
77 fJetShapeType(kData),
78 fJetShapeSub(kNoSub),
79 fJetSelection(kInclusive),
80 fPtThreshold(-9999.),
81 fRMatching(0.2),
82 fSelectedShapes(0),
83 fminpTTrig(20.),
84 fmaxpTTrig(50.),
85 fangWindowRecoil(0.6),
86 fSemigoodCorrect(0),
87 fHolePos(0),
88 fHoleWidth(0),
89 fCentSelectOn(kTRUE),
90 fCentMin(0),
91 fCentMax(10),
92 fOneConstSelectOn(kFALSE),
93 fDerivSubtrOrder(0),
94 fMCweight(0),
95 fRunNumber(0),
96 fAssPtCut(0.1),
97 fITSncut(3),
98 fAssTPCnCut(60),
99 fTPCnCut(100),
100 fAssITSrefitCut(kTRUE),
101 fUseTender(kFALSE),
102 fSigmaTOFcut(3.),
103 fSigmaTPCcut(-1.),
104 fDcaXYcut(1.),
105 fDcaZcut(2.),
106 fIMcut(0.1),
107 fNeventV0(0),
108 fNeventT0(0),
109 fh2ResponseUW(0x0),
110 fh2ResponseW(0x0),
111 fPhiJetCorr6(0x0),
112 fPhiJetCorr7(0x0),
113 fEtaJetCorr6(0x0),
114 fEtaJetCorr7(0x0),
115 fPtJetCorr(0x0),
116 fPtJet(0x0),
117 fPtGenJet(0),
118 fPhiJet(0x0),
119 fEtaJet(0x0),
120 fEtaPhiJet(0x0),
121 fAreaJet(0x0),
122 fJetProbDensityDetPart(0x0),
123 fJetProbDensityPartDet(0x0),
124 fNbOfConstvspT(0x0),
125 fnTPCnTOFnocut(0),
126 fnTPCnocutP(0),
127 fnTOFnocutP(0),
128 fnTPCcutP(0),
129 fnTPCcutPt(0),
130 fnULSmLSpairsPerElectron(0),
131 fnPartPerJet(0),
132 fnElecOverPartPerJet(0),
133 fnInclElecPerJet(0),
134 fnPhotElecPerJet(0),
135 fnIncSubPhotElecPerJet(0),
136 fnTrueElecPerJet(0),
137 fnTrueHFElecPerJet(0),
138 fnTruePElecPerJet(0),
139 fPi0Pt(0),
140 fEtaPt(0),
141 fGenHfePt(0),
142 fGenPePt(0),
143 fPtP(0),
144 fptJetIE(0),
145 fptJetPE(0),
146 fptJetHFE(0),
147 fptRecPE(0),
148 fptTruePE(0),
149 fptWrongPE(0),
150 fPtTrack(0),
151 fPhiTrack(0x0),
152 fEtaTrack(0x0),
153 fEtaPhiTrack(0x0),
154 fPhiRecElec(0x0),
155 fEtaRecElec(0x0),
156 fEtaPhiRecElec(0x0),
157 fPhiTrueElec(0x0),
158 fEtaTrueElec(0x0),
159 fEtaPhiTrueElec(0x0),
160 fnEovPelec(0x0),
161 fnEovPbackg(0x0),
162 fnClsE(0x0),
163 fnM20(0x0),
164 fnM02(0x0),
165 fnClsTime(0x0),
166 fTreeObservableTagging(0)
167 
168 {
169  for(Int_t i=0;i<21;i++){
170  fShapesVar[i]=0;
171  }
172 
173  for(Int_t i=0;i<5;i++){
174  fptTrueHFE[i] = NULL;
175  }
176 
177  for(Int_t i=0;i<5;i++){
178  fInvmassLS[i] = NULL;
179  fInvmassULS[i] = NULL;
180  fUlsLsElecPt[i] = NULL;
181  fTotElecPt[i] = NULL;
182  for(Int_t j=0;j<18;j++){
183  fnTPCTrueParticles[i][j] = NULL;
184  }
185  }
186  SetMakeGeneralHistograms(kTRUE);
187  DefineOutput(1, TList::Class());
188  DefineOutput(2, TTree::Class());
189 
190 }
191 
192 //________________________________________________________________________
194 AliAnalysisTaskEmcalJet(name, kTRUE),
195 fAOD(0),
196 fVevent(0),
197 fpidResponse(0),
198 fTracksTender(0),
199 pVtx(0),
200 spdVtx(0),
201 fMC(0),
202 fStack(0),
203 fMCparticle(0),
204 fMCarray(0),
205 fMCheader(0),
206 fContainer(0),
207 fMinFractionShared(0),
208 fJetShapeType(kData),
209 fJetShapeSub(kNoSub),
210 fJetSelection(kInclusive),
211 fPtThreshold(-9999.),
212 fRMatching(0.2),
213 fSelectedShapes(0),
214 fminpTTrig(20.),
215 fmaxpTTrig(50.),
216 fangWindowRecoil(0.6),
217 fSemigoodCorrect(0),
218 fHolePos(0),
219 fHoleWidth(0),
220 fCentSelectOn(kTRUE),
221 fCentMin(0),
222 fCentMax(10),
223 fOneConstSelectOn(kFALSE),
224 fDerivSubtrOrder(0),
225 fMCweight(0),
226 fRunNumber(0),
227 fAssPtCut(0.1),
228 fITSncut(3),
229 fAssTPCnCut(60),
230 fTPCnCut(100),
231 fAssITSrefitCut(kTRUE),
232 fUseTender(kFALSE),
233 fSigmaTOFcut(3.),
234 fSigmaTPCcut(-1.),
235 fDcaXYcut(1.),
236 fDcaZcut(2.),
237 fIMcut(0.1),
238 fNeventV0(0),
239 fNeventT0(0),
240 fh2ResponseUW(0x0),
241 fh2ResponseW(0x0),
242 fPhiJetCorr6(0x0),
243 fPhiJetCorr7(0x0),
244 fEtaJetCorr6(0x0),
245 fEtaJetCorr7(0x0),
246 fPtJetCorr(0x0),
247 fPtJet(0x0),
248 fPtGenJet(0),
249 fPhiJet(0x0),
250 fEtaJet(0x0),
251 fEtaPhiJet(0x0),
252 fAreaJet(0x0),
253 fJetProbDensityDetPart(0x0),
254 fJetProbDensityPartDet(0x0),
255 fNbOfConstvspT(0x0),
256 fnTPCnTOFnocut(0),
257 fnTPCnocutP(0),
258 fnTOFnocutP(0),
259 fnTPCcutP(0),
260 fnTPCcutPt(0),
261 fnULSmLSpairsPerElectron(0),
262 fnPartPerJet(0),
263 fnElecOverPartPerJet(0),
264 fnInclElecPerJet(0),
265 fnPhotElecPerJet(0),
266 fnIncSubPhotElecPerJet(0),
267 fnTrueElecPerJet(0),
268 fnTrueHFElecPerJet(0),
269 fnTruePElecPerJet(0),
270 fPi0Pt(0),
271 fEtaPt(0),
272 fGenHfePt(0),
273 fGenPePt(0),
274 fPtP(0),
275 fptJetIE(0),
276 fptJetPE(0),
277 fptJetHFE(0),
278 fptRecPE(0),
279 fptTruePE(0),
280 fptWrongPE(0),
281 fPtTrack(0),
282 fPhiTrack(0x0),
283 fEtaTrack(0x0),
284 fEtaPhiTrack(0x0),
285 fPhiRecElec(0x0),
286 fEtaRecElec(0x0),
287 fEtaPhiRecElec(0x0),
288 fPhiTrueElec(0x0),
289 fEtaTrueElec(0x0),
290 fEtaPhiTrueElec(0x0),
291 fnEovPelec(0x0),
292 fnEovPbackg(0x0),
293 fnClsE(0x0),
294 fnM20(0x0),
295 fnM02(0x0),
296 fnClsTime(0x0),
297 fTreeObservableTagging(0)
298 
299 {
300  // Standard constructor.
301  for(Int_t i=0;i<21;i++){
302  fShapesVar[i]=0;
303  }
304 
305  for(Int_t i=0;i<5;i++){
306  fptTrueHFE[i] = NULL;
307  }
308 
309  for(Int_t i=0;i<5;i++){
310  fInvmassLS[i] = NULL;
311  fInvmassULS[i] = NULL;
312  fUlsLsElecPt[i] = NULL;
313  fTotElecPt[i] = NULL;
314  for(Int_t j=0;j<18;j++){
315  fnTPCTrueParticles[i][j] = NULL;
316  }
317  }
319 
320  DefineOutput(1, TList::Class());
321  DefineOutput(2, TTree::Class());
322 
323 }
324 
325 //________________________________________________________________________
327 {
328  // Destructor.
329 }
330 
331 //________________________________________________________________________
333 {
334  // Create user output.
335 
337 
338  Bool_t oldStatus = TH1::AddDirectoryStatus();
339  TH1::AddDirectory(kFALSE);
340 
341  fNeventV0 = new TH1F("fNeventV0","Number of Events (V0)",5,-0.5,4.5);
342  fOutput->Add(fNeventV0);
343 
344  fNeventT0 = new TH1F("fNeventT0","Number of Events (T0)",5,-0.5,4.5);
345  fOutput->Add(fNeventT0);
346 
347 
348  fh2ResponseUW= new TH2F("fh2ResponseUW", "fh2ResponseUW", 100, 0, 200, 100, 0, 200);
349  fOutput->Add(fh2ResponseUW);
350  fh2ResponseW= new TH2F("fh2ResponseW", "fh2ResponseW", 100, 0, 200, 100, 0, 200);
351  fOutput->Add(fh2ResponseW);
352  fPhiJetCorr6= new TH2F("fPhiJetCorr6", "fPhiJetCorr6", 50, 0, 2*TMath::Pi(), 50, 0, 2*TMath::Pi());
353  fOutput->Add(fPhiJetCorr6);
354  fEtaJetCorr6= new TH2F("fEtaJetCorr6", "fEtaJetCorr6", 50, -1.5, 1.5, 50, -1.5, 1.5);
355  fOutput->Add(fEtaJetCorr6);
356 
357  fPhiJetCorr7= new TH2F("fPhiJetCorr7", "fPhiJetCorr7", 50, 0, 2*TMath::Pi(), 50, 0, 2*TMath::Pi());
358  fOutput->Add(fPhiJetCorr7);
359  fEtaJetCorr7= new TH2F("fEtaJetCorr7", "fEtaJetCorr7", 50, -1.5, 1.5, 50, -1.5, 1.5);
360  fOutput->Add(fEtaJetCorr7);
361 
362  fPtJetCorr= new TH2F("fPtJetCorr", "fPtJetCorr", 100, 0, 200, 100, 0, 200);
363  fOutput->Add(fPtJetCorr);
364 
365  fPtJet= new TH1F("fPtJet", "fPtJet", 100, 0, 200);
366  fOutput->Add(fPtJet);
367 
368  fPtGenJet= new TH1F("fPtGenJet", "fPtGenJet", 100, 0, 200);
369  fOutput->Add(fPtGenJet);
370 
371  fPhiJet= new TH2F("fPhiJet", "fPhiJet", 100, 0, 200, 100, 0, TMath::TwoPi());
372  fOutput->Add(fPhiJet);
373 
374  fEtaJet= new TH2F("fEtaJet", "fEtaJet", 100, 0, 200, 100, -1,1);
375  fOutput->Add(fEtaJet);
376 
377  fEtaPhiJet= new TH2F("fEtaPhiJet", "fEtaPhiJet", 100, 0, TMath::TwoPi(), 100, -1,1);
378  fOutput->Add(fEtaPhiJet);
379 
380  fAreaJet= new TH2F("fAreaJet", "fAreaJet", 100, 0, 200, 100, 0,1.5);
381  fOutput->Add(fAreaJet);
382 
383  fNbOfConstvspT=new TH2F("fNbOfConstvspT", "fNbOfConstvspT", 100, 0, 100, 200, 0, 200);
384  fOutput->Add(fNbOfConstvspT);
385 
386  fnTPCnTOFnocut=new TH2F("fnTPCnTOFnocut", "fnTPCnTOFnocut", 200, -10, 10, 200, -10, 10);
387  fOutput->Add(fnTPCnTOFnocut);
388 
389  fnTPCnocutP=new TH2F("fnTPCnocutP", "fnTPCnocutP", 50, 0, 5, 200, -10, 10);
390  fOutput->Add(fnTPCnocutP);
391 
392  fnTOFnocutP=new TH2F("fnTOFnocutP", "fnTOFnocutP", 50, 0, 5, 200, -10, 10);
393  fOutput->Add(fnTOFnocutP);
394 
395  fnTPCcutP=new TH2F("fnTPCcutP", "fnTPCcutP", 50, 0, 5, 200, -10, 10);
396  fOutput->Add(fnTPCcutP);
397 
398  fnTPCcutPt=new TH2F("fnTPCcutPt", "fnTPCcutPt", 50, 0, 5, 200, -10, 10);
399  fOutput->Add(fnTPCcutPt);
400 
401  fnULSmLSpairsPerElectron =new TH2F("fnULSmLSpairsPerElectron", "fnULSmLSpairsPerElectron", 50, 0, 5, 100, 0, 100);
403 
404  fnPartPerJet=new TH1F("fnPartPerJet", "fnPartPerJet", 500,0,500);
405  fOutput->Add(fnPartPerJet);
406 
407  fnElecOverPartPerJet=new TH1F("fnElecOverPartPerJet", "fnElecOverPartPerJet", 100,0,0.1);
409 
410  fnInclElecPerJet=new TH1F("fnInclElecPerJet", "fnInclElecPerJet", 100,0,100);
412 
413  fnPhotElecPerJet=new TH1F("fnPhotElecPerJet", "fnPhotElecPerJet", 100,0,100);
415 
416  fnIncSubPhotElecPerJet=new TH1F("fnIncSubPhotElecPerJet", "fnIncSubPhotElecPerJet", 101,-1,100);
418 
419  fnTrueElecPerJet=new TH1F("fnTrueElecPerJet", "fnTrueElecPerJet", 100,0,100);
421 
422  fnTrueHFElecPerJet=new TH1F("fnTrueHFElecPerJet", "fnTrueHFElecPerJet", 100,0,100);
424 
425  fnTruePElecPerJet=new TH1F("fnTruePElecPerJet", "fnTruePElecPerJet", 100,0,100);
427 
428  fJetProbDensityDetPart=new TH2F("fJetProbDensityDetPart", "fJetProbDensityDetPart",200,-2,2,100, 0,200);
430 
431  fJetProbDensityPartDet=new TH2F("fJetProbDensityPartDet", "fJetProbDensityPartDet",200,-2,2,100, 0,200);
433 
434  int nbin = 59;
435  double xbins[60] = {0.01,0.1,0.12,0.14,0.16,0.18,0.2,0.25,0.3,0.35,0.4,0.45,0.5,0.55,0.6,0.65,0.7,0.75,
436  0.8,0.85,0.9,0.95,1,1.1,1.2,1.3,1.4,1.5,1.6,1.7,1.8,1.9,2,2.2,2.4,2.6,2.8,3,3.2,3.4,3.6,3.8,4,4.5,5,
437  5.5,6,6.5,7,8,9,10,11,12,13,14,15,16,18,20};
438 
439  fPi0Pt = new TH2F("fPi0Pt","fPi0Pt",2,0,2,nbin,xbins);
440  fOutput->Add(fPi0Pt);
441 
442  fEtaPt = new TH2F("fEtaPt", "fEtaPt",2,0,2,nbin,xbins);
443  fOutput->Add(fEtaPt);
444 
445  fGenHfePt = new TH1F("fGenHfePt","fGenHfePt",nbin,xbins);
446  fOutput->Add(fGenHfePt);
447 
448  fGenPePt = new TH1F("fGenPePt", "fGenPePt",nbin,xbins);
449  fOutput->Add(fGenPePt);
450 
451  Double_t ptRange[19] = {0.5,0.7,0.9,1.1,1.3,1.5,1.7,1.9,2.1,2.3,2.5,2.7,2.9,3.1,3.3,3.5,3.7,3.9,5};
452 
453  fPtP=new TH2F("fPtP", "fPtP", 18,ptRange,18,ptRange);
454  fOutput->Add(fPtP);
455 
456  for(Int_t i=0;i<5;i++){
457 
458  fInvmassLS[i] = new TH2F(Form("fInvmassLS%d",i), Form("fInvmassLS%d",i), 50, 0, 5, 100, 0, 0.5);
459  fOutput->Add(fInvmassLS[i]);
460 
461  fInvmassULS[i] = new TH2F(Form("fInvmassULS%d",i), Form("fInvmassULS%d",i), 50, 0, 5, 100, 0, 0.5);
462  fOutput->Add(fInvmassULS[i]);
463 
464  fUlsLsElecPt[i] = new TH1F(Form("fUlsLsElecPt%d",i), Form("fUlsLsElecPt%d",i), 18,ptRange);
465  fOutput->Add(fUlsLsElecPt[i]);
466 
467  fTotElecPt[i] = new TH1F(Form("fTotElecPt%d",i), Form("fTotElecPt%d",i), 18,ptRange);
468  fOutput->Add(fTotElecPt[i]);
469 
470 
471  for(Int_t j=0;j<18;j++){
472  fnTPCTrueParticles[i][j] = new TH2F(Form("fnTPCTrueParticles%d%d",i,j),Form("fnTPCTrueParticles%d%d",i,j), 7,0,7,100,-15,15);
473  fOutput->Add(fnTPCTrueParticles[i][j]);
474  }
475  }
476 
477  for(Int_t i=0;i<5;i++){
478  fptTrueHFE[i] = new TH1F(Form("fptTrueHFE%d",i), Form("fptTrueHFE%d",i), 18,ptRange);
479  fOutput->Add(fptTrueHFE[i]);
480  }
481 
482  fptJetIE= new TH1F("fptJetIE", "fptJetIE", 100, 0, 200);
483  fOutput->Add(fptJetIE);
484 
485  fptJetPE= new TH1F("fptJetPE", "fptJetPE", 100, 0, 200);
486  fOutput->Add(fptJetPE);
487 
488  fptJetHFE= new TH1F("fptJetHFE", "fptJetHFE", 100, 0, 200);
489  fOutput->Add(fptJetHFE);
490 
491  fptRecPE= new TH1F("fptRecPE", "fptRecPE", 100, 0, 50);
492  fOutput->Add(fptRecPE);
493 
494  fptTruePE= new TH1F("fptTruePE", "fptTruePE", 100, 0, 50);
495  fOutput->Add(fptTruePE);
496 
497  fptWrongPE= new TH1F("fptWrongPE", "fptWrongPE", 100, 0, 50);
498  fOutput->Add(fptWrongPE);
499 
500  fPtTrack= new TH1F("fPtTrack", "fPtTrack", 100, 0, 200);
501  fOutput->Add(fPtTrack);
502 
503  fPhiTrack= new TH2F("fPhiTrack", "fPhiTrack", 100, 0, 200, 100, 0, TMath::TwoPi());
504  fOutput->Add(fPhiTrack);
505 
506  fEtaTrack= new TH2F("fEtaTrack", "fEtaTrack", 100, 0, 200, 100, -1,1);
507  fOutput->Add(fEtaTrack);
508 
509  fEtaPhiTrack= new TH2F("fEtaPhiTrack", "fEtaPhiTrack", 100, 0, TMath::TwoPi(), 100, -1,1);
510  fOutput->Add(fEtaPhiTrack);
511 
512  fPhiRecElec= new TH2F("fPhiRecElec", "fPhiRecElec", 100, 0, 50, 100, 0, TMath::TwoPi());
513  fOutput->Add(fPhiRecElec);
514 
515  fEtaRecElec= new TH2F("fEtaRecElec", "fEtaRecElec", 100, 0, 50, 100, -1,1);
516  fOutput->Add(fEtaRecElec);
517 
518  fEtaPhiRecElec= new TH2F("fEtaPhiRecElec", "fEtaPhiRecElec", 100, 0, TMath::TwoPi(), 100, -1,1);
519  fOutput->Add(fEtaPhiRecElec);
520 
521  fPhiTrueElec= new TH2F("fPhiTrueElec", "fPhiTrueElec", 100, 0, 50, 100, 0, TMath::TwoPi());
522  fOutput->Add(fPhiTrueElec);
523 
524  fEtaTrueElec= new TH2F("fEtaTrueElec", "fEtaTrueElec", 100, 0, 50, 100, -1,1);
525  fOutput->Add(fEtaTrueElec);
526 
527  fEtaPhiTrueElec= new TH2F("fEtaPhiTrueElec", "fEtaPhiTrueElec", 100, 0, TMath::TwoPi(), 100, -1,1);
528  fOutput->Add(fEtaPhiTrueElec);
529 
530 
531  fnEovPelec = new TH2F("fnEovPelec", "fnEovPelec", 100,0,100,40,0,2);
532  fOutput->Add(fnEovPelec);
533 
534  fnEovPbackg = new TH2F("fnEovPbackg", "fnEovPbackg", 100,0,100,40,0,2);
535  fOutput->Add(fnEovPbackg);
536 
537  fnClsE = new TH2F("fnClsE", "fnClsE", 100, 0, 100, 100, 0,100);
538  fOutput->Add(fnClsE);
539 
540  fnM20 = new TH2F("fnM20", "fnM20", 100, 0, 100, 100, 0,2);
541  fOutput->Add(fnM20);
542 
543  fnM02 = new TH2F("fnM02", "fnM02", 100, 0, 100, 100, 0,2);
544  fOutput->Add(fnM02);
545 
546  fnClsTime = new TH2F("fnClsTime", "fnClsTime", 100, 0, 100, 100, -200,200);
547  fOutput->Add(fnClsTime);
548 
549 
550  // =========== Switch on Sumw2 for all histos ===========
551  for (Int_t i=0; i<fOutput->GetEntries(); ++i) {
552  TH1 *h1 = dynamic_cast<TH1*>(fOutput->At(i));
553  if (h1){
554  h1->Sumw2();
555  continue;
556  }
557  THnSparse *hn = dynamic_cast<THnSparse*>(fOutput->At(i));
558  if(hn)hn->Sumw2();
559  }
560 
561 
562  TH1::AddDirectory(oldStatus);
563  const Int_t nVar = 24;
564 
565  fTreeObservableTagging = new TTree(GetOutputSlot(2)->GetContainer()->GetName(), GetOutputSlot(2)->GetContainer()->GetName());
566 
567  TString *fShapesVarNames = new TString [nVar];
568 
569  fShapesVarNames[0] = "partonCode";
570  fShapesVarNames[1] = "ptJet";
571  fShapesVarNames[2] = "ptDJet";
572  fShapesVarNames[3] = "mJet";
573  // fShapesVarNames[4] = "nbOfConst";
574  fShapesVarNames[4] = "angularity";
575  fShapesVarNames[5] = "circularity";
576  fShapesVarNames[6] = "lesub";
577  fShapesVarNames[7] = "coronna";
578 
579  fShapesVarNames[8] = "ptJetMatch";
580  fShapesVarNames[9] = "ptDJetMatch";
581  fShapesVarNames[10] = "mJetMatch";
582  // fShapesVarNames[12] = "nbOfConstMatch";
583  fShapesVarNames[11] = "angularityMatch";
584  fShapesVarNames[12] = "circularityMatch";
585  fShapesVarNames[13] = "lesubMatch";
586  fShapesVarNames[14] = "coronnaMatch";
587  fShapesVarNames[15]="weightPythia";
588  //fShapesVarNames[14]="ntrksEvt";
589  fShapesVarNames[16]="rhoVal";
590  fShapesVarNames[17]="rhoMassVal";
591  fShapesVarNames[18]="ptUnsub";
592  fShapesVarNames[19]="pElec";
593  fShapesVarNames[20]="ptElec";
594  fShapesVarNames[21]="nInclElec";
595  fShapesVarNames[22]="nPhotElec";
596  fShapesVarNames[23]="hasElec";
597 
598 
599  for(Int_t ivar=0; ivar < nVar; ivar++){
600  //cout<<"looping over variables"<<endl;
601  fTreeObservableTagging->Branch(fShapesVarNames[ivar].Data(), &fShapesVar[ivar], Form("%s/F", fShapesVarNames[ivar].Data()));
602  }
603 
604  PostData(1,fOutput);
605  PostData(2,fTreeObservableTagging);
606 
607  delete [] fShapesVarNames;
608 }
609 
610 //________________________________________________________________________
612 {
613  // // Run analysis code here, if needed. It will be executed before FillHistograms().
614 
615  fAOD = dynamic_cast<AliAODEvent*>(InputEvent());
616  if (!fAOD){
617  printf("ERROR: fAOD not available\n");
618  return kFALSE;
619  }
620 
621  fVevent = dynamic_cast<AliVEvent*>(InputEvent());
622  if(!fVevent){
623  printf("ERROR: fVEvent not available\n");
624  return kFALSE;
625  }
626 
627  fRunNumber = fVevent->GetRunNumber();
628 
629  //remaining event selection
630  pVtx = fVevent->GetPrimaryVertex();
631  spdVtx = fVevent->GetPrimaryVertexSPD();
632 
633  fMCarray = dynamic_cast<TClonesArray*>(fAOD->FindListObject(AliAODMCParticle::StdBranchName()));
634  fMCheader = dynamic_cast<AliAODMCHeader*>(fAOD->GetList()->FindObject(AliAODMCHeader::StdBranchName()));
635 
636  fNeventV0->Fill(0);
637  if (!fMCheader){
638  TString firedTriggerClasses = static_cast<const AliAODEvent*>(InputEvent())->GetFiredTriggerClasses();
639  if ((firedTriggerClasses.Contains("C0TVX-B-NOPF-CENT"))){
640  fNeventT0->Fill(0);
641  }
642  }
643 
644  Int_t NpureMC = -1, NpureMCproc = -1;
645 
646  if (fMCheader){
647  TList *lh=fMCheader->GetCocktailHeaders();
648  if(lh){
649  for(int igene=0; igene<lh->GetEntries(); igene++){
650  AliGenEventHeader* gh=(AliGenEventHeader*)lh->At(igene);
651  if(gh){
652  // cout << "<------- imc = "<< gh->GetName() << endl;
653  if(igene==0)NpureMC = gh->NProduced(); // generate by PYTHIA or HIJING
654  NpureMCproc += gh->NProduced();
655  }
656  }
657  }
658  }
659  // pileup rejection with SPD multiple vertices and track multivertexer (using default configuration)
660 
661  Bool_t isPileupfromSPDmulbins = kFALSE, isPileupFromMV = kFALSE;
662  isPileupfromSPDmulbins = fAOD->IsPileupFromSPDInMultBins();
663  if (isPileupfromSPDmulbins) return kFALSE;
664  fNeventV0->Fill(1);
665 
666  AliAnalysisUtils utils;
667  utils.SetMinPlpContribMV(5);
668  utils.SetMaxPlpChi2MV(5.);
669  utils.SetMinWDistMV(15);
670  utils.SetCheckPlpFromDifferentBCMV(kFALSE);
671  isPileupFromMV = utils.IsPileUpMV(fAOD);
672  if (isPileupFromMV) return kFALSE;
673  fNeventV0->Fill(2);
674 
675  // Selection of pi0 and eta in MC to compute the weight
676 
677  Bool_t isPrimary = kFALSE, isFromLMdecay = kTRUE, isFromHFdecay=kTRUE, hasMother = kTRUE;
678 
679  Double_t MCweight = 1.;
680  Int_t iDecay = 0;
681 
682  if(fMCarray){
683  Int_t nParticles = fMCarray->GetEntries();
684  for (Int_t iParticle = 0; iParticle < NpureMCproc; iParticle++) {
685  AliAODMCParticle* particle = (AliAODMCParticle*) fMCarray->At(iParticle);
686  int fPDG = particle->GetPdgCode();
687  Double_t pTMC = particle->Pt();
688  Double_t phiMC = particle->Phi();
689  Double_t etaMC = particle->Eta();
690 
691  Bool_t iEnhance = kFALSE;
692  if(iParticle>=NpureMC)iEnhance = kTRUE;
693 
694  //if (TMath::Abs(etaMC)>1.2)continue;
695 
696  isPrimary = IsPrimary(particle);
697  isFromLMdecay = IsFromLMdecay(particle);
698  isFromHFdecay = IsFromHFdecay(particle);
699  hasMother = HasMother(particle);
700 
701  MCweight = 1.;
702  iDecay = 0;
703 
704  GetWeightAndDecay(particle,iDecay,MCweight);
705 
706 
707  if (TMath::Abs(etaMC)<0.8 && TMath::Abs(fPDG)==11){
708  fPhiTrueElec->Fill(pTMC,phiMC);
709  fEtaTrueElec->Fill(pTMC,etaMC);
710  if (pTMC > 0.5) fEtaPhiTrueElec->Fill(phiMC,etaMC);
711 
712  if (isFromHFdecay) fGenHfePt->Fill(pTMC);
713  if (iDecay>0 && iDecay<7) fGenPePt->Fill(pTMC);
714  }
715 
716 
717  Double_t yMC = particle->Y();
718  if (TMath::Abs(yMC)>1.0)continue;
719 
720  if (isPrimary){
721  if (!hasMother || (!isFromLMdecay && !isFromHFdecay)){
722  if(fPDG==111) fPi0Pt->Fill(iEnhance,pTMC); //pi0
723  if(fPDG==221) fEtaPt->Fill(iEnhance,pTMC); //eta
724  }
725  }
726  }
727  }//MC
728  return kTRUE;
729 }
730 //________________________________________________________________________
732 {
733  // Fill histograms.
734  //cout<<"base container"<<endl;
735  AliEmcalJet* jet1 = NULL;
736  AliJetContainer *jetCont = GetJetContainer(0);
737 
738  Float_t kWeight=1;
739  if (fCentSelectOn)
740  if ((fCent>fCentMax) || (fCent<fCentMin)) return 0;
741 
742  AliAODTrack *triggerHadron = 0x0;
743 
744  // list of kink mothers
745  Int_t nVertices = 1;
746  nVertices = fAOD->GetNumberOfVertices();
747  Double_t listofmotherkink[nVertices];
748  Int_t nMotherKink = 0;
749  for(Int_t ivertex=0; ivertex < nVertices; ivertex++) {
750  AliAODVertex *vertex = fAOD->GetVertex(ivertex);
751  if(!vertex) continue;
752  if(vertex->GetType()==AliAODVertex::kKink) {
753  AliAODTrack *mother = (AliAODTrack *) vertex->GetParent();
754  if(!mother) continue;
755  Int_t idmother = mother->GetID();
756  listofmotherkink[nMotherKink] = idmother;
757  nMotherKink++;
758  }
759  }
760 
761  Float_t rhoVal=0, rhoMassVal = 0.;
762 
763  if(jetCont) {
764  jetCont->ResetCurrentID();
766  //rho
767  AliRhoParameter* rhoParam = dynamic_cast<AliRhoParameter*>(InputEvent()->FindListObject("RhoSparseR020"));
768  if (!rhoParam) {
769  Printf("%s: Could not retrieve rho %s (some histograms will be filled with zero)!", GetName(), jetCont->GetRhoName().Data());
770  } else rhoVal = rhoParam->GetVal();
771  //rhom
772  AliRhoParameter* rhomParam = dynamic_cast<AliRhoParameter*>(InputEvent()->FindListObject("RhoMassSparseR020"));
773  if (!rhomParam) {
774  Printf("%s: Could not retrieve rho_m %s (some histograms will be filled with zero)!", GetName(), jetCont->GetRhoMassName().Data());
775  } else rhoMassVal = rhomParam->GetVal();
776  }
777 
778  while((jet1 = jetCont->GetNextAcceptJet())) {
779  if (!jet1) continue;
780  AliEmcalJet* jet2 = 0x0;
781  AliEmcalJet* jet3 = 0x0;
782  fPtJet->Fill(jet1->Pt());
783  fPhiJet->Fill(jet1->Pt(),jet1->Phi());
784  fEtaJet->Fill(jet1->Pt(),jet1->Eta());
785  if (jet1->Pt() > 5.) fEtaPhiJet->Fill(jet1->Phi(),jet1->Eta());
786  fAreaJet->Fill(jet1->Pt(),jet1->Area());
787  AliEmcalJet *jetUS = NULL;
788  Int_t ifound=0, jfound=0;
789  Int_t ilab=-1, jlab=-1;
790 
791  fShapesVar[0] = 0.;
793  //AliJetContainer *jetContTrue = GetJetContainer(1);
794  AliJetContainer *jetContUS = GetJetContainer(2);
795 
797  for(Int_t i = 0; i<jetContUS->GetNJets(); i++) {
798  jetUS = jetContUS->GetJet(i);
799  if(jetUS->GetLabel()==jet1->GetLabel()) {
800  ifound++;
801  if(ifound==1) ilab = i;
802  }
803  }
804  if(ilab==-1) continue;
805  jetUS=jetContUS->GetJet(ilab);
806  jet2=jetUS->ClosestJet();
807  }
808 
810  if (!jet2) {
811  Printf("jet2 does not exist, returning");
812  continue;
813  }
814 
815  //AliJetContainer *jetContPart=GetJetContainer(3);
816  jet3=jet2->ClosestJet();
817 
818  if(!jet3){
819  Printf("jet3 does not exist, returning");
820  continue;
821  }
822  //cout<<"jet 3 exists"<<jet3->Pt()<<endl;
823 
824 
825  fh2ResponseUW->Fill(jet1->Pt(),jet2->Pt());
826 
827  Double_t fraction=0;
828  if(!(fJetShapeSub==kConstSub)) fraction = jetCont->GetFractionSharedPt(jet1);
829  if(fJetShapeSub==kConstSub) fraction = jetContUS->GetFractionSharedPt(jetUS);
830  //if (fraction > 0.1) cout<<"***** hey a jet matched with fraction"<<fraction<<" "<<jet1->Pt()<<" "<<jet2->Pt()<<" "<<fCent<<endl;
831 
832  if(fraction<fMinFractionShared) continue;
833  //InputEvent()->Print();
834 
835  }
836 
838  jet3 = jet1->ClosestJet();
839  if (!jet3) continue;
840 
841  fh2ResponseUW->Fill(jet1->Pt(),jet3->Pt());
842 
843  Double_t probDensDetPart = -999., probDensPartDet = -999.;
844 
845  if (jet1->Pt()>0) probDensPartDet = (jet3->Pt()-jet1->Pt())/jet1->Pt();
846  if (jet3->Pt()>0) probDensDetPart = (jet1->Pt()-jet3->Pt())/jet3->Pt();
847 
848  fJetProbDensityDetPart->Fill(probDensDetPart,jet3->Pt());
849  fJetProbDensityPartDet->Fill(probDensPartDet,jet1->Pt());
850 
851  }
852 
853  if (fJetShapeType == kGenOnTheFly){
854  const AliEmcalPythiaInfo *partonsInfo = 0x0;
855  partonsInfo = GetPythiaInfo();
856  Double_t jp1=RelativePhi(jet1->Phi(),partonsInfo->GetPartonPhi6());
857  Double_t detap1=(jet1->Eta())-(partonsInfo->GetPartonEta6());
858  kWeight=partonsInfo->GetPythiaEventWeight();
859  fh2ResponseW->Fill(jet1->Pt(),jet1->Pt(),kWeight);
860 
861  Float_t dRp1 = TMath::Sqrt(jp1 * jp1 + detap1 * detap1);
862  fEtaJetCorr6->Fill(jet1->Eta(), partonsInfo->GetPartonEta6());
863  fPhiJetCorr6->Fill(jet1->Phi(), partonsInfo->GetPartonPhi6());
864  if(dRp1 < fRMatching) {
865  fShapesVar[0] = partonsInfo->GetPartonFlag6();
866  fPtJetCorr ->Fill(partonsInfo->GetPartonPt6(), jet1->Pt());
867  }
868  else {
869  jp1=RelativePhi(jet1->Phi(),partonsInfo->GetPartonPhi7());
870  detap1=(jet1->Eta())-(partonsInfo->GetPartonEta7());
871  dRp1 = TMath::Sqrt(jp1 * jp1 + detap1 * detap1);
872  fEtaJetCorr7->Fill(jet1->Eta(), partonsInfo->GetPartonEta7());
873  fPhiJetCorr7->Fill(jet1->Phi(), partonsInfo->GetPartonPhi7());
874  if(dRp1 < fRMatching) {
875  fShapesVar[0] = partonsInfo->GetPartonFlag7();
876  fPtJetCorr->Fill(partonsInfo->GetPartonPt7(), jet1->Pt());
877  }
878  else fShapesVar[0]=0;
879  }
880  }
881 
882  Double_t ptSubtracted = 0;
883  if (fJetShapeSub==kConstSub) ptSubtracted= jet1->Pt();
884 
885  else if (fJetShapeSub==kDerivSub) {
886  ptSubtracted=jet1->Pt()-GetRhoVal(0)*jet1->Area();
887  }
888 
889  else if (fJetShapeSub==kNoSub) {
890  if ((fJetShapeType==kData) || (fJetShapeType==kDetEmbPartPythia)) ptSubtracted=jet1->Pt()-GetRhoVal(0)*jet1->Area();
891  else if ((fJetShapeType==kPythiaDef) || (fJetShapeType==kMCTrue) || (fJetShapeType==kGenOnTheFly)) ptSubtracted= jet1->Pt();
892  }
893 
894  //Printf("ptSubtracted=%f,fPtThreshold =%f ", ptSubtracted, fPtThreshold);
895  if (ptSubtracted < fPtThreshold) continue;
896 
897  if (fOneConstSelectOn == kTRUE) fNbOfConstvspT->Fill(GetJetNumberOfConstituents(jet1,0), ptSubtracted);
898  if ((fCentSelectOn == kFALSE) && (jet1->GetNumberOfTracks() <= 1)) continue;
899 
900 
901  fShapesVar[1] = ptSubtracted;
902  fShapesVar[2] = GetJetpTD(jet1,0);
903  fShapesVar[3] = GetJetMass(jet1,0);
904  fShapesVar[4] = GetJetAngularity(jet1,0);
905  fShapesVar[5] = GetJetCircularity(jet1,0);
906  fShapesVar[6] = GetJetLeSub(jet1,0);
907  fShapesVar[6] = GetJetCoronna(jet1,0);
908 
909 
910 
911  Float_t ptMatch=0., ptDMatch=0., massMatch=0., angulMatch=0.,circMatch=0., lesubMatch=0., coronnaMatch=0;
912  //Float constMatch=0., sigma2Match=0.;
913  Int_t kMatched = 0;
914 
915  if (fJetShapeType==kPythiaDef) {
916  kMatched =1;
917  if(fJetShapeSub==kConstSub) kMatched = 3;
918 
919  if (!jet3) {
920  Printf("jet3 does not exist, returning");
921  continue;
922  }
923 
924  ptMatch=jet3->Pt();
925  ptDMatch=GetJetpTD(jet3, kMatched);
926  massMatch=GetJetMass(jet3,kMatched);
927  //constMatch=1.*GetJetNumberOfConstituents(jet2,kMatched);
928  angulMatch=GetJetAngularity(jet3, kMatched);
929  circMatch=GetJetCircularity(jet3, kMatched);
930  lesubMatch=GetJetLeSub(jet3, kMatched);
931  coronnaMatch=GetJetCoronna(jet3,kMatched);
932  //sigma2Match = GetSigma2(jet2, kMatched);
933  }
934 
936  if(fJetShapeSub==kConstSub) kMatched = 3;
937  if(fJetShapeSub==kDerivSub) kMatched = 2;
938  ptMatch=jet3->Pt();
939  ptDMatch=GetJetpTD(jet3, kMatched);
940  massMatch=GetJetMass(jet3,kMatched);
941  // constMatch=1.*GetJetNumberOfConstituents(jet3,kMatched);
942  angulMatch=GetJetAngularity(jet3, kMatched);
943  circMatch=GetJetCircularity(jet3, kMatched);
944  lesubMatch=GetJetLeSub(jet3, kMatched);
945  coronnaMatch = GetJetCoronna(jet3, kMatched);
946  }
947 
948 
949 
951  kMatched = 0;
952  ptMatch=0.;
953  ptDMatch=0.;
954  massMatch=0.;
955  //constMatch=0.;
956  angulMatch=0.;
957  circMatch=0.;
958  lesubMatch=0.;
959  coronnaMatch =0.;
960 
961  }
962 
963  fShapesVar[8] = ptMatch;
964  fShapesVar[9] = ptDMatch;
965  fShapesVar[10] = massMatch;
966  fShapesVar[11] = angulMatch;
967  fShapesVar[12] = circMatch;
968  fShapesVar[13] = lesubMatch;
969  fShapesVar[14] = coronnaMatch;
970  fShapesVar[15] = kWeight;
971  fShapesVar[16] = rhoVal;
972  fShapesVar[17] = rhoMassVal;
973  fShapesVar[18] = jet1->Pt();
974 
975  Int_t nInclusiveElectrons = 0, nPhotonicElectrons = 0, nTrueElectronsMC, nTrueHFElecMC;
976  Double_t pElec = 0., ptElec = 0.;
977  Bool_t hasElectrons = kFALSE;
978 
979  GetNumberOfElectrons(jet1, 0,nMotherKink,listofmotherkink,nInclusiveElectrons,nPhotonicElectrons,pElec,ptElec,hasElectrons);
980  GetNumberOfTrueElectrons(jet1, 0,nMotherKink,listofmotherkink,nTrueElectronsMC,nTrueHFElecMC);
981 
982  // generated HFE jets
983 
984  AliVParticle *vp1 = 0x0;
985  Int_t pdgCode = 0;
986  Int_t elecCounter = 0;
987 
988  if(fMCarray){
989  for(UInt_t i = 0; i < jet1->GetNumberOfTracks(); i++) {
990  vp1 = static_cast<AliVParticle*>(jet1->TrackAt(i, jetCont->GetParticleContainer()->GetArray()));
991 
992  if (!vp1){
993  Printf("AliVParticle associated to constituent not found");
994  continue;
995  }
996 
997  pdgCode = vp1->PdgCode();
998  if (TMath::Abs(pdgCode)==11) elecCounter++;
999  }
1000  if (elecCounter==1) fPtGenJet->Fill(jet1->Pt());
1001  }
1002 
1003  fShapesVar[19] = pElec;
1004  fShapesVar[20] = ptElec;
1005 
1006  fShapesVar[21] = nInclusiveElectrons;
1007  fShapesVar[22] = nPhotonicElectrons;
1008  fShapesVar[23] = hasElectrons;
1009 
1010  fTreeObservableTagging->Fill();
1011 
1012 
1013  }//jet loop
1014  }
1015  return kTRUE;
1016 }
1017 
1018 //________________________________________________________________________
1020  //calc subtracted jet mass
1021  if((fJetShapeSub==kDerivSub)&&(jetContNb==0))
1022  if (fDerivSubtrOrder == 1) return jet->GetShapeProperties()->GetFirstOrderSubtracted();
1023  else return jet->GetShapeProperties()->GetSecondOrderSubtracted();
1024  else
1025  return jet->M();
1026 }
1027 
1028 //________________________________________________________________________
1029 void AliAnalysisTaskEmcalHfeTagging::GetNumberOfElectrons(AliEmcalJet *jet, Int_t jetContNb , Int_t nMother, Double_t listMother[] , Int_t &nIncElec, Int_t &nPhotElec, Double_t &pElec, Double_t &ptElec, Bool_t &hasElec){
1030  // count the number of inclusive electrons per jet and per event
1031 
1032  AliVParticle *vp1 = 0x0;
1033  Int_t nIE=0, nPairs=0, nPE=0, sub = -1;
1034  Float_t ratioElec = -1.;
1035  Double_t pte=0., pe=0.;
1036  Bool_t hasElecCand = kFALSE;
1037 
1038  AliJetContainer *jetCont = GetJetContainer(jetContNb);
1039  if (jet->GetNumberOfTracks()){
1040 
1041  fnPartPerJet->Fill(jet->GetNumberOfTracks());
1042  fpidResponse = fInputHandler->GetPIDResponse();
1043  if(!fpidResponse){
1044  printf("ERROR: pid response not available\n");
1045  }
1046 
1047  for(UInt_t i = 0; i < jet->GetNumberOfTracks(); i++) {
1048  vp1 = static_cast<AliVParticle*>(jet->TrackAt(i, jetCont->GetParticleContainer()->GetArray()));
1049 
1050  if (!vp1){
1051  Printf("AliVParticle associated to constituent not found");
1052  continue;
1053  }
1054 
1055  AliVTrack *vtrack = dynamic_cast<AliVTrack*>(vp1);
1056  if (!vtrack) {
1057  printf("ERROR: Could not receive track%d\n", i);
1058  continue;
1059  }
1060 
1061  AliAODTrack *track = dynamic_cast<AliAODTrack*>(vtrack);
1062  if (!track) continue;
1063 
1064  // track cuts for electron identification
1065  Bool_t passTrackCut = kFALSE;
1066  passTrackCut = InclElecTrackCuts(pVtx,track,nMother,listMother);
1067  if (!passTrackCut) continue;
1068 
1069  Double_t p=-9., pt=-9., fTPCnSigma=-99., fTOFnSigma=-99., phi = -9., eta = -99.;
1070  p = track->P();
1071  pt = track->Pt();
1072  phi = track->Phi();
1073  eta = track->Eta();
1074 
1075  fPtTrack->Fill(pt);
1076  fPhiTrack->Fill(pt,phi);
1077  fEtaTrack->Fill(pt,eta);
1078  if (pt > 0.5) fEtaPhiTrack->Fill(phi,eta);
1079 
1080  nPairs=0;
1081 
1082  fTPCnSigma = fpidResponse->NumberOfSigmasTPC(track, AliPID::kElectron);
1083  fTOFnSigma = fpidResponse->NumberOfSigmasTOF(track, AliPID::kElectron);
1084 
1085  fnTPCnTOFnocut->Fill(fTPCnSigma,fTOFnSigma);
1086  fnTPCnocutP->Fill(p,fTPCnSigma);
1087  fnTOFnocutP->Fill(p,fTOFnSigma);
1088  if (TMath::Abs(fTOFnSigma)<fSigmaTOFcut){
1089  fnTPCcutP->Fill(p,fTPCnSigma);
1090  fnTPCcutPt->Fill(pt,fTPCnSigma);
1091  }
1092 
1093  if(TMath::Abs(fTPCnSigma)<3.5) hasElecCand = kTRUE;
1094 
1095  if (TMath::Abs(fTOFnSigma)<fSigmaTOFcut) fPtP->Fill(pt,p);
1096 
1097  if ((fTPCnSigma>fSigmaTPCcut) && (fTPCnSigma<3) && TMath::Abs(fTOFnSigma)<fSigmaTOFcut){
1098  fPhiRecElec->Fill(pt,phi);
1099  fEtaRecElec->Fill(pt,eta);
1100  if (pt > 0.5) fEtaPhiRecElec->Fill(phi,eta);
1101 
1102  nIE++;
1103  pte=pt;
1104  pe=p;
1105  nPairs = GetNumberOfPairs(jet,track,pVtx,nMother,listMother);
1106  if (nPairs>0) nPE++;
1107  }
1108 
1109  // Electron ID with EMCal
1110 
1111  Double_t clsE = -9., m02 = -9., m20 = -9., clsTime = -9, EovP = -9.;
1112 
1113  Double_t emcphimim = 1.39;
1114  Double_t emcphimax = 3.265;
1115 
1116  Int_t clsId = track->GetEMCALcluster();
1117  if (clsId>0){
1118  AliVCluster *cluster=0x0;
1119  cluster = (AliVCluster*)fVevent->GetCaloCluster(clsId);//tender is not used at the moment
1120 
1121  if(cluster && cluster->IsEMCAL() && phi>emcphimim && phi<emcphimax){
1122  clsE = cluster->E();
1123  m20 = cluster->GetM20();
1124  m02 = cluster->GetM02();
1125  clsTime = cluster->GetTOF()*1e+9; // ns
1126  }
1127  }
1128 
1129  EovP = clsE/p;
1130 
1131  if ((fTPCnSigma>fSigmaTPCcut) && (fTPCnSigma<3)) fnEovPelec->Fill(pt,EovP);
1132  if (TMath::Abs(fTPCnSigma)>4) fnEovPbackg->Fill(pt,EovP);
1133  fnClsE->Fill(pt,clsE);
1134  fnM20->Fill(pt,m20);
1135  fnM02->Fill(pt,m02);
1136  fnClsTime->Fill(pt,clsTime);
1137 
1138 
1139  }//tagged track
1140  sub = nIE - nPE;
1141  if (jet->GetNumberOfTracks()>0) ratioElec = nIE/jet->GetNumberOfTracks();
1142  fnInclElecPerJet->Fill(nIE);
1143  fnPhotElecPerJet->Fill(nPE);
1144  fnIncSubPhotElecPerJet->Fill(sub);
1145  fnElecOverPartPerJet->Fill(ratioElec);
1146  }
1147 
1148  nIncElec = nIE;
1149  nPhotElec = nPE;
1150  pElec = pe;
1151  ptElec = pte;
1152  hasElec = hasElecCand;
1153 }
1154 //________________________________________________________________________
1155 void AliAnalysisTaskEmcalHfeTagging::GetNumberOfTrueElectrons(AliEmcalJet *jet, Int_t jetContNb , Int_t nMother, Double_t listMother[] , Int_t &nTrueElec, Int_t &nTrueHFElec){
1156  // count the number of inclusive and HF electrons per jet and per event (true MC)
1157 
1158  AliVParticle *vp1 = 0x0;
1159  Int_t nIE=0, nHFE=0, nPE=0, PartId=0, nPairs=0, iDecay = 0;
1160  Double_t p=-9., pt=-9., fTPCnSigma=-99., fTOFnSigma=-99., MCweight = 1.;
1161  Double_t ptRange[19] = {0.5,0.7,0.9,1.1,1.3,1.5,1.7,1.9,2.1,2.3,2.5,2.7,2.9,3.1,3.3,3.5,3.7,3.9,5};
1162  Double_t ptJetRange[7] = {5.,15.,25.,35.,45.,60.,100.};
1163 
1164  Bool_t isFromHFdecay=kFALSE;
1165  Bool_t isFromLMdecay=kFALSE;
1166  Bool_t passTrackCut = kFALSE;
1167 
1168  Double_t jetPt = jet->Pt();
1169 
1170  AliJetContainer *jetCont = GetJetContainer(jetContNb);
1171  if (jet->GetNumberOfTracks()){
1172  for(UInt_t i = 0; i < jet->GetNumberOfTracks(); i++) {
1173  vp1 = static_cast<AliVParticle*>(jet->TrackAt(i, jetCont->GetParticleContainer()->GetArray()));
1174 
1175  if (!vp1){
1176  Printf("AliVParticle associated to constituent not found");
1177  continue;
1178  }
1179 
1180  AliVTrack *vtrack = dynamic_cast<AliVTrack*>(vp1);
1181  if (!vtrack) {
1182  printf("ERROR: Could not receive track%d\n", i);
1183  continue;
1184  }
1185 
1186  AliAODTrack *track = dynamic_cast<AliAODTrack*>(vtrack);
1187 
1188  passTrackCut = kFALSE;
1189  isFromHFdecay=kFALSE;
1190  isFromLMdecay=kFALSE;
1191 
1192  p = track->P();
1193  pt = track->Pt();
1194 
1195  fTPCnSigma = fpidResponse->NumberOfSigmasTPC(track, AliPID::kElectron);
1196  fTOFnSigma = fpidResponse->NumberOfSigmasTOF(track, AliPID::kElectron);
1197 
1198  nPairs=0;
1199  MCweight = 1.;
1200  iDecay = 0;
1201 
1202  if(fMCarray){
1203  Int_t label = track->GetLabel();
1204  if(label!=0){
1205  fMCparticle = (AliAODMCParticle*) fMCarray->At(label);
1206  if(fMCparticle){
1207  Int_t partPDG = fMCparticle->GetPdgCode();
1208 
1209  GetWeightAndDecay(fMCparticle,iDecay,MCweight);
1210  isFromHFdecay = IsFromHFdecay(fMCparticle);
1211  isFromLMdecay = IsFromLMdecay(fMCparticle);
1212 
1213  if (TMath::Abs(partPDG)==11 && isFromHFdecay) fptTrueHFE[0]->Fill(pt);
1214 
1215  // track cuts
1216  passTrackCut = InclElecTrackCuts(pVtx,track,nMother,listMother);
1217  if (!passTrackCut) continue;
1218 
1219  if (TMath::Abs(partPDG)==11 && isFromHFdecay) fptTrueHFE[1]->Fill(pt);
1220 
1221  //check sigma_TPC in MC for different particles
1222  if (TMath::Abs(fTOFnSigma)<fSigmaTOFcut){
1223  if (TMath::Abs(partPDG)==11) PartId = 1; // electrons
1224  if (TMath::Abs(partPDG)==13) PartId = 2; // muons
1225  if (TMath::Abs(partPDG)==321) PartId = 3; // kaons
1226  if (TMath::Abs(partPDG)==2212) PartId = 4; // protons
1227  if (TMath::Abs(partPDG)==211) PartId = 5; // pions
1228 
1229  for (Int_t l=0;l<6;l++){// pt jet range
1230  for(Int_t k=0;k<18;k++){// pt electron range
1231  if (jetPt>=ptJetRange[l] && jetPt<ptJetRange[l+1] && p>=ptRange[k] && p<ptRange[k+1]) fnTPCTrueParticles[l][k]->Fill(PartId,fTPCnSigma);
1232  }
1233  }
1234  }
1235 
1236  if (isFromHFdecay && (fTPCnSigma>fSigmaTPCcut) && (fTPCnSigma<3)) fptTrueHFE[2]->Fill(pt);
1237  if (isFromHFdecay && (TMath::Abs(fTOFnSigma)<fSigmaTOFcut)) fptTrueHFE[3]->Fill(pt);
1238  if (isFromHFdecay && (fTPCnSigma>fSigmaTPCcut) && (fTPCnSigma<3) && (TMath::Abs(fTOFnSigma)<fSigmaTOFcut)) fptTrueHFE[4]->Fill(pt);
1239 
1240 
1241  if (TMath::Abs(partPDG)==11) nIE++;
1242  if (isFromHFdecay) nHFE++;
1243  if (isFromLMdecay) nPE++;
1244 
1245  if ((fTPCnSigma>fSigmaTPCcut) && (fTPCnSigma<3) && (TMath::Abs(fTOFnSigma)<fSigmaTOFcut)){
1246  nPairs = GetNumberOfPairs(jet,track,pVtx,nMother,listMother);
1247  if (nPairs>0) fptRecPE->Fill(pt,MCweight);
1248  if (nPairs>0 && (iDecay<1 || iDecay>6)) fptWrongPE->Fill(pt,MCweight);
1249  if (iDecay>0 && iDecay<7){
1250  fptTruePE->Fill(pt,MCweight);
1251  for (Int_t l=0;l<6;l++){// pt jet range
1252  if (jetPt>=ptJetRange[l] && jetPt<ptJetRange[l+1]){
1253  fTotElecPt[l]->Fill(pt,MCweight);
1254  if (nPairs>0) fUlsLsElecPt[l]->Fill(pt,MCweight);
1255  }
1256  }//jet pt
1257  } // decay channels
1258  }// PID cuts
1259  }
1260  }
1261  }
1262  }//track loop
1263 
1264  if (nIE==1) fptJetIE->Fill(jet->Pt());
1265  if (nIE==1 && nPE==1) fptJetPE->Fill(jet->Pt());
1266  if (nIE==1 && nHFE==1) fptJetHFE->Fill(jet->Pt());
1267 
1268  fnTrueElecPerJet->Fill(nIE);
1269  fnTrueHFElecPerJet->Fill(nHFE);
1270  fnTruePElecPerJet->Fill(nPE);
1271  }
1272 
1273  nTrueElec = nIE;
1274  nTrueHFElec = nHFE;
1275 }
1276 
1277 //_________________________________________
1278 Int_t AliAnalysisTaskEmcalHfeTagging::GetNumberOfPairs(AliEmcalJet *jet, AliAODTrack *track,const AliVVertex *pVtx, Int_t nMother, Double_t listMother[])
1279 {
1280  //Get number of ULS and LS pairs per event
1281 
1282  Int_t ntracks = 0;
1283  ntracks = fVevent->GetNumberOfTracks();
1284 
1285  Int_t nULSpairs = 0;
1286  Int_t nLSpairs = 0;
1287  Int_t sub = -1;
1288 
1289  Double_t ptJetRange[7] = {5,15,25,35,45,60,100};
1290  Double_t jetPt = jet->Pt();
1291 
1292  for(Int_t jTracks = 0; jTracks < ntracks; jTracks++){
1293 
1294  AliVParticle* Vassotrack = fVevent->GetTrack(jTracks);
1295 
1296  if (!Vassotrack) {
1297  printf("ERROR: Could not receive associated track %d\n", jTracks);
1298  continue;
1299  }
1300  AliAODTrack *trackAsso = dynamic_cast<AliAODTrack*>(Vassotrack);
1301  if(!trackAsso) continue;
1302 
1303  if((track->GetID())==(trackAsso->GetID())) continue;
1304 
1305  // track cuts
1306  Bool_t passAssoTrackCut = kFALSE;
1307  passAssoTrackCut = PhotElecTrackCuts(pVtx,trackAsso,nMother,listMother);
1308  if (!passAssoTrackCut) continue;
1309 
1310  // tagged particle
1311  Double_t p=-9.,pt=-9.,eta =-9.,phi=-9.;
1312  Int_t charge = 0;
1313 
1314  pt = track->Pt();
1315  p = track->P();
1316  phi = track->Phi();
1317  eta = track->Eta();
1318  charge = track->Charge();
1319 
1320 
1321  // associated particle variables
1322  Double_t pAsso=-9.,ptAsso=-9.,etaAsso =-9.,fITSnSigmaAsso=-9.,fTPCnSigmaAsso=-9.,phiAsso=-9.;
1323  Int_t chargeAsso = 0;
1324 
1325  ptAsso = trackAsso->Pt();
1326  pAsso = trackAsso->P();
1327  phiAsso = trackAsso->Phi();
1328  etaAsso = trackAsso->Eta();
1329  chargeAsso = trackAsso->Charge();
1330 
1331 
1332  // looser PID cuts
1333  fITSnSigmaAsso = fpidResponse->NumberOfSigmasITS(trackAsso, AliPID::kElectron);
1334  fTPCnSigmaAsso = fpidResponse->NumberOfSigmasTPC(trackAsso, AliPID::kElectron);
1335 
1336  if(TMath::Abs(fTPCnSigmaAsso)>3) continue;
1337 
1338  // invariant mass
1339  Bool_t fFlagLS=kFALSE, fFlagULS=kFALSE;
1340  Double_t openingAngle = -999., mass=999., width = -999;
1341 
1342  Int_t fPDGe1 = 11; Int_t fPDGe2 = 11;
1343  if(charge>0) fPDGe1 = -11;
1344  if(chargeAsso>0) fPDGe2 = -11;
1345 
1346  if(charge == chargeAsso) fFlagLS = kTRUE;
1347  if(charge != chargeAsso) fFlagULS = kTRUE;
1348 
1349  AliKFParticle::SetField(fVevent->GetMagneticField());
1350  AliKFParticle ge1(*track, fPDGe1);
1351  AliKFParticle ge2(*trackAsso, fPDGe2);
1352  AliKFParticle recg(ge1, ge2);
1353 
1354  if(recg.GetNDF()<1) continue;
1355  Double_t chi2recg = recg.GetChi2()/recg.GetNDF();
1356  if(TMath::Sqrt(TMath::Abs(chi2recg))>3.) continue;
1357 
1358  openingAngle = ge1.GetAngle(ge2);
1359  //if(openingAngle > fOpeningAngleCut) continue;
1360 
1361  Int_t MassCorrect=-9;
1362  MassCorrect = recg.GetMass(mass,width);
1363 
1364  for (Int_t l=0;l<6;l++){// pt jet range
1365  if (jetPt>=ptJetRange[l] && jetPt<ptJetRange[l+1] && fFlagULS) fInvmassULS[l]->Fill(pt,mass);
1366  if (jetPt>=ptJetRange[l] && jetPt<ptJetRange[l+1] && fFlagLS) fInvmassLS[l]->Fill(pt,mass);
1367  }
1368 
1369  if(mass<fIMcut && fFlagULS)
1370  nULSpairs++;
1371 
1372  if(mass<fIMcut && fFlagLS)
1373  nLSpairs++;
1374 
1375  }//track loop
1376 
1377  sub = nULSpairs-nLSpairs;
1378  fnULSmLSpairsPerElectron->Fill(track->Pt(),sub);
1379 
1380  return sub;
1381 }
1382 //_________________________________________
1384 {
1385  // Check if the mother comes from heavy-flavour decays
1386  Bool_t isHFdecay = kFALSE;
1387  Int_t partPDG = particle->GetPdgCode();
1388 
1389  Int_t idMother = particle->GetMother();
1390  if (TMath::Abs(partPDG)==11 && idMother>0){
1391  AliAODMCParticle* mother = (AliAODMCParticle*) fMCarray->At(idMother);
1392  Int_t motherPDG = TMath::Abs(mother->GetPdgCode());
1393 
1394  // c decays
1395  if( (((motherPDG/1000)%10) == 4) || (((motherPDG/100)%10) == 4) ) isHFdecay = kTRUE;
1396 
1397  // b decays
1398  if( (((motherPDG/1000)%10) == 5) || (((motherPDG/100)%10) == 5) ) isHFdecay = kTRUE;
1399  }
1400 
1401  return isHFdecay;
1402 }
1403 //_________________________________________
1405 {
1406  // Check if mother comes from light-meson decays
1407  Bool_t isLMdecay = kFALSE;
1408  Int_t partPDG = particle->GetPdgCode();
1409 
1410  Int_t idMother = particle->GetMother();
1411  if (TMath::Abs(partPDG)==11 && idMother>0){
1412  AliAODMCParticle* mother = (AliAODMCParticle*) fMCarray->At(idMother);
1413  Int_t motherPDG = TMath::Abs(mother->GetPdgCode());
1414 
1415  if(motherPDG == 111 || motherPDG == 221 || motherPDG==223 || motherPDG==333 || motherPDG==331 ||
1416  motherPDG==113 || motherPDG==213 || motherPDG==313 || motherPDG==323) isLMdecay = kTRUE;
1417  }
1418 
1419  return isLMdecay;
1420 }
1421 //_________________________________________
1423 {
1424  // Check if particle is primary
1425  Bool_t isprimary = kFALSE;
1426  if (particle->IsPrimary()) isprimary = kTRUE;
1427 
1428  return isprimary;
1429 }
1430 //_________________________________________
1432 {
1433  // Check if the particle has mother
1434  Bool_t hasMother = kTRUE;
1435  Int_t partPDG = particle->GetPdgCode();
1436 
1437  Int_t idMother = particle->GetMother();
1438  if (idMother < 0) hasMother = kFALSE;
1439 
1440  return hasMother;
1441 }
1442 //_________________________________________
1444 {
1445  //Get Pi0 weight
1446  double weight = 0;
1447  double parPi0_enh[5] = {0,0,0,0,0};
1448 
1449  if (fRunNumber >= 252235 && fRunNumber <= 264347){//LHC17h8b (o/p)
1450  parPi0_enh[0] = 4.15196;
1451  parPi0_enh[1] = 0.000681836;
1452  parPi0_enh[2] = 0.214775;
1453  parPi0_enh[3] = 1.41707;
1454  parPi0_enh[4] = 5.21343;
1455  }
1456 
1457  if (fRunNumber >= 256504 && fRunNumber <= 259888){//LHC18f4b (k/l)
1458  parPi0_enh[0] = 4.89689;
1459  parPi0_enh[1] = -0.0393185;
1460  parPi0_enh[2] = 0.231849;
1461  parPi0_enh[3] = 1.38001;
1462  parPi0_enh[4] = 5.22948;
1463  }
1464 
1465  if (fMCweight==1) weight = parPi0_enh[0] / TMath::Power((exp(parPi0_enh[1]*mcPi0pT - parPi0_enh[2]*mcPi0pT*mcPi0pT) + (mcPi0pT/parPi0_enh[3])) , parPi0_enh[4]);
1466 
1467  return weight;
1468 }
1469 //_________________________________________
1471 {
1472  //Get Pi0 weight
1473  double weight = 0;
1474  double parEta_enh[5] = {0,0,0,0,0};
1475 
1476  if (fRunNumber >= 252235 && fRunNumber <= 264347){//LHC17h8b (o/p)
1477  parEta_enh[0] = 0.233518;
1478  parEta_enh[1] = -0.492922;
1479  parEta_enh[2] = -0.0226642;
1480  parEta_enh[3] = 3.35401;
1481  parEta_enh[4] = 5.8473;
1482  }
1483 
1484  if (fRunNumber >= 256504 && fRunNumber <= 259888){//LHC18f4b (k/l)
1485  parEta_enh[0] = 0.224789;
1486  parEta_enh[1] = -0.504347;
1487  parEta_enh[2] = -0.0229456;
1488  parEta_enh[3] = 3.37102;
1489  parEta_enh[4] = 5.83616;
1490  }
1491 
1492  if (fMCweight==1) weight = parEta_enh[0] / TMath::Power((exp(parEta_enh[1]*mcEtapT - parEta_enh[2]*mcEtapT*mcEtapT) + (mcEtapT/parEta_enh[3])), parEta_enh[4]);
1493 
1494  return weight;
1495 }
1496 //________________________________________________________________________
1497 void AliAnalysisTaskEmcalHfeTagging::GetWeightAndDecay(AliAODMCParticle *particle, Int_t &decay, Double_t &weight)
1498 {
1499  //Get decay channel and weight for pi0 and eta (MC with enhanced signal)
1500  Double_t w = 0.;
1501  Int_t d = 0;
1502  Int_t partPDG = particle->GetPdgCode();
1503 
1504  if (TMath::Abs(partPDG)==11){
1505  Int_t idMother = particle->GetMother();
1506 
1507  if (idMother>0){
1508  AliAODMCParticle* mother = (AliAODMCParticle*) fMCarray->At(idMother);
1509  Int_t motherPDG = mother->GetPdgCode();
1510  Double_t motherPt = mother->Pt();
1511 
1512  Bool_t isMotherPrimary = IsPrimary(mother);
1513  Bool_t isMotherFromHF = IsFromHFdecay(mother);
1514  Bool_t isMotherFromLM = IsFromLMdecay(mother);
1515  Bool_t hasSecondMother = HasMother(mother);
1516 
1517  if (motherPDG==111 && isMotherPrimary){// pi0 -> e
1518  if (!hasSecondMother || (!isMotherFromHF && !isMotherFromLM)){
1519  d = 1;
1520  w = GetPi0weight(motherPt);
1521  }
1522  }
1523 
1524  if (motherPDG==221 && isMotherPrimary){// eta -> e
1525  if (!hasSecondMother || (!isMotherFromHF && !isMotherFromLM)){
1526  d = 2;
1527  w = GetEtaweight(motherPt);
1528  }
1529  }
1530 
1531  //Int_t idSecondMother = particle->GetSecondMother();
1532  Int_t idSecondMother = mother->GetMother();
1533 
1534  if (idSecondMother>0){
1535  AliAODMCParticle* secondMother = (AliAODMCParticle*) fMCarray->At(idSecondMother);
1536  Int_t secondMotherPDG = secondMother->GetPdgCode();
1537  Double_t secondMotherPt = secondMother->Pt();
1538 
1539  Bool_t isSecondMotherPrimary = IsPrimary(secondMother);
1540  Bool_t isSecondMotherFromHF = IsFromHFdecay(secondMother);
1541  Bool_t isSecondMotherFromLM = IsFromLMdecay(secondMother);
1542  Bool_t hasThirdMother = HasMother(secondMother);
1543 
1544  if (motherPDG==22 && secondMotherPDG==111 && isSecondMotherPrimary){ //pi0 -> g -> e
1545  if (!hasThirdMother || (!isSecondMotherFromHF && !isSecondMotherFromLM)){
1546  d = 3;
1547  w = GetPi0weight(secondMotherPt);
1548  }
1549  }
1550 
1551  if (motherPDG==22 && secondMotherPDG==221 && isSecondMotherPrimary){ //eta -> g -> e
1552  if (!hasThirdMother || (!isSecondMotherFromHF && !isSecondMotherFromLM)){
1553  d = 4;
1554  w = GetEtaweight(secondMotherPt);
1555  }
1556  }
1557 
1558  if (motherPDG==111 && secondMotherPDG==221 && isSecondMotherPrimary){ //eta -> pi0 -> e
1559  if (!hasThirdMother || (!isSecondMotherFromHF && !isSecondMotherFromLM)){
1560  d = 5;
1561  w = GetEtaweight(secondMotherPt);
1562  }
1563  }
1564 
1565  Int_t idThirdMother = secondMother->GetMother();
1566  if (idThirdMother>0){
1567  AliAODMCParticle* thirdMother = (AliAODMCParticle*) fMCarray->At(idThirdMother);
1568  Int_t thirdMotherPDG = thirdMother->GetPdgCode();
1569  Double_t thirdMotherPt = thirdMother->Pt();
1570 
1571  Bool_t isThirdMotherPrimary = IsPrimary(thirdMother);
1572  Bool_t isThirdMotherFromHF = IsFromHFdecay(thirdMother);
1573  Bool_t isThirdMotherFromLM = IsFromLMdecay(thirdMother);
1574  Bool_t hasFourthMother = HasMother(thirdMother);
1575 
1576  if (motherPDG==22 && secondMotherPDG==111 && thirdMotherPDG==221 && isThirdMotherPrimary){//eta->pi0->g-> e
1577  if (!hasFourthMother || (!isThirdMotherFromHF && !isThirdMotherFromLM)){
1578  d = 6;
1579  w = GetEtaweight(thirdMotherPt);
1580  }
1581  }
1582  }//third mother
1583  }//second mother
1584  }//mother
1585  }// if electron
1586  decay = d;
1587  weight = w;
1588 }
1589 //________________________________________________________________________
1591 
1592  AliJetContainer *jetCont = GetJetContainer(jetContNb);
1593  if (!jet->GetNumberOfTracks())
1594  return 0;
1595  Double_t den=0.;
1596  Double_t num = 0.;
1597  AliVParticle *vp1 = 0x0;
1598  for(UInt_t i = 0; i < jet->GetNumberOfTracks(); i++) {
1599  vp1 = static_cast<AliVParticle*>(jet->TrackAt(i, jetCont->GetParticleContainer()->GetArray()));
1600 
1601  if (!vp1){
1602  Printf("AliVParticle associated to constituent not found");
1603  continue;
1604  }
1605 
1606  Double_t dphi = RelativePhi(vp1->Phi(),jet->Phi());
1607  Double_t dr2 = (vp1->Eta()-jet->Eta())*(vp1->Eta()-jet->Eta()) + dphi*dphi;
1608  Double_t dr = TMath::Sqrt(dr2);
1609  num=num+vp1->Pt()*dr;
1610  den=den+vp1->Pt();
1611  }
1612  return num/den;
1613 }
1614 
1615 //________________________________________________________________________
1617 
1618  if((fJetShapeSub==kDerivSub) && (jetContNb==0))
1621  else
1622  return Angularity(jet, jetContNb);
1623 
1624 }
1625 
1626 //____________________________________________________________________________
1627 
1629 
1630  AliTrackContainer *PartCont = NULL;
1631  AliParticleContainer *PartContMC = NULL;
1632 
1633 
1634  if (fJetShapeSub==kConstSub){
1636  else PartCont = GetTrackContainer(1);
1637  }
1638  else{
1640  else PartCont = GetTrackContainer(0);
1641  }
1642 
1643  TClonesArray *TracksArray = NULL;
1644  TClonesArray *TracksArrayMC = NULL;
1645 
1646  if (fJetShapeType == AliAnalysisTaskEmcalHfeTagging::kGenOnTheFly) TracksArrayMC = PartContMC->GetArray();
1647  else TracksArray = PartCont->GetArray();
1648 
1650  if(!PartContMC || !TracksArrayMC) return -2;
1651  }
1652  else {
1653  if(!PartCont || !TracksArray) return -2;
1654  }
1655 
1656 
1657  AliAODTrack *Track = 0x0;
1658  Float_t sumpt=0;
1659  Int_t NTracks=0;
1660  if (fJetShapeType == AliAnalysisTaskEmcalHfeTagging::kGenOnTheFly) NTracks = TracksArrayMC->GetEntriesFast();
1661  else NTracks = TracksArray->GetEntriesFast();
1662 
1663  for(Int_t i=0; i < NTracks; i++){
1665  if((Track = static_cast<AliAODTrack*>(PartContMC->GetAcceptParticle(i)))){
1666  if (!Track) continue;
1667  if(TMath::Abs(Track->Eta())>0.9) continue;
1668  Double_t dphi = RelativePhi(Track->Phi(),jet->Phi());
1669  Double_t dr2 = (Track->Eta()-jet->Eta())*(Track->Eta()-jet->Eta()) + dphi*dphi;
1670  Double_t dr = TMath::Sqrt(dr2);
1671  if((dr>=0.8) && (dr<1)) sumpt=sumpt+Track->Pt();
1672  }
1673  }
1674  else{
1675  if((Track = static_cast<AliAODTrack*>(PartCont->GetAcceptTrack(i)))){
1676  if (!Track) continue;
1677  if(TMath::Abs(Track->Eta())>0.9) continue;
1678  if (Track->Pt()<0.15) continue;
1679  Double_t dphi = RelativePhi(Track->Phi(),jet->Phi());
1680  Double_t dr2 = (Track->Eta()-jet->Eta())*(Track->Eta()-jet->Eta()) + dphi*dphi;
1681  Double_t dr = TMath::Sqrt(dr2);
1682  if((dr>=0.8) && (dr<1)) sumpt=sumpt+Track->Pt();
1683 
1684  }
1685  }
1686  }
1687  return sumpt;
1688 }
1689 
1690 //________________________________________________________________________
1692 
1693  if((fJetShapeSub==kDerivSub) && (jetContNb==0)) return -2;
1694  else
1695  return Coronna(jet, jetContNb);
1696 
1697 }
1698 
1699 //________________________________________________________________________
1701 
1702  AliJetContainer *jetCont = GetJetContainer(jetContNb);
1703  if (!jet->GetNumberOfTracks())
1704  return 0;
1705  Double_t den=0.;
1706  Double_t num = 0.;
1707  AliVParticle *vp1 = 0x0;
1708  for(UInt_t i = 0; i < jet->GetNumberOfTracks(); i++) {
1709  vp1 = static_cast<AliVParticle*>(jet->TrackAt(i, jetCont->GetParticleContainer()->GetArray()));
1710 
1711  if (!vp1){
1712  Printf("AliVParticle associated to constituent not found");
1713  continue;
1714  }
1715 
1716  num=num+vp1->Pt()*vp1->Pt();
1717  den=den+vp1->Pt();
1718  }
1719  return TMath::Sqrt(num)/den;
1720 }
1721 
1722 //________________________________________________________________________
1724  //calc subtracted jet mass
1725  if((fJetShapeSub==kDerivSub)&&(jetContNb==0))
1727  else return jet->GetShapeProperties()->GetSecondOrderSubtractedpTD();
1728  else
1729  return PTD(jet, jetContNb);
1730 
1731 }
1732 
1733 //_____________________________________________________________________________
1735 
1736  AliJetContainer *jetCont = GetJetContainer(jetContNb);
1737  if (!jet->GetNumberOfTracks())
1738  return 0;
1739  Double_t mxx = 0.;
1740  Double_t myy = 0.;
1741  Double_t mxy = 0.;
1742  int nc = 0;
1743  Double_t sump2 = 0.;
1744  Double_t pxjet=jet->Px();
1745  Double_t pyjet=jet->Py();
1746  Double_t pzjet=jet->Pz();
1747 
1748 
1749  //2 general normalized vectors perpendicular to the jet
1750  TVector3 ppJ1(pxjet, pyjet, pzjet);
1751  TVector3 ppJ3(- pxjet* pzjet, - pyjet * pzjet, pxjet * pxjet + pyjet * pyjet);
1752  ppJ3.SetMag(1.);
1753  TVector3 ppJ2(-pyjet, pxjet, 0);
1754  ppJ2.SetMag(1.);
1755  AliVParticle *vp1 = 0x0;
1756  for(UInt_t i = 0; i < jet->GetNumberOfTracks(); i++) {
1757  vp1 = static_cast<AliVParticle*>(jet->TrackAt(i, jetCont->GetParticleContainer()->GetArray()));
1758 
1759  if (!vp1){
1760  Printf("AliVParticle associated to constituent not found");
1761  continue;
1762  }
1763 
1764  TVector3 pp(vp1->Px(), vp1->Py(), vp1->Pz());
1765 
1766  //local frame
1767  TVector3 pLong = pp.Dot(ppJ1) / ppJ1.Mag2() * ppJ1;
1768  TVector3 pPerp = pp - pLong;
1769  //projection onto the two perpendicular vectors defined above
1770 
1771  Float_t ppjX = pPerp.Dot(ppJ2);
1772  Float_t ppjY = pPerp.Dot(ppJ3);
1773  Float_t ppjT = TMath::Sqrt(ppjX * ppjX + ppjY * ppjY);
1774  if(ppjT<=0) return 0;
1775 
1776  mxx += (ppjX * ppjX / ppjT);
1777  myy += (ppjY * ppjY / ppjT);
1778  mxy += (ppjX * ppjY / ppjT);
1779  nc++;
1780  sump2 += ppjT;}
1781 
1782  if(nc<2) return 0;
1783  if(sump2==0) return 0;
1784  // Sphericity Matrix
1785  Double_t ele[4] = {mxx / sump2, mxy / sump2, mxy / sump2, myy / sump2};
1786  TMatrixDSym m0(2,ele);
1787 
1788  // Find eigenvectors
1789  TMatrixDSymEigen m(m0);
1790  TVectorD eval(2);
1791  TMatrixD evecm = m.GetEigenVectors();
1792  eval = m.GetEigenValues();
1793  // Largest eigenvector
1794  int jev = 0;
1795  // cout<<eval[0]<<" "<<eval[1]<<endl;
1796  if (eval[0] < eval[1]) jev = 1;
1797  TVectorD evec0(2);
1798  // Principle axis
1799  evec0 = TMatrixDColumn(evecm, jev);
1800  Double_t compx=evec0[0];
1801  Double_t compy=evec0[1];
1802  TVector2 evec(compx, compy);
1803  Double_t circ=0;
1804  if(jev==1) circ=2*eval[0];
1805  if(jev==0) circ=2*eval[1];
1806 
1807  return circ;
1808 
1809 
1810 
1811 }
1812 
1813 //________________________________________________________________________
1815  //calc subtracted jet mass
1816 
1817  if((fJetShapeSub==kDerivSub)&&(jetContNb==0))
1820  else
1821  return Circularity(jet, jetContNb);
1822 
1823 }
1824 
1825 //________________________________________________________________________
1827 
1828  AliJetContainer *jetCont = GetJetContainer(jetContNb);
1829  if (!jet->GetNumberOfTracks())
1830  return 0;
1831  Double_t den=0.;
1832  Double_t num = 0.;
1833  AliVParticle *vp1 = 0x0;
1834  AliVParticle *vp2 = 0x0;
1835  std::vector<int> ordindex;
1836  ordindex=jet->GetPtSortedTrackConstituentIndexes(jetCont->GetParticleContainer()->GetArray());
1837  //Printf("Nbof const = %d", jet->GetNumberOfTracks());
1838  //Printf("ordindex[0] = %d, ordindex[1] = %d", ordindex[0], ordindex[1]);
1839 
1840  if(ordindex.size()<2) return -1;
1841 
1842  vp1 = static_cast<AliVParticle*>(jet->TrackAt(ordindex[0], jetCont->GetParticleContainer()->GetArray()));
1843  if (!vp1){
1844  Printf("AliVParticle associated to Leading constituent not found");
1845  return -1;
1846  }
1847 
1848  vp2 = static_cast<AliVParticle*>(jet->TrackAt(ordindex[1], jetCont->GetParticleContainer()->GetArray()));
1849  if (!vp2){
1850  Printf("AliVParticle associated to Subleading constituent not found");
1851  return -1;
1852  }
1853 
1854 
1855  num=vp1->Pt();
1856  den=vp2->Pt();
1857  //Printf("vp1->Pt() =%f, vp2->Pt() =%f", vp1->Pt(), vp2->Pt());
1858 
1859  return num-den;
1860 }
1861 
1862 //________________________________________________________________________
1864  //calc subtracted jet mass
1865 
1866  if((fJetShapeSub==kDerivSub)&&(jetContNb==0))
1868  else return jet->GetShapeProperties()->GetSecondOrderSubtractedLeSub();
1869  else
1870  return LeSub(jet, jetContNb);
1871 
1872 }
1873 
1874 //________________________________________________________________________
1876  //calc subtracted jet mass
1877 
1878  if((fJetShapeSub==kDerivSub)&&(jetContNb==0))
1881  else
1882  return jet->GetNumberOfTracks();
1883 
1884 }
1885 
1886 
1887 //______________________________________________________________________________
1889 
1890  AliJetContainer *jetCont = GetJetContainer(jetContNb);
1891  if (!jet->GetNumberOfTracks())
1892  return 0;
1893  Double_t mxx = 0.;
1894  Double_t myy = 0.;
1895  Double_t mxy = 0.;
1896  int nc = 0;
1897  Double_t sump2 = 0.;
1898 
1899  AliVParticle *vp1 = 0x0;
1900  for(UInt_t i = 0; i < jet->GetNumberOfTracks(); i++) {
1901  vp1 = static_cast<AliVParticle*>(jet->TrackAt(i, jetCont->GetParticleContainer()->GetArray()));
1902 
1903  if (!vp1){
1904  Printf("AliVParticle associated to constituent not found");
1905  continue;
1906  }
1907 
1908  Double_t ppt=vp1->Pt();
1909  Double_t dphi = RelativePhi(vp1->Phi(),jet->Phi());
1910 
1911  Double_t deta = vp1->Eta()-jet->Eta();
1912  mxx += ppt*ppt*deta*deta;
1913  myy += ppt*ppt*dphi*dphi;
1914  mxy -= ppt*ppt*deta*TMath::Abs(dphi);
1915  nc++;
1916  sump2 += ppt*ppt;
1917 
1918  }
1919  if(nc<2) return 0;
1920  if(sump2==0) return 0;
1921  // Sphericity Matrix
1922  Double_t ele[4] = {mxx , mxy , mxy , myy };
1923  TMatrixDSym m0(2,ele);
1924 
1925  // Find eigenvectors
1926  TMatrixDSymEigen m(m0);
1927  TVectorD eval(2);
1928  TMatrixD evecm = m.GetEigenVectors();
1929  eval = m.GetEigenValues();
1930  // Largest eigenvector
1931  int jev = 0;
1932  // cout<<eval[0]<<" "<<eval[1]<<endl;
1933  if (eval[0] < eval[1]) jev = 1;
1934  TVectorD evec0(2);
1935  // Principle axis
1936  evec0 = TMatrixDColumn(evecm, jev);
1937  Double_t compx=evec0[0];
1938  Double_t compy=evec0[1];
1939  TVector2 evec(compx, compy);
1940  Double_t sig=0;
1941  if(jev==1) sig=TMath::Sqrt(TMath::Abs(eval[0])/sump2);
1942  if(jev==0) sig=TMath::Sqrt(TMath::Abs(eval[1])/sump2);
1943 
1944  return sig;
1945 
1946 }
1947 
1948 //________________________________________________________________________
1950  //calc subtracted jet mass
1951 
1952  if((fJetShapeSub==kDerivSub)&&(jetContNb==0))
1954  else return jet->GetShapeProperties()->GetSecondOrderSubtractedSigma2();
1955  else
1956  return Sigma2(jet, jetContNb);
1957 
1958 }
1959 
1960 //________________________________________________________________________
1962 
1963  AliTrackContainer *PartCont = NULL;
1964  AliParticleContainer *PartContMC = NULL;
1965 
1966 
1967  if (fJetShapeSub==kConstSub){
1969  else PartCont = GetTrackContainer(1);
1970  }
1971  else{
1973  else PartCont = GetTrackContainer(0);
1974  }
1975 
1976  TClonesArray *TracksArray = NULL;
1977  TClonesArray *TracksArrayMC = NULL;
1978 
1979  if (fJetShapeType == AliAnalysisTaskEmcalHfeTagging::kGenOnTheFly) TracksArrayMC = PartContMC->GetArray();
1980  else TracksArray = PartCont->GetArray();
1981 
1983  if(!PartContMC || !TracksArrayMC) return -99999;
1984  }
1985  else {
1986  if(!PartCont || !TracksArray) return -99999;
1987  }
1988 
1989 
1990  AliAODTrack *Track = 0x0;
1991 
1992 
1993 
1994  //TList *trackList = new TList();
1995  Int_t triggers[100];
1996  for (Int_t iTrigger=0; iTrigger<100; iTrigger++) triggers[iTrigger] = 0;
1997  Int_t iTT = 0;
1998  Int_t NTracks=0;
1999  if (fJetShapeType == AliAnalysisTaskEmcalHfeTagging::kGenOnTheFly) NTracks = TracksArrayMC->GetEntriesFast();
2000  else NTracks = TracksArray->GetEntriesFast();
2001 
2002  for(Int_t i=0; i < NTracks; i++){
2004  if((Track = static_cast<AliAODTrack*>(PartContMC->GetAcceptParticle(i)))){
2005  if (!Track) continue;
2006  if(TMath::Abs(Track->Eta())>0.9) continue;
2007  if (Track->Pt()<0.15) continue;
2008  if ((Track->Pt() >= minpT) && (Track->Pt()< maxpT)) {
2009  triggers[iTT] = i;
2010  iTT++;
2011  }
2012  }
2013  }
2014  else{
2015  if((Track = static_cast<AliAODTrack*>(PartCont->GetAcceptTrack(i)))){
2016  if (!Track) continue;
2017  if(TMath::Abs(Track->Eta())>0.9) continue;
2018  if (Track->Pt()<0.15) continue;
2019  if ((Track->Pt() >= minpT) && (Track->Pt()< maxpT)) {
2020  triggers[iTT] = i;
2021  iTT++;
2022  }
2023  }
2024  }
2025  }
2026 
2027 
2028  if (iTT == 0) return -99999;
2029  Int_t nbRn = 0, index = 0 ;
2030  TRandom3* random = new TRandom3(0);
2031  nbRn = random->Integer(iTT);
2032  index = triggers[nbRn];
2033  //Printf("iTT Total= %d, nbRn = %d, Index = %d",iTT, nbRn, index );
2034  return index;
2035 
2036 }
2037 
2038 //__________________________________________________________________________________
2040 
2041  if (vphi < -1*TMath::Pi()) vphi += (2*TMath::Pi());
2042  else if (vphi > TMath::Pi()) vphi -= (2*TMath::Pi());
2043  if (mphi < -1*TMath::Pi()) mphi += (2*TMath::Pi());
2044  else if (mphi > TMath::Pi()) mphi -= (2*TMath::Pi());
2045  double dphi = mphi-vphi;
2046  if (dphi < -1*TMath::Pi()) dphi += (2*TMath::Pi());
2047  else if (dphi > TMath::Pi()) dphi -= (2*TMath::Pi());
2048  return dphi;//dphi in [-Pi, Pi]
2049 }
2050 
2051 
2052 //________________________________________________________________________
2054  //
2055  // retrieve event objects
2056  //
2058  return kFALSE;
2059 
2060  return kTRUE;
2061 }
2062 
2063 //_________________________________________
2064 Bool_t AliAnalysisTaskEmcalHfeTagging::InclElecTrackCuts(const AliVVertex *pVietx,AliAODTrack *ietrack,Int_t nMother, Double_t listMother[])
2065 {
2066  // track cuts for inclusive electrons
2067 
2068  if(!ietrack->TestFilterMask(AliAODTrack::kTrkGlobalNoDCA)) return kFALSE;
2069  if(TMath::Abs(ietrack->Eta())>0.8) return kFALSE;
2070  if(ietrack->GetTPCNcls() < fTPCnCut) return kFALSE;
2071  if (ietrack->GetITSNcls() < fITSncut) return kFALSE;
2072  if(!ietrack->IsOn(AliAODTrack::kITSrefit)) return kFALSE;
2073  if(!ietrack->IsOn(AliAODTrack::kTPCrefit)) return kFALSE;
2074  if(!(ietrack->HasPointOnITSLayer(0) && ietrack->HasPointOnITSLayer(1))) return kFALSE;
2075  //if ((ietrack->Pt()<0.5) || (ietrack->Pt()>4)) return kFALSE;
2076 
2077  Bool_t kinkmotherpass = kTRUE;
2078  for(Int_t kinkmother = 0; kinkmother < nMother; kinkmother++) {
2079  if(ietrack->GetID() == listMother[kinkmother]) {
2080  kinkmotherpass = kFALSE;
2081  continue;
2082  }
2083  }
2084  if(!kinkmotherpass) return kFALSE;
2085 
2086  Double_t d0z0[2]={-999,-999}, cov[3];
2087 
2088  if(ietrack->PropagateToDCA(pVietx, fVevent->GetMagneticField(), 20., d0z0, cov))
2089  if(TMath::Abs(d0z0[0]) > fDcaXYcut || TMath::Abs(d0z0[1]) > fDcaZcut) return kFALSE;
2090 
2091  return kTRUE;
2092 
2093 }
2094 //_________________________________________
2095 Bool_t AliAnalysisTaskEmcalHfeTagging::PhotElecTrackCuts(const AliVVertex *pVaetx,AliAODTrack *aetrack,Int_t nMother, Double_t listMother[])
2096 {
2097  // track cuts for associate tracks of photonic electrons
2098 
2099  if(!aetrack->TestFilterMask(AliAODTrack::kTrkTPCOnly)) return kFALSE;
2100  if(aetrack->Pt() < fAssPtCut) return kFALSE;
2101  if(TMath::Abs(aetrack->Eta())>0.9) return kFALSE;
2102  if(aetrack->GetTPCNcls() < fAssTPCnCut) return kFALSE;
2103  if (fAssITSrefitCut && !(aetrack->GetStatus()&AliAODTrack::kITSrefit)) return kFALSE;
2104  if(!(aetrack->GetStatus()&AliAODTrack::kTPCrefit)) return kFALSE;
2105 
2106  return kTRUE;
2107 
2108 }
2109 
2110 //_______________________________________________________________________
2112 {
2113  // Called once at the end of the analysis.
2114 
2115  // fTreeObservableTagging = dynamic_cast<TTree*>(GetOutputData(1));
2116  // if (!fTreeObservableTagging){
2117  // Printf("ERROR: fTreeObservableTagging not available");
2118  // return;
2119  // }
2120 
2121 }
2122 
Int_t charge
Float_t Angularity(AliEmcalJet *jet, Int_t jetContNb)
Double_t GetFirstOrderSubtractedAngularity() const
Float_t GetJetLeSub(AliEmcalJet *jet, Int_t jetContNb)
Double_t Area() const
Definition: AliEmcalJet.h:130
Bool_t IsFromHFdecay(AliAODMCParticle *particle)
const TString & GetRhoName() const
double Double_t
Definition: External.C:58
Double_t GetSecondOrderSubtractedSigma2() const
Definition: External.C:236
Bool_t Run()
Run function. This is the core function of the analysis and contains the user code. Therefore users have to implement this function.
Bool_t FillHistograms()
Function filling histograms.
Float_t GetPartonEta6() const
AliEmcalJet * ClosestJet() const
Definition: AliEmcalJet.h:327
AliJetContainer * GetJetContainer(Int_t i=0) const
Float_t GetPartonEta7() const
Double_t GetSecondOrderSubtractedConstituent() const
Double_t Eta() const
Definition: AliEmcalJet.h:121
Double_t Py() const
Definition: AliEmcalJet.h:107
Double_t Phi() const
Definition: AliEmcalJet.h:117
Double_t mass
Float_t GetPythiaEventWeight() const
Container with name, TClonesArray and cuts for particles.
Double_t GetPi0weight(Double_t mcPi0pT) const
Int_t GetLabel() const
Definition: AliEmcalJet.h:124
Float_t GetPartonPhi7() const
Bool_t RetrieveEventObjects()
Retrieve common objects from event.
Bool_t PhotElecTrackCuts(const AliVVertex *pVtx, AliAODTrack *aetrack, Int_t nMother, Double_t listMother[])
Float_t Circularity(AliEmcalJet *jet, Int_t jetContNb)
Bool_t HasMother(AliAODMCParticle *particle)
Int_t GetNumberOfPairs(AliEmcalJet *jet, AliAODTrack *track, const AliVVertex *pVtx, Int_t nMother, Double_t listMother[])
Float_t GetJetCircularity(AliEmcalJet *jet, Int_t jetContNb)
Int_t GetPartonFlag7() const
Container for particles within the EMCAL framework.
Float_t Sigma2(AliEmcalJet *jet, Int_t jetContNb)
Float_t GetPartonPhi6() const
Int_t TrackAt(Int_t idx) const
Definition: AliEmcalJet.h:160
UShort_t GetNumberOfTracks() const
Definition: AliEmcalJet.h:139
TString kData
Declare data MC or deltaAOD.
Double_t Px() const
Definition: AliEmcalJet.h:106
Float_t PTD(AliEmcalJet *jet, Int_t jetContNb)
AliParticleContainer * GetParticleContainer(Int_t i=0) const
Get particle container attached to this task.
const TString & GetRhoMassName() const
Int_t GetPartonFlag6() const
Double_t GetEtaweight(Double_t mcEtapT) const
AliParticleContainer * GetParticleContainer() const
Double_t GetFirstOrderSubtractedConstituent() const
int Int_t
Definition: External.C:63
unsigned int UInt_t
Definition: External.C:33
float Float_t
Definition: External.C:68
Bool_t IsPrimary(AliAODMCParticle *particle)
Int_t GetNJets() const
Float_t GetJetMass(AliEmcalJet *jet, Int_t jetContNb)
Double_t GetSecondOrderSubtractedAngularity() const
Bool_t InclElecTrackCuts(const AliVVertex *pVtx, AliAODTrack *ietrack, Int_t nMother, Double_t listMother[])
Double_t RelativePhi(Double_t mphi, Double_t vphi)
virtual AliVParticle * GetAcceptParticle(Int_t i=-1) const
Double_t fCent
!event centrality
AliEmcalJet * GetNextAcceptJet()
void GetNumberOfElectrons(AliEmcalJet *jet, Int_t jetContNb, Int_t nMother, Double_t listMother[], Int_t &nIncElec, Int_t &nPhotElec, Double_t &pElec, Double_t &ptElec, Bool_t &hasElec)
Bool_t Data(TH1F *h, Double_t *rangefit, Bool_t writefit, Double_t &sgn, Double_t &errsgn, Double_t &bkg, Double_t &errbkg, Double_t &sgnf, Double_t &errsgnf, Double_t &sigmafit, Int_t &status)
Float_t LeSub(AliEmcalJet *jet, Int_t jetContNb)
Double_t Pt() const
Definition: AliEmcalJet.h:109
Double_t GetRhoVal(Int_t i=0) const
void GetWeightAndDecay(AliAODMCParticle *particle, Int_t &decay, Double_t &weight)
Double_t GetFirstOrderSubtractedCircularity() const
void Track()
decay
Definition: HFPtSpectrum.C:41
AliEmcalList * fOutput
!output list
Float_t GetJetCoronna(AliEmcalJet *jet, Int_t jetContNb)
Double_t GetSecondOrderSubtractedCircularity() const
AliTrackContainer * GetTrackContainer(Int_t i=0) const
Store some informaion about a Pythia eventThis class is used to store some information about a Pythia...
void SetMakeGeneralHistograms(Bool_t g)
Float_t GetJetAngularity(AliEmcalJet *jet, Int_t jetContNb)
Float_t GetSigma2(AliEmcalJet *jet, Int_t jetContNb)
virtual AliVTrack * GetAcceptTrack(Int_t i=-1) const
Base task in the EMCAL jet framework.
Represent a jet reconstructed using the EMCal jet framework.
Definition: AliEmcalJet.h:51
void GetNumberOfTrueElectrons(AliEmcalJet *jet, Int_t jetContNb, Int_t nMother, Double_t listMother[], Int_t &nTrueElec, Int_t &nTrueHFElec)
const AliEmcalPythiaInfo * GetPythiaInfo() const
Double_t Pz() const
Definition: AliEmcalJet.h:108
Double_t GetFractionSharedPt(const AliEmcalJet *jet, AliParticleContainer *cont2=0x0) const
Declaration of class AliEmcalPythiaInfo.
const char Option_t
Definition: External.C:48
void UserCreateOutputObjects()
Main initialization function on the worker.
Double_t GetFirstOrderSubtractedSigma2() const
bool Bool_t
Definition: External.C:53
Bool_t IsFromLMdecay(AliAODMCParticle *particle)
AliEmcalJetShapeProperties * GetShapeProperties() const
Definition: AliEmcalJet.h:361
Int_t SelectTrigger(Float_t minpT, Float_t maxpT)
Float_t GetJetpTD(AliEmcalJet *jet, Int_t jetContNb)
Float_t Coronna(AliEmcalJet *jet, Int_t jetContNb)
Float_t GetPartonPt7() const
Double_t M() const
Definition: AliEmcalJet.h:120
Container for jet within the EMCAL jet framework.
Definition: External.C:196
std::vector< int > GetPtSortedTrackConstituentIndexes(TClonesArray *tracks) const
Float_t GetPartonPt6() const
Float_t GetJetNumberOfConstituents(AliEmcalJet *jet, Int_t jetContNb)
AliEmcalJet * GetJet(Int_t i) const