AliPhysics  fde8a9f (fde8a9f)
 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 #include "AliMCEvent.h"
30 #include "AliPythia.h"
31 #include "AliStack.h"
32 
33 #include "AliVTrack.h"
34 #include "AliVHeader.h"
35 #include "AliEmcalJet.h"
36 #include "AliRhoParameter.h"
37 #include "AliLog.h"
38 #include "AliJetContainer.h"
39 #include "AliTrackContainer.h"
40 #include "AliAODTrack.h"
41 #include "AliPicoTrack.h"
42 #include "AliVParticle.h"
43 #include "TRandom3.h"
46 
48 
49 //________________________________________________________________________
51 {
52 // dummy destructor
53 }
54 
58 //________________________________________________________________________
61  fJetsCont(0),
62  fTracksCont(0),
63  fEventExtractionPercentage(0),
64  fEventExtractionMinJetPt(0),
65  fEventExtractionMaxJetPt(0),
66  fConstPtFilterBit(1024),
67  fNumberOfCentralityBins(10),
68  fJetsOutput(),
69  fTracksOutput(),
70  fJetParticleArrayName("JetsDPhiBasicParticles"),
71  fTrackParticleArrayName(""),
72  fJetEmbeddingArray(),
73  fJetEmbeddingArrayName(""),
74  fJetEmbeddingTrackArrayName(""),
75  fJetEmbeddingMaxDistance(0.3),
76  fJetEmbeddingNumMatchedJets(2),
77  fJetEmbeddingUsePerTrackMCPercentage(kTRUE),
78  fJetEmbeddingUseBgrdForMCPercentage(kFALSE),
79  fJetEmbeddingCreatePtPlotPerCut(kFALSE),
80  fJetEmbeddingCuts(),
81  fJetVetoArray(),
82  fJetVetoArrayName(""),
83  fJetVetoJetByJet(1),
84  fMatchedJets(),
85  fRandom(0),
86  fJetOutputMode(0),
87  fLeadingJet(0),
88  fSubleadingJet(0),
89  fInitialPartonMatchedJet1(0),
90  fInitialPartonMatchedJet2(0),
91  fAcceptedJets(0),
92  fAcceptedTracks(0)
93 {
94  // Default constructor.
95  SetMakeGeneralHistograms(kTRUE);
96  fRandom = new TRandom3(0);
97 }
98 
99 
100 //________________________________________________________________________
102  AliAnalysisTaskEmcalJet(name, kTRUE),
103  fJetsCont(0),
104  fTracksCont(0),
105  fEventExtractionPercentage(0),
106  fEventExtractionMinJetPt(0),
107  fEventExtractionMaxJetPt(0),
108  fConstPtFilterBit(1024),
109  fNumberOfCentralityBins(10),
110  fJetsOutput(),
111  fTracksOutput(),
112  fJetParticleArrayName("JetsDPhiBasicParticles"),
113  fTrackParticleArrayName(""),
114  fJetEmbeddingArray(),
115  fJetEmbeddingArrayName(""),
116  fJetEmbeddingTrackArrayName(""),
117  fJetEmbeddingMaxDistance(0.3),
118  fJetEmbeddingNumMatchedJets(2),
119  fJetEmbeddingUsePerTrackMCPercentage(kTRUE),
120  fJetEmbeddingUseBgrdForMCPercentage(kFALSE),
121  fJetEmbeddingCreatePtPlotPerCut(kFALSE),
122  fJetEmbeddingCuts(),
123  fJetVetoArray(),
124  fJetVetoArrayName(""),
125  fJetVetoJetByJet(1),
126  fMatchedJets(),
127  fRandom(0),
128  fJetOutputMode(0),
129  fLeadingJet(0),
130  fSubleadingJet(0),
131  fInitialPartonMatchedJet1(0),
132  fInitialPartonMatchedJet2(0),
133  fAcceptedJets(0),
134  fAcceptedTracks(0)
135 {
136  // Constructor
138  fRandom = new TRandom3(0);
139 }
140 
141 //________________________________________________________________________
143 {
144  // Destructor.
145 }
146 
147 //________________________________________________________________________
149 {
151 
152  // ### Basic container settings
154  if(fJetsCont) { //get particles connected to jets
155  fJetsCont->PrintCuts();
157  } else { //no jets, just analysis tracks
159  }
160  if(fTracksCont) fTracksCont->SetClassName("AliVTrack");
161 
162  // ### Create all histograms
163  fHistEventRejection->GetXaxis()->SetBinLabel(15,"JetVeto");
164 
165  // Track QA plots
166  AddHistogram2D<TH2D>("hTrackPt", "Tracks p_{T} distribution", "", 300, 0., 300., fNumberOfCentralityBins, 0, 100, "p_{T} (GeV/c)", "Centrality", "dN^{Tracks}/dp_{T}");
167  AddHistogram2D<TH2D>("hTrackPhi", "Track angular distribution in #phi", "LEGO2", 180, 0., 2*TMath::Pi(), fNumberOfCentralityBins, 0, 100, "#phi", "Centrality", "dN^{Tracks}/(d#phi)");
168  AddHistogram2D<TH2D>("hTrackEta", "Track angular distribution in #eta", "LEGO2", 100, -2.5, 2.5, fNumberOfCentralityBins, 0, 100, "#eta", "Centrality", "dN^{Tracks}/(d#eta)");
169  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");
170 
171  AddHistogram2D<TH2D>("hLeadingTrackPt", "Leading tracks p_{T} distribution", "", 300, 0., 300., fNumberOfCentralityBins, 0, 100, "p_{T} (GeV/c)", "Centrality", "dN^{Tracks}/dp_{T}");
172  AddHistogram2D<TH2D>("hLeadingTrackPhi", "Leading tracks angular distribution in #phi", "LEGO2", 180, 0., 2*TMath::Pi(), fNumberOfCentralityBins, 0, 100, "#phi", "Centrality", "dN^{Tracks}/(d#phi)");
173  AddHistogram2D<TH2D>("hLeadingTrackEta", "Leading tracks angular distribution in #eta", "LEGO2", 100, -2.5, 2.5, fNumberOfCentralityBins, 0, 100, "#eta", "Centrality", "dN^{Tracks}/(d#eta)");
174  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");
175 
176  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})");
177  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})");
178 
179  // Create plots for each embedding cut
180  for(Int_t i = -1; i<static_cast<Int_t>(fJetEmbeddingCuts.size()); i++)
181  {
182  const char* appendix = "";
183  if(i>-1)
184  {
186  appendix = Form("_%s", currentCut.fCutName.Data());
187 
188  // Don't double-add cuts
189  if( static_cast<TH1*>(fOutput->FindObject(Form("hJetPtRaw%s", appendix))) )
190  continue;
191  }
192  // Jet QA plots
193  AddHistogram2D<TH2D>(Form("hJetPtRaw%s", appendix), "Jets p_{T} distribution (no bgrd. corr.)", "", 300, 0., 300., fNumberOfCentralityBins, 0, 100, "p_{T, jet} (GeV/c)", "Centrality", "dN^{Jets}/dp_{T}");
194  AddHistogram2D<TH2D>(Form("hJetPt%s", appendix), "Jets p_{T} distribution (background subtracted)", "", 400, -100., 300., fNumberOfCentralityBins, 0, 100, "p_{T, jet} (GeV/c)", "Centrality", "dN^{Jets}/dp_{T}");
195  AddHistogram2D<TH2D>(Form("hJetPhi%s", appendix), "Jet angular distribution #phi", "LEGO2", 180, 0., 2*TMath::Pi(), fNumberOfCentralityBins, 0, 100, "#phi", "Centrality", "dN^{Jets}/d#phi");
196  AddHistogram2D<TH2D>(Form("hJetEta%s", appendix), "Jet angular distribution #eta", "LEGO2", 100, -2.5, 2.5, fNumberOfCentralityBins, 0, 100, "#eta","Centrality","dN^{Jets}/d#eta");
197  AddHistogram2D<TH2D>(Form("hJetPhiPt%s", appendix), "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}");
198  AddHistogram2D<TH2D>(Form("hJetEtaPt%s", appendix), "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}");
199  AddHistogram2D<TH2D>(Form("hJetPhiEta%s", appendix), "Jet angular distribution #phi/#eta", "COLZ", 180, 0., 2*TMath::Pi(), 100, -2.5, 2.5, "#phi", "#eta", "dN^{Jets}/d#phi d#eta");
200  AddHistogram2D<TH2D>(Form("hJetArea%s", appendix), "Jet area", "LEGO2", 200, 0., 2., fNumberOfCentralityBins, 0, 100, "Jet A", "Centrality", "dN^{Jets}/dA");
201  AddHistogram2D<TH2D>(Form("hJetAreaPt%s", appendix), "Jet area vs. p_{T}", "LEGO2", 200, 0., 2., 400, -100., 300., "Jet A", "p_{T, jet} (GeV/c)", "dN^{Jets}/dA dp_{T}");
202  AddHistogram2D<TH2D>(Form("hJetPtLeadingHadron%s", appendix), "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}");
203 
204  // Leading/subleading ...
205  AddHistogram2D<TH2D>(Form("hLeadingJetPtRaw%s", appendix), "Jets p_{T} distribution (no bgrd. corr.)", "", 300, 0., 300., fNumberOfCentralityBins, 0, 100, "p_{T, jet} (GeV/c)", "Centrality", "dN^{Jets}/dp_{T}");
206  AddHistogram2D<TH2D>(Form("hLeadingJetPt%s", appendix), "Jets p_{T} distribution (background subtracted)", "", 400, -100., 300., fNumberOfCentralityBins, 0, 100, "p_{T, jet} (GeV/c)", "Centrality", "dN^{Jets}/dp_{T}");
207  AddHistogram2D<TH2D>(Form("hLeadingJetPhi%s", appendix), "Jet angular distribution #phi", "LEGO2", 180, 0., 2*TMath::Pi(), fNumberOfCentralityBins, 0, 100, "#phi", "Centrality", "dN^{Jets}/d#phi");
208  AddHistogram2D<TH2D>(Form("hLeadingJetEta%s", appendix), "Jet angular distribution #eta", "LEGO2", 100, -2.5, 2.5, fNumberOfCentralityBins, 0, 100, "#eta","Centrality","dN^{Jets}/d#eta");
209  AddHistogram2D<TH2D>(Form("hLeadingJetPhiPt%s", appendix), "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}");
210  AddHistogram2D<TH2D>(Form("hLeadingJetEtaPt%s", appendix), "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}");
211  AddHistogram2D<TH2D>(Form("hLeadingJetPhiEta%s", appendix), "Jet angular distribution #phi/#eta", "COLZ", 180, 0., 2*TMath::Pi(), 100, -2.5, 2.5, "#phi", "#eta", "dN^{Jets}/d#phi d#eta");
212  AddHistogram2D<TH2D>(Form("hLeadingJetArea%s", appendix), "Jet area", "LEGO2", 200, 0., 2., fNumberOfCentralityBins, 0, 100, "Jet A", "Centrality", "dN^{Jets}/dA");
213  AddHistogram2D<TH2D>(Form("hLeadingJetAreaPt%s", appendix), "Jet area vs. p_{T}", "LEGO2", 200, 0., 2., 400, -100., 300., "Jet A", "p_{T, jet} (GeV/c)", "dN^{Jets}/dA dp_{T}");
214  AddHistogram2D<TH2D>(Form("hLeadingJetPtLeadingHadron%s", appendix), "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}");
215 
216  AddHistogram2D<TH2D>(Form("hSubleadingJetPtRaw%s", appendix), "Jets p_{T} distribution (no bgrd. corr.)", "", 300, 0., 300., fNumberOfCentralityBins, 0, 100, "p_{T, jet} (GeV/c)", "Centrality", "dN^{Jets}/dp_{T}");
217  AddHistogram2D<TH2D>(Form("hSubleadingJetPt%s", appendix), "Jets p_{T} distribution (background subtracted)", "", 400, -100., 300., fNumberOfCentralityBins, 0, 100, "p_{T, jet} (GeV/c)", "Centrality", "dN^{Jets}/dp_{T}");
218  AddHistogram2D<TH2D>(Form("hSubleadingJetPhi%s", appendix), "Jet angular distribution #phi", "LEGO2", 180, 0., 2*TMath::Pi(), fNumberOfCentralityBins, 0, 100, "#phi", "Centrality", "dN^{Jets}/d#phi");
219  AddHistogram2D<TH2D>(Form("hSubleadingJetEta%s", appendix), "Jet angular distribution #eta", "LEGO2", 100, -2.5, 2.5, fNumberOfCentralityBins, 0, 100, "#eta","Centrality","dN^{Jets}/d#eta");
220  AddHistogram2D<TH2D>(Form("hSubleadingJetPhiPt%s", appendix), "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}");
221  AddHistogram2D<TH2D>(Form("hSubleadingJetEtaPt%s", appendix), "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}");
222  AddHistogram2D<TH2D>(Form("hSubleadingJetPhiEta%s", appendix), "Jet angular distribution #phi/#eta", "COLZ", 180, 0., 2*TMath::Pi(), 100, -2.5, 2.5, "#phi", "#eta", "dN^{Jets}/d#phi d#eta");
223  AddHistogram2D<TH2D>(Form("hSubleadingJetArea%s", appendix), "Jet area", "LEGO2", 200, 0., 2., fNumberOfCentralityBins, 0, 100, "Jet A", "Centrality", "dN^{Jets}/dA");
224  AddHistogram2D<TH2D>(Form("hSubleadingJetAreaPt%s", appendix), "Jet area vs. p_{T}", "LEGO2", 200, 0., 2., 400, -100., 300., "Jet A", "p_{T, jet} (GeV/c)", "dN^{Jets}/dA dp_{T}");
225  AddHistogram2D<TH2D>(Form("hSubleadingJetPtLeadingHadron%s", appendix), "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}");
226 
227  AddHistogram2D<TH2D>(Form("hJetConstituentPt_Cent0_100%s", appendix), "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}");
228  AddHistogram2D<TH2D>(Form("hJetConstituentPt_Cent0_10%s", appendix), "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}");
229  AddHistogram2D<TH2D>(Form("hJetConstituentPt_Cent10_30%s", appendix), "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}");
230  AddHistogram2D<TH2D>(Form("hJetConstituentPt_Cent30_50%s", appendix), "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}");
231  AddHistogram2D<TH2D>(Form("hJetConstituentPt_Cent50_90%s", appendix), "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}");
232 
233  AddHistogram2D<TH2D>(Form("hJetConstituentPt_Cent0_100_FilterBit%i%s", fConstPtFilterBit, appendix), "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}");
234  AddHistogram2D<TH2D>(Form("hJetConstituentPt_Cent0_10_FilterBit%i%s", fConstPtFilterBit, appendix), "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}");
235  AddHistogram2D<TH2D>(Form("hJetConstituentPt_Cent10_30_FilterBit%i%s", fConstPtFilterBit, appendix), "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}");
236  AddHistogram2D<TH2D>(Form("hJetConstituentPt_Cent30_50_FilterBit%i%s", fConstPtFilterBit, appendix), "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}");
237  AddHistogram2D<TH2D>(Form("hJetConstituentPt_Cent50_90_FilterBit%i%s", fConstPtFilterBit, appendix), "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}");
238 
239  AddHistogram2D<TH2D>(Form("hJetConstituentCount_Cent0_100%s", appendix), "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}");
240  AddHistogram2D<TH2D>(Form("hJetConstituentCount_Cent0_10%s", appendix), "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}");
241  }
242 
243  // Embedding plots
244  if(fJetOutputMode == 4 || fJetOutputMode == 5)
245  {
246  Double_t maxRatio = 1.;
248  maxRatio = 2.;
249 
250  for(Int_t i = -1; i<static_cast<Int_t>(fJetEmbeddingCuts.size()); i++)
251  {
252  const char* appendix = "";
253  if(i>-1)
254  {
256  appendix = Form("_%s", currentCut.fCutName.Data());
257 
258  // Don't double-add cuts
259  if( static_cast<TH1*>(fOutput->FindObject(Form("hEmbeddingDeltaR%s", appendix))) )
260  continue;
261  }
262  AddHistogram2D<TH2D>(Form("hEmbeddingDeltaR%s", appendix), "Matched jet #Delta R distribution", "", 200, -50., 150., 100, 0, 1.0, "p_{T, jet} (GeV/c)", "#Delta R", "dN^{Matched}/dp_{T}dR");
263  AddHistogram2D<TH2D>(Form("hEmbeddingDeltaEta%s", appendix), "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");
264  AddHistogram2D<TH2D>(Form("hEmbeddingDeltaPhi%s", appendix), "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");
265  AddHistogram1D<TH1D>(Form("hEmbeddingJetPt%s", appendix), "Embedded jets p_{T} distribution", "", 200, -50., 150., "p_{T, jet} (GeV/c)", "dN/dp_{T}");
266  AddHistogram2D<TH2D>(Form("hEmbeddingJetPhiEta%s", appendix), "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");
267 
269  {
270  AddHistogram3D<TH3D>(Form("hEmbeddingPtCorr010%s", appendix), "Matched jet p_{T} distributions (0-10% centrality)", "", 150, 0., 150., 150, 0., 150., 100, 0., maxRatio, "p_{T, MC jet} (GeV/c)", "p_{T, emb} (GeV/c)", "% MC");
271  AddHistogram3D<TH3D>(Form("hEmbeddingPtCorr1030%s", appendix), "Matched jet p_{T} distributions (10-30% centrality)", "", 150, 0., 150., 150, 0., 150., 100, 0., maxRatio, "p_{T, MC jet} (GeV/c)", "p_{T, emb} (GeV/c)", "% MC");
272  AddHistogram3D<TH3D>(Form("hEmbeddingPtCorr3050%s", appendix), "Matched jet p_{T} distributions (30-50% centrality)", "", 150, 0., 150., 150, 0., 150., 100, 0., maxRatio, "p_{T, MC jet} (GeV/c)", "p_{T, emb} (GeV/c)", "% MC");
273  AddHistogram3D<TH3D>(Form("hEmbeddingPtCorr5090%s", appendix), "Matched jet p_{T} distributions (50-90% centrality)", "", 150, 0., 150., 150, 0., 150., 100, 0., maxRatio, "p_{T, MC jet} (GeV/c)", "p_{T, emb} (GeV/c)", "% MC");
274  }
275  else
276  {
277  AddHistogram2D<TH2D>(Form("hEmbeddingPtCorr010_Above20%s", appendix), "Matched jet p_{T} distributions, MC ratio > 20% (0-10% centrality)", "", 150, 0., 150., 150, 0., 150.,"p_{T, MC jet} (GeV/c)", "p_{T, emb} (GeV/c)", "% MC");
278  AddHistogram2D<TH2D>(Form("hEmbeddingPtCorr1030_Above20%s", appendix),"Matched jet p_{T} distributions, MC ratio > 20% (10-30% centrality)","", 150, 0., 150., 150, 0., 150.,"p_{T, MC jet} (GeV/c)", "p_{T, emb} (GeV/c)", "% MC");
279  AddHistogram2D<TH2D>(Form("hEmbeddingPtCorr3050_Above20%s", appendix),"Matched jet p_{T} distributions, MC ratio > 20% (30-50% centrality)","", 150, 0., 150., 150, 0., 150.,"p_{T, MC jet} (GeV/c)", "p_{T, emb} (GeV/c)", "% MC");
280  AddHistogram2D<TH2D>(Form("hEmbeddingPtCorr5090_Above20%s", appendix),"Matched jet p_{T} distributions, MC ratio > 20% (50-90% centrality)","", 150, 0., 150., 150, 0., 150.,"p_{T, MC jet} (GeV/c)", "p_{T, emb} (GeV/c)", "% MC");
281  }
282  }
283 
285  {
286  AddHistogram3D<TH3D>("hEmbeddingPtCorr010", "Matched jet p_{T} distributions (0-10% centrality)", "", 150, 0., 150., 150, 0., 150., 100, 0., maxRatio, "p_{T, MC jet} (GeV/c)", "p_{T, emb} (GeV/c)", "% MC");
287  AddHistogram3D<TH3D>("hEmbeddingPtCorr1030", "Matched jet p_{T} distributions (10-30% centrality)", "", 150, 0., 150., 150, 0., 150., 100, 0., maxRatio, "p_{T, MC jet} (GeV/c)", "p_{T, emb} (GeV/c)", "% MC");
288  AddHistogram3D<TH3D>("hEmbeddingPtCorr3050", "Matched jet p_{T} distributions (30-50% centrality)", "", 150, 0., 150., 150, 0., 150., 100, 0., maxRatio, "p_{T, MC jet} (GeV/c)", "p_{T, emb} (GeV/c)", "% MC");
289  AddHistogram3D<TH3D>("hEmbeddingPtCorr5090", "Matched jet p_{T} distributions (50-90% centrality)", "", 150, 0., 150., 150, 0., 150., 100, 0., maxRatio, "p_{T, MC jet} (GeV/c)", "p_{T, emb} (GeV/c)", "% MC");
290  }
291  }
292 
293  // Random cone plots, background, ...
294  AddHistogram2D<TH2D>("hRandomConePt", "Random cone p_{T} distribution", "", 400, -100., 300., fNumberOfCentralityBins, 0, 100, "p_{T, cone} (GeV/c)", "Centrality", "dN^{Tracks}/dp_{T}");
295  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}");
296  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}");
297  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}");
298 
299  AddHistogram2D<TH2D>("hTrackCount", "Number of tracks in acceptance vs. centrality", "LEGO2", 500, 0., 5000., fNumberOfCentralityBins, 0, 100, "N tracks","Centrality", "dN^{Events}/dN^{Tracks}");
300  AddHistogram2D<TH2D>("hJetCount", "Number of jets in acceptance vs. centrality", "LEGO2", 100, 0., 100., fNumberOfCentralityBins, 0, 100, "N Jets","Centrality", "dN^{Events}/dN^{Jets}");
301  AddHistogram2D<TH2D>("hBackgroundPt", "Background p_{T} distribution", "", 150, 0., 150., fNumberOfCentralityBins, 0, 100, "Background p_{T} (GeV/c)", "Centrality", "dN^{Events}/dp_{T}");
302 
303 
304  for(Int_t i = -1; i<static_cast<Int_t>(fJetEmbeddingCuts.size()); i++)
305  {
306  const char* appendix = "";
307  if(i>-1)
308  {
310  appendix = Form("_%s", currentCut.fCutName.Data());
311 
312  // Don't double-add cuts
313  if( static_cast<TH1*>(fOutput->FindObject(Form("hBackgroundPtJetPt_Cent0_100%s", appendix))) )
314  continue;
315  }
316  AddHistogram2D<TH2D>(Form("hBackgroundPtJetPt_Cent0_100%s", appendix), "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}");
317  AddHistogram2D<TH2D>(Form("hBackgroundPtJetPt_Cent0_10%s", appendix), "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}");
318  AddHistogram2D<TH2D>(Form("hBackgroundPtConstCount_Cent0_100%s", appendix), "Background p_{T} distribution vs. const. count", "", 150, 0., 150., 200, 0., 200., "Background p_{T} (GeV/c)", "Count", "dN^{Events}/dp_{T}");
319  AddHistogram2D<TH2D>(Form("hBackgroundPtConstCount_Cent0_10%s", appendix), "Background p_{T} distribution vs. const. count", "", 150, 0., 150., 200, 0., 200., "Background p_{T} (GeV/c)", "Count", "dN^{Events}/dp_{T}");
320  }
321 
322  PostData(1, fOutput); // Post data for ALL output slots > 0 here.
323 }
324 
325 
326 //________________________________________________________________________
328 
330 
331 
332  // ### Add the jets as basic correlation particles to the event
333  // This output object carries all accepted jets
334  if (!(fInputEvent->FindListObject(Form("%s", fJetParticleArrayName.Data()))))
335  {
336  fJetsOutput.push_back(new TClonesArray("AliPicoTrack"));
337  fJetsOutput.at(0)->SetName(fJetParticleArrayName.Data());
338  fInputEvent->AddObject(fJetsOutput.at(0));
339  }
340  else
341  AliFatal(Form("%s: Object with name %s already in event!", GetName(), Form("%s", fJetParticleArrayName.Data())));
342 
343  // These output objects carry all jets that pass certain cuts
344  if( (fJetOutputMode==4 || fJetOutputMode==5) )
345  {
346  // before, check if all given output names are OK
347  for(Int_t i = 0; i<fJetEmbeddingCuts.size(); i++)
348  if (fInputEvent->FindListObject(Form("%s", fJetEmbeddingCuts.at(i).fOutputName.Data())))
349  AliFatal(Form("%s: Object with name %s already in event!", GetName(), Form("%s", fJetEmbeddingCuts.at(i).fOutputName.Data())));
350 
351  for(Int_t i = 0; i<fJetEmbeddingCuts.size(); i++)
352  {
353  // If the cut demands a new output stream, add it
354  if (!fInputEvent->FindListObject(Form("%s", fJetEmbeddingCuts.at(i).fOutputName.Data())))
355  {
356  fJetsOutput.push_back(new TClonesArray("AliPicoTrack"));
357  fJetsOutput.at(fJetsOutput.size()-1)->SetName(fJetEmbeddingCuts.at(i).fOutputName.Data());
358  fInputEvent->AddObject(fJetsOutput.at(fJetsOutput.size()-1));
359  fJetEmbeddingCuts.at(i).fArrayIndex = fJetsOutput.size()-1;
360 
361  // Set the array indices for all cuts that use this output stream
362  for(Int_t j = 0; j<fJetEmbeddingCuts.size(); j++)
363  {
364  if(fJetEmbeddingCuts.at(j).fArrayIndex != -1)
365  continue;
366  if(fJetEmbeddingCuts.at(j).fOutputName != fJetEmbeddingCuts.at(i).fOutputName)
367  continue;
368  fJetEmbeddingCuts.at(j).fArrayIndex = fJetEmbeddingCuts.at(i).fArrayIndex;
369  }
370  }
371  }
372  }
373 
374  // ##############################################
375  // ##############################################
376 
377  // ### Add the tracks as basic correlation particles to the event (optional)
378  if(fTrackParticleArrayName != "")
379  {
380  if (!(fInputEvent->FindListObject(Form("%s", fTrackParticleArrayName.Data()))))
381  {
382  fTracksOutput = new TClonesArray("AliPicoTrack");
383  fTracksOutput->SetName(fTrackParticleArrayName.Data());
384  fInputEvent->AddObject(fTracksOutput);
385  }
386  else
387  AliFatal(Form("%s: Object with name %s already in event!", GetName(), Form("%s", fTrackParticleArrayName.Data())));
388  }
389 
390  // ### Import jets for embedding (optional)
391  if(fJetEmbeddingArrayName != "")
392  {
393  fJetEmbeddingArray = static_cast<TClonesArray*>(InputEvent()->FindListObject(Form("%s", fJetEmbeddingArrayName.Data())));
394  if(!fJetEmbeddingArray)
395  AliFatal(Form("Importing jets for embedding failed! Array '%s' not found!", fJetEmbeddingArrayName.Data()));
396  }
397  else if(fJetOutputMode==4 || fJetOutputMode==5)
398  AliFatal(Form("fJetEmbeddingArrayName must be set in jet output mode 4 or 5."));
399 
400  // ### Import veto jets for matching (optional)
401  if(fJetVetoArrayName != "")
402  {
403  fJetVetoArray = static_cast<TClonesArray*>(InputEvent()->FindListObject(Form("%s", fJetVetoArrayName.Data())));
404  if(!fJetVetoArray)
405  AliFatal(Form("Importing jets for veto failed! Array '%s' not found!", fJetVetoArrayName.Data()));
406  }
407 }
408 
409 //________________________________________________________________________
411 {
412  if(fJetOutputMode==3) // output leading&subleading jet
413  {
414  if((jet!=fLeadingJet) && (jet!=fSubleadingJet))
415  return kFALSE;
416  }
417  else if(fJetOutputMode==1) // output the leading jet
418  {
419  if(jet!=fLeadingJet)
420  return kFALSE;
421  }
422  else if(fJetOutputMode==2) // output the subleading jet
423  {
424  if(jet!=fSubleadingJet)
425  return kFALSE;
426  }
427  else if(fJetOutputMode==6)
428  {
430  return kFALSE;
431  }
432 
433  if(fJetOutputMode==4) // matching jets only
434  return (std::find(fMatchedJets.begin(), fMatchedJets.end(), jet) != fMatchedJets.end());
435  else if(fJetOutputMode==5) // non-matching jets only
436  return (std::find(fMatchedJets.begin(), fMatchedJets.end(), jet) == fMatchedJets.end());
437 
438  return kTRUE;
439 }
440 
441 //________________________________________________________________________
443 {
444  TString appendix("");
445  if(cutName)
446  appendix = Form("_%s", cutName);
447 
448  // All jets
449  FillHistogram(Form("hJetPtRaw%s", appendix.Data()), jet->Pt(), fCent);
450  FillHistogram(Form("hJetPt%s", appendix.Data()), jet->Pt() - fJetsCont->GetRhoVal()*jet->Area(), fCent);
451  FillHistogram(Form("hJetPhi%s", appendix.Data()), jet->Phi(), fCent);
452  FillHistogram(Form("hJetEta%s", appendix.Data()), jet->Eta(), fCent);
453  FillHistogram(Form("hJetEtaPt%s", appendix.Data()), jet->Eta(), jet->Pt() - fJetsCont->GetRhoVal()*jet->Area());
454  FillHistogram(Form("hJetPhiPt%s", appendix.Data()), jet->Phi(), jet->Pt() - fJetsCont->GetRhoVal()*jet->Area());
455  FillHistogram(Form("hJetPhiEta%s", appendix.Data()), jet->Phi(), jet->Eta());
456  FillHistogram(Form("hJetArea%s", appendix.Data()), jet->Area(), fCent);
457  FillHistogram(Form("hJetAreaPt%s", appendix.Data()), jet->Area(), jet->Pt() - fJetsCont->GetRhoVal()*jet->Area());
458  FillHistogram(Form("hJetPtLeadingHadron%s", appendix.Data()), jet->Pt() - fJetsCont->GetRhoVal()*jet->Area(), fJetsCont->GetLeadingHadronPt(jet));
459 
460  FillHistogram(Form("hBackgroundPtJetPt_Cent0_100%s", appendix.Data()), fJetsCont->GetRhoVal(), jet->Pt() - fJetsCont->GetRhoVal()*jet->Area());
461  if( (fCent >= 0) && (fCent < 10) )
462  FillHistogram(Form("hBackgroundPtJetPt_Cent0_10%s", appendix.Data()), fJetsCont->GetRhoVal(), jet->Pt() - fJetsCont->GetRhoVal()*jet->Area());
463 
464  // Leading jet plots
465  if(jet==fLeadingJet)
466  {
467  FillHistogram(Form("hLeadingJetPtRaw%s", appendix.Data()), jet->Pt(), fCent);
468  FillHistogram(Form("hLeadingJetPt%s", appendix.Data()), jet->Pt() - fJetsCont->GetRhoVal()*jet->Area(), fCent);
469  FillHistogram(Form("hLeadingJetPhi%s", appendix.Data()), jet->Phi(), fCent);
470  FillHistogram(Form("hLeadingJetEta%s", appendix.Data()), jet->Eta(), fCent);
471  FillHistogram(Form("hLeadingJetEtaPt%s", appendix.Data()), jet->Eta(), jet->Pt() - fJetsCont->GetRhoVal()*jet->Area());
472  FillHistogram(Form("hLeadingJetPhiPt%s", appendix.Data()), jet->Phi(), jet->Pt() - fJetsCont->GetRhoVal()*jet->Area());
473  FillHistogram(Form("hLeadingJetPhiEta%s", appendix.Data()), jet->Phi(), jet->Eta());
474  FillHistogram(Form("hLeadingJetArea%s", appendix.Data()), jet->Area(), fCent);
475  FillHistogram(Form("hLeadingJetAreaPt%s", appendix.Data()), jet->Area(), jet->Pt() - fJetsCont->GetRhoVal()*jet->Area());
476  FillHistogram(Form("hLeadingJetPtLeadingHadron%s", appendix.Data()), jet->Pt() - fJetsCont->GetRhoVal()*jet->Area(), fJetsCont->GetLeadingHadronPt(jet));
477  }
478 
479  // Subleading jet plot
480  else if(jet==fSubleadingJet)
481  {
482  FillHistogram(Form("hSubleadingJetPtRaw%s", appendix.Data()), jet->Pt(), fCent);
483  FillHistogram(Form("hSubleadingJetPt%s", appendix.Data()), jet->Pt() - fJetsCont->GetRhoVal()*jet->Area(), fCent);
484  FillHistogram(Form("hSubleadingJetPhi%s", appendix.Data()), jet->Phi(), fCent);
485  FillHistogram(Form("hSubleadingJetEta%s", appendix.Data()), jet->Eta(), fCent);
486  FillHistogram(Form("hSubleadingJetEtaPt%s", appendix.Data()), jet->Eta(), jet->Pt() - fJetsCont->GetRhoVal()*jet->Area());
487  FillHistogram(Form("hSubleadingJetPhiPt%s", appendix.Data()), jet->Phi(), jet->Pt() - fJetsCont->GetRhoVal()*jet->Area());
488  FillHistogram(Form("hSubleadingJetPhiEta%s", appendix.Data()), jet->Phi(), jet->Eta());
489  FillHistogram(Form("hSubleadingJetArea%s", appendix.Data()), jet->Area(), fCent);
490  FillHistogram(Form("hSubleadingJetAreaPt%s", appendix.Data()), jet->Area(), jet->Pt() - fJetsCont->GetRhoVal()*jet->Area());
491  FillHistogram(Form("hSubleadingJetPtLeadingHadron%s", appendix.Data()), jet->Pt() - fJetsCont->GetRhoVal()*jet->Area(), fJetsCont->GetLeadingHadronPt(jet));
492  }
493 
494  // ####### Jet constituent plots
495  for(Int_t i = 0; i < jet->GetNumberOfTracks(); i++)
496  {
497  AliVParticle* constituent = static_cast<AliVParticle*>(jet->TrackAt(i, fTracksCont->GetArray()));
498  if(!constituent)
499  continue;
500 
501  Bool_t filterConditionFulfilled = kFALSE;
502  AliAODTrack* aodTrack = static_cast<AliAODTrack*>(constituent);
503  if (aodTrack)
504  filterConditionFulfilled = aodTrack->TestFilterBit(fConstPtFilterBit);
505 
506  // Fill jet constituent plots
507  FillHistogram(Form("hJetConstituentPt_Cent0_100%s", appendix.Data()), jet->Pt() - fJetsCont->GetRhoVal()*jet->Area(), constituent->Pt());
508  if(filterConditionFulfilled)
509  FillHistogram(Form("hJetConstituentPt_Cent0_100_FilterBit%i%s", fConstPtFilterBit, appendix.Data()), jet->Pt() - fJetsCont->GetRhoVal()*jet->Area(), constituent->Pt());
510  if( (fCent >= 0) && (fCent < 10) )
511  {
512  FillHistogram(Form("hJetConstituentPt_Cent0_10%s", appendix.Data()), jet->Pt() - fJetsCont->GetRhoVal()*jet->Area(), constituent->Pt());
513  if(filterConditionFulfilled)
514  FillHistogram(Form("hJetConstituentPt_Cent0_10_FilterBit%i%s", fConstPtFilterBit, appendix.Data()), jet->Pt() - fJetsCont->GetRhoVal()*jet->Area(), constituent->Pt());
515  }
516  else if( (fCent >= 10) && (fCent < 30) )
517  {
518  FillHistogram(Form("hJetConstituentPt_Cent10_30%s", appendix.Data()), jet->Pt() - fJetsCont->GetRhoVal()*jet->Area(), constituent->Pt());
519  if(filterConditionFulfilled)
520  FillHistogram(Form("hJetConstituentPt_Cent10_30_FilterBit%i%s", fConstPtFilterBit, appendix.Data()), jet->Pt() - fJetsCont->GetRhoVal()*jet->Area(), constituent->Pt());
521  }
522  else if( (fCent >= 30) && (fCent < 50) )
523  {
524  FillHistogram(Form("hJetConstituentPt_Cent30_50%s", appendix.Data()), jet->Pt() - fJetsCont->GetRhoVal()*jet->Area(), constituent->Pt());
525  if(filterConditionFulfilled)
526  FillHistogram(Form("hJetConstituentPt_Cent30_50_FilterBit%i%s", fConstPtFilterBit, appendix.Data()), jet->Pt() - fJetsCont->GetRhoVal()*jet->Area(), constituent->Pt());
527  }
528  else if( (fCent >= 50) && (fCent < 90) )
529  {
530  FillHistogram(Form("hJetConstituentPt_Cent50_90%s", appendix.Data()), jet->Pt() - fJetsCont->GetRhoVal()*jet->Area(), constituent->Pt());
531  if(filterConditionFulfilled)
532  FillHistogram(Form("hJetConstituentPt_Cent50_90_FilterBit%i%s", fConstPtFilterBit, appendix.Data()), jet->Pt() - fJetsCont->GetRhoVal()*jet->Area(), constituent->Pt());
533  }
534  }
535 
536  FillHistogram(Form("hJetConstituentCount_Cent0_100%s", appendix.Data()), jet->Pt() - fJetsCont->GetRhoVal()*jet->Area(), jet->GetNumberOfTracks());
537  if( (fCent >= 0) && (fCent < 10) )
538  FillHistogram(Form("hJetConstituentCount_Cent0_10%s", appendix.Data()), jet->Pt() - fJetsCont->GetRhoVal()*jet->Area(), jet->GetNumberOfTracks());
539 
540  FillHistogram(Form("hBackgroundPtConstCount_Cent0_100%s", appendix.Data()), fJetsCont->GetRhoVal(), jet->GetNumberOfTracks());
541  if( (fCent >= 0) && (fCent < 10) )
542  FillHistogram(Form("hBackgroundPtConstCount_Cent0_10%s", appendix.Data()), fJetsCont->GetRhoVal(), jet->GetNumberOfTracks());
543 
544  // ####### Embedding plots
545  if( (fJetOutputMode == 4) || (fJetOutputMode == 5))
546  {
547  AliEmcalJet* refJet = GetReferenceJet(jet);
548  Double_t deltaEta = (jet->Eta()-refJet->Eta());
549  Double_t deltaPhi = TMath::Min(TMath::Abs(jet->Phi()-refJet->Phi()),TMath::TwoPi() - TMath::Abs(jet->Phi()-refJet->Phi()));
550  if(jet->Phi() < refJet->Phi())
551  deltaPhi = -deltaPhi;
552 
553  Double_t deltaR = TMath::Sqrt(deltaEta*deltaEta + deltaPhi*deltaPhi);
554  FillHistogram(Form("hEmbeddingDeltaR%s", appendix.Data()), jet->Pt() - fJetsCont->GetRhoVal()*jet->Area(), deltaR);
555  FillHistogram(Form("hEmbeddingDeltaEta%s", appendix.Data()), jet->Pt() - fJetsCont->GetRhoVal()*jet->Area(), deltaPhi);
556  FillHistogram(Form("hEmbeddingDeltaPhi%s", appendix.Data()), jet->Pt() - fJetsCont->GetRhoVal()*jet->Area(), deltaEta);
557  FillHistogram(Form("hEmbeddingJetPt%s", appendix.Data()), refJet->Pt());
558  FillHistogram(Form("hEmbeddingJetPhiEta%s", appendix.Data()), refJet->Phi(), refJet->Eta());
559 
560  // Only create 3D plots for each cut on demand
561  Double_t trackRatio = 0.;
562  Double_t ptRatio = 0.;
563  GetTrackMCRatios(jet, refJet, trackRatio, ptRatio);
564 
565  if(fCent >= 0 && fCent < 10)
566  {
567  if((appendix == "") || fJetEmbeddingCreatePtPlotPerCut)
568  FillHistogram3D(Form("hEmbeddingPtCorr010%s", appendix.Data()), refJet->Pt(), jet->Pt() - fJetsCont->GetRhoVal()*jet->Area(), ptRatio);
569  if(ptRatio >= 0.2)
570  FillHistogram(Form("hEmbeddingPtCorr010_Above20%s", appendix.Data()), refJet->Pt(), jet->Pt() - fJetsCont->GetRhoVal()*jet->Area());
571  }
572  else if (fCent >= 10 && fCent < 30)
573  {
574  if((appendix == "") || fJetEmbeddingCreatePtPlotPerCut)
575  FillHistogram3D(Form("hEmbeddingPtCorr1030%s", appendix.Data()), refJet->Pt(), jet->Pt() - fJetsCont->GetRhoVal()*jet->Area(), ptRatio);
576  if(ptRatio >= 0.2)
577  FillHistogram(Form("hEmbeddingPtCorr1030_Above20%s", appendix.Data()), refJet->Pt(), jet->Pt() - fJetsCont->GetRhoVal()*jet->Area());
578  }
579  else if (fCent >= 30 && fCent < 50)
580  {
581  if((appendix == "") || fJetEmbeddingCreatePtPlotPerCut)
582  FillHistogram3D(Form("hEmbeddingPtCorr3050%s", appendix.Data()), refJet->Pt(), jet->Pt() - fJetsCont->GetRhoVal()*jet->Area(), ptRatio);
583  if(ptRatio >= 0.2)
584  FillHistogram(Form("hEmbeddingPtCorr3050_Above20%s", appendix.Data()), refJet->Pt(), jet->Pt() - fJetsCont->GetRhoVal()*jet->Area());
585  }
586  else if (fCent >= 50 && fCent < 90)
587  {
588  if((appendix == "") || fJetEmbeddingCreatePtPlotPerCut)
589  FillHistogram3D(Form("hEmbeddingPtCorr5090%s", appendix.Data()), refJet->Pt(), jet->Pt() - fJetsCont->GetRhoVal()*jet->Area(), ptRatio);
590  if(ptRatio >= 0.2)
591  FillHistogram(Form("hEmbeddingPtCorr5090_Above20%s", appendix.Data()), refJet->Pt(), jet->Pt() - fJetsCont->GetRhoVal()*jet->Area());
592  }
593  }
594 }
595 
596 //________________________________________________________________________
598 {
599  FillHistogram("hTrackPt", track->Pt(), fCent);
600  FillHistogram("hTrackPhi", track->Phi(), fCent);
601  FillHistogram("hTrackEta", track->Eta(), fCent);
602  FillHistogram("hTrackEtaPt", track->Eta(), track->Pt());
603  FillHistogram("hTrackPhiPt", track->Phi(), track->Pt());
604  FillHistogram("hTrackPhiEta", track->Phi(), track->Eta());
605 }
606 
607 //________________________________________________________________________
609 {
610  Double_t tmpPt = jet->Pt() - fJetsCont->GetRhoVal()*jet->Area();
611  new ((*fJetsOutput.at(arrayIndex))[jetsAlreadyInArray]) AliPicoTrack(tmpPt, jet->Eta(), jet->Phi(), jet->Charge(), 0, 0);
612  jetsAlreadyInArray++;
613 }
614 
615 //________________________________________________________________________
617 {
618  if(fTrackParticleArrayName != "")
619  {
620  new ((*fTracksOutput)[fAcceptedTracks]) AliPicoTrack(track->Pt(), track->Eta(), track->Phi(), track->Charge(), 0, 0); // only Pt,Eta,Phi are interesting for correlations;
621  fAcceptedTracks++;
622  }
623 }
624 
625 //________________________________________________________________________
627 {
628  // Check jet pT threshold
630  return;
631 
632  // Discard jets statistically
633  if(fRandom->Rndm() >= fEventExtractionPercentage)
634  return;
635 
636  static Int_t numSavedEvents = 0;
637  numSavedEvents++;
638 
639 
640  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");
641  fTracksCont->ResetCurrentID();
642  while(AliVTrack *track = static_cast<AliVTrack*>(fTracksCont->GetNextAcceptParticle()))
643  FillHistogram(Form("Event%i", numSavedEvents), track->Phi(), track->Eta(), track->Pt());
644 
645 }
646 
647 //________________________________________________________________________
649 {
651 
652  // Jet veto:
653  // 1. jet-by-jet mode: veto is active if jets overlaps with a suitable jet
654  // 2. other mode: veto is active if suitable jet is in sample
655  AliEmcalJet* vetoJet = 0;
656  if(!fJetVetoJetByJet)
657  vetoJet = GetLeadingVetoJet();
658 
659  // ####### Jet loop
660  fAcceptedJets = 0;
661  for(Int_t i = 0; i<fJetEmbeddingCuts.size(); i++)
662  fJetEmbeddingCuts.at(i).fAcceptedJets = 0;
663  fJetsCont->ResetCurrentID();
664  while(AliEmcalJet *jet = fJetsCont->GetNextAcceptJet())
665  {
666  if(!IsJetSelected(jet))
667  continue;
668 
669  // Plots + output jets regardless of embedding cut
670  FillHistogramsJets(jet, 0);
672 
673  // Plots + output jets for each embedding cut
674  if(fJetVetoJetByJet)
675  vetoJet = GetVetoJet(jet);
676  for(Int_t i = 0; i<fJetEmbeddingCuts.size(); i++)
677  {
679  AliEmcalJet* refJet = GetReferenceJet(jet);
680  Double_t trackRatio = 0.;
681  Double_t ptRatio = 0.;
682  GetTrackMCRatios(jet, refJet, trackRatio, ptRatio);
683 
684  Double_t vetoJetPt = 0.;
685  if(vetoJet)
686  vetoJetPt = vetoJet->Pt();
687 
688  if(!currentCut.IsCutFulfilled(jet->Pt(), refJet->Pt(), fCent, ptRatio, vetoJetPt))
689  continue;
690 
691  FillHistogramsJets(jet, currentCut.fCutName.Data());
692  AddJetToOutputArray(jet, currentCut.fArrayIndex, currentCut.fAcceptedJets);
693  }
694  }
695 
696  // ####### Particle loop
697  // Throw random cone
698  Double_t tmpRandConeEta = fJetsCont->GetJetEtaMin() + fRandom->Rndm()*TMath::Abs(fJetsCont->GetJetEtaMax()-fJetsCont->GetJetEtaMin());
699  Double_t tmpRandConePhi = fRandom->Rndm()*TMath::TwoPi();
700  Double_t tmpRandConePt = 0; // to be determined
701  Double_t tmpRandConePt3GeV = 0; // to be determined
702 
703  fAcceptedTracks = 0;
704  fTracksCont->ResetCurrentID();
705  Int_t trackcount = 0;
706  while(AliVTrack *track = static_cast<AliVTrack*>(fTracksCont->GetNextAcceptParticle()))
707  {
708  // Track plots
709  FillHistogramsTracks(track);
710 
711  if(IsTrackInCone(track, tmpRandConeEta, tmpRandConePhi, fJetsCont->GetJetRadius()))
712  {
713  tmpRandConePt += track->Pt();
714  if (track->Pt() > 3.0)
715  tmpRandConePt3GeV += track->Pt();
716  }
717 
718  // Add track to output array
719  trackcount++;
720  AddTrackToOutputArray(track);
721  }
722 
723  // Add event to output tree
725  AddEventToTree();
726 
727  // ####### Event properties
728  FillHistogram("hRandomConePt", tmpRandConePt - fJetsCont->GetRhoVal()*fJetsCont->GetJetRadius()*fJetsCont->GetJetRadius()*TMath::Pi(), fCent);
729  FillHistogram("hRandomConePtCut3GeV", tmpRandConePt3GeV - fJetsCont->GetRhoVal()*fJetsCont->GetJetRadius()*fJetsCont->GetJetRadius()*TMath::Pi(), fCent);
730  FillHistogram("hRandomConeRawPt", tmpRandConePt, fCent);
731  FillHistogram("hRandomConeRawPtCut3GeV", tmpRandConePt3GeV, fCent);
732 
733  FillHistogram("hBackgroundPt", fJetsCont->GetRhoVal(), fCent);
734  FillHistogram("hJetCount", fAcceptedJets, fCent);
735  FillHistogram("hTrackCount", trackcount, fCent);
736  // NOTE: It is possible to use fTracksCont->GetLeadingParticle() since we do not apply additional track cuts
737  AliVTrack* leadTrack = static_cast<AliVTrack*>(fTracksCont->GetLeadingParticle());
738  if(leadTrack)
739  {
740  FillHistogram("hLeadingTrackPt", leadTrack->Pt(), fCent);
741  FillHistogram("hLeadingTrackPhi", leadTrack->Phi(), fCent);
742  FillHistogram("hLeadingTrackEta", leadTrack->Eta(), fCent);
743  FillHistogram("hLeadingTrackPhiEta", leadTrack->Phi(), leadTrack->Eta());
744  }
745 
746  return kTRUE;
747 }
748 
749 //########################################################################
750 // HELPERS
751 //########################################################################
752 
753 //________________________________________________________________________
755 {
756  if(!fPythiaInfo)
757  AliError("fPythiaInfo object not available. Is it activated with SetGeneratePythiaInfoObject()?");
758 
759  Double_t bestMatchDeltaR1 = 999.;
760  Double_t bestMatchDeltaR2 = 999.;
761 
762  fJetsCont->ResetCurrentID();
763  while(AliEmcalJet *jet = fJetsCont->GetNextAcceptJet())
764  {
765  // Check via geometrical matching if jet is connected to the initial collision
766  Double_t deltaEta1 = TMath::Abs(jet->Eta()-fPythiaInfo->GetPartonEta6());
767  Double_t deltaEta2 = TMath::Abs(jet->Eta()-fPythiaInfo->GetPartonEta7());
768  Double_t deltaPhi1 = TMath::Min(TMath::Abs(jet->Phi()-fPythiaInfo->GetPartonPhi6()),TMath::TwoPi() - TMath::Abs(jet->Phi()-fPythiaInfo->GetPartonPhi6()));
769  Double_t deltaPhi2 = TMath::Min(TMath::Abs(jet->Phi()-fPythiaInfo->GetPartonPhi7()),TMath::TwoPi() - TMath::Abs(jet->Phi()-fPythiaInfo->GetPartonPhi7()));
770 
771  Double_t deltaR1 = TMath::Sqrt(deltaEta1*deltaEta1 + deltaPhi1*deltaPhi1);
772  Double_t deltaR2 = TMath::Sqrt(deltaEta2*deltaEta2 + deltaPhi2*deltaPhi2);
773 
774  if(deltaR1 < bestMatchDeltaR1)
775  {
776  bestMatchDeltaR1 = deltaR1;
778  }
779  if(deltaR2 < bestMatchDeltaR2)
780  {
781  bestMatchDeltaR2 = deltaR2;
783  }
784  }
785 
786  if(bestMatchDeltaR1 > 0.3)
788  if(bestMatchDeltaR2 > 0.3)
790 }
791 
792 //________________________________________________________________________
794 {
795  fMatchedJets.clear();
796  fMatchedJetsReference.clear();
797 
798  AliEmcalJet* jetLeading = 0;
799  AliEmcalJet* jetSubLeading = 0;
800  GetLeadingJetsInArray(fJetEmbeddingArray, "rho", jetLeading, jetSubLeading);
801 
802  // ############ Search for all matches with leading/subleading jets
803  for(Int_t i=0; i<fJetEmbeddingNumMatchedJets; i++)
804  {
805  AliEmcalJet* probeJet = 0;
806  if(i==0)
807  probeJet = jetLeading;
808  else if(i==1)
809  probeJet = jetSubLeading;
810 
811  if(!probeJet)
812  continue;
813 
814  AliEmcalJet* matchedJet = 0;
815  AliEmcalJet* matchedJetReference = 0;
816  Double_t bestMatchDeltaR = 999.;
817  fJetsCont->ResetCurrentID();
818  // Loop over all embedded jets to find the best match
819  while(AliEmcalJet* embeddedJet = fJetsCont->GetNextAcceptJet())
820  {
821  Double_t deltaEta = (embeddedJet->Eta()-probeJet->Eta());
822  Double_t deltaPhi = TMath::Min(TMath::Abs(embeddedJet->Phi()-probeJet->Phi()),TMath::TwoPi() - TMath::Abs(embeddedJet->Phi()-probeJet->Phi()));
823  Double_t deltaR = TMath::Sqrt(deltaEta*deltaEta + deltaPhi*deltaPhi);
824 
825  // Cut jets too far away
826  if (deltaR > fJetEmbeddingMaxDistance)
827  continue;
828 
829  // Search for the best match
830  if(deltaR < bestMatchDeltaR)
831  {
832  bestMatchDeltaR = deltaR;
833  matchedJet = embeddedJet;
834  matchedJetReference = probeJet;
835  }
836  }
837  // Put matched jet to a list
838  if(matchedJet && matchedJetReference)
839  {
840  fMatchedJets.push_back(matchedJet);
841  fMatchedJetsReference.push_back(matchedJetReference);
842  }
843  }
844 }
845 
846 
847 //________________________________________________________________________
849 {
850  Int_t tracksFromMC = 0;
851  Int_t tracksTotal = 0;
852  Double_t ptFromMC = 0;
853  Double_t ptTotal = 0;
854 
855  if(fJetEmbeddingUsePerTrackMCPercentage) // Calculate MC track percentage from tracks of the matched jet
856  {
857  for(Int_t j = 0; j < jet->GetNumberOfTracks(); j++)
858  {
859  AliVParticle* constituent = static_cast<AliVParticle*>(jet->TrackAt(j, fTracksCont->GetArray()));
860  if(!constituent)
861  continue;
862 
863  TClonesArray* mcArray = static_cast<TClonesArray*>(InputEvent()->FindListObject(Form("%s", fJetEmbeddingTrackArrayName.Data())));
864  Bool_t foundInMC = kFALSE;
865  for(Int_t k=0; k<mcJet->GetNumberOfTracks(); k++)
866  {
867  AliVParticle* mcConstituent = static_cast<AliVParticle*>(mcJet->TrackAt(k, mcArray));
868  if(!mcConstituent)
869  continue;
870  if(mcConstituent->GetLabel() == constituent->GetLabel())
871  {
872  foundInMC = kTRUE;
873  break;
874  }
875  }
876 
877  if(foundInMC)
878  {
879  tracksFromMC++;
880  ptFromMC += constituent->Pt();
881  }
882  tracksTotal++;
883  ptTotal += constituent->Pt();
884 
885  }
886  }
887  else // Calculate MC track percentage from all tracks in MC
888  {
889  for(Int_t j = 0; j < jet->GetNumberOfTracks(); j++)
890  {
891  AliVParticle* constituent = static_cast<AliVParticle*>(jet->TrackAt(j, fTracksCont->GetArray()));
892  if(!constituent)
893  continue;
894 
895  // Plots on MC percentage in jet
896  if(constituent->GetLabel() > 10000)
897  {
898  tracksFromMC++;
899  ptFromMC += constituent->Pt();
900  }
901  tracksTotal++;
902  ptTotal += constituent->Pt();
903  }
904  }
905 
906 
907  trackRatio = 0.;
908  if(tracksTotal)
909  trackRatio = tracksFromMC/((Double_t)tracksTotal);
910 
912  ptTotal = jet->Pt() - fJetsCont->GetRhoVal()*jet->Area();
913 
914  ptRatio = 0.;
915  if(ptTotal)
916  ptRatio = ptFromMC/ptTotal;
917 
918 }
919 
920 //________________________________________________________________________
922 {
923  Double_t leadingVetoJetPt = -999.;
924  AliEmcalJet* leadingVetoJet = 0;
925  // Search for the 'leading' overlapping jet in the veto sample
926  if(fJetVetoArray && jet)
927  {
928  for(Int_t j=0; j<fJetVetoArray->GetEntries(); j++)
929  {
930  UInt_t dummy = 0;
931  AliEmcalJet* vetoJet = static_cast<AliEmcalJet*>(fJetVetoArray->At(j));
932  // Check if veto jet is accepted
933  if(!fJetsCont->AcceptJet(vetoJet , dummy))
934  continue;
935 
936  // Check matching distance
937  Double_t vetoPt = vetoJet->Pt() - vetoJet->Area()*fJetsCont->GetRhoVal();
938  Double_t deltaEta = (jet->Eta()-vetoJet->Eta());
939  Double_t deltaPhi = TMath::Min(TMath::Abs(jet->Phi()-vetoJet->Phi()),TMath::TwoPi() - TMath::Abs(jet->Phi()-vetoJet->Phi()));
940  Double_t deltaR = TMath::Sqrt(deltaEta*deltaEta + deltaPhi*deltaPhi);
941 
942  if ((vetoPt > leadingVetoJetPt) && (deltaR <= fJetEmbeddingMaxDistance))
943  {
944  leadingVetoJetPt = vetoPt;
945  leadingVetoJet = vetoJet;
946  }
947  }
948  }
949 
950  return leadingVetoJet;
951 }
952 
953 //________________________________________________________________________
955 {
956  Double_t leadingVetoJetPt = -999.;
957  AliEmcalJet* leadingVetoJet = 0;
958  // Search for the 'leading' jet in the veto sample
959  if(fJetVetoArray)
960  {
961  for(Int_t j=0; j<fJetVetoArray->GetEntries(); j++)
962  {
963  UInt_t dummy = 0;
964  AliEmcalJet* vetoJet = static_cast<AliEmcalJet*>(fJetVetoArray->At(j));
965  // Check if veto jet is accepted
966  if(!fJetsCont->AcceptJet(vetoJet , dummy))
967  continue;
968 
969  // Check matching distance
970  Double_t vetoPt = vetoJet->Pt() - vetoJet->Area()*fJetsCont->GetRhoVal();
971  if (vetoPt > leadingVetoJetPt)
972  {
973  leadingVetoJetPt = vetoPt;
974  leadingVetoJet = vetoJet;
975  }
976  }
977  }
978  return leadingVetoJet;
979 }
980 
981 //________________________________________________________________________
983 {
984  // This is to use a full cone in phi even at the edges of phi (2pi -> 0) (0 -> 2pi)
985  Double_t trackPhi = 0.0;
986  if (track->Phi() > (TMath::TwoPi() - (radius-phi)))
987  trackPhi = track->Phi() - TMath::TwoPi();
988  else if (track->Phi() < (phi+radius - TMath::TwoPi()))
989  trackPhi = track->Phi() + TMath::TwoPi();
990  else
991  trackPhi = track->Phi();
992 
993  if ( TMath::Abs(trackPhi-phi)*TMath::Abs(trackPhi-phi) + TMath::Abs(track->Eta()-eta)*TMath::Abs(track->Eta()-eta) <= radius*radius)
994  return kTRUE;
995 
996  return kFALSE;
997 }
998 
999 
1000 //________________________________________________________________________
1002 {
1003  // Calculate leading + subleading jet
1005  if(fJetOutputMode==6)
1007  else if(fJetOutputMode==4 || fJetOutputMode==5)
1008  GetMatchingJets();
1009 }
1010 
1011 //________________________________________________________________________
1012 void AliAnalysisTaskChargedJetsHadronCF::GetLeadingJets(const char* opt, AliEmcalJet*& jetLeading, AliEmcalJet*& jetSubLeading)
1013 {
1014  // Customized from AliJetContainer::GetLeadingJet()
1015  // Get the leading+subleading jet; if opt contains "rho" the sorting is according to pt-A*rho
1016 
1017  TString option(opt);
1018  option.ToLower();
1019 
1020  jetLeading = 0;
1021  jetSubLeading = 0;
1022 
1023  fJetsCont->ResetCurrentID();
1024  Double_t tmpLeadingPt = 0;
1025  Double_t tmpSubleadingPt = 0;
1026 
1027  if (option.Contains("rho")) {
1028  while (AliEmcalJet* jet = fJetsCont->GetNextAcceptJet()) {
1029  if ( (jet->Pt()-jet->Area()*fJetsCont->GetRhoVal()) > tmpLeadingPt )
1030  {
1031  jetSubLeading = jetLeading;
1032  jetLeading = jet;
1033  tmpSubleadingPt = tmpLeadingPt;
1034  tmpLeadingPt = jet->Pt()-jet->Area()*fJetsCont->GetRhoVal();
1035  }
1036  else if ( (jet->Pt()-jet->Area()*fJetsCont->GetRhoVal()) > tmpSubleadingPt )
1037  {
1038  jetSubLeading = jet;
1039  tmpSubleadingPt = jet->Pt()-jet->Area()*fJetsCont->GetRhoVal();
1040  }
1041  }
1042  }
1043  else {
1044  while (AliEmcalJet* jet = fJetsCont->GetNextAcceptJet()) {
1045  if ( (jet->Pt()) > tmpLeadingPt )
1046  {
1047  jetSubLeading = jetLeading;
1048  jetLeading = jet;
1049  tmpSubleadingPt = tmpLeadingPt;
1050  tmpLeadingPt = jet->Pt();
1051  }
1052  else if ( (jet->Pt()) > tmpSubleadingPt )
1053  {
1054  jetSubLeading = jet;
1055  tmpSubleadingPt = jet->Pt();
1056  }
1057  }
1058  }
1059 }
1060 
1061 //________________________________________________________________________
1062 void AliAnalysisTaskChargedJetsHadronCF::GetLeadingJetsInArray(TClonesArray* arr, const char* opt, AliEmcalJet*& jetLeading, AliEmcalJet*& jetSubLeading)
1063 {
1064  // Customized from AliJetContainer::GetLeadingJet()
1065  // Get the leading+subleading jet; if opt contains "rho" the sorting is according to pt-A*rho
1066 
1067  TString option(opt);
1068  option.ToLower();
1069 
1070  jetLeading = 0;
1071  jetSubLeading = 0;
1072  Double_t tmpLeadingPt = -999.;
1073  Double_t tmpSubleadingPt = -999.;
1074 
1075  for(Int_t i=0; i<arr->GetEntries(); i++)
1076  {
1077  AliEmcalJet* jet = static_cast<AliEmcalJet*>(arr->At(i));
1078  UInt_t dummy = 0;
1079  if(!fJetsCont->AcceptJet(jet , dummy))
1080  continue;
1081 
1082  Double_t jetPt = jet->Pt();
1083  if (option.Contains("rho"))
1084  jetPt -= jet->Area()*fJetsCont->GetRhoVal();
1085 
1086  if ( jetPt > tmpLeadingPt )
1087  {
1088  jetSubLeading = jetLeading;
1089  jetLeading = jet;
1090  tmpSubleadingPt = tmpLeadingPt;
1091  tmpLeadingPt = jetPt;
1092  }
1093  else if ( jetPt > tmpSubleadingPt )
1094  {
1095  jetSubLeading = jet;
1096  tmpSubleadingPt = jetPt;
1097  }
1098 
1099  }
1100 }
1101 
1102 
1103 //________________________________________________________________________
1105 {
1106  // Method for the correct logarithmic binning of histograms
1107  TAxis *axis = h->GetAxis(axisNumber);
1108  int bins = axis->GetNbins();
1109 
1110  Double_t from = axis->GetXmin();
1111  Double_t to = axis->GetXmax();
1112  Double_t *newBins = new Double_t[bins + 1];
1113 
1114  newBins[0] = from;
1115  Double_t factor = pow(to/from, 1./bins);
1116 
1117  for (int i = 1; i <= bins; i++) {
1118  newBins[i] = factor * newBins[i-1];
1119  }
1120  axis->Set(bins, newBins);
1121  delete [] newBins;
1122 }
1123 
1124 //________________________________________________________________________
1126 {
1127  std::vector<AliEmcalJet*>::iterator matchedJetFindResult = std::find(fMatchedJets.begin(), fMatchedJets.end(), jet);
1128  if(matchedJetFindResult == fMatchedJets.end())
1129  {
1130  AliError("Checked for a reference jet but it was not found. Check code.");
1131  return 0;
1132  }
1133 
1134  Int_t matchedJetIndex = (matchedJetFindResult - fMatchedJets.begin());
1135  AliEmcalJet* refJet = fMatchedJetsReference[matchedJetIndex];
1136  return refJet;
1137 }
1138 
1139 //________________________________________________________________________
1141 {
1142  TH1* tmpHist = static_cast<TH1*>(fOutput->FindObject(key));
1143  if(!tmpHist)
1144  {
1145  AliError(Form("Cannot find histogram <%s> ",key)) ;
1146  return;
1147  }
1148 
1149  tmpHist->Fill(x);
1150 }
1151 
1152 //________________________________________________________________________
1154 {
1155  TH1* tmpHist = static_cast<TH1*>(fOutput->FindObject(key));
1156  if(!tmpHist)
1157  {
1158  AliError(Form("Cannot find histogram <%s> ",key));
1159  return;
1160  }
1161 
1162  if (tmpHist->IsA()->GetBaseClass("TH1"))
1163  static_cast<TH1*>(tmpHist)->Fill(x,y); // Fill x with y
1164  else if (tmpHist->IsA()->GetBaseClass("TH2"))
1165  static_cast<TH2*>(tmpHist)->Fill(x,y); // Fill x,y with 1
1166 }
1167 
1168 //________________________________________________________________________
1170 {
1171  TH2* tmpHist = static_cast<TH2*>(fOutput->FindObject(key));
1172  if(!tmpHist)
1173  {
1174  AliError(Form("Cannot find histogram <%s> ",key));
1175  return;
1176  }
1177 
1178  tmpHist->Fill(x,y,add);
1179 }
1180 
1181 //________________________________________________________________________
1183 {
1184  TH3* tmpHist = static_cast<TH3*>(fOutput->FindObject(key));
1185  if(!tmpHist)
1186  {
1187  AliError(Form("Cannot find histogram <%s> ",key));
1188  return;
1189  }
1190 
1191  if(add)
1192  tmpHist->Fill(x,y,z,add);
1193  else
1194  tmpHist->Fill(x,y,z);
1195 }
1196 
1197 
1198 //________________________________________________________________________
1199 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)
1200 {
1201  T* tmpHist = new T(name, title, xBins, xMin, xMax);
1202 
1203  tmpHist->GetXaxis()->SetTitle(xTitle);
1204  tmpHist->GetYaxis()->SetTitle(yTitle);
1205  tmpHist->SetOption(options);
1206  tmpHist->SetMarkerStyle(kFullCircle);
1207  tmpHist->Sumw2();
1208 
1209  fOutput->Add(tmpHist);
1210 
1211  return tmpHist;
1212 }
1213 
1214 //________________________________________________________________________
1215 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)
1216 {
1217  T* tmpHist = new T(name, title, xBins, xMin, xMax, yBins, yMin, yMax);
1218  tmpHist->GetXaxis()->SetTitle(xTitle);
1219  tmpHist->GetYaxis()->SetTitle(yTitle);
1220  tmpHist->GetZaxis()->SetTitle(zTitle);
1221  tmpHist->SetOption(options);
1222  tmpHist->SetMarkerStyle(kFullCircle);
1223  tmpHist->Sumw2();
1224 
1225  fOutput->Add(tmpHist);
1226 
1227  return tmpHist;
1228 }
1229 
1230 //________________________________________________________________________
1231 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)
1232 {
1233  T* tmpHist = new T(name, title, xBins, xMin, xMax, yBins, yMin, yMax, zBins, zMin, zMax);
1234  tmpHist->GetXaxis()->SetTitle(xTitle);
1235  tmpHist->GetYaxis()->SetTitle(yTitle);
1236  tmpHist->GetZaxis()->SetTitle(zTitle);
1237  tmpHist->SetOption(options);
1238  tmpHist->SetMarkerStyle(kFullCircle);
1239  tmpHist->Sumw2();
1240 
1241  fOutput->Add(tmpHist);
1242 
1243  return tmpHist;
1244 }
1245 
1246 //________________________________________________________________________
1248 {
1249  // Called once at the end of the analysis.
1250 }
1251 
Int_t fArrayIndex
array index that holds the output array index
Double_t fEventExtractionMaxJetPt
maximum jet pt of recorded events
Short_t Charge() const
Definition: AliEmcalJet.h:110
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
AliJetContainer * GetJetContainer(Int_t i=0) const
Definition: External.C:244
Float_t GetPartonEta7() const
std::vector< AliChargedJetsHadronCFCuts > fJetEmbeddingCuts
Cuts used in jet embedding.
Double_t Eta() const
Definition: AliEmcalJet.h:108
Double_t Phi() const
Definition: AliEmcalJet.h:104
Container with name, TClonesArray and cuts for particles.
Support task for (charged) jet-hadron correlations.
Double_t GetJetEtaMax() const
Float_t GetPartonPhi7() const
virtual Bool_t AcceptJet(Int_t i, UInt_t &rejectionReason) const
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
std::vector< TClonesArray * > fJetsOutput
! vector of arrays of basic correlation particles attached to the event (jets)
AliEmcalJet * fSubleadingJet
! subleading jet (calculated event-by-event)
void FillHistogram3D(const char *key, Double_t x, Double_t y, Double_t z, Double_t add=0)
Float_t GetPartonPhi6() const
Container class of cuts for AliAnalysisTaskChargedJetsHadronCF.
UShort_t GetNumberOfTracks() const
Definition: AliEmcalJet.h:126
UShort_t T(UShort_t m, UShort_t t)
Definition: RingBits.C:60
void GetLeadingJetsInArray(TClonesArray *arr, const char *opt, AliEmcalJet *&jetLeading, AliEmcalJet *&jetSubLeading)
TClonesArray * fJetEmbeddingArray
! Array of generated jets imported into task (for embedding)
AliParticleContainer * GetParticleContainer(Int_t i=0) const
void GetTrackMCRatios(AliEmcalJet *jet, AliEmcalJet *mcJet, Double_t &trackRatio, Double_t &ptRatio)
AliParticleContainer * GetParticleContainer() const
Bool_t fJetEmbeddingCreatePtPlotPerCut
create TH3 per cut or only once
int Int_t
Definition: External.C:63
unsigned int UInt_t
Definition: External.C:33
TString fJetParticleArrayName
Name of fJetsOutput array (if one uses only one)
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")
TString fJetEmbeddingArrayName
Name of array used to match jets.
Int_t fNumberOfCentralityBins
Number of centrality bins.
virtual AliVParticle * GetLeadingParticle(const char *opt="")
std::vector< AliEmcalJet * > fMatchedJets
Jets matched in an event (embedded)
TString fJetEmbeddingTrackArrayName
Name of array used to match tracks of jets.
Double_t fCent
!event centrality
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)
AliEmcalJet * GetNextAcceptJet()
void AddJetToOutputArray(AliEmcalJet *jet, Int_t arrayIndex, Int_t &jetsAlreadyInArray)
Double_t Pt() const
Definition: AliEmcalJet.h:96
Bool_t IsTrackInCone(AliVParticle *track, Double_t eta, Double_t phi, Double_t radius)
Bool_t fJetEmbeddingUsePerTrackMCPercentage
When cutting on MC percentage, calculate it per track and not for all MC tracks.
Int_t fAcceptedJets
temporary var that holds how many jets passed
TString fJetVetoArrayName
Name of array used for veto jets.
Float_t GetJetRadius() const
AliEmcalList * fOutput
!output list
Int_t fJetEmbeddingNumMatchedJets
Number of matched leading jets that will be used.
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.
Bool_t IsCutFulfilled(Double_t pt, Double_t mcPt, Double_t cent, Double_t ptRatio, Double_t vetoPt)
Represent a jet reconstructed using the EMCal jet framework.
Definition: AliEmcalJet.h:44
Bool_t fJetEmbeddingUseBgrdForMCPercentage
When cutting on MC percentage, use bgrd. corr to calculate MC percentage.
Declaration of class AliEmcalPythiaInfo.
const char Option_t
Definition: External.C:48
virtual AliVParticle * GetNextAcceptParticle()
bool Bool_t
Definition: External.C:53
Double_t fJetEmbeddingMaxDistance
Max distance allowed to accept an embedded jet.
void FillHistogramsJets(AliEmcalJet *jet, const char *cutName)
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)
Int_t fConstPtFilterBit
For const pt plot, filter bit.