AliPhysics  ff1d528 (ff1d528)
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
AliAnalysisTaskSubJetFraction.cxx
Go to the documentation of this file.
1 //
2 // Subjet fraction analysis task.
3 //
4 //Nima Zardoshti
5 
6 #include <TClonesArray.h>
7 #include <TH1F.h>
8 #include <TH2F.h>
9 #include <TH3F.h>
10 #include <TCanvas.h>
11 #include <THnSparse.h>
12 #include <TTree.h>
13 #include <TList.h>
14 #include <TLorentzVector.h>
15 #include <TProfile.h>
16 #include <TChain.h>
17 #include <TSystem.h>
18 #include <TFile.h>
19 #include <TKey.h>
20 #include <AliAnalysisDataSlot.h>
21 #include <AliAnalysisDataContainer.h>
22 #include "TMatrixD.h"
23 #include "TMatrixDSym.h"
24 #include "TMatrixDSymEigen.h"
25 #include "TVector3.h"
26 #include "TVector2.h"
27 #include "AliVCluster.h"
28 #include "AliVTrack.h"
29 #include "AliEmcalJet.h"
30 #include "AliRhoParameter.h"
31 #include "AliLog.h"
32 #include "AliEmcalParticle.h"
33 #include "AliMCEvent.h"
34 #include "AliGenPythiaEventHeader.h"
35 #include "AliAODMCHeader.h"
36 #include "AliMCEvent.h"
37 #include "AliAnalysisManager.h"
38 #include "AliJetContainer.h"
39 #include "AliParticleContainer.h"
40 //#include "AliPythiaInfo.h"
41 #include "TRandom3.h"
42 #include "AliPicoTrack.h"
43 #include "AliEmcalJetFinder.h"
44 #include "AliAODEvent.h"
46 
47 //Globals
48 
49 
50 Double_t XBinsPt[66]={0.15,0.20,0.25,0.30,0.35,0.40,0.45,0.50,0.55,0.60,0.65,0.70,0.75,0.80,0.85,0.9,0.95,1.00,1.10,1.20,1.30,1.40,1.50,1.60,1.70,1.80,1.90,2.00,2.20,2.40,2.60,2.80,3.00,3.20,3.40,3.60,3.80,4.00,4.50,5.00,5.50,6.00,6.50,7.00,8.00,9.00,10.00,11.00,12.00,13.00,14.00,15.00,16.00,18.00,20.00,22.00,24.00,26.00,28.00,30.00,32.00,34.00,36.00,40.00,45.00,50.00}; //Lower edges of new bins for rebbing purposes for track pt
52 Double_t XBinsJetPt[35]={0,0.50,1.00,2.00,3.00,4.00,5.00,6.00,7.00,8.00,9.00,10.00,12.00,14.00,16.00,18.00,20.00,25.00,30.00,35.00,40.00,45.00,50.00,60.00,70.00,80.00,90.00,100.00,120.00,140.00,160.00,180.00,200.00,250.00,300.00}; //for jet pt
54 Double_t XBinsJetMass[28]={0,0.50,1.00,2.00,3.00,4.00,5.00,6.00,7.00,8.00,9.00,10.00,12.00,14.00,16.00,18.00,20.00,25.00,30.00,35.00,40.00,45.00,50.00,60.00,70.00,80.00,90.00,100.00}; //for jet mass
59 Double_t Phi_Up=2*(TMath::Pi());
60 Double_t Phi_Low=(-1*(TMath::Pi()));
62 
63 
64 
65 
66 
67 using std::cout;
68 using std::endl;
69 
71 
72 //________________________________________________________________________
75  fContainer(0),
76  fMinFractionShared(0),
77  fJetShapeType(kData),
78  fJetShapeSub(kNoSub),
79  fJetSelection(kInclusive),
80  fPtThreshold(-9999.),
81  fRMatching(0.2),
82  fPtMinTriggerHadron(20.),
83  fPtMaxTriggerHadron(50.),
84  fRecoilAngularWindow(0.6),
85  fSemigoodCorrect(0),
86  fHolePos(0),
87  fHoleWidth(0),
88  fCentSelectOn(kTRUE),
89  fCentMin(0),
90  fCentMax(10),
91  fSubJetAlgorithm(0),
92  fSubJetRadius(0.1),
93  fSubJetMinPt(1),
94  fJetRadius(0.4),
95  fRMatched(0.2),
96  fSharedFractionPtMin(0.5),
97  fDerivSubtrOrder(0),
98  fFullTree(kFALSE),
99  fBeta_SD(0),
100  fZCut(0.1),
101  fReclusteringAlgorithm(0),
102  fNsubMeasure(kFALSE),
103  fhPtTriggerHadron(0x0),
104  fhJetPt(0x0),
105  fhJetPt_1(0x0),
106  fhJetPt_2(0x0),
107  fhJetPhi(0x0),
108  fhJetPhi_1(0x0),
109  fhJetPhi_2(0x0),
110  fhJetEta(0x0),
111  fhJetEta_1(0x0),
112  fhJetEta_2(0x0),
113  fhJetMass(0x0),
114  fhJetMass_1(0x0),
115  fhJetMass_2(0x0),
116  fhJetRadius(0x0),
117  fhJetRadius_1(0x0),
118  fhJetRadius_2(0x0),
119  fhJetCounter(0x0),
120  fhJetCounter_1(0x0),
121  fhJetCounter_2(0x0),
122  fhNumberOfJetTracks(0x0),
123  fhNumberOfJetTracks_1(0x0),
124  fhNumberOfJetTracks_2(0x0),
125  fhSubJetPt(0x0),
126  fhSubJetPt_1(0x0),
127  fhSubJetPt_2(0x0),
128  fhSubJetMass(0x0),
129  fhSubJetMass_1(0x0),
130  fhSubJetMass_2(0x0),
131  fhSubJetRadius(0x0),
132  fhSubJetRadius_1(0x0),
133  fhSubJetRadius_2(0x0),
134  fhSubJetCounter(0x0),
135  fhSubJetCounter_1(0x0),
136  fhSubJetCounter_2(0x0),
137  fhNumberOfSubJetTracks(0x0),
138  fhNumberOfSubJetTracks_1(0x0),
139  fhNumberOfSubJetTracks_2(0x0),
140  fh2PtTriggerHadronJet(0x0),
141  fhPhiTriggerHadronJet(0x0),
142  fhPhiTriggerHadronEventPlane(0x0),
143  fhPhiTriggerHadronEventPlaneTPC(0x0),
144  fh2PtRatio(0x0),
145  fhEventCounter(0x0),
146  fhEventCounter_1(0x0),
147  fhEventCounter_2(0x0),
148  fhSubJettiness1CheckRatio_FJ_AKT(0x0),
149  fhSubJettiness1CheckRatio_FJ_KT(0x0),
150  fhSubJettiness1CheckRatio_FJ_CA(0x0),
151  fhSubJettiness1CheckRatio_FJ_WTA_KT(0x0),
152  fhSubJettiness1CheckRatio_FJ_WTA_CA(0x0),
153  fhSubJettiness1CheckRatio_FJ_OP_AKT(0x0),
154  fhSubJettiness1CheckRatio_FJ_OP_KT(0x0),
155  fhSubJettiness1CheckRatio_FJ_OP_CA(0x0),
156  fhSubJettiness1CheckRatio_FJ_OP_WTA_KT(0x0),
157  fhSubJettiness1CheckRatio_FJ_OP_WTA_CA(0x0),
158  fhSubJettiness1CheckRatio_FJ_MIN(0x0),
159  fhSubJettiness2CheckRatio_FJ_AKT(0x0),
160  fhSubJettiness2CheckRatio_FJ_KT(0x0),
161  fhSubJettiness2CheckRatio_FJ_CA(0x0),
162  fhSubJettiness2CheckRatio_FJ_WTA_KT(0x0),
163  fhSubJettiness2CheckRatio_FJ_WTA_CA(0x0),
164  fhSubJettiness2CheckRatio_FJ_OP_AKT(0x0),
165  fhSubJettiness2CheckRatio_FJ_OP_KT(0x0),
166  fhSubJettiness2CheckRatio_FJ_OP_CA(0x0),
167  fhSubJettiness2CheckRatio_FJ_OP_WTA_KT(0x0),
168  fhSubJettiness2CheckRatio_FJ_OP_WTA_CA(0x0),
169  fhSubJettiness2CheckRatio_FJ_MIN(0x0),
170  fhSubJettiness2to1CheckRatio_FJ_AKT(0x0),
171  fhSubJettiness2to1CheckRatio_FJ_KT(0x0),
172  fhSubJettiness2to1CheckRatio_FJ_CA(0x0),
173  fhSubJettiness2to1CheckRatio_FJ_WTA_KT(0x0),
174  fhSubJettiness2to1CheckRatio_FJ_WTA_CA(0x0),
175  fhSubJettiness2to1CheckRatio_FJ_OP_AKT(0x0),
176  fhSubJettiness2to1CheckRatio_FJ_OP_KT(0x0),
177  fhSubJettiness2to1CheckRatio_FJ_OP_CA(0x0),
178  fhSubJettiness2to1CheckRatio_FJ_OP_WTA_KT(0x0),
179  fhSubJettiness2to1CheckRatio_FJ_OP_WTA_CA(0x0),
180  fhSubJettiness2to1CheckRatio_FJ_MIN(0x0),
181  fhSubJettiness1_FJ_AKT(0x0),
182  fhSubJettiness1_FJ_KT(0x0),
183  fhSubJettiness1_FJ_CA(0x0),
184  fhSubJettiness1_FJ_WTA_KT(0x0),
185  fhSubJettiness1_FJ_WTA_CA(0x0),
186  fhSubJettiness1_FJ_OP_AKT(0x0),
187  fhSubJettiness1_FJ_OP_KT(0x0),
188  fhSubJettiness1_FJ_OP_CA(0x0),
189  fhSubJettiness1_FJ_OP_WTA_KT(0x0),
190  fhSubJettiness1_FJ_OP_WTA_CA(0x0),
191  fhSubJettiness1_FJ_MIN(0x0),
192  fhSubJettiness2_FJ_AKT(0x0),
193  fhSubJettiness2_FJ_KT(0x0),
194  fhSubJettiness2_FJ_CA(0x0),
195  fhSubJettiness2_FJ_WTA_KT(0x0),
196  fhSubJettiness2_FJ_WTA_CA(0x0),
197  fhSubJettiness2_FJ_OP_AKT(0x0),
198  fhSubJettiness2_FJ_OP_KT(0x0),
199  fhSubJettiness2_FJ_OP_CA(0x0),
200  fhSubJettiness2_FJ_OP_WTA_KT(0x0),
201  fhSubJettiness2_FJ_OP_WTA_CA(0x0),
202  fhSubJettiness2_FJ_MIN(0x0),
203  fhSubJettiness2to1_FJ_AKT(0x0),
204  fhSubJettiness2to1_FJ_KT(0x0),
205  fhSubJettiness2to1_FJ_CA(0x0),
206  fhSubJettiness2to1_FJ_WTA_KT(0x0),
207  fhSubJettiness2to1_FJ_WTA_CA(0x0),
208  fhSubJettiness2to1_FJ_OP_AKT(0x0),
209  fhSubJettiness2to1_FJ_OP_KT(0x0),
210  fhSubJettiness2to1_FJ_OP_CA(0x0),
211  fhSubJettiness2to1_FJ_OP_WTA_KT(0x0),
212  fhSubJettiness2to1_FJ_OP_WTA_CA(0x0),
213  fhSubJettiness2to1_FJ_MIN(0x0),
214  fTreeResponseMatrixAxis(0)
215 
216 {
217  for(Int_t i=0;i<nVar;i++){
218  fShapesVar[i]=0;
219  }
220  SetMakeGeneralHistograms(kTRUE);
221  DefineOutput(1, TList::Class());
222  DefineOutput(2, TTree::Class());
223 }
224 
225 //________________________________________________________________________
227  AliAnalysisTaskEmcalJet(name, kTRUE),
228  fContainer(0),
229  fMinFractionShared(0),
230  fJetShapeType(kData),
231  fJetShapeSub(kNoSub),
232  fJetSelection(kInclusive),
233  fPtThreshold(-9999.),
234  fRMatching(0.2),
235  fPtMinTriggerHadron(20.),
236  fPtMaxTriggerHadron(50.),
237  fRecoilAngularWindow(0.6),
238  fSemigoodCorrect(0),
239  fHolePos(0),
240  fHoleWidth(0),
241  fCentSelectOn(kTRUE),
242  fCentMin(0),
243  fCentMax(10),
244  fSubJetAlgorithm(0),
245  fSubJetRadius(0.1),
246  fSubJetMinPt(1),
247  fJetRadius(0.4),
248  fRMatched(0.2),
249  fSharedFractionPtMin(0.5),
250  fDerivSubtrOrder(0),
251  fFullTree(kFALSE),
252  fBeta_SD(0),
253  fZCut(0.1),
254  fReclusteringAlgorithm(0),
255  fNsubMeasure(kFALSE),
256  fhPtTriggerHadron(0x0),
257  fhJetPt(0x0),
258  fhJetPt_1(0x0),
259  fhJetPt_2(0x0),
260  fhJetPhi(0x0),
261  fhJetPhi_1(0x0),
262  fhJetPhi_2(0x0),
263  fhJetEta(0x0),
264  fhJetEta_1(0x0),
265  fhJetEta_2(0x0),
266  fhJetMass(0x0),
267  fhJetMass_1(0x0),
268  fhJetMass_2(0x0),
269  fhJetRadius(0x0),
270  fhJetRadius_1(0x0),
271  fhJetRadius_2(0x0),
272  fhJetCounter(0x0),
273  fhJetCounter_1(0x0),
274  fhJetCounter_2(0x0),
275  fhNumberOfJetTracks(0x0),
276  fhNumberOfJetTracks_1(0x0),
277  fhNumberOfJetTracks_2(0x0),
278  fhSubJetPt(0x0),
279  fhSubJetPt_1(0x0),
280  fhSubJetPt_2(0x0),
281  fhSubJetMass(0x0),
282  fhSubJetMass_1(0x0),
283  fhSubJetMass_2(0x0),
284  fhSubJetRadius(0x0),
285  fhSubJetRadius_1(0x0),
286  fhSubJetRadius_2(0x0),
287  fhSubJetCounter(0x0),
288  fhSubJetCounter_1(0x0),
289  fhSubJetCounter_2(0x0),
290  fhNumberOfSubJetTracks(0x0),
291  fhNumberOfSubJetTracks_1(0x0),
292  fhNumberOfSubJetTracks_2(0x0),
293  fh2PtTriggerHadronJet(0x0),
294  fhPhiTriggerHadronJet(0x0),
295  fhPhiTriggerHadronEventPlane(0x0),
296  fhPhiTriggerHadronEventPlaneTPC(0x0),
297  fh2PtRatio(0x0),
298  fhEventCounter(0x0),
299  fhEventCounter_1(0x0),
300  fhEventCounter_2(0x0),
301  fhSubJettiness1CheckRatio_FJ_AKT(0x0),
302  fhSubJettiness1CheckRatio_FJ_KT(0x0),
303  fhSubJettiness1CheckRatio_FJ_CA(0x0),
304  fhSubJettiness1CheckRatio_FJ_WTA_KT(0x0),
305  fhSubJettiness1CheckRatio_FJ_WTA_CA(0x0),
306  fhSubJettiness1CheckRatio_FJ_OP_AKT(0x0),
307  fhSubJettiness1CheckRatio_FJ_OP_KT(0x0),
308  fhSubJettiness1CheckRatio_FJ_OP_CA(0x0),
309  fhSubJettiness1CheckRatio_FJ_OP_WTA_KT(0x0),
310  fhSubJettiness1CheckRatio_FJ_OP_WTA_CA(0x0),
311  fhSubJettiness1CheckRatio_FJ_MIN(0x0),
312  fhSubJettiness2CheckRatio_FJ_AKT(0x0),
313  fhSubJettiness2CheckRatio_FJ_KT(0x0),
314  fhSubJettiness2CheckRatio_FJ_CA(0x0),
315  fhSubJettiness2CheckRatio_FJ_WTA_KT(0x0),
316  fhSubJettiness2CheckRatio_FJ_WTA_CA(0x0),
317  fhSubJettiness2CheckRatio_FJ_OP_AKT(0x0),
318  fhSubJettiness2CheckRatio_FJ_OP_KT(0x0),
319  fhSubJettiness2CheckRatio_FJ_OP_CA(0x0),
320  fhSubJettiness2CheckRatio_FJ_OP_WTA_KT(0x0),
321  fhSubJettiness2CheckRatio_FJ_OP_WTA_CA(0x0),
322  fhSubJettiness2CheckRatio_FJ_MIN(0x0),
323  fhSubJettiness2to1CheckRatio_FJ_AKT(0x0),
324  fhSubJettiness2to1CheckRatio_FJ_KT(0x0),
325  fhSubJettiness2to1CheckRatio_FJ_CA(0x0),
326  fhSubJettiness2to1CheckRatio_FJ_WTA_KT(0x0),
327  fhSubJettiness2to1CheckRatio_FJ_WTA_CA(0x0),
328  fhSubJettiness2to1CheckRatio_FJ_OP_AKT(0x0),
329  fhSubJettiness2to1CheckRatio_FJ_OP_KT(0x0),
330  fhSubJettiness2to1CheckRatio_FJ_OP_CA(0x0),
331  fhSubJettiness2to1CheckRatio_FJ_OP_WTA_KT(0x0),
332  fhSubJettiness2to1CheckRatio_FJ_OP_WTA_CA(0x0),
333  fhSubJettiness2to1CheckRatio_FJ_MIN(0x0),
334  fhSubJettiness1_FJ_AKT(0x0),
335  fhSubJettiness1_FJ_KT(0x0),
336  fhSubJettiness1_FJ_CA(0x0),
337  fhSubJettiness1_FJ_WTA_KT(0x0),
338  fhSubJettiness1_FJ_WTA_CA(0x0),
339  fhSubJettiness1_FJ_OP_AKT(0x0),
340  fhSubJettiness1_FJ_OP_KT(0x0),
341  fhSubJettiness1_FJ_OP_CA(0x0),
342  fhSubJettiness1_FJ_OP_WTA_KT(0x0),
343  fhSubJettiness1_FJ_OP_WTA_CA(0x0),
344  fhSubJettiness1_FJ_MIN(0x0),
345  fhSubJettiness2_FJ_AKT(0x0),
346  fhSubJettiness2_FJ_KT(0x0),
347  fhSubJettiness2_FJ_CA(0x0),
348  fhSubJettiness2_FJ_WTA_KT(0x0),
349  fhSubJettiness2_FJ_WTA_CA(0x0),
350  fhSubJettiness2_FJ_OP_AKT(0x0),
351  fhSubJettiness2_FJ_OP_KT(0x0),
352  fhSubJettiness2_FJ_OP_CA(0x0),
353  fhSubJettiness2_FJ_OP_WTA_KT(0x0),
354  fhSubJettiness2_FJ_OP_WTA_CA(0x0),
355  fhSubJettiness2_FJ_MIN(0x0),
356  fhSubJettiness2to1_FJ_AKT(0x0),
357  fhSubJettiness2to1_FJ_KT(0x0),
358  fhSubJettiness2to1_FJ_CA(0x0),
359  fhSubJettiness2to1_FJ_WTA_KT(0x0),
360  fhSubJettiness2to1_FJ_WTA_CA(0x0),
361  fhSubJettiness2to1_FJ_OP_AKT(0x0),
362  fhSubJettiness2to1_FJ_OP_KT(0x0),
363  fhSubJettiness2to1_FJ_OP_CA(0x0),
364  fhSubJettiness2to1_FJ_OP_WTA_KT(0x0),
365  fhSubJettiness2to1_FJ_OP_WTA_CA(0x0),
366  fhSubJettiness2to1_FJ_MIN(0x0),
367  fTreeResponseMatrixAxis(0)
368 
369 {
370  // Standard constructor.
371  for(Int_t i=0;i<nVar;i++){
372  fShapesVar[i]=0;
373  }
375  DefineOutput(1, TList::Class());
376  DefineOutput(2, TTree::Class());
377 }
378 
379 //________________________________________________________________________
381 {
382  // Destructor.
383 }
384 
385 //________________________________________________________________________
387 {
388  // Create user output.
389 
391 
392  Bool_t oldStatus = TH1::AddDirectoryStatus();
393  TH1::AddDirectory(kFALSE);
394  TH1::AddDirectory(oldStatus);
395  //create a tree used for the MC data and making a 4D response matrix
396  const char* nameoutput = GetOutputSlot(2)->GetContainer()->GetName();
397  fTreeResponseMatrixAxis = new TTree(nameoutput, nameoutput);
398  if (fFullTree){
399  TString *fShapesVarNames = new TString [nVar];
400 
401  fShapesVarNames[0] = "Pt";
402  fShapesVarNames[1] = "Pt_Truth";
403  fShapesVarNames[2] = "Tau1";
404  fShapesVarNames[3] = "Tau1_Truth";
405  fShapesVarNames[4] = "Tau2";
406  fShapesVarNames[5] = "Tau2_Truth";
407  fShapesVarNames[6] = "Tau3";
408  fShapesVarNames[7] = "Tau3_Truth";
409  fShapesVarNames[8] = "OpeningAngle";
410  fShapesVarNames[9] = "OpeningAngle_Truth";
411  fShapesVarNames[10] = "JetMultiplicity";
412  fShapesVarNames[11] = "JetMultiplicity_Truth";
413  fShapesVarNames[12] = "OpeningAngleSD";
414  fShapesVarNames[13] = "OpeningAngleSD_Truth";
415  fShapesVarNames[14] = "Zg";
416  fShapesVarNames[15] = "Zg_Truth";
417  fShapesVarNames[16] = "LeadingTrackPt";
418  fShapesVarNames[17] = "LeadingTrackPt_Truth";
419  fShapesVarNames[18] = "EventPlaneTriggerHadron";
420  fShapesVarNames[19] = "EventPlaneTriggerHadron_Truth";
421  fShapesVarNames[20] = "EventPlaneTPCTriggerHadron";
422  fShapesVarNames[21] = "EventPlaneTPCTriggerHadron_Truth";
423  fShapesVarNames[22] = "DeltaR";
424  fShapesVarNames[23] = "DeltaR_Truth";
425  fShapesVarNames[24] = "Frac1";
426  fShapesVarNames[25] = "Frac1_Truth";
427  fShapesVarNames[26] = "Frac2";
428  fShapesVarNames[27] = "Frac2_Truth";
429  for(Int_t ivar=0; ivar < nVar; ivar++){
430  cout<<"looping over variables"<<endl;
431  fTreeResponseMatrixAxis->Branch(fShapesVarNames[ivar].Data(), &fShapesVar[ivar], Form("%s/D", fShapesVarNames[ivar].Data()));
432  }
433  }
434 
435  if (!fFullTree){
436  const Int_t nVarMin = 22;
437  TString *fShapesVarNames = new TString [nVarMin];
438 
439  fShapesVarNames[0] = "Pt";
440  fShapesVarNames[1] = "Pt_Truth";
441  fShapesVarNames[2] = "Tau1";
442  fShapesVarNames[3] = "Tau1_Truth";
443  fShapesVarNames[4] = "Tau2";
444  fShapesVarNames[5] = "Tau2_Truth";
445  fShapesVarNames[6] = "SubJet1LeadingTrackPt";
446  fShapesVarNames[7] = "SubJet1LeadingTrackPt_Truth";
447  fShapesVarNames[8] = "OpeningAngle";
448  fShapesVarNames[9] = "OpeningAngle_Truth";
449  fShapesVarNames[10] = "SubJet2LeadingTrackPt";
450  fShapesVarNames[11] = "SubJet2LeadingTrackPt_Truth";
451  fShapesVarNames[12] = "OpeningAngleSD";
452  fShapesVarNames[13] = "OpeningAngleSD_Truth";
453  fShapesVarNames[14] = "SubJet1Pt";
454  fShapesVarNames[15] = "SubJet1Pt_Truth";
455  fShapesVarNames[16] = "LeadingTrackPt";
456  fShapesVarNames[17] = "LeadingTrackPt_Truth";
457  fShapesVarNames[18] = "EventPlaneTriggerHadron";
458  fShapesVarNames[19] = "EventPlaneTriggerHadron_Truth";
459  fShapesVarNames[20] = "SubJet2Pt";
460  fShapesVarNames[21] = "SubJet2Pt_Truth";
461 
462  for(Int_t ivar=0; ivar < nVarMin; ivar++){
463  cout<<"looping over variables"<<endl;
464  fTreeResponseMatrixAxis->Branch(fShapesVarNames[ivar].Data(), &fShapesVar[ivar], Form("%s/D", fShapesVarNames[ivar].Data()));
465  }
466  }
467 
469  fhPtTriggerHadron= new TH1F("fhPtTriggerHadron", "fhPtTriggerHadron",1500,-0.5,149.5);
471  fh2PtTriggerHadronJet= new TH2F("fh2PtTriggerHadronJet", "fh2PtTriggerHadronJet",1500,-0.5,149.5,1500,-0.5,149.5);
473  fhPhiTriggerHadronJet= new TH1F("fhPhiTriggerHadronJet", "fhPhiTriggerHadronJet",360 , -1.5*(TMath::Pi()), 1.5*(TMath::Pi()));
475  fhPhiTriggerHadronEventPlane= new TH1F("fhPhiTriggerHadronEventPlane", "fhPhiTriggerHadronEventPlane",360 , -1.5*(TMath::Pi()), 1.5*(TMath::Pi()));
477  fhPhiTriggerHadronEventPlaneTPC= new TH1F("fhPhiTriggerHadronEventPlaneTPC", "fhPhiTriggerHadronEventPlaneTPC",360 , -1.5*(TMath::Pi()), 1.5*(TMath::Pi()));
479  }
481 
482  // fhJetPt= new TH1F("fhJetPt", "Jet Pt", (XBinsJetPtSize)-1, XBinsJetPt);
483  fhJetPt= new TH1F("fhJetPt", "Jet Pt",1500,-0.5,149.5 );
484  fOutput->Add(fhJetPt);
485  //fhJetPhi= new TH1F("fhJetPhi", "Jet Phi", Phi_Bins, Phi_Low, Phi_Up);
486  fhJetPhi= new TH1F("fhJetPhi", "Jet Phi",360 , -1.5*(TMath::Pi()), 1.5*(TMath::Pi()));
487  fOutput->Add(fhJetPhi);
488  fhJetEta= new TH1F("fhJetEta", "Jet Eta", Eta_Bins, Eta_Low, Eta_Up);
489  fOutput->Add(fhJetEta);
490  fhJetMass= new TH1F("fhJetMass", "Jet Mass", 4000,-0.5, 39.5);
491  fOutput->Add(fhJetMass);
492  fhJetRadius= new TH1F("fhJetRadius", "Jet Radius", 100, -0.05,0.995);
493  fOutput->Add(fhJetRadius);
494  fhNumberOfJetTracks= new TH1F("fhNumberOfJetTracks", "Number of Tracks within a Jet", 300, -0.5,299.5);
496  fhSubJetRadius= new TH1F("fhSubJetRadius", "SubJet Radius", 100, -0.05,0.995);
497  fOutput->Add(fhSubJetRadius);
498  fhSubJetPt= new TH1F("fhSubJetPt", "SubJet Pt", 1500, -0.5,149.5);
499  fOutput->Add(fhSubJetPt);
500  fhSubJetMass= new TH1F("fhSubJetMass", "Sub Jet Mass", 4000,-0.5, 39.5);
501  fOutput->Add(fhSubJetMass);
502  fhNumberOfSubJetTracks= new TH1F("fhNumberOfSubJetTracks", "Number of Tracks within a Sub Jet", 300, -0.5,299.5);
504  fhJetCounter= new TH1F("fhJetCounter", "Jet Counter", 150, -0.5, 149.5);
505  fOutput->Add(fhJetCounter);
506  fhSubJetCounter = new TH1F("fhSubJetCounter", "SubJet Counter",50, -0.5,49.5);
507  fOutput->Add(fhSubJetCounter);
508  fhEventCounter= new TH1F("fhEventCounter", "Event Counter", 15,0.5,15.5);
509  fOutput->Add(fhEventCounter);
510  }
512  fhSubJettiness1_FJ_KT= new TH1D("fhSubJettiness1_FJ_KT","fhSubJettiness1_FJ_KT",400,-2,2);
514  fhSubJettiness1_FJ_MIN= new TH1D("fhSubJettiness1_FJ_MIN","fhSubJettiness1_FJ_MIN",400,-2,2);
516  fhSubJettiness2_FJ_KT= new TH1D("fhSubJettiness2_FJ_KT","fhSubJettiness2_FJ_KT",400,-2,2);
518  fhSubJettiness2_FJ_MIN= new TH1D("fhSubJettiness2_FJ_MIN","fhSubJettiness2_FJ_MIN",400,-2,2);
520  fhSubJettiness1CheckRatio_FJ_AKT = new TH2D("fhSubJettiness1CheckRatio_FJ_AKT","fhSubJettiness1CheckRatio_FJ_AKT",400,-2,2,300,-1,2);
522  fhSubJettiness1CheckRatio_FJ_KT= new TH2D("fhSubJettiness1CheckRatio_FJ_KT","fhSubJettiness1CheckRatio_FJ_KT",400,-2,2,300,-1,2);
524  fhSubJettiness1CheckRatio_FJ_CA= new TH2D("fhSubJettiness1CheckRatio_FJ_CA","fhSubJettiness1CheckRatio_FJ_CA",400,-2,2,300,-1,2);
526  fhSubJettiness1CheckRatio_FJ_WTA_KT= new TH2D("fhSubJettiness1CheckRatio_FJ_WTA_KT","fhSubJettiness1CheckRatio_FJ_WTA_KT",400,-2,2,300,-1,2);
528  fhSubJettiness1CheckRatio_FJ_WTA_CA= new TH2D("fhSubJettiness1CheckRatio_FJ_WTA_CA","fhSubJettiness1CheckRatio_FJ_WTA_CA",400,-2,2,300,-1,2);
530  fhSubJettiness1CheckRatio_FJ_OP_AKT= new TH2D("fhSubJettiness1CheckRatio_FJ_OP_AKT","fhSubJettiness1CheckRatio_FJ_OP_AKT",400,-2,2,300,-1,2);
532  fhSubJettiness1CheckRatio_FJ_OP_KT= new TH2D("fhSubJettiness1CheckRatio_FJ_OP_KT","fhSubJettiness1CheckRatio_FJ_OP_KT",400,-2,2,300,-1,2);
534  fhSubJettiness1CheckRatio_FJ_OP_CA= new TH2D("fhSubJettiness1CheckRatio_FJ_OP_CA","fhSubJettiness1CheckRatio_FJ_OP_CA",400,-2,2,300,-1,2);
536  fhSubJettiness1CheckRatio_FJ_OP_WTA_KT= new TH2D("fhSubJettiness1CheckRatio_FJ_OP_WTA_KT","fhSubJettiness1CheckRatio_FJ_OP_WTA_KT",400,-2,2,300,-1,2);
538  fhSubJettiness1CheckRatio_FJ_OP_WTA_CA= new TH2D("fhSubJettiness1CheckRatio_FJ_OP_WTA_CA","fhSubJettiness1CheckRatio_FJ_OP_WTA_CA",400,-2,2,300,-1,2);
540  fhSubJettiness1CheckRatio_FJ_MIN= new TH2D("fhSubJettiness1CheckRatio_FJ_MIN","fhSubJettiness1CheckRatio_FJ_MIN",400,-2,2,300,-1,2);
542  fhSubJettiness2CheckRatio_FJ_AKT = new TH2D("fhSubJettiness2CheckRatio_FJ_AKT","fhSubJettiness2CheckRatio_FJ_AKT",400,-2,2,300,-1,2);
544  fhSubJettiness2CheckRatio_FJ_KT= new TH2D("fhSubJettiness2CheckRatio_FJ_KT","fhSubJettiness2CheckRatio_FJ_KT",400,-2,2,300,-1,2);
546  fhSubJettiness2CheckRatio_FJ_CA= new TH2D("fhSubJettiness2CheckRatio_FJ_CA","fhSubJettiness2CheckRatio_FJ_CA",400,-2,2,300,-1,2);
548  fhSubJettiness2CheckRatio_FJ_WTA_KT= new TH2D("fhSubJettiness2CheckRatio_FJ_WTA_KT","fhSubJettiness2CheckRatio_FJ_WTA_KT",400,-2,2,300,-1,2);
550  fhSubJettiness2CheckRatio_FJ_WTA_CA= new TH2D("fhSubJettiness2CheckRatio_FJ_WTA_CA","fhSubJettiness2CheckRatio_FJ_WTA_CA",400,-2,2,300,-1,2);
552  fhSubJettiness2CheckRatio_FJ_OP_AKT= new TH2D("fhSubJettiness2CheckRatio_FJ_OP_AKT","fhSubJettiness2CheckRatio_FJ_OP_AKT",400,-2,2,300,-1,2);
554  fhSubJettiness2CheckRatio_FJ_OP_KT= new TH2D("fhSubJettiness2CheckRatio_FJ_OP_KT","fhSubJettiness2CheckRatio_FJ_OP_KT",400,-2,2,300,-1,2);
556  fhSubJettiness2CheckRatio_FJ_OP_CA= new TH2D("fhSubJettiness2CheckRatio_FJ_OP_CA","fhSubJettiness2CheckRatio_FJ_OP_CA",400,-2,2,300,-1,2);
558  fhSubJettiness2CheckRatio_FJ_OP_WTA_KT= new TH2D("fhSubJettiness2CheckRatio_FJ_OP_WTA_KT","fhSubJettiness2CheckRatio_FJ_OP_WTA_KT",400,-2,2,300,-1,2);
560  fhSubJettiness2CheckRatio_FJ_OP_WTA_CA= new TH2D("fhSubJettiness2CheckRatio_FJ_OP_WTA_CA","fhSubJettiness2CheckRatio_FJ_OP_WTA_CA",400,-2,2,300,-1,2);
562  fhSubJettiness2CheckRatio_FJ_MIN= new TH2D("fhSubJettiness2CheckRatio_FJ_MIN","fhSubJettiness2CheckRatio_FJ_MIN",400,-2,2,300,-1,2);
564  fhSubJettiness2to1CheckRatio_FJ_AKT = new TH2D("fhSubJettiness2to1CheckRatio_FJ_AKT","fhSubJettiness2to1CheckRatio_FJ_AKT",400,-2,2,300,-1,2);
566  fhSubJettiness2to1CheckRatio_FJ_KT= new TH2D("fhSubJettiness2to1CheckRatio_FJ_KT","fhSubJettiness2to1CheckRatio_FJ_KT",400,-2,2,300,-1,2);
568  fhSubJettiness2to1CheckRatio_FJ_CA= new TH2D("fhSubJettiness2to1CheckRatio_FJ_CA","fhSubJettiness2to1CheckRatio_FJ_CA",400,-2,2,300,-1,2);
570  fhSubJettiness2to1CheckRatio_FJ_WTA_KT= new TH2D("fhSubJettiness2to1CheckRatio_FJ_WTA_KT","fhSubJettiness2to1CheckRatio_FJ_WTA_KT",400,-2,2,300,-1,2);
572  fhSubJettiness2to1CheckRatio_FJ_WTA_CA= new TH2D("fhSubJettiness2to1CheckRatio_FJ_WTA_CA","fhSubJettiness2to1CheckRatio_FJ_WTA_CA",400,-2,2,300,-1,2);
574  fhSubJettiness2to1CheckRatio_FJ_OP_AKT= new TH2D("fhSubJettiness2to1CheckRatio_FJ_OP_AKT","fhSubJettiness2to1CheckRatio_FJ_OP_AKT",400,-2,2,300,-1,2);
576  fhSubJettiness2to1CheckRatio_FJ_OP_KT= new TH2D("fhSubJettiness2to1CheckRatio_FJ_OP_KT","fhSubJettiness2to1CheckRatio_FJ_OP_KT",400,-2,2,300,-1,2);
578  fhSubJettiness2to1CheckRatio_FJ_OP_CA= new TH2D("fhSubJettiness2to1CheckRatio_FJ_OP_CA","fhSubJettiness2to1CheckRatio_FJ_OP_CA",400,-2,2,300,-1,2);
580  fhSubJettiness2to1CheckRatio_FJ_OP_WTA_KT= new TH2D("fhSubJettiness2to1CheckRatio_FJ_OP_WTA_KT","fhSubJettiness2to1CheckRatio_FJ_OP_WTA_KT",400,-2,2,300,-1,2);
582  fhSubJettiness2to1CheckRatio_FJ_OP_WTA_CA= new TH2D("fhSubJettiness2to1CheckRatio_FJ_OP_WTA_CA","fhSubJettiness2to1CheckRatio_FJ_OP_WTA_CA",400,-2,2,300,-1,2);
584  fhSubJettiness2to1CheckRatio_FJ_MIN= new TH2D("fhSubJettiness2to1CheckRatio_FJ_MIN","fhSubJettiness2to1CheckRatio_FJ_MIN",400,-2,2,300,-1,2);
586  fhSubJettiness1_FJ_AKT= new TH1D("fhSubJettiness1_FJ_AKT","fhSubJettiness1_FJ_AKT",400,-2,2);
588  fhSubJettiness1_FJ_CA= new TH1D("fhSubJettiness1_FJ_CA","fhSubJettiness1_FJ_CA",400,-2,2);
590  fhSubJettiness1_FJ_WTA_KT= new TH1D("fhSubJettiness1_FJ_WTA_KT","fhSubJettiness1_FJ_WTA_KT",400,-2,2);
592  fhSubJettiness1_FJ_WTA_CA= new TH1D("fhSubJettiness1_FJ_WTA_CA","fhSubJettiness1_FJ_WTA_CA",400,-2,2);
594  fhSubJettiness1_FJ_OP_AKT= new TH1D("fhSubJettiness1_FJ_OP_AKT","fhSubJettiness1_FJ_OP_AKT",400,-2,2);
596  fhSubJettiness1_FJ_OP_KT= new TH1D("fhSubJettiness1_FJ_OP_KT","fhSubJettiness1_FJ_OP_KT",400,-2,2);
598  fhSubJettiness1_FJ_OP_CA= new TH1D("fhSubJettiness1_FJ_OP_CA","fhSubJettiness1_FJ_OP_CA",400,-2,2);
600  fhSubJettiness1_FJ_OP_WTA_KT= new TH1D("fhSubJettiness1_FJ_OP_WTA_KT","fhSubJettiness1_FJ_OP_WTA_KT",400,-2,2);
602  fhSubJettiness1_FJ_OP_WTA_CA= new TH1D("fhSubJettiness1_FJ_OP_WTA_CA","fhSubJettiness1_FJ_OP_WTA_CA",400,-2,2);
604  fhSubJettiness2_FJ_AKT= new TH1D("fhSubJettiness2_FJ_AKT","fhSubJettiness2_FJ_AKT",400,-2,2);
606  fhSubJettiness2_FJ_CA= new TH1D("fhSubJettiness2_FJ_CA","fhSubJettiness2_FJ_CA",400,-2,2);
608  fhSubJettiness2_FJ_WTA_KT= new TH1D("fhSubJettiness2_FJ_WTA_KT","fhSubJettiness2_FJ_WTA_KT",400,-2,2);
610  fhSubJettiness2_FJ_WTA_CA= new TH1D("fhSubJettiness2_FJ_WTA_CA","fhSubJettiness2_FJ_WTA_CA",400,-2,2);
612  fhSubJettiness2_FJ_OP_AKT= new TH1D("fhSubJettiness2_FJ_OP_AKT","fhSubJettiness2_FJ_OP_AKT",400,-2,2);
614  fhSubJettiness2_FJ_OP_KT= new TH1D("fhSubJettiness2_FJ_OP_KT","fhSubJettiness2_FJ_OP_KT",400,-2,2);
616  fhSubJettiness2_FJ_OP_CA= new TH1D("fhSubJettiness2_FJ_OP_CA","fhSubJettiness2_FJ_OP_CA",400,-2,2);
618  fhSubJettiness2_FJ_OP_WTA_KT= new TH1D("fhSubJettiness2_FJ_OP_WTA_KT","fhSubJettiness2_FJ_OP_WTA_KT",400,-2,2);
620  fhSubJettiness2_FJ_OP_WTA_CA= new TH1D("fhSubJettiness2_FJ_OP_WTA_CA","fhSubJettiness2_FJ_OP_WTA_CA",400,-2,2);
622  fhSubJettiness2to1_FJ_KT= new TH1D("fhSubJettiness2to1_FJ_KT","fhSubJettiness2to1_FJ_KT",400,-2,2);
624  fhSubJettiness2to1_FJ_AKT= new TH1D("fhSubJettiness2to1_FJ_AKT","fhSubJettiness2to1_FJ_AKT",400,-2,2);
626  fhSubJettiness2to1_FJ_CA= new TH1D("fhSubJettiness2to1_FJ_CA","fhSubJettiness2to1_FJ_CA",400,-2,2);
628  fhSubJettiness2to1_FJ_WTA_KT= new TH1D("fhSubJettiness2to1_FJ_WTA_KT","fhSubJettiness2to1_FJ_WTA_KT",400,-2,2);
630  fhSubJettiness2to1_FJ_WTA_CA= new TH1D("fhSubJettiness2to1_FJ_WTA_CA","fhSubJettiness2to1_FJ_WTA_CA",400,-2,2);
632  fhSubJettiness2to1_FJ_OP_AKT= new TH1D("fhSubJettiness2to1_FJ_OP_AKT","fhSubJettiness2to1_FJ_OP_AKT",400,-2,2);
634  fhSubJettiness2to1_FJ_OP_KT= new TH1D("fhSubJettiness2to1_FJ_OP_KT","fhSubJettiness2to1_FJ_OP_KT",400,-2,2);
636  fhSubJettiness2to1_FJ_OP_CA= new TH1D("fhSubJettiness2to1_FJ_OP_CA","fhSubJettiness2to1_FJ_OP_CA",400,-2,2);
638  fhSubJettiness2to1_FJ_OP_WTA_KT= new TH1D("fhSubJettiness2to1_FJ_OP_WTA_KT","fhSubJettiness2to1_FJ_OP_WTA_KT",400,-2,2);
640  fhSubJettiness2to1_FJ_OP_WTA_CA= new TH1D("fhSubJettiness2to1_FJ_OP_WTA_CA","fhSubJettiness2to1_FJ_OP_WTA_CA",400,-2,2);
642  fhSubJettiness2to1_FJ_MIN= new TH1D("fhSubJettiness2to1_FJ_MIN","fhSubJettiness2to1_FJ_MIN",400,-2,2);
644  }
646  fhJetPt_1= new TH1F("fhJetPt_1", "Jet Pt Detector Level",1500,-0.5,149.5 );
647  fOutput->Add(fhJetPt_1);
648  fhJetPt_2= new TH1F("fhJetPt_2", "Jet Pt Particle Level",1500,-0.5,149.5 );
649  fOutput->Add(fhJetPt_2);
650  fhJetPhi_1= new TH1F("fhJetPhi_1", "Jet Phi Detector Level",360 , -1.5*(TMath::Pi()), 1.5*(TMath::Pi()));
651  fOutput->Add(fhJetPhi_1);
652  fhJetPhi_2= new TH1F("fhJetPhi_2", "Jet Phi Particle Level",360 , -1.5*(TMath::Pi()), 1.5*(TMath::Pi()));
653  fOutput->Add(fhJetPhi_2);
654  fhJetEta_1= new TH1F("fhJetEta_1", "Jet Eta Detector Level", Eta_Bins, Eta_Low, Eta_Up);
655  fOutput->Add(fhJetEta_1);
656  fhJetEta_2= new TH1F("fhJetEta_2", "Jet Eta Particle Level", Eta_Bins, Eta_Low, Eta_Up);
657  fOutput->Add(fhJetEta_2);
658  fhJetMass_1= new TH1F("fhJetMass_1", "Jet Mass Detector Level", 4000,-0.5, 39.5);
659  fOutput->Add(fhJetMass_1);
660  fhJetMass_2= new TH1F("fhJetMass_2", "Jet Mass Particle Level", 4000,-0.5, 39.5);
661  fOutput->Add(fhJetMass_2);
662  fhJetRadius_1= new TH1F("fhJetRadius_1", "Jet Radius Detector Level", 100, -0.05,0.995);
663  fOutput->Add(fhJetRadius_1);
664  fhJetRadius_2= new TH1F("fhJetRadius_2", "Jet Radius Particle Level", 100, -0.05,0.995);
665  fOutput->Add(fhJetRadius_2);
666  fhNumberOfJetTracks_1= new TH1F("fhNumberOfJetTracks_1", "Number of Tracks within a Jet Detector Level", 300, -0.5,299.5);
668  fhNumberOfJetTracks_2= new TH1F("fhNumberOfJetTracks_2", "Number of Tracks within a Jet Particle Level", 300, -0.5,299.5);
670  fhSubJetRadius_1= new TH1F("fhSubJetRadius_1", "SubJet Radius Detector Level", 100, -0.05,0.995);
672  fhSubJetRadius_2= new TH1F("fhSubJetRadius_2", "SubJet Radius Particle Level", 100, -0.05,0.995);
674  fhSubJetPt_1= new TH1F("fhSubJetPt_1", "SubJet Pt Detector Level", 1500, -0.5,149.5);
675  fOutput->Add(fhSubJetPt_1);
676  fhSubJetPt_2= new TH1F("fhSubJetPt_2", "SubJet Pt Particle Level", 1500, -0.5,149.5);
677  fOutput->Add(fhSubJetPt_2);
678  fhSubJetMass_1= new TH1F("fhSubJetMass_1", "Sub Jet Mass Detector Level", 4000,-0.5, 39.5);
679  fOutput->Add(fhSubJetMass_1);
680  fhSubJetMass_2= new TH1F("fhSubJetMass_2", "Sub Jet Mass Particle Level", 4000,-0.5, 39.5);
681  fOutput->Add(fhSubJetMass_2);
682  fhNumberOfSubJetTracks_1= new TH1F("fhNumberOfSubJetTracks_1", "Number of Tracks within a Sub Jet Detector Level", 300, -0.5,299.5);
684  fhNumberOfSubJetTracks_2= new TH1F("fhNumberOfSubJetTracks_2", "Number of Tracks within a Sub Jet Particle Level", 300, -0.5,299.5);
686  fhJetCounter_1= new TH1F("fhJetCounter_1", "Jet Counter Detector Level", 150, -0.5, 149.5);
687  fOutput->Add(fhJetCounter_1);
688  fhJetCounter_2= new TH1F("fhJetCounter_2", "Jet Counter Particle Level", 150, -0.5, 149.5);
689  fOutput->Add(fhJetCounter_2);
690  fhSubJetCounter_1 = new TH1F("fhSubJetCounter_1", "SubJet Counter Detector Level",50, -0.5,49.5);
692  fhSubJetCounter_2 = new TH1F("fhSubJetCounter_2", "SubJet Counter Particle Level",50, -0.5,49.5);
694  fh2PtRatio= new TH2F("fhPtRatio", "MC pt for detector level vs particle level jets",1500,-0.5,149.5,1500,-0.5,149.5);
695  fOutput->Add(fh2PtRatio);
696  fhEventCounter_1= new TH1F("fhEventCounter_1", "Event Counter Detector Level", 15,0.5,15.5);
698  fhEventCounter_2= new TH1F("fhEventCounter_2", "Event Counter Particle Level", 15,0.5,15.5);
700  }
702  fhEventCounter= new TH1F("fhEventCounter", "Event Counter", 15,0.5,15.5);
703  fOutput->Add(fhEventCounter);
704  }
705 
706  PostData(1,fOutput);
707  PostData(2,fTreeResponseMatrixAxis);
708  // delete [] fShapesVarNames;
709 }
710 
711 //________________________________________________________________________
713 {
714  // Run analysis code here, if needed. It will be executed before FillHistograms().
715 
716 
717  return kTRUE;
718 }
719 
720 //________________________________________________________________________
722 {
723 
724  //fhEventCounter Key:
725  // 1: Number of events with a Jet Container
726  // 2: Number of Jets without a Jet Container
727  // 3:
728  // 4: Number of Jets found in all events
729  // 5: Number of Jets that were reclustered in all events
730  // 6: Number of SubJets found in all events
731  // 7: Number of events were primary vertext was found
732  // 8: Number of Jets with more than one SubJet
733  // 9:Number of Jets with more than two SubJets
734  // 12:Number of SubJetinessEvents in kData
735 
736 
737  // const AliVVertex *vert = InputEvent()->GetPrimaryVertex();
738  // Double_t dVtx[3]={vert->GetX(),vert->GetY(),vert->GetZ()};
739  // if(vert) fhEventCounter->Fill(7);
740 
741  //cout << ((AliVAODHeader*)(InputEvent()->GetHeader()))->GetEventplane()<< " "<<fEPV0<<endl;
742  // cout << InputEvent()->GetEventplane()->GetEventplane("Q")<< " "<<fEPV0<<endl;
743  if (fCentSelectOn){
744  if ((fCent>fCentMax) || (fCent<fCentMin)) return 0;
745  }
746 
747  AliAODTrack *TriggerHadron = 0x0;
748  if (fJetSelection == kRecoil) {
749  //you have to set a flag and the limits of the pT interval for your trigger
751  if (TriggerHadronLabel==-99999) return 0; //Trigger Hadron Not Found
752  AliTrackContainer *PartCont =NULL;
753  AliParticleContainer *PartContMC=NULL;
754  if (fJetShapeSub==kConstSub){
756  else PartCont = GetTrackContainer(1);
757  }
758  else{
760  else PartCont = GetTrackContainer(0);
761  }
762  TClonesArray *TrackArray = NULL;
763  TClonesArray *TrackArrayMC = NULL;
764  if (fJetShapeType == AliAnalysisTaskSubJetFraction::kGenOnTheFly) TrackArrayMC = PartContMC->GetArray();
765  else TrackArray = PartCont->GetArray();
766  if (fJetShapeType == AliAnalysisTaskSubJetFraction::kGenOnTheFly) TriggerHadron = static_cast<AliAODTrack*>(TrackArrayMC->At(TriggerHadronLabel));
767  else TriggerHadron = static_cast<AliAODTrack*>(TrackArray->At(TriggerHadronLabel));
768  if (!TriggerHadron) return 0;//No trigger hadron with label found
769  if(fSemigoodCorrect){
770  Double_t HoleDistance=RelativePhi(TriggerHadron->Phi(),fHolePos);
771  if(TMath::Abs(HoleDistance)+fHoleWidth+fJetRadius>TMath::Pi()-fRecoilAngularWindow) return 0;
772  }
773  fhPtTriggerHadron->Fill(TriggerHadron->Pt()); //Needed for per trigger Normalisation
774  if (fJetShapeType != AliAnalysisTaskSubJetFraction::kGenOnTheFly) fhPhiTriggerHadronEventPlane->Fill(TMath::Abs(RelativePhiEventPlane(fEPV0,TriggerHadron->Phi()))); //fEPV0 is the event plane from AliAnalysisTaskEmcal
775  if (fJetShapeType != AliAnalysisTaskSubJetFraction::kGenOnTheFly) fhPhiTriggerHadronEventPlaneTPC->Fill(TMath::Abs(RelativePhiEventPlane(((AliVAODHeader*)(InputEvent()->GetHeader()))->GetEventplane(),TriggerHadron->Phi()))); //TPC event plane
776  }
777 
778 
781  AliEmcalJet *Jet1 = NULL; //Subtracted hybrid Jet
782  AliEmcalJet *Jet2 = NULL; //Unsubtracted Hybrid Jet
783  AliEmcalJet *Jet3 = NULL; //Detector Level Pythia Jet
784  AliEmcalJet *Jet4 = NULL; //Particle Level Pyhtia Jet
785  AliJetContainer *JetCont1= GetJetContainer(0); //Jet Container for Subtracted Hybrid Jets
786  AliJetContainer *JetCont2= GetJetContainer(1); //Jet Container for Unsubtracted Hybrid Jets
787  AliJetContainer *JetCont3= GetJetContainer(2); //Jet Container for Detector Level Pyhtia Jets
788  AliJetContainer *JetCont4= GetJetContainer(3); //Jet Container for Particle Level Pythia Jets
789  AliEmcalJetFinder *Reclusterer1; //Object containg Subjets from Subtracted Hybrid Jets
790  AliEmcalJetFinder *Reclusterer4; //Object containg Subjets from Particle Level Pythia Jets
791  Bool_t JetsMatched=kFALSE;
792  Bool_t EventCounter=kFALSE;
793  Int_t JetNumber=-1;
794  Double_t JetPtThreshold=-2;
795  fhEventCounter->Fill(1);
796  if(JetCont1) {
797  fhEventCounter->Fill(2);
798  JetCont1->ResetCurrentID();
799  while((Jet1=JetCont1->GetNextAcceptJet())) {
800  if (fJetShapeSub==kConstSub) JetPtThreshold=Jet1->Pt();
801  else JetPtThreshold=Jet1->Pt()-(GetRhoVal(0)*Jet1->Area());
802  if ( (!Jet1) || (JetPtThreshold<fPtThreshold)) continue;
803  else {
804  /* if(fSemigoodCorrect){
805  Double_t HoleDistance=RelativePhi(Jet1->Phi(),fHolePos);
806  if(TMath::Abs(HoleDistance)<fHoleWidth) continue;
807  }*/
808  Float_t RecoilDeltaPhi = 0.;
809  if (fJetSelection == kRecoil){
810  RecoilDeltaPhi = RelativePhi(TriggerHadron->Phi(), Jet1->Phi());
811  if (TMath::Abs(RecoilDeltaPhi) < (TMath::Pi() - fRecoilAngularWindow)) continue; //accept the jet only if it overlaps with the recoil phi area of the trigger
812  fh2PtTriggerHadronJet->Fill(TriggerHadron->Pt(), Jet1->Pt());
813  fhPhiTriggerHadronJet->Fill(RelativePhi(TriggerHadron->Phi(), Jet1->Phi()));
814  }
815  if (!EventCounter){
816  fhEventCounter->Fill(3);
817  EventCounter=kTRUE;
818  }
819  if(fJetShapeSub==kConstSub){
820  JetNumber=-1;
821  for(Int_t i = 0; i<JetCont2->GetNJets(); i++) {
822  Jet2 = JetCont2->GetJet(i);
823  if(Jet2->GetLabel()==Jet1->GetLabel()) {
824  JetNumber=i;
825  }
826  }
827  if(JetNumber==-1) continue;
828  Jet2=JetCont2->GetJet(JetNumber);
829  if (JetCont2->AliJetContainer::GetFractionSharedPt(Jet2)<fSharedFractionPtMin) continue;
830  Jet3=Jet2->ClosestJet();
831  }
832  if(!(fJetShapeSub==kConstSub)){
833  if (JetCont1->AliJetContainer::GetFractionSharedPt(Jet1)<fSharedFractionPtMin) continue;
834  Jet3 = Jet1->ClosestJet(); //Note for NoSub and Deriv Sub cases you must fill both the Unsubtracted and Subtracted Hybrid jet containers with the same jet branch
835  }
836  if (!Jet3) continue;
837  Jet4=Jet3->ClosestJet();
838  if(!Jet4) continue;
839  JetsMatched=kTRUE;
841  if (fJetShapeSub==kConstSub) fShapesVar[0]=Jet1->Pt();
842  else fShapesVar[0]=Jet1->Pt()-(GetRhoVal(0)*Jet1->Area());
843  fShapesVar[2]=fjNSubJettiness(Jet1,0,1,0,1,0);
844  fShapesVar[4]=fjNSubJettiness(Jet1,0,2,0,1,0);
845  fShapesVar[6]=fjNSubJettiness(Jet1,0,2,0,1,8);
846  fShapesVar[8]=fjNSubJettiness(Jet1,0,2,0,1,1);
847  // fShapesVar[10]=Jet1->GetNumberOfTracks();
848  fShapesVar[10]=fjNSubJettiness(Jet1,0,2,0,1,9);
849  fShapesVar[12]=fjNSubJettiness(Jet1,0,2,0,1,3,fBeta_SD,fZCut);
850  fShapesVar[14]=fjNSubJettiness(Jet1,0,2,0,1,5,fBeta_SD,fZCut);
851  fShapesVar[16]=Jet1->GetLeadingTrack(JetCont1->GetParticleContainer()->GetArray())->Pt();
853  //fShapesVar[20]=RelativePhiEventPlane(((AliVAODHeader*)(InputEvent()->GetHeader()))->GetEventplane(),Jet1->Phi());
854  fShapesVar[20]=fjNSubJettiness(Jet1,0,2,0,1,6,fBeta_SD,fZCut);
855  if (fFullTree){
856  fShapesVar[22]=fjNSubJettiness(Jet1,0,2,0,1,2);
857  Reclusterer1 = Recluster(Jet1, 0, fSubJetRadius, fSubJetMinPt, fSubJetAlgorithm, "SubJetFinder_1");
858  fShapesVar[24]=SubJetFraction(Jet1, Reclusterer1, 1, 0, kTRUE, kFALSE);
859  fShapesVar[26]=SubJetFraction(Jet1, Reclusterer1, 2, 0, kTRUE, kFALSE);
860  }
861  if (JetsMatched){ //even needed? Not now but might be if you want to fill trees when jets aren't matched too
862  fShapesVar[1]=Jet4->Pt();
863  fShapesVar[3]=fjNSubJettiness(Jet4,3,1,0,1,0);
864  fShapesVar[5]=fjNSubJettiness(Jet4,3,2,0,1,0);
865  fShapesVar[7]=fjNSubJettiness(Jet4,3,2,0,1,8);
866  fShapesVar[9]=fjNSubJettiness(Jet4,3,2,0,1,1);
867  //fShapesVar[11]=Jet4->GetNumberOfTracks();
868  fShapesVar[11]=fjNSubJettiness(Jet4,3,2,0,1,9);
869  fShapesVar[13]=fjNSubJettiness(Jet4,3,2,0,1,3,fBeta_SD,fZCut);
870  fShapesVar[15]=fjNSubJettiness(Jet4,3,2,0,1,5,fBeta_SD,fZCut);
871  fShapesVar[17]=Jet4->GetLeadingTrack(JetCont4->GetParticleContainer()->GetArray())->Pt();
872  fShapesVar[19]=RelativePhiEventPlane(fEPV0,Jet4->Phi());
873  //fShapesVar[21]=RelativePhiEventPlane(((AliVAODHeader*)(InputEvent()->GetHeader()))->GetEventplane(),Jet4->Phi());
874  fShapesVar[21]=fjNSubJettiness(Jet4,3,2,0,1,6,fBeta_SD,fZCut);
875  if (fFullTree){
876  fShapesVar[23]=fjNSubJettiness(Jet4,3,2,0,1,2);
877  Reclusterer4=Recluster(Jet4, 3, fSubJetRadius, 0, fSubJetAlgorithm, "SubJetFinder_4");
878  fShapesVar[25]=SubJetFraction(Jet4, Reclusterer4, 1, 0, kTRUE, kFALSE);
879  fShapesVar[27]=SubJetFraction(Jet4, Reclusterer4, 2, 0, kTRUE, kFALSE);
880  }
881  }
882  else{
883  fShapesVar[1]=-2;
884  fShapesVar[3]=-2;
885  fShapesVar[5]=-2;
886  fShapesVar[7]=-2;
887  fShapesVar[9]=-2;
888  fShapesVar[11]=-2;
889  fShapesVar[13]=-2;
890  fShapesVar[15]=-2;
891  fShapesVar[17]=-2;
892  fShapesVar[19]=-2;
893  fShapesVar[21]=-2;
894  if (fFullTree){
895  fShapesVar[23]=-2;
896  fShapesVar[25]=-2;
897  fShapesVar[27]=-2;
898  }
899  }
900  fTreeResponseMatrixAxis->Fill();
901  JetsMatched=kFALSE;
902  }
903  }
904  }
905  }
906 
909  AliEmcalJet *Jet1 = NULL; //Detector Level Jet
910  AliEmcalJet *Jet2 = NULL; //Particle Level Jet
911  AliJetContainer *JetCont1= GetJetContainer(0); //Jet Container for Detector Level Pythia
912  AliJetContainer *JetCont2= GetJetContainer(1); //Jet Container for Particle Level Pythia
913  AliEmcalJetFinder *Reclusterer1; //Object containg Subjets Detector Level
914  AliEmcalJetFinder *Reclusterer2; //Object containg Subjets Particle Level
915  Int_t JetCounter1=0; //Counts number of jets in event
916  Int_t JetCounter2=0; //Counts number of jets in event
917  Double_t JetPhi1=0;
918  Double_t JetPhi2=0;
919  Bool_t JetsMatched=kFALSE;
920  Double_t Pythia_Event_Weight=1;
921  Bool_t EventCounter=kFALSE;
922  fhEventCounter_1->Fill(1);
923  if(JetCont1) {
924  fhEventCounter_1->Fill(2); //Number of events with a jet container
925  JetCont1->ResetCurrentID();
926  while((Jet1=JetCont1->GetNextAcceptJet())) {
927  if( (!Jet1) || ((Jet1->Pt())<fPtThreshold)) {
928  // fhEventCounter_1->Fill(3); //events where the jet had a problem
929  continue;
930  }
931  else {
932  /* if(fSemigoodCorrect){
933  Double_t HoleDistance=RelativePhi(Jet1->Phi(),fHolePos);
934  if(TMath::Abs(HoleDistance)<fHoleWidth) continue;
935  }*/
936  Float_t RecoilDeltaPhi = 0.;
937  if (fJetSelection == kRecoil){
938  RecoilDeltaPhi = RelativePhi(TriggerHadron->Phi(), Jet1->Phi());
939  if (TMath::Abs(RecoilDeltaPhi) < (TMath::Pi() - fRecoilAngularWindow)) continue; //accept the jet only if it overlaps with the recoil phi area of the trigger
940  fh2PtTriggerHadronJet->Fill(TriggerHadron->Pt(), Jet1->Pt());
941  fhPhiTriggerHadronJet->Fill(RelativePhi(TriggerHadron->Phi(), Jet1->Phi()));
942  }
943  if (!EventCounter){
944  fhEventCounter_1->Fill(3);
945  EventCounter=kTRUE;
946  }
947  if((Jet1->GetNumberOfTracks())==0){
948  fhEventCounter_1->Fill(10); //zero track jets
949  }
950  if((Jet1->GetNumberOfTracks())==1){
951  fhEventCounter_1->Fill(11); //one track jets
952  }
953  fhEventCounter_1->Fill(4); //Number of Jets found in all events
954  JetCounter1++;
955  fhJetPt_1->Fill(Jet1->Pt());
956  JetPhi1=Jet1->Phi();
957  if(JetPhi1 < -1*TMath::Pi()) JetPhi1 += (2*TMath::Pi());
958  else if (JetPhi1 > TMath::Pi()) JetPhi1 -= (2*TMath::Pi());
959  fhJetPhi_1->Fill(JetPhi1);
960  fhJetEta_1->Fill(Jet1->Eta());
961  fhJetMass_1->Fill(Jet1->M());
962  fhJetRadius_1->Fill(TMath::Sqrt((Jet1->Area()/TMath::Pi()))); //Radius of Jets per event
964  if((Jet2 = Jet1->ClosestJet())){
965  JetsMatched=kTRUE;
966  if((Jet2->GetNumberOfTracks())==0){
967  fhEventCounter_2->Fill(10); //zero track jets
968  }
969  if((Jet2->GetNumberOfTracks())==1){
970  fhEventCounter_2->Fill(11); //one track jets
971  }
972  fhEventCounter_2->Fill(4); //Number of Jets found in all events
973  JetCounter2++;
974  fhJetPt_2->Fill(Jet2->Pt());
975  JetPhi2=Jet2->Phi();
976  if(JetPhi2 < -1*TMath::Pi()) JetPhi2 += (2*TMath::Pi());
977  else if (JetPhi2 > TMath::Pi()) JetPhi2 -= (2*TMath::Pi());
978  fhJetPhi_2->Fill(JetPhi2);
979  fhJetEta_2->Fill(Jet2->Eta());
980  fhJetMass_2->Fill(Jet2->M());
981  fhJetRadius_2->Fill(TMath::Sqrt((Jet2->Area()/TMath::Pi()))); //Radius of Jets per event
983  fh2PtRatio->Fill(Jet1->Pt(),Jet2->Pt(),Pythia_Event_Weight);
984  }
985  else {
986  fhEventCounter_2->Fill(1);
987  //continue;
988  }
990 
991 
992  fShapesVar[0]=Jet1->Pt();
993  fShapesVar[2]=fjNSubJettiness(Jet1,0,1,0,1,0);
994  fShapesVar[4]=fjNSubJettiness(Jet1,0,2,0,1,0);
995  fShapesVar[6]=fjNSubJettiness(Jet1,0,2,0,1,8);
996  fShapesVar[8]=fjNSubJettiness(Jet1,0,2,0,1,1);
997  // fShapesVar[10]=Jet1->GetNumberOfTracks();
998  fShapesVar[10]=fjNSubJettiness(Jet1,0,2,0,1,9);
999  fShapesVar[12]=fjNSubJettiness(Jet1,0,2,0,1,3,fBeta_SD,fZCut);
1000  fShapesVar[14]=fjNSubJettiness(Jet1,0,2,0,1,5,fBeta_SD,fZCut);
1001  fShapesVar[16]=Jet1->GetLeadingTrack(JetCont1->GetParticleContainer()->GetArray())->Pt();
1002  fShapesVar[18]=-2; //event plane calculation only needed for PbPb recoils
1003  fShapesVar[20]=fjNSubJettiness(Jet1,0,2,0,1,6,fBeta_SD,fZCut);
1004  Reclusterer1 = Recluster(Jet1, 0, fSubJetRadius, fSubJetMinPt, fSubJetAlgorithm, "SubJetFinder_1");
1005  if (fFullTree){
1006  fShapesVar[22]=fjNSubJettiness(Jet1,0,2,0,1,2);
1007  fShapesVar[24]=SubJetFraction(Jet1, Reclusterer1, 1, 0, kTRUE, kFALSE);
1008  fShapesVar[26]=SubJetFraction(Jet1, Reclusterer1, 2, 0, kTRUE, kFALSE);
1009  }
1010  if (JetsMatched){ //even needed? Not now but might be if you want to fill trees when jets aren't matched too
1011  fShapesVar[1]=Jet2->Pt();
1012  fShapesVar[3]=fjNSubJettiness(Jet2,1,1,0,1,0);
1013  fShapesVar[5]=fjNSubJettiness(Jet2,1,2,0,1,0);
1014  fShapesVar[7]=fjNSubJettiness(Jet2,1,2,0,1,8);
1015  fShapesVar[9]=fjNSubJettiness(Jet2,1,2,0,1,1);
1016  // fShapesVar[11]=Jet2->GetNumberOfTracks();
1017  fShapesVar[11]=fjNSubJettiness(Jet2,1,2,0,1,9);
1018  fShapesVar[13]=fjNSubJettiness(Jet2,1,2,0,1,3,fBeta_SD,fZCut);
1019  fShapesVar[15]=fjNSubJettiness(Jet2,1,2,0,1,5,fBeta_SD,fZCut);
1020  fShapesVar[17]=Jet2->GetLeadingTrack(JetCont2->GetParticleContainer()->GetArray())->Pt();
1021  fShapesVar[19]=-2;
1022  fShapesVar[21]=fjNSubJettiness(Jet2,1,2,0,1,6,fBeta_SD,fZCut);
1023  Reclusterer2 = Recluster(Jet2, 1, fSubJetRadius, 0, fSubJetAlgorithm, "SubJetFinder_2");
1024  if (fFullTree){
1025  fShapesVar[23]=fjNSubJettiness(Jet2,1,2,0,1,2);
1026  fShapesVar[25]=SubJetFraction(Jet2, Reclusterer2, 1, 0, kTRUE, kFALSE);
1027  fShapesVar[27]=SubJetFraction(Jet2, Reclusterer2, 2, 0, kTRUE, kFALSE);
1028  }
1029  }
1030  else{
1031  fShapesVar[1]=-2;
1032  fShapesVar[3]=-2;
1033  fShapesVar[5]=-2;
1034  fShapesVar[7]=-2;
1035  fShapesVar[9]=-2;
1036  fShapesVar[11]=-2;
1037  fShapesVar[13]=-2;
1038  fShapesVar[15]=-2;
1039  fShapesVar[17]=-2;
1040  fShapesVar[19]=-2;
1041  fShapesVar[21]=-2;
1042  if (fFullTree){
1043  fShapesVar[23]=-2;
1044  fShapesVar[25]=-2;
1045  fShapesVar[27]=-2;
1046  }
1047  }
1048  fTreeResponseMatrixAxis->Fill();
1049 
1050  fhSubJetCounter_1->Fill(Reclusterer1->GetNumberOfJets());
1051  for (Int_t i= 0; i<Reclusterer1->GetNumberOfJets(); i++){
1052  fhEventCounter_1->Fill(6); //Number of overall subjets in all events
1053  fhSubJetPt_1->Fill(Reclusterer1->GetJet(i)->Pt());
1054  fhSubJetMass_1->Fill(Reclusterer1->GetJet(i)->M());
1055  fhNumberOfSubJetTracks_1->Fill(Reclusterer1->GetJet(i)->GetNumberOfTracks());
1056  fhSubJetRadius_1->Fill(TMath::Sqrt((Reclusterer1->GetJet(i)->Area()/TMath::Pi()))); //Radius of SubJets per event
1057  }
1058  if(JetsMatched){
1059  fhSubJetCounter_2->Fill(Reclusterer2->GetNumberOfJets());
1060  for (Int_t i= 0; i<Reclusterer2->GetNumberOfJets(); i++){
1061  fhEventCounter_2->Fill(6); //Number of overall subjets in all events
1062  fhSubJetPt_2->Fill(Reclusterer2->GetJet(i)->Pt());
1063  fhSubJetMass_2->Fill(Reclusterer2->GetJet(i)->M());
1064  fhNumberOfSubJetTracks_2->Fill(Reclusterer2->GetJet(i)->GetNumberOfTracks());
1065  fhSubJetRadius_2->Fill(TMath::Sqrt((Reclusterer2->GetJet(i)->Area()/TMath::Pi()))); //Radius of SubJets per event
1066  }
1067  }
1068  JetsMatched=kFALSE;
1069  }
1070  }
1071  fhJetCounter_1->Fill(JetCounter1); //Number of Jets in Each Event Particle Level
1072  fhJetCounter_2->Fill(JetCounter2); //Number of Jets in Each Event Detector Level
1073  }
1074  //else {fhEventCounter_1->Fill(3);} //Events with no jet container
1075  }
1076 
1077 
1078 
1080  AliEmcalJet *Jet1 = NULL; //Original Jet in the event
1081  AliJetContainer *JetCont= GetJetContainer(0); //Jet Container for event
1082  Int_t JetCounter=0; //Counts number of jets in event
1083  Double_t JetPhi=0;
1084  Bool_t EventCounter=kFALSE;
1085  Double_t JetPt_ForThreshold=0;
1086  fhEventCounter->Fill(1);
1087  if(JetCont) {
1088  fhEventCounter->Fill(2); //Number of events with a jet container
1089  JetCont->ResetCurrentID();
1090  while((Jet1=JetCont->GetNextAcceptJet())) {
1091  if(!Jet1) continue;
1092  if (fJetShapeSub==kNoSub || fJetShapeSub==kDerivSub) JetPt_ForThreshold = Jet1->Pt()-(GetRhoVal(0)*Jet1->Area());
1093  else JetPt_ForThreshold = Jet1->Pt();
1094  if(JetPt_ForThreshold<fPtThreshold) {
1095  //fhEventCounter->Fill(3); //events where the jet had a problem
1096  continue;
1097  }
1098  else {
1099  /* if(fSemigoodCorrect){
1100  Double_t HoleDistance=RelativePhi(Jet1->Phi(),fHolePos);
1101  if(TMath::Abs(HoleDistance)<fHoleWidth) continue;
1102  }*/
1103  Float_t RecoilDeltaPhi = 0.;
1104  if (fJetSelection == kRecoil){
1105  RecoilDeltaPhi = RelativePhi(TriggerHadron->Phi(), Jet1->Phi());
1106  if (TMath::Abs(RecoilDeltaPhi) < (TMath::Pi() - fRecoilAngularWindow)) continue; //accept the jet only if it overlaps with the recoil phi area of the trigger
1107  fh2PtTriggerHadronJet->Fill(TriggerHadron->Pt(), Jet1->Pt());
1108  fhPhiTriggerHadronJet->Fill(RelativePhi(TriggerHadron->Phi(), Jet1->Phi()));
1109  }
1110  if (!EventCounter){
1111  fhEventCounter->Fill(3);
1112  EventCounter=kTRUE;
1113  }
1114  if((Jet1->GetNumberOfTracks())==0){
1115  fhEventCounter->Fill(10); //zero track jets
1116  }
1117  if((Jet1->GetNumberOfTracks())==1){
1118  fhEventCounter->Fill(11); //one track jets
1119  }
1120  fhEventCounter->Fill(4); //Number of Jets found in all events
1121  JetCounter++;
1122  fhJetPt->Fill(Jet1->Pt());
1123  JetPhi=Jet1->Phi();
1124  if(JetPhi < -1*TMath::Pi()) JetPhi += (2*TMath::Pi());
1125  else if (JetPhi > TMath::Pi()) JetPhi -= (2*TMath::Pi());
1126  fhJetPhi->Fill(JetPhi);
1127  fhJetEta->Fill(Jet1->Eta());
1128  fhJetMass->Fill(Jet1->M());
1129  fhJetRadius->Fill(TMath::Sqrt((Jet1->Area()/TMath::Pi()))); //Radius of Jets per event
1130  fhNumberOfJetTracks->Fill(Jet1->GetNumberOfTracks());
1131  if(fJetShapeSub==kNoSub || fJetShapeSub==kDerivSub) fShapesVar[0]= Jet1->Pt()-(GetRhoVal(0)*Jet1->Area());
1132  else fShapesVar[0]=Jet1->Pt();
1133  fShapesVar[2]=fjNSubJettiness(Jet1,0,1,0,1,0);
1134  fShapesVar[4]=fjNSubJettiness(Jet1,0,2,0,1,0);
1135  fShapesVar[6]=fjNSubJettiness(Jet1,0,2,0,1,8);
1136  fShapesVar[8]=fjNSubJettiness(Jet1,0,2,0,1,1);
1137  //fShapesVar[10]=Jet1->GetNumberOfTracks();
1138  fShapesVar[10]=fjNSubJettiness(Jet1,0,2,0,1,9);
1139  fShapesVar[12]=fjNSubJettiness(Jet1,0,2,0,1,3,fBeta_SD,fZCut);
1140  fShapesVar[14]=fjNSubJettiness(Jet1,0,2,0,1,5,fBeta_SD,fZCut);
1141  fShapesVar[16]=Jet1->GetLeadingTrack(JetCont->GetParticleContainer()->GetArray())->Pt();
1142  fShapesVar[18]=-2; //event plane calculation not needed for data
1143  fShapesVar[20]=fjNSubJettiness(Jet1,0,2,0,1,6,fBeta_SD,fZCut);
1144  AliEmcalJetFinder *Reclusterer1 = Recluster(Jet1, 0, fSubJetRadius, fSubJetMinPt, fSubJetAlgorithm, "SubJetFinder");
1145  if (fFullTree){
1146  fShapesVar[22]=fjNSubJettiness(Jet1,0,2,0,1,2);
1147  fShapesVar[24]=SubJetFraction(Jet1, Reclusterer1, 1, 0, kTRUE, kFALSE);
1148  fShapesVar[26]=SubJetFraction(Jet1, Reclusterer1, 2, 0, kTRUE, kFALSE);
1149  }
1150  fShapesVar[1]=-2;
1151  fShapesVar[3]=-2;
1152  fShapesVar[5]=-2;
1153  fShapesVar[7]=-2;
1154  fShapesVar[9]=-2;
1155  fShapesVar[11]=-2;
1156  fShapesVar[13]=-2;
1157  fShapesVar[15]=-2;
1158  fShapesVar[17]=-2;
1159  fShapesVar[19]=-2;
1160  fShapesVar[21]=-2;
1161  if (fFullTree){
1162  fShapesVar[23]=-2;
1163  fShapesVar[25]=-2;
1164  fShapesVar[27]=-2;
1165  }
1166  fTreeResponseMatrixAxis->Fill();
1167  fhSubJetCounter->Fill(Reclusterer1->GetNumberOfJets());
1168  for (Int_t i= 0; i<Reclusterer1->GetNumberOfJets(); i++){
1169  fhEventCounter->Fill(6); //Number of overall subjets in all events
1170  fhSubJetPt->Fill(Reclusterer1->GetJet(i)->Pt());
1171  fhSubJetMass->Fill(Reclusterer1->GetJet(i)->M());
1172  fhNumberOfSubJetTracks->Fill(Reclusterer1->GetJet(i)->GetNumberOfTracks());
1173  fhSubJetRadius->Fill(TMath::Sqrt((Reclusterer1->GetJet(i)->Area()/TMath::Pi()))); //Radius of SubJets per event
1174  }
1175  }
1176  }
1177  fhJetCounter->Fill(JetCounter); //Number of Jets in Each Event
1178  }
1179  //else {fhEventCounter->Fill(2);} //Events with no jet container
1180  }
1181 
1182 
1184 
1185  AliEmcalJet *Jet1 = NULL; //Original Jet in the event
1186  AliJetContainer *JetCont= GetJetContainer(0); //Jet Container for event
1187  Int_t JetCounter=0; //Counts number of jets in event
1188  Double_t JetPhi=0;
1189  Bool_t EventCounter=kFALSE;
1190  Double_t JetPt_ForThreshold=0;
1191  fhEventCounter->Fill(1);
1192  if(JetCont) {
1193  fhEventCounter->Fill(2); //Number of events with a jet container
1194  JetCont->ResetCurrentID();
1195  while((Jet1=JetCont->GetNextAcceptJet())) {
1196  // if (((Jet1=JetCont->GetLeadingJet("rho")) && (fPtThreshold<=Jet1->Pt()-(GetRhoVal(0)*Jet1->Area())))){
1197  if(!Jet1) continue;
1198  if(fJetShapeSub==kNoSub || fJetShapeSub==kDerivSub) JetPt_ForThreshold = Jet1->Pt()-(GetRhoVal(0)*Jet1->Area());
1199  else JetPt_ForThreshold = Jet1->Pt();
1200  if(JetPt_ForThreshold<fPtThreshold) {
1201  //fhEventCounter->Fill(3); //events where the jet had a problem
1202  continue;
1203  }
1204  else {
1205  /* if(fSemigoodCorrect){
1206  Double_t HoleDistance=RelativePhi(Jet1->Phi(),fHolePos);
1207  if(TMath::Abs(HoleDistance)<fHoleWidth) continue;
1208  }*/
1209  Float_t RecoilDeltaPhi = 0.;
1210  if (fJetSelection == kRecoil){
1211  RecoilDeltaPhi = RelativePhi(TriggerHadron->Phi(), Jet1->Phi());
1212  if (TMath::Abs(RecoilDeltaPhi) < (TMath::Pi() - fRecoilAngularWindow)) continue; //accept the jet only if it overlaps with the recoil phi area of the trigger
1213  fh2PtTriggerHadronJet->Fill(TriggerHadron->Pt(), Jet1->Pt());
1214  fhPhiTriggerHadronJet->Fill(RelativePhi(TriggerHadron->Phi(), Jet1->Phi()));
1215  }
1216  if (!EventCounter){
1217  fhEventCounter->Fill(3);
1218  EventCounter=kTRUE;
1219  }
1220  if((Jet1->GetNumberOfTracks())==0){
1221  fhEventCounter->Fill(10); //zero track jets
1222  }
1223  if((Jet1->GetNumberOfTracks())==1){
1224  fhEventCounter->Fill(11); //one track jets
1225  }
1226  fhEventCounter->Fill(4); //Number of Jets found in all events
1227  JetCounter++;
1228  fhJetPt->Fill(Jet1->Pt());
1229  JetPhi=Jet1->Phi();
1230  if(JetPhi < -1*TMath::Pi()) JetPhi += (2*TMath::Pi());
1231  else if (JetPhi > TMath::Pi()) JetPhi -= (2*TMath::Pi());
1232  fhJetPhi->Fill(JetPhi);
1233  fhJetEta->Fill(Jet1->Eta());
1234  fhJetMass->Fill(Jet1->M());
1235  fhJetRadius->Fill(TMath::Sqrt((Jet1->Area()/TMath::Pi()))); //Radius of Jets per event
1236  fhNumberOfJetTracks->Fill(Jet1->GetNumberOfTracks());
1237 
1238  Int_t FJ_Algorithm=9; //KT=0, CA=1, AKT_R02=2, WTA_KT=3, WTA_CA=4, OP_KT=5, OP_CA=6, OP_AKT_R02=7, OP_WTA_KT=8, OP_WTA_CA=9, MIN=10
1239  Double_t FJ_Beta=1.0;
1240  /* fhSubJettiness1CheckRatio_FJ_KT->Fill(fjNSubJettiness(Jet1,0,1,0,FJ_Beta,0)-fjNSubJettiness(Jet1,0,1,0,FJ_Beta,0),fjNSubJettiness(Jet1,0,1,0,FJ_Beta,0));
1241  fhSubJettiness1CheckRatio_FJ_CA->Fill(fjNSubJettiness(Jet1,0,1,0,FJ_Beta,0)-fjNSubJettiness(Jet1,0,1,1,FJ_Beta,0),fjNSubJettiness(Jet1,0,1,0,FJ_Beta,0));
1242  fhSubJettiness1CheckRatio_FJ_AKT->Fill(fjNSubJettiness(Jet1,0,1,0,FJ_Beta,0)-fjNSubJettiness(Jet1,0,1,2,FJ_Beta,0),fjNSubJettiness(Jet1,0,1,0,FJ_Beta,0));
1243  fhSubJettiness1CheckRatio_FJ_WTA_KT->Fill(fjNSubJettiness(Jet1,0,1,0,FJ_Beta,0)-fjNSubJettiness(Jet1,0,1,3,FJ_Beta,0),fjNSubJettiness(Jet1,0,1,0,FJ_Beta,0));
1244  fhSubJettiness1CheckRatio_FJ_WTA_CA->Fill(fjNSubJettiness(Jet1,0,1,0,FJ_Beta,0)-fjNSubJettiness(Jet1,0,1,4,FJ_Beta,0),fjNSubJettiness(Jet1,0,1,0,FJ_Beta,0));
1245  fhSubJettiness1CheckRatio_FJ_OP_KT->Fill(fjNSubJettiness(Jet1,0,1,0,FJ_Beta,0)-fjNSubJettiness(Jet1,0,1,5,FJ_Beta,0),fjNSubJettiness(Jet1,0,1,0,FJ_Beta,0));
1246  fhSubJettiness1CheckRatio_FJ_OP_CA->Fill(fjNSubJettiness(Jet1,0,1,0,FJ_Beta,0)-fjNSubJettiness(Jet1,0,1,6,FJ_Beta,0),fjNSubJettiness(Jet1,0,1,0,FJ_Beta,0));
1247  fhSubJettiness1CheckRatio_FJ_OP_AKT->Fill(fjNSubJettiness(Jet1,0,1,0,FJ_Beta,0)-fjNSubJettiness(Jet1,0,1,7,FJ_Beta,0),fjNSubJettiness(Jet1,0,1,0,FJ_Beta,0));
1248  fhSubJettiness1CheckRatio_FJ_OP_WTA_KT->Fill(fjNSubJettiness(Jet1,0,1,0,FJ_Beta,0)-fjNSubJettiness(Jet1,0,1,8,FJ_Beta,0),fjNSubJettiness(Jet1,0,1,0,FJ_Beta,0));
1249  fhSubJettiness1CheckRatio_FJ_OP_WTA_CA->Fill(fjNSubJettiness(Jet1,0,1,0,FJ_Beta,0)-fjNSubJettiness(Jet1,0,1,9,FJ_Beta,0),fjNSubJettiness(Jet1,0,1,0,FJ_Beta,0));
1250  fhSubJettiness1CheckRatio_FJ_MIN->Fill(fjNSubJettiness(Jet1,0,1,0,FJ_Beta,0)-fjNSubJettiness(Jet1,0,1,10,FJ_Beta,0),fjNSubJettiness(Jet1,0,1,0,FJ_Beta,0));
1251  fhSubJettiness2CheckRatio_FJ_KT->Fill(fjNSubJettiness(Jet1,0,2,0,FJ_Beta,0)-fjNSubJettiness(Jet1,0,2,0,FJ_Beta,0),fjNSubJettiness(Jet1,0,2,0,FJ_Beta,0));
1252  fhSubJettiness2CheckRatio_FJ_CA->Fill(fjNSubJettiness(Jet1,0,2,0,FJ_Beta,0)-fjNSubJettiness(Jet1,0,2,1,FJ_Beta,0),fjNSubJettiness(Jet1,0,2,0,FJ_Beta,0));
1253  fhSubJettiness2CheckRatio_FJ_AKT->Fill(fjNSubJettiness(Jet1,0,2,0,FJ_Beta,0)-fjNSubJettiness(Jet1,0,2,2,FJ_Beta,0),fjNSubJettiness(Jet1,0,2,0,FJ_Beta,0));
1254  fhSubJettiness2CheckRatio_FJ_WTA_KT->Fill(fjNSubJettiness(Jet1,0,2,0,FJ_Beta,0)-fjNSubJettiness(Jet1,0,2,3,FJ_Beta,0),fjNSubJettiness(Jet1,0,2,0,FJ_Beta,0));
1255  fhSubJettiness2CheckRatio_FJ_WTA_CA->Fill(fjNSubJettiness(Jet1,0,2,0,FJ_Beta,0)-fjNSubJettiness(Jet1,0,2,4,FJ_Beta,0),fjNSubJettiness(Jet1,0,2,0,FJ_Beta,0));
1256  fhSubJettiness2CheckRatio_FJ_OP_KT->Fill(fjNSubJettiness(Jet1,0,2,0,FJ_Beta,0)-fjNSubJettiness(Jet1,0,2,5,FJ_Beta,0),fjNSubJettiness(Jet1,0,2,0,FJ_Beta,0));
1257  fhSubJettiness2CheckRatio_FJ_OP_CA->Fill(fjNSubJettiness(Jet1,0,2,0,FJ_Beta,0)-fjNSubJettiness(Jet1,0,2,6,FJ_Beta,0),fjNSubJettiness(Jet1,0,2,0,FJ_Beta,0));
1258  fhSubJettiness2CheckRatio_FJ_OP_AKT->Fill(fjNSubJettiness(Jet1,0,2,0,FJ_Beta,0)-fjNSubJettiness(Jet1,0,2,7,FJ_Beta,0),fjNSubJettiness(Jet1,0,2,0,FJ_Beta,0));
1259  fhSubJettiness2CheckRatio_FJ_OP_WTA_KT->Fill(fjNSubJettiness(Jet1,0,2,0,FJ_Beta,0)-fjNSubJettiness(Jet1,0,2,8,FJ_Beta,0),fjNSubJettiness(Jet1,0,2,0,FJ_Beta,0));
1260  fhSubJettiness2CheckRatio_FJ_OP_WTA_CA->Fill(fjNSubJettiness(Jet1,0,2,0,FJ_Beta,0)-fjNSubJettiness(Jet1,0,2,9,FJ_Beta,0),fjNSubJettiness(Jet1,0,2,0,FJ_Beta,0));
1261  fhSubJettiness2CheckRatio_FJ_MIN->Fill(fjNSubJettiness(Jet1,0,2,0,FJ_Beta,0)-fjNSubJettiness(Jet1,0,2,10,FJ_Beta,0),fjNSubJettiness(Jet1,0,2,0,FJ_Beta,0));
1262 
1263  fhSubJettiness2to1CheckRatio_FJ_KT->Fill((fjNSubJettiness(Jet1,0,2,0,FJ_Beta,0)/fjNSubJettiness(Jet1,0,1,0,FJ_Beta,0))-(fjNSubJettiness(Jet1,0,2,0,FJ_Beta,0)/fjNSubJettiness(Jet1,0,1,0,FJ_Beta,0)),fjNSubJettiness(Jet1,0,2,0,FJ_Beta,0)/fjNSubJettiness(Jet1,0,1,0,FJ_Beta,0));
1264  fhSubJettiness2to1CheckRatio_FJ_CA->Fill((fjNSubJettiness(Jet1,0,2,0,FJ_Beta,0)/fjNSubJettiness(Jet1,0,1,0,FJ_Beta,0))-(fjNSubJettiness(Jet1,0,2,1,FJ_Beta,0)/fjNSubJettiness(Jet1,0,1,1,FJ_Beta,0)),fjNSubJettiness(Jet1,0,2,0,FJ_Beta,0)/fjNSubJettiness(Jet1,0,1,0,FJ_Beta,0));
1265  fhSubJettiness2to1CheckRatio_FJ_AKT->Fill((fjNSubJettiness(Jet1,0,2,0,FJ_Beta,0)/fjNSubJettiness(Jet1,0,1,0,FJ_Beta,0))-(fjNSubJettiness(Jet1,0,2,2,FJ_Beta,0)/fjNSubJettiness(Jet1,0,1,2,FJ_Beta,0)),fjNSubJettiness(Jet1,0,2,0,FJ_Beta,0)/fjNSubJettiness(Jet1,0,1,0,FJ_Beta,0));
1266  fhSubJettiness2to1CheckRatio_FJ_WTA_KT->Fill((fjNSubJettiness(Jet1,0,2,0,FJ_Beta,0)/fjNSubJettiness(Jet1,0,1,0,FJ_Beta,0))-(fjNSubJettiness(Jet1,0,2,3,FJ_Beta,0)/fjNSubJettiness(Jet1,0,1,3,FJ_Beta,0)),fjNSubJettiness(Jet1,0,2,0,FJ_Beta,0)/fjNSubJettiness(Jet1,0,1,0,FJ_Beta,0));
1267  fhSubJettiness2to1CheckRatio_FJ_WTA_CA->Fill((fjNSubJettiness(Jet1,0,2,0,FJ_Beta,0)/fjNSubJettiness(Jet1,0,1,0,FJ_Beta,0))-(fjNSubJettiness(Jet1,0,2,4,FJ_Beta,0)/fjNSubJettiness(Jet1,0,1,4,FJ_Beta,0)),fjNSubJettiness(Jet1,0,2,0,FJ_Beta,0)/fjNSubJettiness(Jet1,0,1,0,FJ_Beta,0));
1268  fhSubJettiness2to1CheckRatio_FJ_OP_KT->Fill((fjNSubJettiness(Jet1,0,2,0,FJ_Beta,0)/fjNSubJettiness(Jet1,0,1,0,FJ_Beta,0))-(fjNSubJettiness(Jet1,0,2,5,FJ_Beta,0)/fjNSubJettiness(Jet1,0,1,5,FJ_Beta,0)),fjNSubJettiness(Jet1,0,2,0,FJ_Beta,0)/fjNSubJettiness(Jet1,0,1,0,FJ_Beta,0));
1269  fhSubJettiness2to1CheckRatio_FJ_OP_CA->Fill((fjNSubJettiness(Jet1,0,2,0,FJ_Beta,0)/fjNSubJettiness(Jet1,0,1,0,FJ_Beta,0))-(fjNSubJettiness(Jet1,0,2,6,FJ_Beta,0)/fjNSubJettiness(Jet1,0,1,6,FJ_Beta,0)),fjNSubJettiness(Jet1,0,2,0,FJ_Beta,0)/fjNSubJettiness(Jet1,0,1,0,FJ_Beta,0));
1270  fhSubJettiness2to1CheckRatio_FJ_OP_AKT->Fill((fjNSubJettiness(Jet1,0,2,0,FJ_Beta,0)/fjNSubJettiness(Jet1,0,1,0,FJ_Beta,0))-(fjNSubJettiness(Jet1,0,2,7,FJ_Beta,0)/fjNSubJettiness(Jet1,0,1,7,FJ_Beta,0)),fjNSubJettiness(Jet1,0,2,0,FJ_Beta,0)/fjNSubJettiness(Jet1,0,1,0,FJ_Beta,0));
1271  fhSubJettiness2to1CheckRatio_FJ_OP_WTA_KT->Fill((fjNSubJettiness(Jet1,0,2,0,FJ_Beta,0)/fjNSubJettiness(Jet1,0,1,0,FJ_Beta,0))-(fjNSubJettiness(Jet1,0,2,8,FJ_Beta,0)/fjNSubJettiness(Jet1,0,1,8,FJ_Beta,0)),fjNSubJettiness(Jet1,0,2,0,FJ_Beta,0)/fjNSubJettiness(Jet1,0,1,0,FJ_Beta,0));
1272  fhSubJettiness2to1CheckRatio_FJ_OP_WTA_CA->Fill((fjNSubJettiness(Jet1,0,2,0,FJ_Beta,0)/fjNSubJettiness(Jet1,0,1,0,FJ_Beta,0))-(fjNSubJettiness(Jet1,0,2,9,FJ_Beta,0)/fjNSubJettiness(Jet1,0,1,9,FJ_Beta,0)),fjNSubJettiness(Jet1,0,2,0,FJ_Beta,0)/fjNSubJettiness(Jet1,0,1,0,FJ_Beta,0));
1273  fhSubJettiness2to1CheckRatio_FJ_MIN->Fill((fjNSubJettiness(Jet1,0,2,0,FJ_Beta,0)/fjNSubJettiness(Jet1,0,1,0,FJ_Beta,0))-(fjNSubJettiness(Jet1,0,2,10,FJ_Beta,0)/fjNSubJettiness(Jet1,0,1,10,FJ_Beta,0)),fjNSubJettiness(Jet1,0,2,0,FJ_Beta,0)/fjNSubJettiness(Jet1,0,1,0,FJ_Beta,0));
1274 
1275 
1276  fhSubJettiness1_FJ_KT->Fill(fjNSubJettiness(Jet1,0,1,0,FJ_Beta,0));
1277  fhSubJettiness1_FJ_CA->Fill(fjNSubJettiness(Jet1,0,1,1,FJ_Beta,0));
1278  fhSubJettiness1_FJ_AKT->Fill(fjNSubJettiness(Jet1,0,1,2,FJ_Beta,0));
1279  fhSubJettiness1_FJ_WTA_KT->Fill(fjNSubJettiness(Jet1,0,1,3,FJ_Beta,0));
1280  fhSubJettiness1_FJ_WTA_CA->Fill(fjNSubJettiness(Jet1,0,1,4,FJ_Beta,0));
1281  fhSubJettiness1_FJ_OP_KT->Fill(fjNSubJettiness(Jet1,0,1,5,FJ_Beta,0));
1282  fhSubJettiness1_FJ_OP_CA->Fill(fjNSubJettiness(Jet1,0,1,6,FJ_Beta,0));
1283  fhSubJettiness1_FJ_OP_AKT->Fill(fjNSubJettiness(Jet1,0,1,7,FJ_Beta,0));
1284  fhSubJettiness1_FJ_OP_WTA_KT->Fill(fjNSubJettiness(Jet1,0,1,8,FJ_Beta,0));
1285  fhSubJettiness1_FJ_OP_WTA_CA->Fill(fjNSubJettiness(Jet1,0,1,9,FJ_Beta,0));
1286  fhSubJettiness1_FJ_MIN->Fill(fjNSubJettiness(Jet1,0,1,10,FJ_Beta,0));
1287  fhSubJettiness2_FJ_KT->Fill(fjNSubJettiness(Jet1,0,2,0,FJ_Beta,0));
1288  fhSubJettiness2_FJ_CA->Fill(fjNSubJettiness(Jet1,0,2,1,FJ_Beta,0));
1289  fhSubJettiness2_FJ_AKT->Fill(fjNSubJettiness(Jet1,0,2,2,FJ_Beta,0)); //because in this case we aren't garantueed to get 2 subjets
1290  fhSubJettiness2_FJ_WTA_KT->Fill(fjNSubJettiness(Jet1,0,2,3,FJ_Beta,0));
1291  fhSubJettiness2_FJ_WTA_CA->Fill(fjNSubJettiness(Jet1,0,2,4,FJ_Beta,0));
1292  fhSubJettiness2_FJ_OP_KT->Fill(fjNSubJettiness(Jet1,0,2,5,FJ_Beta,0));
1293  fhSubJettiness2_FJ_OP_CA->Fill(fjNSubJettiness(Jet1,0,2,6,FJ_Beta,0));
1294  fhSubJettiness2_FJ_OP_AKT->Fill(fjNSubJettiness(Jet1,0,2,7,FJ_Beta,0));
1295  fhSubJettiness2_FJ_OP_WTA_KT->Fill(fjNSubJettiness(Jet1,0,2,8,FJ_Beta,0));
1296  fhSubJettiness2_FJ_OP_WTA_CA->Fill(fjNSubJettiness(Jet1,0,2,9,FJ_Beta,0));
1297  fhSubJettiness2_FJ_MIN->Fill(fjNSubJettiness(Jet1,0,2,10,FJ_Beta,0));
1298 
1299  fhSubJettiness2to1_FJ_KT->Fill(fjNSubJettiness(Jet1,0,2,0,FJ_Beta,0)/fjNSubJettiness(Jet1,0,1,0,FJ_Beta,0));
1300  fhSubJettiness2to1_FJ_CA->Fill(fjNSubJettiness(Jet1,0,2,1,FJ_Beta,0)/fjNSubJettiness(Jet1,0,2,1,FJ_Beta,0));
1301  fhSubJettiness2to1_FJ_AKT->Fill(fjNSubJettiness(Jet1,0,2,2,FJ_Beta,0)/fjNSubJettiness(Jet1,0,2,2,FJ_Beta,0)); //because in this case we aren't garantueed to get 2 subjets
1302  fhSubJettiness2to1_FJ_WTA_KT->Fill(fjNSubJettiness(Jet1,0,2,3,FJ_Beta,0)/fjNSubJettiness(Jet1,0,2,3,FJ_Beta,0));
1303  fhSubJettiness2to1_FJ_WTA_CA->Fill(fjNSubJettiness(Jet1,0,2,4,FJ_Beta,0)/fjNSubJettiness(Jet1,0,2,4,FJ_Beta,0));
1304  fhSubJettiness2to1_FJ_OP_KT->Fill(fjNSubJettiness(Jet1,0,2,5,FJ_Beta,0)/fjNSubJettiness(Jet1,0,2,5,FJ_Beta,0));
1305  fhSubJettiness2to1_FJ_OP_CA->Fill(fjNSubJettiness(Jet1,0,2,6,FJ_Beta,0)/fjNSubJettiness(Jet1,0,2,6,FJ_Beta,0));
1306  fhSubJettiness2to1_FJ_OP_AKT->Fill(fjNSubJettiness(Jet1,0,2,7,FJ_Beta,0)/fjNSubJettiness(Jet1,0,2,7,FJ_Beta,0));
1307  fhSubJettiness2to1_FJ_OP_WTA_KT->Fill(fjNSubJettiness(Jet1,0,2,8,FJ_Beta,0)/fjNSubJettiness(Jet1,0,2,8,FJ_Beta,0));
1308  fhSubJettiness2to1_FJ_OP_WTA_CA->Fill(fjNSubJettiness(Jet1,0,2,9,FJ_Beta,0)/fjNSubJettiness(Jet1,0,2,9,FJ_Beta,0));
1309  fhSubJettiness2to1_FJ_MIN->Fill(fjNSubJettiness(Jet1,0,2,10,FJ_Beta,0)/fjNSubJettiness(Jet1,0,2,10,FJ_Beta,0));
1310  */
1311  if(fJetShapeSub==kNoSub || fJetShapeSub==kDerivSub) fShapesVar[0]= Jet1->Pt()-(GetRhoVal(0)*Jet1->Area());
1312  else fShapesVar[0]=Jet1->Pt();
1313  fShapesVar[2]=fjNSubJettiness(Jet1,0,1,0,1,0);
1314  fShapesVar[4]=fjNSubJettiness(Jet1,0,2,0,1,0);
1315  fShapesVar[6]=fjNSubJettiness(Jet1,0,2,0,1,8);
1316  fShapesVar[8]=fjNSubJettiness(Jet1,0,2,0,1,1);
1317  // fShapesVar[10]=Jet1->GetNumberOfTracks();
1318  fShapesVar[10]=fjNSubJettiness(Jet1,0,2,0,1,9);
1319  fShapesVar[12]=fjNSubJettiness(Jet1,0,2,0,1,3,fBeta_SD,fZCut);
1320  fShapesVar[14]=fjNSubJettiness(Jet1,0,2,0,1,5,fBeta_SD,fZCut);
1321  fShapesVar[16]=Jet1->GetLeadingTrack(JetCont->GetParticleContainer()->GetArray())->Pt();
1322  fShapesVar[18]=-2;
1323  fShapesVar[20]=fjNSubJettiness(Jet1,0,2,0,1,6,fBeta_SD,fZCut);
1324  AliEmcalJetFinder *Reclusterer1 = Recluster(Jet1, 0, fSubJetRadius, fSubJetMinPt, fSubJetAlgorithm, "SubJetFinder");
1325  if (fFullTree){
1326  fShapesVar[22]=fjNSubJettiness(Jet1,0,2,0,1,2);
1327  fShapesVar[24]=SubJetFraction(Jet1, Reclusterer1, 1, 0, kTRUE, kFALSE);
1328  fShapesVar[26]=SubJetFraction(Jet1, Reclusterer1, 2, 0, kTRUE, kFALSE);
1329  }
1330  fShapesVar[1]=-2;
1331  fShapesVar[3]=-2;
1332  fShapesVar[5]=-2;
1333  fShapesVar[7]=-2;
1334  fShapesVar[9]=-2;
1335  fShapesVar[11]=-2;
1336  fShapesVar[13]=-2;
1337  fShapesVar[15]=-2;
1338  fShapesVar[17]=-2;
1339  fShapesVar[19]=-2;
1340  fShapesVar[21]=-2;
1341  if (fFullTree){
1342  fShapesVar[23]=-2;
1343  fShapesVar[25]=-2;
1344  fShapesVar[27]=-2;
1345  }
1346  fTreeResponseMatrixAxis->Fill();
1347 
1348  fhSubJetCounter->Fill(Reclusterer1->GetNumberOfJets());
1349  for (Int_t i= 0; i<Reclusterer1->GetNumberOfJets(); i++){
1350  fhEventCounter->Fill(6); //Number of overall subjets in all events
1351  fhSubJetPt->Fill(Reclusterer1->GetJet(i)->Pt());
1352  fhSubJetMass->Fill(Reclusterer1->GetJet(i)->M());
1353  fhNumberOfSubJetTracks->Fill(Reclusterer1->GetJet(i)->GetNumberOfTracks());
1354  fhSubJetRadius->Fill(TMath::Sqrt((Reclusterer1->GetJet(i)->Area()/TMath::Pi()))); //Radius of SubJets per event
1355  }
1356  }
1357  }
1358  fhJetCounter->Fill(JetCounter); //Number of Jets in Each Event
1359  }
1360  //else {fhEventCounter->Fill(2);} //Events with no jet container
1361  }
1362  return kTRUE;
1363 }
1364 //________________________________________________________________________
1366 
1367  if(Phi < -1*TMath::Pi()) Phi += (2*TMath::Pi());
1368  else if (Phi > TMath::Pi()) Phi -= (2*TMath::Pi());
1369  Double_t DeltaPhi=Phi-EventPlane;
1370  if(DeltaPhi < -1*TMath::Pi()) DeltaPhi += (2*TMath::Pi());
1371  else if (DeltaPhi > TMath::Pi()) DeltaPhi -= (2*TMath::Pi());
1372  return DeltaPhi;
1373 }
1374 //________________________________________________________________________
1376 
1377  if(Phi1 < -1*TMath::Pi()) Phi1 += (2*TMath::Pi()); // Turns the range of 0to2Pi into -PitoPi ???????????
1378  else if (Phi1 > TMath::Pi()) Phi1 -= (2*TMath::Pi());
1379  if(Phi2 < -1*TMath::Pi()) Phi2 += (2*TMath::Pi());
1380  else if (Phi2 > TMath::Pi()) Phi2 -= (2*TMath::Pi());
1381  Double_t DeltaPhi=Phi2-Phi1;
1382  if(DeltaPhi < -1*TMath::Pi()) DeltaPhi += (2*TMath::Pi());
1383  else if (DeltaPhi > TMath::Pi()) DeltaPhi -= (2*TMath::Pi());
1384  return DeltaPhi;
1385 }
1386 
1387 
1388 //--------------------------------------------------------------------------
1390 
1391  AliTrackContainer *PartCont = NULL;
1392  AliParticleContainer *PartContMC = NULL;
1393 
1394 
1395  if (fJetShapeSub==kConstSub){
1397  else PartCont = GetTrackContainer(1);
1398  }
1399  else{
1401  else PartCont = GetTrackContainer(0);
1402  }
1403 
1404  TClonesArray *TracksArray = NULL;
1405  TClonesArray *TracksArrayMC = NULL;
1406  if (fJetShapeType == AliAnalysisTaskSubJetFraction::kGenOnTheFly) TracksArrayMC = PartContMC->GetArray();
1407  else TracksArray = PartCont->GetArray();
1408 
1410  if(!PartContMC || !TracksArrayMC) return -99999;
1411  }
1412  else {
1413  if(!PartCont || !TracksArray) return -99999;
1414  }
1415 
1416  AliAODTrack *Track = 0x0;
1417  Int_t Trigger_Index[100];
1418  for (Int_t i=0; i<100; i++) Trigger_Index[i] = 0;
1419  Int_t Trigger_Counter = 0;
1420  Int_t NTracks=0;
1421  if (fJetShapeType == AliAnalysisTaskSubJetFraction::kGenOnTheFly) NTracks = TracksArrayMC->GetEntriesFast();
1422  else NTracks = TracksArray->GetEntriesFast();
1423  for(Int_t i=0; i < NTracks; i++){
1425  if((Track = static_cast<AliAODTrack*>(PartContMC->GetAcceptParticle(i)))){
1426  if (!Track) continue;
1427  if(TMath::Abs(Track->Eta())>0.9) continue;
1428  if (Track->Pt()<0.15) continue;
1429  if ((Track->Pt() >= PtMin) && (Track->Pt()< PtMax)) {
1430  Trigger_Index[Trigger_Counter] = i;
1431  Trigger_Counter++;
1432  }
1433  }
1434  }
1435  else{
1436  if((Track = static_cast<AliAODTrack*>(PartCont->GetAcceptTrack(i)))){
1437  if (!Track) continue;
1438  if(TMath::Abs(Track->Eta())>0.9) continue;
1439  if (Track->Pt()<0.15) continue;
1440  if ((Track->Pt() >= PtMin) && (Track->Pt()< PtMax)) {
1441  Trigger_Index[Trigger_Counter] = i;
1442  Trigger_Counter++;
1443  }
1444  }
1445  }
1446  }
1447  if (Trigger_Counter == 0) return -99999;
1448  Int_t RandomNumber = 0, Index = 0 ;
1449  TRandom3* Random = new TRandom3(0);
1450  RandomNumber = Random->Integer(Trigger_Counter);
1451  Index = Trigger_Index[RandomNumber];
1452  return Index;
1453 }
1454 
1455 
1456 //--------------------------------------------------------------------------
1458 
1459  AliJetContainer *JetCont = GetJetContainer(JetContNb);
1460  Double_t Angularity_Numerator=0; //Reset these values
1461  Double_t Angularity_Denominator=0;
1462  AliVParticle *Particle=0x0;
1463  Double_t DeltaPhi=0;
1464 
1465 
1466  for (Int_t i=0; i< Jet->GetNumberOfTracks(); i++){ //loops through all tracks (particles in the jet
1467  Particle = static_cast<AliVParticle*>(Jet->TrackAt(i, JetCont->GetParticleContainer()->GetArray()));
1468  if(!Particle) continue;
1469  DeltaPhi=RelativePhi(Jet->Phi(),Particle->Phi());
1470  Angularity_Numerator=Angularity_Numerator+(Particle->Pt()*TMath::Sqrt(((Particle->Eta()-Jet->Eta())*(Particle->Eta()-Jet->Eta()))+(DeltaPhi*DeltaPhi)));
1471  Angularity_Denominator= Angularity_Denominator+Particle->Pt();
1472  }
1473  if(Angularity_Denominator!=0) return Angularity_Numerator/Angularity_Denominator;
1474  else return -1;
1475 
1476 }
1477 
1478 
1479 
1480 //--------------------------------------------------------------------------
1482 
1483  AliJetContainer *JetCont = GetJetContainer(JetContNb);
1484  Double_t PTD_Numerator=0; //Reset these values
1485  Double_t PTD_Denominator=0;
1486  AliVParticle *Particle=0x0;
1487  Double_t DeltaPhi=0;
1488  for (Int_t i=0; i< Jet->GetNumberOfTracks(); i++){ //loops through all tracks (particles in the jet
1489  Particle = static_cast<AliVParticle*>(Jet->TrackAt(i, JetCont->GetParticleContainer()->GetArray()));
1490  if(!Particle) continue;
1491  PTD_Numerator=PTD_Numerator+(Particle->Pt()*Particle->Pt());
1492  PTD_Denominator=PTD_Denominator+Particle->Pt();
1493  }
1494  if(PTD_Denominator!=0) return TMath::Sqrt(PTD_Numerator)/PTD_Denominator;
1495  else return -1;
1496 
1497 }
1498 
1499 
1500 //----------------------------------------------------------------------
1502 AliEmcalJetFinder *AliAnalysisTaskSubJetFraction::Recluster(AliEmcalJet *Jet, Int_t JetContNb, Double_t SubJetRadius, Double_t SubJetMinPt, Int_t Algorithm, const char* Name){
1503 
1504  AliJetContainer *JetCont = GetJetContainer(JetContNb);
1505  AliEmcalJetFinder *Reclusterer = new AliEmcalJetFinder(Name); //JetFinder Object for reclustered jets
1506  Reclusterer->SetRadius(SubJetRadius);
1507  Reclusterer->SetJetMinPt(SubJetMinPt);
1508  Reclusterer->SetJetAlgorithm(Algorithm); //0 for anti-kt 1 for kt
1509  Reclusterer->SetJetMaxEta(0.9);
1510  Reclusterer->SetRecombSheme(0);
1512  const AliVVertex *vert = InputEvent()->GetPrimaryVertex();
1513  Double_t dVtx[3]={vert->GetX(),vert->GetY(),vert->GetZ()};
1514  if(Reclusterer->AliEmcalJetFinder::Filter(Jet, JetCont, dVtx)){;} //reclustering jet1 using the jetfinderobject Reclusterer
1515  }
1516  else{
1517  Double_t dVtx[3]={1,1,1};
1518  if(Reclusterer->AliEmcalJetFinder::Filter(Jet, JetCont, dVtx)){;} //reclustering jet1 using the jetfinderobject Reclusterer
1519  }
1520  return Reclusterer;
1521 
1522 }
1523 
1524 
1525 
1526 //----------------------------------------------------------------------
1528  AliEmcalJet *SubJet=NULL;
1529  Double_t SortingVariable;
1530  Int_t ArraySize =N+1;
1531  TArrayD *JetSorter = new TArrayD(ArraySize);
1532  TArrayD *JetIndexSorter = new TArrayD(ArraySize);
1533  for (Int_t i=0; i<ArraySize; i++){
1534  JetSorter->SetAt(0,i);
1535  }
1536  for (Int_t i=0; i<ArraySize; i++){
1537  JetIndexSorter->SetAt(0,i);
1538  }
1539  if(Reclusterer->GetNumberOfJets()<N) return -999;
1540  for (Int_t i=0; i<Reclusterer->GetNumberOfJets(); i++){
1541  SubJet=Reclusterer->GetJet(i);
1542  if (Type==0) SortingVariable=SubJet->Pt();
1543  else if (Type==1) SortingVariable=SubJet->E();
1544  else if (Type==2) SortingVariable=SubJet->M();
1545  for (Int_t j=0; j<N; j++){
1546  if (SortingVariable>JetSorter->GetAt(j)){
1547  for (Int_t k=N-1; k>=j; k--){
1548  JetSorter->SetAt(JetSorter->GetAt(k),k+1);
1549  JetIndexSorter->SetAt(JetIndexSorter->GetAt(k),k+1);
1550  }
1551  JetSorter->SetAt(SortingVariable,j);
1552  JetIndexSorter->SetAt(i,j);
1553  break;
1554  }
1555  }
1556  }
1557  if (!Index) return JetSorter->GetAt(N-1);
1558  else return JetIndexSorter->GetAt(N-1);
1559 }
1560 
1561 
1562 
1563 //returns -1 if the Nth hardest jet is requested where N>number of available jets
1564 //type: 0=Pt 1=E 2=M
1565 //Index TRUE=returns index FALSE=returns value of quantatiy in question
1566 
1567 
1568 
1569 
1570 
1571 
1572 
1573 //----------------------------------------------------------------------
1575  AliEmcalJet *SubJet=NULL;
1576  Double_t Observable=0;
1577  Double_t Fraction_Numerator=0;
1578  Bool_t Error=kFALSE;
1579  if (!Jet->GetNumberOfTracks()) return -2;
1580  if (Add){
1581  for (Int_t i=1; i<=N; i++){
1582  Observable=SubJetOrdering(Jet,Reclusterer,i,Type,kFALSE);
1583  if(Observable==-999){
1584  Error = kTRUE;
1585  return -2;
1586  }
1587  Fraction_Numerator=Fraction_Numerator+Observable;
1588  }
1589  }
1590  else {
1591  Fraction_Numerator=SubJetOrdering(Jet,Reclusterer,N,Type,kFALSE);
1592  if (Fraction_Numerator==-999) return -2;
1593  }
1594  if (Type==0){
1595  if(Loss) return (Jet->Pt()-Fraction_Numerator)/Jet->Pt();
1596  else return Fraction_Numerator/Jet->Pt();
1597  }
1598  else if (Type==1){
1599  if(Loss) return (Jet->E()-Fraction_Numerator)/Jet->E();
1600  else return Fraction_Numerator/Jet->E();
1601  }
1602  else { //change to else if if you want to add more later
1603  if(Loss) return (Jet->M()-Fraction_Numerator)/Jet->M();
1604  else return Fraction_Numerator/Jet->M();
1605  }
1606 }
1607 //N number of hardest subjets involved
1608 //Type 0=Pt 1=E 2=M
1609 // Add TRUE: Add 1 to Nth hardest subjets together/total jet False: Nth hardest Jet/toal jet
1610 //Loss TRUE: Jet-Subjet(s)/Jet FALSE: Subjet(s)/Jet
1611 
1612 
1613 //----------------------------------------------------------------------
1615  AliJetContainer *JetCont = GetJetContainer(JetContNb);
1616  AliEmcalJet *SubJet=NULL;
1617  Double_t DeltaR1=0;
1618  Double_t DeltaR2=0;
1619  AliVParticle *JetParticle=0x0;
1620  Double_t SubJetiness_Numerator = 0;
1621  Double_t SubJetiness_Denominator = 0;
1622  Double_t Index=-2;
1623  Bool_t Error=kFALSE;
1624  // JetRadius=TMath::Sqrt((Jet->Area()/TMath::Pi())); //comment out later
1625  if (!Jet->GetNumberOfTracks()) return -2;
1626  if (Reclusterer->GetNumberOfJets() < N) return -2;
1627  for (Int_t i=0; i< Jet->GetNumberOfTracks(); i++){ //loops through all tracks (particles in the jet
1628  JetParticle = static_cast<AliVParticle*>(Jet->TrackAt(i, JetCont->GetParticleContainer()->GetArray()));
1629  for (Int_t j=1; j<=N; j++){
1630  Index=SubJetOrdering(Jet,Reclusterer,j,0,kTRUE);
1631  if(Index==-999){
1632  Error = kTRUE;
1633  i=Jet->GetNumberOfTracks();
1634  break;
1635  }
1636  if(j==1){
1637  DeltaR1=TMath::Power((Reclusterer->GetJet(Index)->Pt()),A)*TMath::Power((TMath::Sqrt((((JetParticle->Eta())-(Reclusterer->GetJet(Index)->Eta()))*((JetParticle->Eta())- (Reclusterer->GetJet(Index)->Eta())))+((RelativePhi((Reclusterer->GetJet(Index)->Phi()),JetParticle->Phi()))*(RelativePhi((Reclusterer->GetJet(Index)->Phi()),JetParticle->Phi()))))),B);
1638  }
1639  else{
1640  DeltaR2=TMath::Power((Reclusterer->GetJet(Index)->Pt()),A)*TMath::Power((TMath::Sqrt((((JetParticle->Eta())-(Reclusterer->GetJet(Index)->Eta()))*((JetParticle->Eta())- (Reclusterer->GetJet(Index)->Eta())))+((RelativePhi((Reclusterer->GetJet(Index)->Phi()),JetParticle->Phi()))*(RelativePhi((Reclusterer->GetJet(Index)->Phi()),JetParticle->Phi()))))),B);
1641  if (DeltaR2<DeltaR1) DeltaR1=DeltaR2;
1642  }
1643  }
1644  SubJetiness_Numerator=SubJetiness_Numerator+(JetParticle->Pt()*DeltaR1);
1645  if (A>=0) SubJetiness_Denominator=SubJetiness_Denominator+(TMath::Power((Reclusterer->GetJet(SubJetOrdering(Jet,Reclusterer,1,0,kTRUE))->Pt()),A)*JetParticle->Pt()*TMath::Power(JetRadius,B));
1646  else SubJetiness_Denominator=SubJetiness_Denominator+(TMath::Power((Reclusterer->GetJet(SubJetOrdering(Jet,Reclusterer,N,0,kTRUE))->Pt()),A)*JetParticle->Pt()*TMath::Power(JetRadius,B));
1647  }
1648  if (SubJetiness_Denominator!=0 && !Error){
1649  // if (SubJetiness_Numerator/SubJetiness_Denominator>1.0) cout << JetRadius<<endl;
1650  return SubJetiness_Numerator/SubJetiness_Denominator; }
1651  else return -2;
1652 }
1653 
1654 
1655 //______________________________________________________________________________________
1657 
1658  //WARNING!!! Only works for parent jets that are clustered with Anti-Kt! To change go to AliEmcalJetFinder.cxx and look at the Nsubjettiness() function
1659 
1660  //Algorithm==0 -> kt_axes;
1661  // Algorithm==1 -> ca_axes;
1662  //Algorithm==2 -> antikt_0p2_axes;
1663  //Algorithm==3 -> wta_kt_axes;
1664  //Algorithm==4 -> wta_ca_axes;
1665  //Algorithm==5 -> onepass_kt_axes;
1666  //Algorithm==6 -> onepass_ca_axes;
1667  //Algorithm==7 -> onepass_antikt_0p2_axes;
1668  //Algorithm==8 -> onepass_wta_kt_axes;
1669  //Algorithm==9 -> onepass_wta_ca_axes;
1670  //Algorithm==10 -> min_axes;
1671 
1672 
1673  //Option==0 returns Nsubjettiness Value
1674  //Option==1 && N==2 returns opening angle between two subjet axes(Delta R?)
1675  //Option==2 && N==2 returns Delta R
1676  //Option==3 returns first splitting distance for soft dropped jet
1677  //Option==4 returns Symmetry measure (Zg) for soft dropped jet
1678  //Option==5 returns Pt of Subjet1
1679  //Option==6 returns Pt of Subjet2
1680  //Options==7 trutns deltaR of subjets...Is this different to before??
1681  //Option==8 Subjet1 Leading track Pt
1682  //Option==9 Subjet1 Leading track Pt
1683  if (Jet->GetNumberOfTracks()>=N){
1684  if((fJetShapeSub==kDerivSub) && (JetContNb==0) && (N==1) && (Algorithm==0) && (Beta==1.0) && (Option==0)){
1687  }
1688  else if((fJetShapeSub==kDerivSub) && (JetContNb==0) && (N==2) && (Algorithm==0) && (Beta==1.0) && (Option==0)){
1691  }
1692  else if((fJetShapeSub==kDerivSub) && (JetContNb==0) && (N==3) && (Algorithm==0) && (Beta==1.0) && (Option==0)){
1695  }
1696  else if((fJetShapeSub==kDerivSub) && (JetContNb==0) && (N==2) && (Algorithm==0) && (Beta==1.0) && (Option==1)){
1699  }
1700  else{
1701  if (fJetShapeType != AliAnalysisTaskSubJetFraction::kGenOnTheFly) Algorithm=fReclusteringAlgorithm; //Lazy programming!! Change this later, just a quick fix for now...it stops you being able to fill tree with two different reclutering algorithms or change algortihm inside this .cxx (can only be changed via the external setter).
1702  AliJetContainer *JetCont = GetJetContainer(JetContNb);
1703  AliEmcalJetFinder *JetFinder=new AliEmcalJetFinder("Nsubjettiness");
1704  JetFinder->SetJetMaxEta(0.9-fJetRadius);
1705  JetFinder->SetRadius(fJetRadius);
1706  JetFinder->SetJetAlgorithm(0); //0 for anti-kt 1 for kt //this is for the JET!!!!!!!!!! Not the SubJets
1707  JetFinder->SetRecombSheme(0);
1708  JetFinder->SetJetMinPt(Jet->Pt());
1710  const AliVVertex *vert = InputEvent()->GetPrimaryVertex();
1711  Double_t dVtx[3]={vert->GetX(),vert->GetY(),vert->GetZ()};
1712  return JetFinder->Nsubjettiness(Jet,JetCont,dVtx,N,Algorithm,fSubJetRadius,Beta,Option,0,Beta_SD,ZCut);
1713  }
1714  else{
1715  Double_t dVtx[3]={1,1,1};
1716  if (!fNsubMeasure){
1717  return JetFinder->Nsubjettiness(Jet,JetCont,dVtx,N,Algorithm,fSubJetRadius,Beta,Option,0,Beta_SD,ZCut);
1718  }
1719  else{
1720  if (Option==3) return JetFinder->Nsubjettiness(Jet,JetCont,dVtx,N,Algorithm,fSubJetRadius,Beta,Option,0,Beta_SD,ZCut);
1721  else return JetFinder->Nsubjettiness(Jet,JetCont,dVtx,N,Algorithm,fSubJetRadius,Beta,Option,1);
1722  }
1723  }
1724  }
1725  }
1726  else return -2;
1727 }
1728 
1729 
1730 //________________________________________________________________________
1732  //
1733  // retrieve event objects
1734  //
1736  return kFALSE;
1737 
1738  return kTRUE;
1739 }
1740 
1741 
1742 //_______________________________________________________________________
1744 {
1745  // Called once at the end of the analysis.
1747 
1748  /*
1749  for (int i=1; i<=(XBinsJetPtSize)-1; i++){ //Rescales the fhJetPt Histograms according to the with of the variable bins and number of events
1750  fhJetPt->SetBinContent(i,((1.0/(XBinsJetPt[i]-XBinsJetPt[i-1]))*((fhJetPt->GetBinContent(i))*(1.0/(fhEventCounter->GetBinContent(1))))));
1751  fhSubJetPt->SetBinContent(i,((1.0/(XBinsJetPt[i]-XBinsJetPt[i-1]))*((fhSubJetPt->GetBinContent(i))*(1.0/(fhEventCounter->GetBinContent(5))))));
1752 
1753  //fhJetPt->SetBinContent(i,((1.0/(fhPt->GetBinWidth(i)))*((fhJetPt->GetBinContent(i))*(fhEventCounter->GetBinContent(1)))));
1754  // fhJetPt->SetBinContent(i,((1.0/((fhPt->GetLowEdge(i+1))-(fhJetPt->GetLowEdge(i))))*((fhPt->GetBinContent(i))*(fhEventCounter->GetBinContent(1)))));
1755  }
1756  for (int i=1; i<=(XBinsJetMassSize)-1; i++){ //Rescales the fhPt Histograms according to the with of the variable bins and number of events
1757  fhJetMass->SetBinContent(i,((1.0/(XBinsJetMass[i]-XBinsJetMass[i-1]))*((fhJetMass->GetBinContent(i))*(1.0/(fhEventCounter->GetBinContent(1))))));
1758  }
1759 
1760  fhJetPhi->Scale(Phi_Bins/((Phi_Up-Phi_Low)*((fhEventCounter->GetBinContent(1)))));
1761  fhJetEta->Scale(Eta_Bins/((Eta_Up-Eta_Low)*((fhEventCounter->GetBinContent(1)))));
1762  fhJetRadius->Scale(100/(fhEventCounter->GetBinContent(4))); //should this and JetAngularity be divided by Bin 1 or 4????
1763  fhNumberOfJetTracks->Scale(1.0/(fhEventCounter->GetBinContent(4)));
1764 
1765  fhJetCounter->Scale(1.0/(fhEventCounter->GetBinContent(1))); //is the first bin the correct one to look at?
1766 
1767 
1768  fhSubJetCounter->Scale(1.0/(fhEventCounter->GetBinContent(5)));
1769 
1770  */
1771  /*
1772 
1773  fhJetPt->Scale(1.0/(fhEventCounter->GetBinContent(1)));
1774  fhSubJetPt->Scale(1.0/(fhEventCounter->GetBinContent(5)));
1775  fhJetMass->Scale(1.0/(fhEventCounter->GetBinContent(1)));
1776  fhJetPhi->Scale(1.0/(fhEventCounter->GetBinContent(1)));
1777  fhJetEta->Scale(1.0/(fhEventCounter->GetBinContent(1)));
1778  fhJetRadius->Scale(1.0/(fhEventCounter->GetBinContent(4))); //should this and JetAngularity be divided by Bin 1 or 4????
1779  fhNumberOfJetTracks->Scale(1.0/(fhEventCounter->GetBinContent(4)));
1780  fhJetCounter->Scale(1.0/(fhEventCounter->GetBinContent(1))); //is the first bin the correct one to look at?
1781  fhSubJetCounter->Scale(1.0/(fhEventCounter->GetBinContent(5)));
1782  */
1783  }
1784 
1785 }
void SetRadius(Double_t val)
Double_t Area() const
Definition: AliEmcalJet.h:123
double Double_t
Definition: External.C:58
Double_t XBinsPtSize
void SetJetMinPt(Double_t val)
static Double_t DeltaPhi(Double_t phia, Double_t phib, Double_t rMin=-TMath::Pi()/2, Double_t rMax=3 *TMath::Pi()/2)
Definition: External.C:236
AliEmcalJet * ClosestJet() const
Definition: AliEmcalJet.h:221
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.
AliJetContainer * GetJetContainer(Int_t i=0) const
Double_t Eta() const
Definition: AliEmcalJet.h:114
Double_t Phi() const
Definition: AliEmcalJet.h:110
Container with name, TClonesArray and cuts for particles.
Double_t PTD(AliEmcalJet *Jet, Int_t JetContNb)
Bool_t RetrieveEventObjects()
Retrieve common objects from event.
Double_t fEPV0
!event plane V0
Int_t GetLabel() const
Definition: AliEmcalJet.h:117
Double_t GetFirstOrderSubtracted2subjettiness_kt() const
Double_t NSubJettiness(AliEmcalJet *Jet, Int_t JetContNb, Double_t JetRadius, AliEmcalJetFinder *Reclusterer, Int_t N, Int_t A, Int_t B)
Double_t GetFirstOrderSubtractedOpeningAngle_kt() const
Double_t Nsubjettiness(AliEmcalJet *pJet, AliJetContainer *pContJets, Double_t dVtx[3], Int_t N, Int_t Algorithm, Double_t Radius, Double_t Beta, Int_t Option=0, Int_t Measure=0, Double_t Beta_SD=0, Double_t ZCut=0.1)
Double_t RelativePhi(Double_t Phi1, Double_t Phi2)
Double_t E() const
Definition: AliEmcalJet.h:112
Bool_t FillHistograms()
Function filling histograms.
Container for particles within the EMCAL framework.
Double_t XBinsJetMass[28]
Int_t TrackAt(Int_t idx) const
Definition: AliEmcalJet.h:153
UShort_t GetNumberOfTracks() const
Definition: AliEmcalJet.h:132
Double_t GetFirstOrderSubtracted3subjettiness_kt() const
TString kData
Declare data MC or deltaAOD.
Double_t GetSecondOrderSubtracted2subjettiness_kt() const
AliParticleContainer * GetParticleContainer(Int_t i=0) const
Get particle container attached to this task.
AliParticleContainer * GetParticleContainer() const
void SetRecombSheme(Int_t val)
void SetJetAlgorithm(Int_t val)
int Int_t
Definition: External.C:63
AliVParticle * GetLeadingTrack(TClonesArray *tracks) const
Double_t fjNSubJettiness(AliEmcalJet *Jet, Int_t JetContNb, Int_t N, Int_t Algorithm, Double_t Beta, Int_t Option=0, Double_t Beta_SD=0, Double_t ZCut=0.1)
ClassImp(AliAnalysisTaskSubJetFraction) AliAnalysisTaskSubJetFraction
float Float_t
Definition: External.C:68
Int_t GetNJets() const
Int_t SelectTriggerHadron(Float_t PtMin, Float_t PtMax)
Definition: External.C:228
Definition: External.C:212
virtual AliVParticle * GetAcceptParticle(Int_t i=-1) const
Definition: Option.C:68
Double_t fCent
!event centrality
Double_t SubJetFraction(AliEmcalJet *Jet, AliEmcalJetFinder *Reclusterer, Int_t N, Int_t Type, Bool_t Add, Bool_t Loss)
void SetJetMaxEta(Double_t val)
AliEmcalJet * GetNextAcceptJet()
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)
AliEmcalJetFinder * Recluster(AliEmcalJet *Jet, Int_t JetContNb, Double_t SubJetRadius, Double_t SubJetMinPt, Int_t Algorithm, const char *Name)
AliEmcalJet * GetJet(Int_t index)
Double_t Pt() const
Definition: AliEmcalJet.h:102
Double_t GetRhoVal(Int_t i=0) const
Double_t XBinsPt[66]
AliEmcalList * fOutput
!output list
const Int_t nVar
AliTrackContainer * GetTrackContainer(Int_t i=0) const
void SetMakeGeneralHistograms(Bool_t g)
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:44
Double_t GetFirstOrderSubtracted1subjettiness_kt() const
Double_t Angularity(AliEmcalJet *Jet, Int_t JetContNb)
const char Option_t
Definition: External.C:48
Double_t RelativePhiEventPlane(Double_t EventPlane, Double_t Phi)
void UserCreateOutputObjects()
Main initialization function on the worker.
bool Bool_t
Definition: External.C:53
Double_t SubJetOrdering(AliEmcalJet *Jet, AliEmcalJetFinder *Reclusterer, Int_t N, Int_t Type, Bool_t Index)
AliEmcalJetShapeProperties * GetShapeProperties() const
Definition: AliEmcalJet.h:255
Double_t GetSecondOrderSubtracted3subjettiness_kt() const
Double_t XBinsJetPt[35]
Double_t M() const
Definition: AliEmcalJet.h:113
Double_t GetSecondOrderSubtracted1subjettiness_kt() const
Container for jet within the EMCAL jet framework.
Double_t GetSecondOrderSubtractedOpeningAngle_kt() const
AliEmcalJet * GetJet(Int_t i) const