AliPhysics  a34469b (a34469b)
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
AliAnalysisTaskChargedJetsHadronCF.cxx
Go to the documentation of this file.
1 /**************************************************************************
2  * Copyright(c) 1998-2016, ALICE Experiment at CERN, All rights reserved. *
3  * *
4  * Author: R. Haake. *
5  * Contributors are mentioned in the code where appropriate. *
6  * *
7  * Permission to use, copy, modify and distribute this software and its *
8  * documentation strictly for non-commercial purposes is hereby granted *
9  * without fee, provided that the above copyright notice appears in all *
10  * copies and that both the copyright notice and this permission notice *
11  * appear in the supporting documentation. The authors make no claims *
12  * about the suitability of this software for any purpose. It is *
13  * provided "as is" without express or implied warranty. *
14  **************************************************************************/
15 
16 #include <algorithm>
17 #include <vector>
18 #include <TClonesArray.h>
19 #include <TF1.h>
20 #include <TH1F.h>
21 #include <TH2F.h>
22 #include <TH3F.h>
23 #include <THn.h>
24 #include <TTree.h>
25 #include <TList.h>
26 #include <TLorentzVector.h>
27 
28 #include "AliEmcalPythiaInfo.h"
29 
30 #include "AliVTrack.h"
31 #include "AliVHeader.h"
32 #include "AliEmcalJet.h"
33 #include "AliRhoParameter.h"
34 #include "AliLog.h"
35 #include "AliJetContainer.h"
36 #include "AliTrackContainer.h"
37 #include "AliAODTrack.h"
38 #include "AliPicoTrack.h"
39 #include "AliVParticle.h"
40 #include "TRandom3.h"
42 
44 
48 //________________________________________________________________________
50 {
51 // dummy destructor
52 }
53 
57 //________________________________________________________________________
59 {
60 // dummy destructor
61 }
62 
66 //________________________________________________________________________
69  fJetsCont(0),
70  fTracksCont(0),
71  fJetsTree(0),
72  fJetsTreeBuffer(0),
73  fExtractionPercentage(0),
74  fExtractionMinPt(0),
75  fExtractionMaxPt(0),
76  fEventExtractionPercentage(0),
77  fEventExtractionMinJetPt(0),
78  fEventExtractionMaxJetPt(0),
79  fConstPtFilterBit(1024),
80  fNumberOfCentralityBins(10),
81  fJetsOutput(),
82  fTracksOutput(),
83  fJetParticleArrayName("JetsDPhiBasicParticles"),
84  fTrackParticleArrayName(""),
85  fJetMatchingArray(),
86  fJetMatchingArrayName(""),
87  fJetMatchingMaxDistance(0.3),
88  fJetMatchingMinSharedFraction(0.5),
89  fJetMatchingMaxSharedFraction(1.5),
90  fJetMatchingMaxEmbeddingOffset(20.),
91  fJetMatchingMinPt(0.0),
92  fJetMatchingMaxPt(999.0),
93  fJetMatchingUseOnlyNLeading(0),
94  fJetVetoArray(),
95  fJetVetoArrayName(""),
96  fJetVetoMinPt(0),
97  fJetVetoMaxPt(0),
98  fJetVetoJetByJet(0),
99  fMatchedJets(),
100  fRandom(0),
101  fJetOutputMode(0),
102  fMinFakeFactorPercentage(0),
103  fMaxFakeFactorPercentage(0),
104  fPythiaExtractionMode(0),
105  fEventCriteriumMode(0),
106  fEventCriteriumMinBackground(0),
107  fEventCriteriumMaxBackground(0),
108  fEventCriteriumMinLeadingJetPt(0),
109  fEventCriteriumMinSubleadingJetPt(0),
110  fEventCriteriumMinJetDeltaPhi(0),
111  fLeadingJet(0),
112  fSubleadingJet(0),
113  fInitialPartonMatchedJet1(0),
114  fInitialPartonMatchedJet2(0),
115  fAcceptedJets(0),
116  fAcceptedTracks(0)
117 {
118  // Default constructor.
119  SetMakeGeneralHistograms(kTRUE);
120  fRandom = new TRandom3(0);
121 }
122 
123 
124 //________________________________________________________________________
126  AliAnalysisTaskEmcalJet(name, kTRUE),
127  fJetsCont(0),
128  fTracksCont(0),
129  fJetsTree(0),
130  fJetsTreeBuffer(0),
131  fExtractionPercentage(0),
132  fExtractionMinPt(0),
133  fExtractionMaxPt(0),
134  fEventExtractionPercentage(0),
135  fEventExtractionMinJetPt(0),
136  fEventExtractionMaxJetPt(0),
137  fConstPtFilterBit(1024),
138  fNumberOfCentralityBins(10),
139  fJetsOutput(),
140  fTracksOutput(),
141  fJetParticleArrayName("JetsDPhiBasicParticles"),
142  fTrackParticleArrayName(""),
143  fJetMatchingArray(),
144  fJetMatchingArrayName(""),
145  fJetMatchingMaxDistance(0.3),
146  fJetMatchingMinSharedFraction(0.5),
147  fJetMatchingMaxSharedFraction(1.5),
148  fJetMatchingMaxEmbeddingOffset(20.),
149  fJetMatchingMinPt(0.0),
150  fJetMatchingMaxPt(999.0),
151  fJetMatchingUseOnlyNLeading(0),
152  fJetVetoArray(),
153  fJetVetoArrayName(""),
154  fJetVetoMinPt(0),
155  fJetVetoMaxPt(0),
156  fJetVetoJetByJet(0),
157  fMatchedJets(),
158  fRandom(0),
159  fJetOutputMode(0),
160  fMinFakeFactorPercentage(0),
161  fMaxFakeFactorPercentage(0),
162  fPythiaExtractionMode(0),
163  fEventCriteriumMode(0),
164  fEventCriteriumMinBackground(0),
165  fEventCriteriumMaxBackground(0),
166  fEventCriteriumMinLeadingJetPt(0),
167  fEventCriteriumMinSubleadingJetPt(0),
168  fEventCriteriumMinJetDeltaPhi(0),
169  fLeadingJet(0),
170  fSubleadingJet(0),
171  fInitialPartonMatchedJet1(0),
172  fInitialPartonMatchedJet2(0),
173  fAcceptedJets(0),
174  fAcceptedTracks(0)
175 {
176  // Constructor
178  fRandom = new TRandom3(0);
179 }
180 
181 //________________________________________________________________________
183 {
184  // Destructor.
185 }
186 
187 //________________________________________________________________________
189 {
191 
192  // ### Basic container settings
194  if(fJetsCont) { //get particles connected to jets
195  fJetsCont->PrintCuts();
197  } else { //no jets, just analysis tracks
199  }
200  if(fTracksCont) fTracksCont->SetClassName("AliVTrack");
201 
202  // ### Create all histograms
203 
204  // Change the event rejection histogram -> Add a custom value
205  fHistEventRejection->GetXaxis()->SetBinLabel(14,"JetCrit");
206  fHistEventRejection->GetXaxis()->SetBinLabel(15,"JetVeto");
207 
208  // Track QA plots
209  AddHistogram2D<TH2D>("hTrackPt", "Tracks p_{T} distribution", "", 300, 0., 300., fNumberOfCentralityBins, 0, 100, "p_{T} (GeV/c)", "Centrality", "dN^{Tracks}/dp_{T}");
210  AddHistogram2D<TH2D>("hTrackPhi", "Track angular distribution in #phi", "LEGO2", 180, 0., 2*TMath::Pi(), fNumberOfCentralityBins, 0, 100, "#phi", "Centrality", "dN^{Tracks}/(d#phi)");
211  AddHistogram2D<TH2D>("hTrackEta", "Track angular distribution in #eta", "LEGO2", 100, -2.5, 2.5, fNumberOfCentralityBins, 0, 100, "#eta", "Centrality", "dN^{Tracks}/(d#eta)");
212  AddHistogram2D<TH2D>("hTrackPhiEta", "Track angular distribution #phi/#eta", "COLZ", 180, 0., 2*TMath::Pi(), 100, -2.5, 2.5, "#phi", "#eta", "dN^{Tracks}/d#phi d#eta");
213 
214  AddHistogram2D<TH2D>("hLeadingTrackPt", "Leading tracks p_{T} distribution", "", 300, 0., 300., fNumberOfCentralityBins, 0, 100, "p_{T} (GeV/c)", "Centrality", "dN^{Tracks}/dp_{T}");
215  AddHistogram2D<TH2D>("hLeadingTrackPhi", "Leading tracks angular distribution in #phi", "LEGO2", 180, 0., 2*TMath::Pi(), fNumberOfCentralityBins, 0, 100, "#phi", "Centrality", "dN^{Tracks}/(d#phi)");
216  AddHistogram2D<TH2D>("hLeadingTrackEta", "Leading tracks angular distribution in #eta", "LEGO2", 100, -2.5, 2.5, fNumberOfCentralityBins, 0, 100, "#eta", "Centrality", "dN^{Tracks}/(d#eta)");
217  AddHistogram2D<TH2D>("hLeadingTrackPhiEta", "Track angular distribution #phi/#eta", "COLZ", 180, 0., 2*TMath::Pi(), 100, -2.5, 2.5, "#phi", "#eta", "dN^{Tracks}/d#phi d#eta");
218 
219  AddHistogram2D<TH2D>("hTrackEtaPt", "Track angular distribution in #eta vs. p_{T}", "LEGO2", 100, -2.5, 2.5, 300, 0., 300., "#eta", "p_{T} (GeV/c)", "dN^{Tracks}/(d#eta dp_{T})");
220  AddHistogram2D<TH2D>("hTrackPhiPt", "Track angular distribution in #phi vs. p_{T}", "LEGO2", 180, 0, 2*TMath::Pi(), 300, 0., 300., "#phi", "p_{T} (GeV/c)", "dN^{Tracks}/(d#phi dp_{T})");
221 
222 
223  // Jet QA plots
224  AddHistogram2D<TH2D>("hJetPtRaw", "Jets p_{T} distribution (no bgrd. corr.)", "", 300, 0., 300., fNumberOfCentralityBins, 0, 100, "p_{T, jet} (GeV/c)", "Centrality", "dN^{Jets}/dp_{T}");
225  AddHistogram2D<TH2D>("hJetPt", "Jets p_{T} distribution (background subtracted)", "", 400, -100., 300., fNumberOfCentralityBins, 0, 100, "p_{T, jet} (GeV/c)", "Centrality", "dN^{Jets}/dp_{T}");
226  AddHistogram2D<TH2D>("hJetPhi", "Jet angular distribution #phi", "LEGO2", 180, 0., 2*TMath::Pi(), fNumberOfCentralityBins, 0, 100, "#phi", "Centrality", "dN^{Jets}/d#phi");
227  AddHistogram2D<TH2D>("hJetEta", "Jet angular distribution #eta", "LEGO2", 100, -2.5, 2.5, fNumberOfCentralityBins, 0, 100, "#eta","Centrality","dN^{Jets}/d#eta");
228  AddHistogram2D<TH2D>("hJetPhiPt", "Jet angular distribution #phi vs. p_{T}", "LEGO2", 180, 0., 2*TMath::Pi(), 400, -100., 300., "#phi", "p_{T, jet} (GeV/c)", "dN^{Jets}/d#phi dp_{T}");
229  AddHistogram2D<TH2D>("hJetEtaPt", "Jet angular distribution #eta vs. p_{T}", "LEGO2", 100, -2.5, 2.5, 400, -100., 300., "#eta","p_{T, jet} (GeV/c)","dN^{Jets}/d#eta dp_{T}");
230  AddHistogram2D<TH2D>("hJetPhiEta", "Jet angular distribution #phi/#eta", "COLZ", 180, 0., 2*TMath::Pi(), 100, -2.5, 2.5, "#phi", "#eta", "dN^{Jets}/d#phi d#eta");
231  AddHistogram2D<TH2D>("hJetArea", "Jet area", "LEGO2", 200, 0., 2., fNumberOfCentralityBins, 0, 100, "Jet A", "Centrality", "dN^{Jets}/dA");
232  AddHistogram2D<TH2D>("hJetAreaPt", "Jet area vs. p_{T}", "LEGO2", 200, 0., 2., 400, -100., 300., "Jet A", "p_{T, jet} (GeV/c)", "dN^{Jets}/dA dp_{T}");
233  AddHistogram2D<TH2D>("hJetPtLeadingHadron", "Jet leading hadron p_{T} distribution vs. jet p_{T}", "", 300, 0., 300., 300, 0., 300., "p_{T, jet} (GeV/c)", "p_{T,lead had} (GeV/c)", "dN^{Jets}/dp_{T}dp_{T,had}");
234 
235  AddHistogram2D<TH2D>("hJetConstituentPt_Cent0_100", "Jet constituent p_{T} distribution vs. jet p_T (background subtracted)", "", 400, -100., 300., 300, 0., 300., "p_{T, jet} (GeV/c)", "p_{T, track} (GeV/c)", "dN^{Tracks}/d^{2}p_{T}");
236  AddHistogram2D<TH2D>("hJetConstituentPt_Cent0_10", "Jet constituent p_{T} distribution vs. jet p_T (background subtracted), 0-10 centrality", "", 400, -100., 300., 300, 0., 300., "p_{T, jet} (GeV/c)", "p_{T, track} (GeV/c)", "dN^{Tracks}/d^{2}p_{T}");
237  AddHistogram2D<TH2D>("hJetConstituentPt_Cent10_30", "Jet constituent p_{T} distribution vs. jet p_T (background subtracted), 10-30 centrality", "", 400, -100., 300., 300, 0., 300., "p_{T, jet} (GeV/c)", "p_{T, track} (GeV/c)", "dN^{Tracks}/d^{2}p_{T}");
238  AddHistogram2D<TH2D>("hJetConstituentPt_Cent30_50", "Jet constituent p_{T} distribution vs. jet p_T (background subtracted), 30-50 centrality", "", 400, -100., 300., 300, 0., 300., "p_{T, jet} (GeV/c)", "p_{T, track} (GeV/c)", "dN^{Tracks}/d^{2}p_{T}");
239  AddHistogram2D<TH2D>("hJetConstituentPt_Cent50_90", "Jet constituent p_{T} distribution vs. jet p_T (background subtracted), 50-90 centrality", "", 400, -100., 300., 300, 0., 300., "p_{T, jet} (GeV/c)", "p_{T, track} (GeV/c)", "dN^{Tracks}/d^{2}p_{T}");
240 
241 
242  AddHistogram2D<TH2D>(Form("hJetConstituentPt_Cent0_100_FilterBit%i", fConstPtFilterBit), "Jet constituent p_{T} distribution vs. jet p_T (background subtracted)", "", 400, -100., 300., 300, 0., 300., "p_{T, jet} (GeV/c)", "p_{T, track} (GeV/c)", "dN^{Tracks}/d^{2}p_{T}");
243  AddHistogram2D<TH2D>(Form("hJetConstituentPt_Cent0_10_FilterBit%i", fConstPtFilterBit), "Jet constituent p_{T} distribution vs. jet p_T (background subtracted), 0-10 centrality", "", 400, -100., 300., 300, 0., 300., "p_{T, jet} (GeV/c)", "p_{T, track} (GeV/c)", "dN^{Tracks}/d^{2}p_{T}");
244  AddHistogram2D<TH2D>(Form("hJetConstituentPt_Cent10_30_FilterBit%i", fConstPtFilterBit), "Jet constituent p_{T} distribution vs. jet p_T (background subtracted), 10-30 centrality", "", 400, -100., 300., 300, 0., 300., "p_{T, jet} (GeV/c)", "p_{T, track} (GeV/c)", "dN^{Tracks}/d^{2}p_{T}");
245  AddHistogram2D<TH2D>(Form("hJetConstituentPt_Cent30_50_FilterBit%i", fConstPtFilterBit), "Jet constituent p_{T} distribution vs. jet p_T (background subtracted), 30-50 centrality", "", 400, -100., 300., 300, 0., 300., "p_{T, jet} (GeV/c)", "p_{T, track} (GeV/c)", "dN^{Tracks}/d^{2}p_{T}");
246  AddHistogram2D<TH2D>(Form("hJetConstituentPt_Cent50_90_FilterBit%i", fConstPtFilterBit), "Jet constituent p_{T} distribution vs. jet p_T (background subtracted), 50-90 centrality", "", 400, -100., 300., 300, 0., 300., "p_{T, jet} (GeV/c)", "p_{T, track} (GeV/c)", "dN^{Tracks}/d^{2}p_{T}");
247 
248 
249  AddHistogram2D<TH2D>("hJetConstituentCount_Cent0_100", "Jet constituent count vs. jet p_T (background subtracted)", "", 400, -100., 300., 200, 0., 200., "p_{T, jet} (GeV/c)", "Count", "dN^{Jets}/dNdp_{T}");
250  AddHistogram2D<TH2D>("hJetConstituentCount_Cent0_10", "Jet constituent count vs. jet p_T (background subtracted), 0-10 centrality", "", 400, -100., 300., 200, 0., 200., "p_{T, jet} (GeV/c)", "Count", "dN^{Jets}/dNdp_{T}");
251 
252  // Embedding plots
253  if(fJetOutputMode == 4 || fJetOutputMode == 5)
254  {
255  if(fJetVetoJetByJet)
256  AddHistogram1D<TH1D>("hJetVeto", "Number of vetoed/accepted jets", "e1p", 2, 0., 2., "Accepted/Vetoed", "dN^{Events}/dN^{veto}");
257 
258  AddHistogram2D<TH2D>("hEmbeddingDeltaR", "Matched jet #Delta R distribution", "", 200, -50., 150., 100, 0, 1.0, "p_{T, jet} (GeV/c)", "#Delta R", "dN^{Matched}/dp_{T}dR");
259  AddHistogram2D<TH2D>("hEmbeddingDeltaEta", "Matched jet #Delta #eta distribution", "", 200, -50., 150., 100, -1.0, 1.0, "p_{T, jet} (GeV/c)", "#Delta #eta", "dN^{Matched}/dp_{T}d#eta");
260  AddHistogram2D<TH2D>("hEmbeddingDeltaPhi", "Matched jet #Delta #phi distribution", "", 200, -50., 150., 100, -1.0, 1.0, "p_{T, jet} (GeV/c)", "#Delta #phi", "dN^{Matched}/dp_{T}d#phi");
261  AddHistogram3D<TH3D>("hEmbeddingPtCorr010", "Matched jet p_{T} distributions (0-10%% centrality)", "", 150, 0., 150., 150, 0., 150., 100, 0., 1., "p_{T, MC jet} (GeV/c)", "p_{T, emb} (GeV/c)", "% MC");
262  AddHistogram3D<TH3D>("hEmbeddingPtCorr1030", "Matched jet p_{T} distributions (10-30%% centrality)", "", 150, 0., 150., 150, 0., 150., 100, 0., 1., "p_{T, MC jet} (GeV/c)", "p_{T, emb} (GeV/c)", "% MC");
263  AddHistogram3D<TH3D>("hEmbeddingPtCorr3050", "Matched jet p_{T} distributions (30-50%% centrality)", "", 150, 0., 150., 150, 0., 150., 100, 0., 1., "p_{T, MC jet} (GeV/c)", "p_{T, emb} (GeV/c)", "% MC");
264  AddHistogram3D<TH3D>("hEmbeddingPtCorr5090", "Matched jet p_{T} distributions (50-90%% centrality)", "", 150, 0., 150., 150, 0., 150., 100, 0., 1., "p_{T, MC jet} (GeV/c)", "p_{T, emb} (GeV/c)", "% MC");
265 
266  AddHistogram3D<TH3D>("hEmbeddingPtCorrPt010", "Matched jet p_{T} distributions (0-10%% centrality)", "", 150, 0., 150., 150, 0., 150., 100, 0., 1., "p_{T, MC jet} (GeV/c)", "p_{T, emb} (GeV/c)", "% MC p_{T}");
267  AddHistogram3D<TH3D>("hEmbeddingPtCorrPt1030", "Matched jet p_{T} distributions (10-30%% centrality)", "", 150, 0., 150., 150, 0., 150., 100, 0., 1., "p_{T, MC jet} (GeV/c)", "p_{T, emb} (GeV/c)", "% MC p_{T}");
268  AddHistogram3D<TH3D>("hEmbeddingPtCorrPt3050", "Matched jet p_{T} distributions (30-50%% centrality)", "", 150, 0., 150., 150, 0., 150., 100, 0., 1., "p_{T, MC jet} (GeV/c)", "p_{T, emb} (GeV/c)", "% MC p_{T}");
269  AddHistogram3D<TH3D>("hEmbeddingPtCorrPt5090", "Matched jet p_{T} distributions (50-90%% centrality)", "", 150, 0., 150., 150, 0., 150., 100, 0., 1., "p_{T, MC jet} (GeV/c)", "p_{T, emb} (GeV/c)", "% MC p_{T}");
270 
271  AddHistogram1D<TH1D>("hEmbeddingJetPt", "Embedded jets p_{T} distribution", "", 200, -50., 150., "p_{T, jet} (GeV/c)", "dN/dp_{T}");
272  AddHistogram2D<TH2D>("hEmbeddingJetPhiEta", "Embedded jet angular distribution #phi/#eta", "COLZ", 180, 0., 2*TMath::Pi(), 100, -2.5, 2.5, "#phi", "#eta", "dN^{Jets}/d#phi d#eta");
273  }
274 
275  // Random cone plots
276  AddHistogram2D<TH2D>("hRandomConePt", "Random cone p_{T} distribution", "", 400, -100., 300., fNumberOfCentralityBins, 0, 100, "p_{T, cone} (GeV/c)", "Centrality", "dN^{Tracks}/dp_{T}");
277  AddHistogram2D<TH2D>("hRandomConePtCut3GeV", "Random cone p_{T} distribution, cut p_{T} > 3 GeV/c", "", 400, -100., 300., fNumberOfCentralityBins, 0, 100, "p_{T, cone} (GeV/c)", "Centrality", "dN^{Tracks}/dp_{T}");
278  AddHistogram2D<TH2D>("hRandomConeRawPt", "Random cone p_{T} distribution (no bgrd. correction)", "", 300, 0., 300., fNumberOfCentralityBins, 0, 100, "p_{T, cone} (GeV/c)", "Centrality", "dN^{Tracks}/dp_{T}");
279  AddHistogram2D<TH2D>("hRandomConeRawPtCut3GeV", "Random cone p_{T} distribution (no bgrd. correction), cut p_{T} > 3 GeV/c", "", 300, 0., 300., fNumberOfCentralityBins, 0, 100, "p_{T, cone} (GeV/c)", "Centrality", "dN^{Tracks}/dp_{T}");
280 
281  // Leading/subleading, background ...
282 
283  AddHistogram2D<TH2D>("hLeadingJetPtRaw", "Jets p_{T} distribution (no bgrd. corr.)", "", 300, 0., 300., fNumberOfCentralityBins, 0, 100, "p_{T, jet} (GeV/c)", "Centrality", "dN^{Jets}/dp_{T}");
284  AddHistogram2D<TH2D>("hLeadingJetPt", "Jets p_{T} distribution (background subtracted)", "", 400, -100., 300., fNumberOfCentralityBins, 0, 100, "p_{T, jet} (GeV/c)", "Centrality", "dN^{Jets}/dp_{T}");
285  AddHistogram2D<TH2D>("hLeadingJetPhi", "Jet angular distribution #phi", "LEGO2", 180, 0., 2*TMath::Pi(), fNumberOfCentralityBins, 0, 100, "#phi", "Centrality", "dN^{Jets}/d#phi");
286  AddHistogram2D<TH2D>("hLeadingJetEta", "Jet angular distribution #eta", "LEGO2", 100, -2.5, 2.5, fNumberOfCentralityBins, 0, 100, "#eta","Centrality","dN^{Jets}/d#eta");
287  AddHistogram2D<TH2D>("hLeadingJetPhiPt", "Jet angular distribution #phi vs. p_{T}", "LEGO2", 180, 0., 2*TMath::Pi(), 400, -100., 300., "#phi", "p_{T, jet} (GeV/c)", "dN^{Jets}/d#phi dp_{T}");
288  AddHistogram2D<TH2D>("hLeadingJetEtaPt", "Jet angular distribution #eta vs. p_{T}", "LEGO2", 100, -2.5, 2.5, 400, -100., 300., "#eta","p_{T, jet} (GeV/c)","dN^{Jets}/d#eta dp_{T}");
289  AddHistogram2D<TH2D>("hLeadingJetPhiEta", "Jet angular distribution #phi/#eta", "COLZ", 180, 0., 2*TMath::Pi(), 100, -2.5, 2.5, "#phi", "#eta", "dN^{Jets}/d#phi d#eta");
290  AddHistogram2D<TH2D>("hLeadingJetArea", "Jet area", "LEGO2", 200, 0., 2., fNumberOfCentralityBins, 0, 100, "Jet A", "Centrality", "dN^{Jets}/dA");
291  AddHistogram2D<TH2D>("hLeadingJetAreaPt", "Jet area vs. p_{T}", "LEGO2", 200, 0., 2., 400, -100., 300., "Jet A", "p_{T, jet} (GeV/c)", "dN^{Jets}/dA dp_{T}");
292  AddHistogram2D<TH2D>("hLeadingJetPtLeadingHadron", "Jet leading hadron p_{T} distribution vs. jet p_{T}", "", 300, 0., 300., 300, 0., 300., "p_{T, jet} (GeV/c)", "p_{T,lead had} (GeV/c)", "dN^{Jets}/dp_{T}dp_{T,had}");
293 
294  AddHistogram2D<TH2D>("hSubleadingJetPtRaw", "Jets p_{T} distribution (no bgrd. corr.)", "", 300, 0., 300., fNumberOfCentralityBins, 0, 100, "p_{T, jet} (GeV/c)", "Centrality", "dN^{Jets}/dp_{T}");
295  AddHistogram2D<TH2D>("hSubleadingJetPt", "Jets p_{T} distribution (background subtracted)", "", 400, -100., 300., fNumberOfCentralityBins, 0, 100, "p_{T, jet} (GeV/c)", "Centrality", "dN^{Jets}/dp_{T}");
296  AddHistogram2D<TH2D>("hSubleadingJetPhi", "Jet angular distribution #phi", "LEGO2", 180, 0., 2*TMath::Pi(), fNumberOfCentralityBins, 0, 100, "#phi", "Centrality", "dN^{Jets}/d#phi");
297  AddHistogram2D<TH2D>("hSubleadingJetEta", "Jet angular distribution #eta", "LEGO2", 100, -2.5, 2.5, fNumberOfCentralityBins, 0, 100, "#eta","Centrality","dN^{Jets}/d#eta");
298  AddHistogram2D<TH2D>("hSubleadingJetPhiPt", "Jet angular distribution #phi vs. p_{T}", "LEGO2", 180, 0., 2*TMath::Pi(), 400, -100., 300., "#phi", "p_{T, jet} (GeV/c)", "dN^{Jets}/d#phi dp_{T}");
299  AddHistogram2D<TH2D>("hSubleadingJetEtaPt", "Jet angular distribution #eta vs. p_{T}", "LEGO2", 100, -2.5, 2.5, 400, -100., 300., "#eta","p_{T, jet} (GeV/c)","dN^{Jets}/d#eta dp_{T}");
300  AddHistogram2D<TH2D>("hSubleadingJetPhiEta", "Jet angular distribution #phi/#eta", "COLZ", 180, 0., 2*TMath::Pi(), 100, -2.5, 2.5, "#phi", "#eta", "dN^{Jets}/d#phi d#eta");
301  AddHistogram2D<TH2D>("hSubleadingJetArea", "Jet area", "LEGO2", 200, 0., 2., fNumberOfCentralityBins, 0, 100, "Jet A", "Centrality", "dN^{Jets}/dA");
302  AddHistogram2D<TH2D>("hSubleadingJetAreaPt", "Jet area vs. p_{T}", "LEGO2", 200, 0., 2., 400, -100., 300., "Jet A", "p_{T, jet} (GeV/c)", "dN^{Jets}/dA dp_{T}");
303  AddHistogram2D<TH2D>("hSubleadingJetPtLeadingHadron", "Jet leading hadron p_{T} distribution vs. jet p_{T}", "", 300, 0., 300., 300, 0., 300., "p_{T, jet} (GeV/c)", "p_{T,lead had} (GeV/c)", "dN^{Jets}/dp_{T}dp_{T,had}");
304 
305  AddHistogram2D<TH2D>("hTrackCount", "Number of tracks in acceptance vs. centrality", "LEGO2", 500, 0., 5000., fNumberOfCentralityBins, 0, 100, "N tracks","Centrality", "dN^{Events}/dN^{Tracks}");
306  AddHistogram2D<TH2D>("hJetCount", "Number of jets in acceptance vs. centrality", "LEGO2", 100, 0., 100., fNumberOfCentralityBins, 0, 100, "N Jets","Centrality", "dN^{Events}/dN^{Jets}");
307  AddHistogram2D<TH2D>("hFakeFactor", "Fake factor distribution", "LEGO2", 1000, 0., 100., fNumberOfCentralityBins, 0, 100, "Fake factor","Centrality", "dN^{Jets}/df");
308  AddHistogram2D<TH2D>("hFakeFactorJetPt_Cent0_100", "Fake factor distribution vs. jet p_{T}", "LEGO2", 1000, 0., 100., 400, -100., 300., "Fake factor","Jet p_{T} (GeV/c)", "dN^{Jets}/df");
309  AddHistogram2D<TH2D>("hFakeFactorJetPt_Cent0_10", "Fake factor distribution vs. jet p_{T}", "LEGO2", 1000, 0., 100., 400, -100., 300., "Fake factor","Jet p_{T} (GeV/c)", "dN^{Jets}/df");
310 
311  AddHistogram2D<TH2D>("hBackgroundPt", "Background p_{T} distribution", "", 150, 0., 150., fNumberOfCentralityBins, 0, 100, "Background p_{T} (GeV/c)", "Centrality", "dN^{Events}/dp_{T}");
312  AddHistogram2D<TH2D>("hBackgroundPtJetPt_Cent0_100", "Background p_{T} distribution vs. jet p_{T}", "", 150, 0., 150., 400, -100., 300., "Background p_{T} (GeV/c)", "Jet p_{T} (GeV/c)", "dN^{Events}/dp_{T}");
313  AddHistogram2D<TH2D>("hBackgroundPtJetPt_Cent0_10", "Background p_{T} distribution vs. jet p_{T}", "", 150, 0., 150., 400, -100., 300., "Background p_{T} (GeV/c)", "Jet p_{T} (GeV/c)", "dN^{Events}/dp_{T}");
314  AddHistogram2D<TH2D>("hBackgroundPtConstCount_Cent0_100", "Background p_{T} distribution vs. const. count", "", 150, 0., 150., 200, 0., 200., "Background p_{T} (GeV/c)", "Count", "dN^{Events}/dp_{T}");
315  AddHistogram2D<TH2D>("hBackgroundPtConstCount_Cent0_10", "Background p_{T} distribution vs. const. count", "", 150, 0., 150., 200, 0., 200., "Background p_{T} (GeV/c)", "Count", "dN^{Events}/dp_{T}");
316 
317  PostData(1, fOutput); // Post data for ALL output slots > 0 here.
318 }
319 
320 
321 //________________________________________________________________________
323 
325 
326  // ### Add the jets as basic correlation particles to the event
327  if (!(fInputEvent->FindListObject(Form("%s", fJetParticleArrayName.Data()))))
328  {
329  fJetsOutput = new TClonesArray("AliPicoTrack");
330  fJetsOutput->SetName(fJetParticleArrayName.Data());
331  fInputEvent->AddObject(fJetsOutput);
332  }
333  else
334  AliError(Form("%s: Object with name %s already in event!", GetName(), Form("%s", fJetParticleArrayName.Data())));
335 
336  // ### Add the tracks as basic correlation particles to the event (optional)
337  if(fTrackParticleArrayName != "")
338  {
339  if (!(fInputEvent->FindListObject(Form("%s", fTrackParticleArrayName.Data()))))
340  {
341  fTracksOutput = new TClonesArray("AliPicoTrack");
342  fTracksOutput->SetName(fTrackParticleArrayName.Data());
343  fInputEvent->AddObject(fTracksOutput);
344  }
345  else
346  AliError(Form("%s: Object with name %s already in event!", GetName(), Form("%s", fTrackParticleArrayName.Data())));
347  }
348 
349  // ### Import generated jets from toymodel for matching (optional)
350  if(fJetMatchingArrayName != "")
351  {
352  fJetMatchingArray = static_cast<TClonesArray*>(InputEvent()->FindListObject(Form("%s", fJetMatchingArrayName.Data())));
353  if(!fJetMatchingArray)
354  AliFatal(Form("Importing jets for matching failed! Array '%s' not found!", fJetMatchingArrayName.Data()));
355  }
356  else if(fJetOutputMode==4 || fJetOutputMode==5)
357  AliFatal(Form("fJetMatchingArrayName must be set in jet output mode 4 or 5."));
358 
359  // ### Import veto jets for matching (optional)
360  if(fJetVetoArrayName != "")
361  {
362  fJetVetoArray = static_cast<TClonesArray*>(InputEvent()->FindListObject(Form("%s", fJetVetoArrayName.Data())));
363  if(!fJetVetoArray)
364  AliFatal(Form("Importing jets for veto failed! Array '%s' not found!", fJetVetoArrayName.Data()));
365  }
366 
367  // ### Jets tree (optional)
369  {
370  fJetsTree = new TTree("ExtractedJets", "ExtractedJets");
371  fJetsTree->Branch("Jets", "AliBasicJet", &fJetsTreeBuffer, 1000);
372  fOutput->Add(fJetsTree);
373  }
374 
375 
376 }
377 
378 //________________________________________________________________________
380 {
381 
382  // In case of special selection criteria, trigger on certain events
383  if(fEventCriteriumMode==0) // "minimum bias"
384  {
385  // do nothing
386  }
387  else if(fEventCriteriumMode==1) // background constraints
388  {
390  {
391  fHistEventRejection->Fill("JetCrit", 1);
392  return kFALSE;
393  }
394  }
395  else if(fEventCriteriumMode==2) // Minimum leading jet pT
396  {
397  if(fLeadingJet)
398  {
400  {
401  fHistEventRejection->Fill("JetCrit", 1);
402  return kFALSE;
403  }
404  }
405  }
406  else if(fEventCriteriumMode==3) // Simple dijet trigger
407  {
409  {
412  {
413  fHistEventRejection->Fill("JetCrit", 1);
414  return kFALSE;
415  }
416  else // dijet pT fulfilled, check back-to-back criterium
417  {
418  Double_t deltaPhi = TMath::Min(TMath::Abs(fLeadingJet->Phi()-fSubleadingJet->Phi()),TMath::TwoPi() - TMath::Abs(fLeadingJet->Phi()-fSubleadingJet->Phi()));
419  if(deltaPhi <= fEventCriteriumMinJetDeltaPhi)
420  {
421  fHistEventRejection->Fill("JetCrit", 1);
422  return kFALSE;
423  }
424  }
425  }
426  }
427  return kTRUE;
428 }
429 
430 //________________________________________________________________________
432 {
433  if(fJetOutputMode==3) // output leading&subleading jet
434  {
435  if((jet!=fLeadingJet) && (jet!=fSubleadingJet))
436  return kFALSE;
437  }
438  else if(fJetOutputMode==1) // output the leading jet
439  {
440  if(jet!=fLeadingJet)
441  return kFALSE;
442  }
443  else if(fJetOutputMode==2) // output the subleading jet
444  {
445  if(jet!=fSubleadingJet)
446  return kFALSE;
447  }
448  else if(fJetOutputMode==6)
449  {
451  return kFALSE;
452  }
453 
454  if(fJetOutputMode==4) // matching jets only
455  return (std::find(fMatchedJets.begin(), fMatchedJets.end(), jet) != fMatchedJets.end());
456  else if(fJetOutputMode==5) // non-matching jets only
457  return (std::find(fMatchedJets.begin(), fMatchedJets.end(), jet) == fMatchedJets.end());
458 
459  return kTRUE;
460 }
461 
462 //________________________________________________________________________
464 {
465  // All jets
466  FillHistogram("hJetPtRaw", jet->Pt(), fCent);
467  FillHistogram("hJetPt", jet->Pt() - fJetsCont->GetRhoVal()*jet->Area(), fCent);
468  FillHistogram("hJetPhi", jet->Phi(), fCent);
469  FillHistogram("hJetEta", jet->Eta(), fCent);
470  FillHistogram("hJetEtaPt", jet->Eta(), jet->Pt() - fJetsCont->GetRhoVal()*jet->Area());
471  FillHistogram("hJetPhiPt", jet->Phi(), jet->Pt() - fJetsCont->GetRhoVal()*jet->Area());
472  FillHistogram("hJetPhiEta", jet->Phi(), jet->Eta());
473  FillHistogram("hJetArea", jet->Area(), fCent);
474  FillHistogram("hJetAreaPt", jet->Area(), jet->Pt() - fJetsCont->GetRhoVal()*jet->Area());
475  FillHistogram("hJetPtLeadingHadron", jet->Pt() - fJetsCont->GetRhoVal()*jet->Area(), fJetsCont->GetLeadingHadronPt(jet));
476 
477  FillHistogram("hBackgroundPtJetPt_Cent0_100", fJetsCont->GetRhoVal(), jet->Pt() - fJetsCont->GetRhoVal()*jet->Area());
478  if( (fCent >= 0) && (fCent < 10) )
479  FillHistogram("hBackgroundPtJetPt_Cent0_10", fJetsCont->GetRhoVal(), jet->Pt() - fJetsCont->GetRhoVal()*jet->Area());
480 
481  // Fake jet rejection (0810.1219)
482  Double_t fakeFactor = CalculateFakeFactor(jet);
483  FillHistogram("hFakeFactor", fakeFactor, fCent);
484  FillHistogram("hFakeFactorJetPt_Cent0_100", fakeFactor, jet->Pt() - fJetsCont->GetRhoVal()*jet->Area());
485  if( (fCent >= 0) && (fCent < 10) )
486  FillHistogram("hFakeFactorJetPt_Cent0_10", fakeFactor, jet->Pt() - fJetsCont->GetRhoVal()*jet->Area());
487 
488 
489  // Leading jet plots
490  if(jet==fLeadingJet)
491  {
492  FillHistogram("hLeadingJetPtRaw", jet->Pt(), fCent);
493  FillHistogram("hLeadingJetPt", jet->Pt() - fJetsCont->GetRhoVal()*jet->Area(), fCent);
494  FillHistogram("hLeadingJetPhi", jet->Phi(), fCent);
495  FillHistogram("hLeadingJetEta", jet->Eta(), fCent);
496  FillHistogram("hLeadingJetEtaPt", jet->Eta(), jet->Pt() - fJetsCont->GetRhoVal()*jet->Area());
497  FillHistogram("hLeadingJetPhiPt", jet->Phi(), jet->Pt() - fJetsCont->GetRhoVal()*jet->Area());
498  FillHistogram("hLeadingJetPhiEta", jet->Phi(), jet->Eta());
499  FillHistogram("hLeadingJetArea", jet->Area(), fCent);
500  FillHistogram("hLeadingJetAreaPt", jet->Area(), jet->Pt() - fJetsCont->GetRhoVal()*jet->Area());
501  FillHistogram("hLeadingJetPtLeadingHadron", jet->Pt() - fJetsCont->GetRhoVal()*jet->Area(), fJetsCont->GetLeadingHadronPt(jet));
502  }
503 
504  // Subleading jet plot
505  else if(jet==fSubleadingJet)
506  {
507  FillHistogram("hSubleadingJetPtRaw", jet->Pt(), fCent);
508  FillHistogram("hSubleadingJetPt", jet->Pt() - fJetsCont->GetRhoVal()*jet->Area(), fCent);
509  FillHistogram("hSubleadingJetPhi", jet->Phi(), fCent);
510  FillHistogram("hSubleadingJetEta", jet->Eta(), fCent);
511  FillHistogram("hSubleadingJetEtaPt", jet->Eta(), jet->Pt() - fJetsCont->GetRhoVal()*jet->Area());
512  FillHistogram("hSubleadingJetPhiPt", jet->Phi(), jet->Pt() - fJetsCont->GetRhoVal()*jet->Area());
513  FillHistogram("hSubleadingJetPhiEta", jet->Phi(), jet->Eta());
514  FillHistogram("hSubleadingJetArea", jet->Area(), fCent);
515  FillHistogram("hSubleadingJetAreaPt", jet->Area(), jet->Pt() - fJetsCont->GetRhoVal()*jet->Area());
516  FillHistogram("hSubleadingJetPtLeadingHadron", jet->Pt() - fJetsCont->GetRhoVal()*jet->Area(), fJetsCont->GetLeadingHadronPt(jet));
517  }
518 }
519 
520 //________________________________________________________________________
522 {
523  FillHistogram("hTrackPt", track->Pt(), fCent);
524  FillHistogram("hTrackPhi", track->Phi(), fCent);
525  FillHistogram("hTrackEta", track->Eta(), fCent);
526  FillHistogram("hTrackEtaPt", track->Eta(), track->Pt());
527  FillHistogram("hTrackPhiPt", track->Phi(), track->Pt());
528  FillHistogram("hTrackPhiEta", track->Phi(), track->Eta());
529 }
530 
531 //________________________________________________________________________
533 {
534  // Loop over all jet constituents
535  for(Int_t i = 0; i < jet->GetNumberOfTracks(); i++)
536  {
537  AliVParticle* constituent = static_cast<AliVParticle*>(jet->TrackAt(i, fTracksCont->GetArray()));
538  if(!constituent)
539  continue;
540 
541  Bool_t filterConditionFulfilled = kFALSE;
542  AliAODTrack* aodTrack = static_cast<AliAODTrack*>(constituent);
543  if (aodTrack)
544  filterConditionFulfilled = aodTrack->TestFilterBit(fConstPtFilterBit);
545 
546  // Fill jet constituent plots
547  FillHistogram("hJetConstituentPt_Cent0_100", jet->Pt() - fJetsCont->GetRhoVal()*jet->Area(), constituent->Pt());
548  if(filterConditionFulfilled)
549  FillHistogram(Form("hJetConstituentPt_Cent0_100_FilterBit%i", fConstPtFilterBit), jet->Pt() - fJetsCont->GetRhoVal()*jet->Area(), constituent->Pt());
550  if( (fCent >= 0) && (fCent < 10) )
551  {
552  FillHistogram("hJetConstituentPt_Cent0_10", jet->Pt() - fJetsCont->GetRhoVal()*jet->Area(), constituent->Pt());
553  if(filterConditionFulfilled)
554  FillHistogram(Form("hJetConstituentPt_Cent0_10_FilterBit%i", fConstPtFilterBit), jet->Pt() - fJetsCont->GetRhoVal()*jet->Area(), constituent->Pt());
555  }
556  else if( (fCent >= 10) && (fCent < 30) )
557  {
558  FillHistogram("hJetConstituentPt_Cent10_30", jet->Pt() - fJetsCont->GetRhoVal()*jet->Area(), constituent->Pt());
559  if(filterConditionFulfilled)
560  FillHistogram(Form("hJetConstituentPt_Cent10_30_FilterBit%i", fConstPtFilterBit), jet->Pt() - fJetsCont->GetRhoVal()*jet->Area(), constituent->Pt());
561  }
562  else if( (fCent >= 30) && (fCent < 50) )
563  {
564  FillHistogram("hJetConstituentPt_Cent30_50", jet->Pt() - fJetsCont->GetRhoVal()*jet->Area(), constituent->Pt());
565  if(filterConditionFulfilled)
566  FillHistogram(Form("hJetConstituentPt_Cent30_50_FilterBit%i", fConstPtFilterBit), jet->Pt() - fJetsCont->GetRhoVal()*jet->Area(), constituent->Pt());
567  }
568  else if( (fCent >= 50) && (fCent < 90) )
569  {
570  FillHistogram("hJetConstituentPt_Cent50_90", jet->Pt() - fJetsCont->GetRhoVal()*jet->Area(), constituent->Pt());
571  if(filterConditionFulfilled)
572  FillHistogram(Form("hJetConstituentPt_Cent50_90_FilterBit%i", fConstPtFilterBit), jet->Pt() - fJetsCont->GetRhoVal()*jet->Area(), constituent->Pt());
573  }
574  }
575 
576  FillHistogram("hJetConstituentCount_Cent0_100", jet->Pt() - fJetsCont->GetRhoVal()*jet->Area(), jet->GetNumberOfTracks());
577  if( (fCent >= 0) && (fCent < 10) )
578  FillHistogram("hJetConstituentCount_Cent0_10", jet->Pt() - fJetsCont->GetRhoVal()*jet->Area(), jet->GetNumberOfTracks());
579 
580  FillHistogram("hBackgroundPtConstCount_Cent0_100", fJetsCont->GetRhoVal(), jet->GetNumberOfTracks());
581  if( (fCent >= 0) && (fCent < 10) )
582  FillHistogram("hBackgroundPtConstCount_Cent0_10", fJetsCont->GetRhoVal(), jet->GetNumberOfTracks());
583 }
584 
585 //________________________________________________________________________
587 {
588  Double_t tmpPt = jet->Pt() - fJetsCont->GetRhoVal()*jet->Area();
589  new ((*fJetsOutput)[fAcceptedJets]) AliPicoTrack(tmpPt, jet->Eta(), jet->Phi(), jet->Charge(), 0, 0);
590  fAcceptedJets++;
591 }
592 
593 //________________________________________________________________________
595 {
596  if(fTrackParticleArrayName != "")
597  {
598  new ((*fTracksOutput)[fAcceptedTracks]) AliPicoTrack(track->Pt(), track->Eta(), track->Phi(), track->Charge(), 0, 0); // only Pt,Eta,Phi are interesting for correlations;
599  fAcceptedTracks++;
600  }
601 }
602 
603 //________________________________________________________________________
605 {
606  // Check pT threshold
607  if( ((jet->Pt()-jet->Area()*fJetsCont->GetRhoVal()) < fExtractionMinPt) || ((jet->Pt()-jet->Area()*fJetsCont->GetRhoVal()) >= fExtractionMaxPt) )
608  return;
609 
610  // Discard jets statistically
611  if(fRandom->Rndm() >= fExtractionPercentage)
612  return;
613 
614  AliVHeader* eventIDHeader = InputEvent()->GetHeader();
615  Long64_t eventID = 0;
616  if(eventIDHeader)
617  eventID = eventIDHeader->GetEventIdAsLong();
618 
619  // if only the two initial collision partons will be added, get PYTHIA info on them
620  Int_t partid = 0;
621  if(fJetOutputMode==6)
622  {
623  if(!fPythiaInfo)
624  AliError("fPythiaInfo object not available. Is it activated with SetGeneratePythiaInfoObject()?");
625  else if(jet==fInitialPartonMatchedJet1)
626  partid = fPythiaInfo->GetPartonFlag6();
627  else if (jet==fInitialPartonMatchedJet2)
628  partid = fPythiaInfo->GetPartonFlag7();
629 
630  // If fPythiaExtractionMode is set, only extract certain jets
631  if( (fPythiaExtractionMode==1) && not (partid>=1 && partid<=6)) // all quark-jet extraction
632  return;
633  else if( (fPythiaExtractionMode==2) && not (partid==21)) // gluon-jet extraction
634  return;
635  else if( (fPythiaExtractionMode<0) && (fPythiaExtractionMode!=-partid) ) // custom type jet extraction by given a negative number
636  return;
637  }
638 
639  AliBasicJet basicJet(jet->Eta(), jet->Phi(), jet->Pt(), jet->Charge(), fJetsCont->GetJetRadius(), jet->Area(), partid, fJetsCont->GetRhoVal(), eventID, fCent);
640  // Add constituents
641  for(Int_t i = 0; i < jet->GetNumberOfTracks(); i++)
642  {
643  AliVParticle* particle = static_cast<AliVParticle*>(jet->TrackAt(i, fTracksCont->GetArray()));
644  if(!particle) continue;
645 
646  AliAODTrack* aodtrack = static_cast<AliAODTrack*>(jet->TrackAt(i, fTracksCont->GetArray()));
647  Int_t constid = 9; // 9 mean unknown
648  if(fJetOutputMode==6)
649  {
650  // Use same convention as PID in AODs
651  if(TMath::Abs(particle->PdgCode()) == 2212) // proton
652  constid = 4;
653  else if (TMath::Abs(particle->PdgCode()) == 211) // pion
654  constid = 2;
655  else if (TMath::Abs(particle->PdgCode()) == 321) // kaon
656  constid = 3;
657  else if (TMath::Abs(particle->PdgCode()) == 11) // electron
658  constid = 0;
659  else if (TMath::Abs(particle->PdgCode()) == 13) // muon
660  constid = 1;
661  }
662  else if (aodtrack)
663  constid = aodtrack->GetMostProbablePID();
664 
665  basicJet.AddJetConstituent(particle->Eta(), particle->Phi(), particle->Pt(), particle->Charge(), constid);
666  }
667  if(std::find(fMatchedJets.begin(), fMatchedJets.end(), jet) != fMatchedJets.end()) // set the true pT from the matched jets (only possible in modes 4 & 7)
668  basicJet.SetTruePt(fMatchedJetsReference[std::find(fMatchedJets.begin(), fMatchedJets.end(), jet)-fMatchedJets.begin()]->Pt());
669 
670  fJetsTreeBuffer = &basicJet;
671  fJetsTree->Fill();
672 }
673 
674 //________________________________________________________________________
676 {
677  // Check jet pT threshold
679  return;
680 
681  // Discard jets statistically
682  if(fRandom->Rndm() >= fEventExtractionPercentage)
683  return;
684 
685  static Int_t numSavedEvents = 0;
686  numSavedEvents++;
687 
688 
689  AddHistogram2D<TH2D>(Form("Event%i", numSavedEvents), "Event display", "COLZ", 180, 0., 2*TMath::Pi(), 100, -2.5, 2.5, "#phi", "#eta", "dN^{Tracks}/d#phi d#eta");
690  fTracksCont->ResetCurrentID();
691  while(AliVTrack *track = static_cast<AliVTrack*>(fTracksCont->GetNextAcceptParticle()))
692  FillHistogram(Form("Event%i", numSavedEvents), track->Phi(), track->Eta(), track->Pt());
693 
694 }
695 
696 //________________________________________________________________________
698 {
700 
702  return kFALSE;
703 
704  // ####### Jet loop
705  fAcceptedJets = 0;
706  fJetsCont->ResetCurrentID();
707  while(AliEmcalJet *jet = fJetsCont->GetNextAcceptJet())
708  {
709  if(!IsJetSelected(jet))
710  continue;
711 
712  // Jet plots
713  FillHistogramsJets(jet);
715 
716  // Add jet to output array
718  AddJetToTree(jet);
719  AddJetToOutputArray(jet);
720  }
721 
722  // ####### Particle loop
723  // Throw random cone
724  Double_t tmpRandConeEta = fJetsCont->GetJetEtaMin() + fRandom->Rndm()*TMath::Abs(fJetsCont->GetJetEtaMax()-fJetsCont->GetJetEtaMin());
725  Double_t tmpRandConePhi = fRandom->Rndm()*TMath::TwoPi();
726  Double_t tmpRandConePt = 0; // to be determined
727  Double_t tmpRandConePt3GeV = 0; // to be determined
728 
729  fAcceptedTracks = 0;
730  fTracksCont->ResetCurrentID();
731  Int_t trackcount = 0;
732  while(AliVTrack *track = static_cast<AliVTrack*>(fTracksCont->GetNextAcceptParticle()))
733  {
734  // Track plots
735  FillHistogramsTracks(track);
736 
737  if(IsTrackInCone(track, tmpRandConeEta, tmpRandConePhi, fJetsCont->GetJetRadius()))
738  {
739  tmpRandConePt += track->Pt();
740  if (track->Pt() > 3.0)
741  tmpRandConePt3GeV += track->Pt();
742  }
743 
744  // Add track to output array
745  trackcount++;
746  AddTrackToOutputArray(track);
747  }
748 
749  // ####### Embedding plots
750  if( (fJetOutputMode == 4) || (fJetOutputMode == 5))
751  {
752  for(Int_t i=0; i<fMatchedJets.size(); i++)
753  {
754  Double_t deltaEta = (fMatchedJets[i]->Eta()-fMatchedJetsReference[i]->Eta());
755  Double_t deltaPhi = TMath::Min(TMath::Abs(fMatchedJets[i]->Phi()-fMatchedJetsReference[i]->Phi()),TMath::TwoPi() - TMath::Abs(fMatchedJets[i]->Phi()-fMatchedJetsReference[i]->Phi()));
756  if(fMatchedJets[i]->Phi() < fMatchedJetsReference[i]->Phi())
757  deltaPhi = -deltaPhi;
758 
759  Double_t deltaR = TMath::Sqrt(deltaEta*deltaEta + deltaPhi*deltaPhi);
760 
761  Double_t trackRatio = 0.;
762  Double_t ptRatio = 0.;
763  GetTrackMCRatios(fMatchedJets[i], trackRatio, ptRatio);
764 
765  FillHistogram("hEmbeddingDeltaR", fMatchedJets[i]->Pt() - fJetsCont->GetRhoVal()*fMatchedJets[i]->Area(), deltaR);
766  FillHistogram("hEmbeddingDeltaEta", fMatchedJets[i]->Pt() - fJetsCont->GetRhoVal()*fMatchedJets[i]->Area(), deltaPhi);
767  FillHistogram("hEmbeddingDeltaPhi", fMatchedJets[i]->Pt() - fJetsCont->GetRhoVal()*fMatchedJets[i]->Area(), deltaEta);
768  if(fCent >= 0 && fCent < 10)
769  {
770  FillHistogram3D("hEmbeddingPtCorr010", fMatchedJetsReference[i]->Pt(), fMatchedJets[i]->Pt() - fJetsCont->GetRhoVal()*fMatchedJets[i]->Area(), trackRatio);
771  FillHistogram3D("hEmbeddingPtCorrPt010", fMatchedJetsReference[i]->Pt(), fMatchedJets[i]->Pt() - fJetsCont->GetRhoVal()*fMatchedJets[i]->Area(), ptRatio);
772  }
773  else if (fCent >= 10 && fCent < 30)
774  {
775  FillHistogram3D("hEmbeddingPtCorr1030", fMatchedJetsReference[i]->Pt(), fMatchedJets[i]->Pt() - fJetsCont->GetRhoVal()*fMatchedJets[i]->Area(), trackRatio);
776  FillHistogram3D("hEmbeddingPtCorrPt1030", fMatchedJetsReference[i]->Pt(), fMatchedJets[i]->Pt() - fJetsCont->GetRhoVal()*fMatchedJets[i]->Area(), ptRatio);
777  }
778  else if (fCent >= 30 && fCent < 50)
779  {
780  FillHistogram3D("hEmbeddingPtCorr3050", fMatchedJetsReference[i]->Pt(), fMatchedJets[i]->Pt() - fJetsCont->GetRhoVal()*fMatchedJets[i]->Area(), trackRatio);
781  FillHistogram3D("hEmbeddingPtCorrPt3050", fMatchedJetsReference[i]->Pt(), fMatchedJets[i]->Pt() - fJetsCont->GetRhoVal()*fMatchedJets[i]->Area(), ptRatio);
782  }
783  else if (fCent >= 50 && fCent < 90)
784  {
785  FillHistogram3D("hEmbeddingPtCorr5090", fMatchedJetsReference[i]->Pt(), fMatchedJets[i]->Pt() - fJetsCont->GetRhoVal()*fMatchedJets[i]->Area(), trackRatio);
786  FillHistogram3D("hEmbeddingPtCorrPt5090", fMatchedJetsReference[i]->Pt(), fMatchedJets[i]->Pt() - fJetsCont->GetRhoVal()*fMatchedJets[i]->Area(), ptRatio);
787  }
788  FillHistogram("hEmbeddingJetPt", fMatchedJetsReference[i]->Pt());
789  FillHistogram("hEmbeddingJetPhiEta", fMatchedJetsReference[i]->Phi(), fMatchedJetsReference[i]->Eta());
790  }
791  }
792 
793  // Add event to output tree
795  AddEventToTree();
796 
797  // ####### Event properties
798  FillHistogram("hRandomConePt", tmpRandConePt - fJetsCont->GetRhoVal()*fJetsCont->GetJetRadius()*fJetsCont->GetJetRadius()*TMath::Pi(), fCent);
799  FillHistogram("hRandomConePtCut3GeV", tmpRandConePt3GeV - fJetsCont->GetRhoVal()*fJetsCont->GetJetRadius()*fJetsCont->GetJetRadius()*TMath::Pi(), fCent);
800  FillHistogram("hRandomConeRawPt", tmpRandConePt, fCent);
801  FillHistogram("hRandomConeRawPtCut3GeV", tmpRandConePt3GeV, fCent);
802 
803  FillHistogram("hBackgroundPt", fJetsCont->GetRhoVal(), fCent);
804  FillHistogram("hJetCount", fAcceptedJets, fCent);
805  FillHistogram("hTrackCount", trackcount, fCent);
806  // NOTE: It is possible to use fTracksCont->GetLeadingParticle() since we do not apply additional track cuts
807  AliVTrack* leadTrack = static_cast<AliVTrack*>(fTracksCont->GetLeadingParticle());
808  if(leadTrack)
809  {
810  FillHistogram("hLeadingTrackPt", leadTrack->Pt(), fCent);
811  FillHistogram("hLeadingTrackPhi", leadTrack->Phi(), fCent);
812  FillHistogram("hLeadingTrackEta", leadTrack->Eta(), fCent);
813  FillHistogram("hLeadingTrackPhiEta", leadTrack->Phi(), leadTrack->Eta());
814  }
815 
816  return kTRUE;
817 }
818 
819 //########################################################################
820 // HELPERS
821 //########################################################################
822 
823 //________________________________________________________________________
825 {
826  if(!fPythiaInfo)
827  AliError("fPythiaInfo object not available. Is it activated with SetGeneratePythiaInfoObject()?");
828 
829  Double_t bestMatchDeltaR1 = 999.;
830  Double_t bestMatchDeltaR2 = 999.;
831 
832  fJetsCont->ResetCurrentID();
833  while(AliEmcalJet *jet = fJetsCont->GetNextAcceptJet())
834  {
835  // Check via geometrical matching if jet is connected to the initial collision
836  Double_t deltaEta1 = TMath::Abs(jet->Eta()-fPythiaInfo->GetPartonEta6());
837  Double_t deltaEta2 = TMath::Abs(jet->Eta()-fPythiaInfo->GetPartonEta7());
838  Double_t deltaPhi1 = TMath::Min(TMath::Abs(jet->Phi()-fPythiaInfo->GetPartonPhi6()),TMath::TwoPi() - TMath::Abs(jet->Phi()-fPythiaInfo->GetPartonPhi6()));
839  Double_t deltaPhi2 = TMath::Min(TMath::Abs(jet->Phi()-fPythiaInfo->GetPartonPhi7()),TMath::TwoPi() - TMath::Abs(jet->Phi()-fPythiaInfo->GetPartonPhi7()));
840 
841  Double_t deltaR1 = TMath::Sqrt(deltaEta1*deltaEta1 + deltaPhi1*deltaPhi1);
842  Double_t deltaR2 = TMath::Sqrt(deltaEta2*deltaEta2 + deltaPhi2*deltaPhi2);
843 
844  if(deltaR1 < bestMatchDeltaR1)
845  {
846  bestMatchDeltaR1 = deltaR1;
848  }
849  if(deltaR2 < bestMatchDeltaR2)
850  {
851  bestMatchDeltaR2 = deltaR2;
853  }
854  }
855 
856  if(bestMatchDeltaR1 > 0.3)
858  if(bestMatchDeltaR2 > 0.3)
860 }
861 
862 //________________________________________________________________________
864 {
865  fMatchedJets.clear();
866  fMatchedJetsReference.clear();
867 
868  // Check for a jet veto here
870  {
871  for(Int_t i=0; i<fJetVetoArray->GetEntries(); i++)
872  {
873  AliEmcalJet* vetoJet = static_cast<AliEmcalJet*>(fJetVetoArray->At(i));
874  UInt_t dummy = 0;
875  if(!fJetsCont->AcceptJet(vetoJet , dummy))
876  continue;
877  // if veto jet found -> return
878  if((vetoJet->Pt() - fJetsCont->GetRhoVal()*vetoJet->Area() >= fJetVetoMinPt) && (vetoJet->Pt() - fJetsCont->GetRhoVal()*vetoJet->Area() < fJetVetoMaxPt))
879  {
880  fHistEventRejection->Fill("JetVeto", 1);
881  return;
882  }
883  }
884  }
885 
886  // Search for all matches above a certain threshold
887  for(Int_t i=0; i<fJetMatchingArray->GetEntries(); i++)
888  {
889  AliEmcalJet* probeJet = static_cast<AliEmcalJet*>(fJetMatchingArray->At(i));
890  UInt_t dummy = 0;
891  if(!fJetsCont->AcceptJet(probeJet , dummy))
892  continue;
893  if((probeJet->Pt() < fJetMatchingMinPt) || (probeJet->Pt() >= fJetMatchingMaxPt))
894  continue;
895 
896  AliEmcalJet* matchedJet = 0;
897  AliEmcalJet* matchedJetReference = 0;
898  Double_t bestMatchDeltaR = 999.;
899  fJetsCont->ResetCurrentID();
900  // Loop over all embedded jets to find the best match
901  while(AliEmcalJet* embeddedJet = fJetsCont->GetNextAcceptJet())
902  {
903  Double_t deltaEta = (embeddedJet->Eta()-probeJet->Eta());
904  Double_t deltaPhi = TMath::Min(TMath::Abs(embeddedJet->Phi()-probeJet->Phi()),TMath::TwoPi() - TMath::Abs(embeddedJet->Phi()-probeJet->Phi()));
905  Double_t deltaR = TMath::Sqrt(deltaEta*deltaEta + deltaPhi*deltaPhi);
906 
907  // Cut jets too far away
908  if (deltaR > fJetMatchingMaxDistance)
909  continue;
910  // Cut jets with too small pT
911  if(embeddedJet->Pt() - fJetsCont->GetRhoVal()*embeddedJet->Area() < fJetMatchingMinSharedFraction*probeJet->Pt())
912  continue;
913  // Cut jets with too high pT
914  if(embeddedJet->Pt() - fJetsCont->GetRhoVal()*embeddedJet->Area() > (fJetMatchingMaxSharedFraction*probeJet->Pt() + fJetMatchingMaxEmbeddingOffset))
915  continue;
916 
917  // Search for the best match
918  if(deltaR < bestMatchDeltaR)
919  {
920  bestMatchDeltaR = deltaR;
921  matchedJet = embeddedJet;
922  matchedJetReference = probeJet;
923  }
924  }
925  // Put matched jet to a list
926  if(matchedJet && matchedJetReference)
927  {
928  fMatchedJets.push_back(matchedJet);
929  fMatchedJetsReference.push_back(matchedJetReference);
930  }
931  }
932 
933  // ############ On demand, search for matches of leading and subleading jet in MC and delete rest
935  {
936  Int_t jetLeadingIndex = -1;
937  Int_t jetSubLeadingIndex = -1;
938  Double_t tmpLeadingPt = 0;
939  Double_t tmpSubleadingPt = 0;
940 
941  // Search leading/subleading in matched MC jets
942  for(Int_t i=0; i<fMatchedJetsReference.size(); i++)
943  {
944  AliEmcalJet* matchedJet = fMatchedJetsReference[i];
945  if (matchedJet->Pt() > tmpLeadingPt)
946  {
947  jetSubLeadingIndex = jetLeadingIndex;
948  jetLeadingIndex = i;
949  tmpSubleadingPt = tmpLeadingPt;
950  tmpLeadingPt = matchedJet->Pt();
951  }
952  else if (matchedJet->Pt() > tmpSubleadingPt)
953  {
954  jetSubLeadingIndex = i;
955  tmpSubleadingPt = matchedJet->Pt();
956  }
957  }
958 
959  AliEmcalJet* matchedLeading = 0;
960  AliEmcalJet* refLeading = 0;
961  AliEmcalJet* matchedSubLeading = 0;
962  AliEmcalJet* refSubLeading = 0;
963 
964  // Cache leading jet, if found
965  if(jetLeadingIndex >= 0)
966  {
967  matchedLeading = fMatchedJets[jetLeadingIndex];
968  refLeading = fMatchedJetsReference[jetLeadingIndex];
969  }
970  // Cache subleading jet, if found
971  if(jetSubLeadingIndex >= 0)
972  {
973  matchedSubLeading = fMatchedJets[jetSubLeadingIndex];
974  refSubLeading = fMatchedJetsReference[jetSubLeadingIndex];
975  }
976 
977  // Delete old list
978  fMatchedJets.clear();
979  fMatchedJetsReference.clear();
980 
981  // Add jets
982  if(matchedLeading)
983  {
984  if(!fJetVetoJetByJet || !IsJetVetoed(matchedLeading))
985  {
986  fMatchedJets.push_back(matchedLeading);
987  fMatchedJetsReference.push_back(refLeading);
988  }
989  }
990  if(matchedSubLeading && fJetMatchingUseOnlyNLeading >= 2)
991  {
992  if(!fJetVetoJetByJet || !IsJetVetoed(matchedSubLeading))
993  {
994  fMatchedJets.push_back(matchedSubLeading);
995  fMatchedJetsReference.push_back(refSubLeading);
996  }
997  }
998  }
999 
1000 }
1001 
1002 //________________________________________________________________________
1004 {
1005  Int_t tracksFromMC = 0;
1006  Int_t tracksTotal = 0;
1007  Double_t ptFromMC = 0;
1008  Double_t ptTotal = 0;
1009  for(Int_t j = 0; j < jet->GetNumberOfTracks(); j++)
1010  {
1011  AliVParticle* constituent = static_cast<AliVParticle*>(jet->TrackAt(j, fTracksCont->GetArray()));
1012  if(!constituent)
1013  continue;
1014 
1015  // Plots on MC percentage in jet
1016  if(constituent->GetLabel() > 1000)
1017  {
1018  tracksFromMC++;
1019  ptFromMC += constituent->Pt();
1020  }
1021  tracksTotal++;
1022  ptTotal += constituent->Pt();
1023  }
1024 
1025 
1026  trackRatio = 0.;
1027  if(tracksTotal)
1028  trackRatio = tracksFromMC/((Double_t)tracksTotal);
1029 
1030  ptRatio = 0.;
1031  if(ptTotal)
1032  ptRatio = ptFromMC/((Double_t)ptTotal);
1033 
1034 }
1035 
1036 //________________________________________________________________________
1038 {
1039  // Check if this jet can be matched with a veto jet
1040  if(fJetVetoArray && jet)
1041  {
1042  for(Int_t j=0; j<fJetVetoArray->GetEntries(); j++)
1043  {
1044  UInt_t dummy = 0;
1045  AliEmcalJet* vetoJet = static_cast<AliEmcalJet*>(fJetVetoArray->At(j));
1046  // Check if veto jet is accepted and high enough in pT
1047  if(!fJetsCont->AcceptJet(vetoJet , dummy))
1048  continue;
1049  if(!((vetoJet->Pt() - fJetsCont->GetRhoVal()*vetoJet->Area() >= fJetVetoMinPt) && (vetoJet->Pt() - fJetsCont->GetRhoVal()*vetoJet->Area() < fJetVetoMaxPt)))
1050  continue;
1051 
1052  // Check matching distance
1053  Double_t deltaEta = (jet->Eta()-vetoJet->Eta());
1054  Double_t deltaPhi = TMath::Min(TMath::Abs(jet->Phi()-vetoJet->Phi()),TMath::TwoPi() - TMath::Abs(jet->Phi()-vetoJet->Phi()));
1055  Double_t deltaR = TMath::Sqrt(deltaEta*deltaEta + deltaPhi*deltaPhi);
1056 
1057  if (deltaR <= fJetMatchingMaxDistance)
1058  {
1059  FillHistogram("hJetVeto", 1.5); // jet vetoed
1060  return kTRUE;
1061  }
1062  }
1063  }
1064  FillHistogram("hJetVeto", 0.5); // jet accepted
1065  return kFALSE;
1066 }
1067 
1068 //________________________________________________________________________
1070 {
1071  // This is to use a full cone in phi even at the edges of phi (2pi -> 0) (0 -> 2pi)
1072  Double_t trackPhi = 0.0;
1073  if (track->Phi() > (TMath::TwoPi() - (radius-phi)))
1074  trackPhi = track->Phi() - TMath::TwoPi();
1075  else if (track->Phi() < (phi+radius - TMath::TwoPi()))
1076  trackPhi = track->Phi() + TMath::TwoPi();
1077  else
1078  trackPhi = track->Phi();
1079 
1080  if ( TMath::Abs(trackPhi-phi)*TMath::Abs(trackPhi-phi) + TMath::Abs(track->Eta()-eta)*TMath::Abs(track->Eta()-eta) <= radius*radius)
1081  return kTRUE;
1082 
1083  return kFALSE;
1084 }
1085 
1086 
1087 //________________________________________________________________________
1089 {
1090  // Calculate leading + subleading jet
1092  if(fJetOutputMode==6)
1094  else if(fJetOutputMode==4 || fJetOutputMode==5)
1095  GetMatchingJets();
1096 }
1097 
1098 //________________________________________________________________________
1100 {
1101  Double_t fakeFactor = 0;
1102 
1103  // Loop over all jet constituents
1104  for(Int_t i = 0; i < jet->GetNumberOfTracks(); i++)
1105  {
1106  AliVParticle* constituent = static_cast<AliVParticle*>(jet->TrackAt(i, fTracksCont->GetArray()));
1107 
1108  Double_t deltaPhi = TMath::Min(TMath::Abs(jet->Phi()-constituent->Phi()),TMath::TwoPi() - TMath::Abs(jet->Phi()-constituent->Phi()));
1109  Double_t deltaR = TMath::Sqrt( (jet->Eta() - constituent->Eta())*(jet->Eta() - constituent->Eta()) + deltaPhi*deltaPhi );
1110  fakeFactor += constituent->Pt() * TMath::Sin(deltaR);
1111  }
1112 
1113  return fakeFactor;
1114 }
1115 
1116 //________________________________________________________________________
1118 {
1119  fEventCriteriumMode = type;
1120 
1121  if(fEventCriteriumMode==0)
1122  AliWarning("Set event criterium to 'default' -- no further selection criterium.");
1123  else if(fEventCriteriumMode==1)
1124  AliWarning("Set event criterium to 'background' -- select events with certain backgrounds");
1125  else if(fEventCriteriumMode==2)
1126  AliWarning("Set event criterium to 'simple jet trigger' -- select events with certain minimum leading jet pT (bgrd corr.)");
1127  else if(fEventCriteriumMode==3)
1128  AliWarning("Set event criterium to 'simple dijet trigger' -- select events with certain minimum leading + subleading jet pT (bgrd corr.)");
1129  else
1130  {
1131  AliFatal("Event criterium not valid.");
1132  }
1133 }
1134 
1135 
1136 //________________________________________________________________________
1137 void AliAnalysisTaskChargedJetsHadronCF::GetLeadingJets(const char* opt, AliEmcalJet*& jetLeading, AliEmcalJet*& jetSubLeading)
1138 {
1139  // Customized from AliJetContainer::GetLeadingJet()
1140  // Get the leading+subleading jet; if opt contains "rho" the sorting is according to pt-A*rho
1141 
1142  TString option(opt);
1143  option.ToLower();
1144 
1145  jetLeading = 0;
1146  jetSubLeading = 0;
1147 
1148  fJetsCont->ResetCurrentID();
1149  Double_t tmpLeadingPt = 0;
1150  Double_t tmpSubleadingPt = 0;
1151 
1152  if (option.Contains("rho")) {
1153  while (AliEmcalJet* jet = fJetsCont->GetNextAcceptJet()) {
1154  if ( (jet->Pt()-jet->Area()*fJetsCont->GetRhoVal()) > tmpLeadingPt )
1155  {
1156  jetSubLeading = jetLeading;
1157  jetLeading = jet;
1158  tmpSubleadingPt = tmpLeadingPt;
1159  tmpLeadingPt = jet->Pt()-jet->Area()*fJetsCont->GetRhoVal();
1160  }
1161  else if ( (jet->Pt()-jet->Area()*fJetsCont->GetRhoVal()) > tmpSubleadingPt )
1162  {
1163  jetSubLeading = jet;
1164  tmpSubleadingPt = jet->Pt()-jet->Area()*fJetsCont->GetRhoVal();
1165  }
1166  }
1167  }
1168  else {
1169  while (AliEmcalJet* jet = fJetsCont->GetNextAcceptJet()) {
1170  if ( (jet->Pt()) > tmpLeadingPt )
1171  {
1172  jetSubLeading = jetLeading;
1173  jetLeading = jet;
1174  tmpSubleadingPt = tmpLeadingPt;
1175  tmpLeadingPt = jet->Pt();
1176  }
1177  else if ( (jet->Pt()) > tmpSubleadingPt )
1178  {
1179  jetSubLeading = jet;
1180  tmpSubleadingPt = jet->Pt();
1181  }
1182  }
1183  }
1184 }
1185 
1186 //________________________________________________________________________
1188 {
1189  // Method for the correct logarithmic binning of histograms
1190  TAxis *axis = h->GetAxis(axisNumber);
1191  int bins = axis->GetNbins();
1192 
1193  Double_t from = axis->GetXmin();
1194  Double_t to = axis->GetXmax();
1195  Double_t *newBins = new Double_t[bins + 1];
1196 
1197  newBins[0] = from;
1198  Double_t factor = pow(to/from, 1./bins);
1199 
1200  for (int i = 1; i <= bins; i++) {
1201  newBins[i] = factor * newBins[i-1];
1202  }
1203  axis->Set(bins, newBins);
1204  delete [] newBins;
1205 }
1206 
1207 //________________________________________________________________________
1209 {
1210  TH1* tmpHist = static_cast<TH1*>(fOutput->FindObject(key));
1211  if(!tmpHist)
1212  {
1213  AliError(Form("Cannot find histogram <%s> ",key)) ;
1214  return;
1215  }
1216 
1217  tmpHist->Fill(x);
1218 }
1219 
1220 //________________________________________________________________________
1222 {
1223  TH1* tmpHist = static_cast<TH1*>(fOutput->FindObject(key));
1224  if(!tmpHist)
1225  {
1226  AliError(Form("Cannot find histogram <%s> ",key));
1227  return;
1228  }
1229 
1230  if (tmpHist->IsA()->GetBaseClass("TH1"))
1231  static_cast<TH1*>(tmpHist)->Fill(x,y); // Fill x with y
1232  else if (tmpHist->IsA()->GetBaseClass("TH2"))
1233  static_cast<TH2*>(tmpHist)->Fill(x,y); // Fill x,y with 1
1234 }
1235 
1236 //________________________________________________________________________
1238 {
1239  TH2* tmpHist = static_cast<TH2*>(fOutput->FindObject(key));
1240  if(!tmpHist)
1241  {
1242  AliError(Form("Cannot find histogram <%s> ",key));
1243  return;
1244  }
1245 
1246  tmpHist->Fill(x,y,add);
1247 }
1248 
1249 //________________________________________________________________________
1251 {
1252  TH3* tmpHist = static_cast<TH3*>(fOutput->FindObject(key));
1253  if(!tmpHist)
1254  {
1255  AliError(Form("Cannot find histogram <%s> ",key));
1256  return;
1257  }
1258 
1259  if(add)
1260  tmpHist->Fill(x,y,z,add);
1261  else
1262  tmpHist->Fill(x,y,z);
1263 }
1264 
1265 
1266 //________________________________________________________________________
1267 template <class T> T* AliAnalysisTaskChargedJetsHadronCF::AddHistogram1D(const char* name, const char* title, const char* options, Int_t xBins, Double_t xMin, Double_t xMax, const char* xTitle, const char* yTitle)
1268 {
1269  T* tmpHist = new T(name, title, xBins, xMin, xMax);
1270 
1271  tmpHist->GetXaxis()->SetTitle(xTitle);
1272  tmpHist->GetYaxis()->SetTitle(yTitle);
1273  tmpHist->SetOption(options);
1274  tmpHist->SetMarkerStyle(kFullCircle);
1275  tmpHist->Sumw2();
1276 
1277  fOutput->Add(tmpHist);
1278 
1279  return tmpHist;
1280 }
1281 
1282 //________________________________________________________________________
1283 template <class T> T* AliAnalysisTaskChargedJetsHadronCF::AddHistogram2D(const char* name, const char* title, const char* options, Int_t xBins, Double_t xMin, Double_t xMax, Int_t yBins, Double_t yMin, Double_t yMax, const char* xTitle, const char* yTitle, const char* zTitle)
1284 {
1285  T* tmpHist = new T(name, title, xBins, xMin, xMax, yBins, yMin, yMax);
1286  tmpHist->GetXaxis()->SetTitle(xTitle);
1287  tmpHist->GetYaxis()->SetTitle(yTitle);
1288  tmpHist->GetZaxis()->SetTitle(zTitle);
1289  tmpHist->SetOption(options);
1290  tmpHist->SetMarkerStyle(kFullCircle);
1291  tmpHist->Sumw2();
1292 
1293  fOutput->Add(tmpHist);
1294 
1295  return tmpHist;
1296 }
1297 
1298 //________________________________________________________________________
1299 template <class T> T* AliAnalysisTaskChargedJetsHadronCF::AddHistogram3D(const char* name, const char* title, const char* options, Int_t xBins, Double_t xMin, Double_t xMax, Int_t yBins, Double_t yMin, Double_t yMax, Int_t zBins, Double_t zMin, Double_t zMax, const char* xTitle, const char* yTitle, const char* zTitle)
1300 {
1301  T* tmpHist = new T(name, title, xBins, xMin, xMax, yBins, yMin, yMax, zBins, zMin, zMax);
1302  tmpHist->GetXaxis()->SetTitle(xTitle);
1303  tmpHist->GetYaxis()->SetTitle(yTitle);
1304  tmpHist->GetZaxis()->SetTitle(zTitle);
1305  tmpHist->SetOption(options);
1306  tmpHist->SetMarkerStyle(kFullCircle);
1307  tmpHist->Sumw2();
1308 
1309  fOutput->Add(tmpHist);
1310 
1311  return tmpHist;
1312 }
1313 
1314 //________________________________________________________________________
1316 {
1317  // Called once at the end of the analysis.
1318 }
1319 
Double_t fEventExtractionMaxJetPt
maximum jet pt of recorded events
Short_t Charge() const
Definition: AliEmcalJet.h:110
Double_t fEventCriteriumMinSubleadingJetPt
Min subleading jet.
Double_t Area() const
Definition: AliEmcalJet.h:117
Double_t GetRhoVal() const
double Double_t
Definition: External.C:58
Bool_t fJetVetoJetByJet
If true, the jet veto will be applied on a jet-by-jet basis.
Double_t GetJetEtaMin() const
T * AddHistogram1D(const char *name="CustomHistogram", const char *title="NO_TITLE", const char *options="", Int_t xBins=100, Double_t xMin=0.0, Double_t xMax=20.0, const char *xTitle="x axis", const char *yTitle="y axis")
const char * title
Definition: MakeQAPdf.C:26
void GetLeadingJets(const char *opt, AliEmcalJet *&jetLeading, AliEmcalJet *&jetSubLeading)
Float_t GetPartonEta6() const
AliEmcalPythiaInfo * fPythiaInfo
!event parton info
TString fJetMatchingArrayName
Name of array used to match jets.
AliJetContainer * GetJetContainer(Int_t i=0) const
Definition: External.C:244
Float_t GetPartonEta7() const
Double_t Eta() const
Definition: AliEmcalJet.h:108
long long Long64_t
Definition: External.C:43
Double_t Phi() const
Definition: AliEmcalJet.h:104
void * fJetsTreeBuffer
! buffer for one jet (that will be saved to the tree)
Container with name, TClonesArray and cuts for particles.
Support task for (charged) jet-hadron correlations.
Int_t fPythiaExtractionMode
Mode which PYTHIA-jets to extract for fJetOutputMode==6: 0: all, 1: quark-jets, 2: gluon jets...
Double_t GetJetEtaMax() const
Float_t GetPartonPhi7() const
virtual Bool_t AcceptJet(Int_t i, UInt_t &rejectionReason) const
Double_t fJetMatchingMaxEmbeddingOffset
An embedded jet must NOT carry more than max fraction + max embedding offset.
Int_t fJetOutputMode
mode which jets are written to array (0: all accepted, 1: leading, 2: subleading, 3: leading+subleadi...
Double_t fEventExtractionMinJetPt
minimum jet pt of recorded events
std::vector< AliEmcalJet * > fMatchedJetsReference
Jets matched in an event (reference)
Double_t fEventExtractionPercentage
percentage of events that is recorded
Simple class containing basic information for a constituent.
Int_t GetPartonFlag7() const
AliEmcalJet * fSubleadingJet
! subleading jet (calculated event-by-event)
Simple class containing basic information for a jet.
void FillHistogram3D(const char *key, Double_t x, Double_t y, Double_t z, Double_t add=0)
Float_t GetPartonPhi6() const
UShort_t GetNumberOfTracks() const
Definition: AliEmcalJet.h:126
UShort_t T(UShort_t m, UShort_t t)
Definition: RingBits.C:60
Double_t fEventCriteriumMinJetDeltaPhi
Min jet delta phi in dijet criterium.
AliParticleContainer * GetParticleContainer(Int_t i=0) const
Int_t GetPartonFlag6() const
void AddJetConstituent(Float_t eta, Float_t phi, Float_t pt, Short_t charge, Short_t pid=0)
AliParticleContainer * GetParticleContainer() const
int Int_t
Definition: External.C:63
Double_t fJetMatchingMaxPt
Max pt cut applied on the matchArray jets.
unsigned int UInt_t
Definition: External.C:33
TString fJetParticleArrayName
Name of fJetsOutput array.
Double_t GetLeadingHadronPt(const AliEmcalJet *jet) const
T * AddHistogram3D(const char *name="CustomHistogram", const char *title="NO_TITLE", const char *options="", Int_t xBins=100, Double_t xMin=0.0, Double_t xMax=20.0, Int_t yBins=100, Double_t yMin=0.0, Double_t yMax=20.0, Int_t zBins=100, Double_t zMin=0.0, Double_t zMax=20.0, const char *xTitle="x axis", const char *yTitle="y axis", const char *zTitle="z axis")
Int_t fNumberOfCentralityBins
Number of centrality bins.
virtual AliVParticle * GetLeadingParticle(const char *opt="")
std::vector< AliEmcalJet * > fMatchedJets
Jets matched in an event (embedded)
Double_t fExtractionPercentage
percentage that is recorded
Double_t fCent
!event centrality
Double_t fJetVetoMinPt
Min pt cut applied on the fJetVetoArray jets.
Double_t fJetVetoMaxPt
Max pt cut applied on the fJetVetoArray jets.
TClonesArray * fJetsOutput
! Array of basic correlation particles attached to the event (jets)
TString fTrackParticleArrayName
Name of fTracksOutput array.
TClonesArray * fTracksOutput
! Array of basic correlation particles attached to the event (tracks)
AliEmcalJet * fLeadingJet
! leading jet (calculated event-by-event)
Double_t fExtractionMinPt
minimum pt of recorded jets
AliEmcalJet * GetNextAcceptJet()
TTree * fJetsTree
! Jets that will be saved to a tree (optionally)
Double_t fJetMatchingMaxSharedFraction
An embedded jet must NOT carry more than max fraction + max embedding offset.
Double_t Pt() const
Definition: AliEmcalJet.h:96
Bool_t IsTrackInCone(AliVParticle *track, Double_t eta, Double_t phi, Double_t radius)
TString fJetVetoArrayName
Name of array used for veto jets.
Float_t GetJetRadius() const
AliEmcalList * fOutput
!output list
TClonesArray * fJetMatchingArray
! Array of generated jets imported into task (toy model/embedding)
Short_t TrackAt(Int_t idx) const
Definition: AliEmcalJet.h:147
AliEmcalJet * fInitialPartonMatchedJet1
! On PYTHIA data and fJetOutputMode=6, this holds the PDG code of the initial collisions that was mat...
AliEmcalJet * fInitialPartonMatchedJet2
! On PYTHIA data and fJetOutputMode=6, this holds the PDG code of the initial collisions that was mat...
Definition: External.C:220
ClassImp(AliAnalysisTaskCRC) AliAnalysisTaskCRC
TH1 * fHistEventRejection
!book keep reasons for rejecting event
void SetMakeGeneralHistograms(Bool_t g)
Base task in the EMCAL jet framework.
Represent a jet reconstructed using the EMCal jet framework.
Definition: AliEmcalJet.h:44
Declaration of class AliEmcalPythiaInfo.
void GetTrackMCRatios(AliEmcalJet *jet, Double_t &trackRatio, Double_t &ptRatio)
const char Option_t
Definition: External.C:48
Double_t fExtractionMaxPt
maximum pt of recorded jets
Double_t fJetMatchingMaxDistance
Max distance allowed to accept a matching jet (for embedding)
virtual AliVParticle * GetNextAcceptParticle()
bool Bool_t
Definition: External.C:53
Double_t fJetMatchingMinPt
Min pt cut applied on the matchArray jets.
Int_t fJetMatchingUseOnlyNLeading
Number of matched leading jets that will be used.
Int_t fAcceptedJets
! number accepted jets (calculated event-by-event)
T * AddHistogram2D(const char *name="CustomHistogram", const char *title="NO_TITLE", const char *options="", Int_t xBins=100, Double_t xMin=0.0, Double_t xMax=20.0, Int_t yBins=100, Double_t yMin=0.0, Double_t yMax=20.0, const char *xTitle="x axis", const char *yTitle="y axis", const char *zTitle="z axis")
Definition: External.C:196
TClonesArray * fJetVetoArray
! Array of jets imported into task used for veto a matching/embedding
Int_t fAcceptedTracks
! number accepted tracks (calculated event-by-event)
Double_t fJetMatchingMinSharedFraction
An embedded jet must carry this pt fraction to be accepted.
Int_t fConstPtFilterBit
For const pt plot, filter bit.