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