AliPhysics  f05a842 (f05a842)
 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 <TClonesArray.h>
17 #include <TF1.h>
18 #include <TH1F.h>
19 #include <TH2F.h>
20 #include <TH3F.h>
21 #include <THn.h>
22 #include <TTree.h>
23 #include <TList.h>
24 #include <TLorentzVector.h>
25 
26 #include "AliEmcalPythiaInfo.h"
27 
28 #include "AliVTrack.h"
29 #include "AliVHeader.h"
30 #include "AliEmcalJet.h"
31 #include "AliRhoParameter.h"
32 #include "AliLog.h"
33 #include "AliJetContainer.h"
34 #include "AliTrackContainer.h"
35 #include "AliPicoTrack.h"
36 #include "AliVParticle.h"
37 #include "TRandom3.h"
39 
41 
45 //________________________________________________________________________
47 {
48 // dummy destructor
49 }
50 
54 //________________________________________________________________________
56 {
57 // dummy destructor
58 }
59 
63 //________________________________________________________________________
66  fJetsCont(0),
67  fTracksCont(0),
68  fJetsTree(0),
69  fJetsTreeBuffer(0),
70  fExtractionPercentage(0),
71  fExtractionMinPt(0),
72  fExtractionMaxPt(0),
73  fNumberOfCentralityBins(10),
74  fJetsOutput(),
75  fTracksOutput(),
76  fJetsInput(),
77  fJetParticleArrayName("JetsDPhiBasicParticles"),
78  fTrackParticleArrayName(""),
79  fJetMatchingArrayName(""),
80  fRandom(0),
81  fJetOutputMode(0),
82  fMinFakeFactorPercentage(0),
83  fMaxFakeFactorPercentage(0),
84  fEventCriteriumMode(0),
85  fEventCriteriumMinBackground(0),
86  fEventCriteriumMaxBackground(0),
87  fEventCriteriumMinLeadingJetPt(0),
88  fEventCriteriumMinSubleadingJetPt(0),
89  fEventCriteriumMinJetDeltaPhi(0),
90  fLeadingJet(0),
91  fSubleadingJet(0),
92  fMatchedJet(0),
93  fMatchedJetReference(0),
94  fInitialPartonMatchedJet1(0),
95  fInitialPartonMatchedJet2(0),
96  fAcceptedJets(0),
97  fAcceptedTracks(0)
98 {
99  // Default constructor.
100  SetMakeGeneralHistograms(kTRUE);
101  fRandom = new TRandom3(0);
102 }
103 
104 
105 //________________________________________________________________________
107  AliAnalysisTaskEmcalJet(name, kTRUE),
108  fJetsCont(0),
109  fTracksCont(0),
110  fJetsTree(0),
111  fJetsTreeBuffer(0),
112  fExtractionPercentage(0),
113  fExtractionMinPt(0),
114  fExtractionMaxPt(0),
115  fNumberOfCentralityBins(10),
116  fJetsOutput(),
117  fTracksOutput(),
118  fJetsInput(),
119  fJetParticleArrayName("JetsDPhiBasicParticles"),
120  fTrackParticleArrayName(""),
121  fJetMatchingArrayName(""),
122  fRandom(0),
123  fJetOutputMode(0),
124  fMinFakeFactorPercentage(0),
125  fMaxFakeFactorPercentage(0),
126  fEventCriteriumMode(0),
127  fEventCriteriumMinBackground(0),
128  fEventCriteriumMaxBackground(0),
129  fEventCriteriumMinLeadingJetPt(0),
130  fEventCriteriumMinSubleadingJetPt(0),
131  fEventCriteriumMinJetDeltaPhi(0),
132  fLeadingJet(0),
133  fSubleadingJet(0),
134  fMatchedJet(0),
135  fMatchedJetReference(0),
136  fInitialPartonMatchedJet1(0),
137  fInitialPartonMatchedJet2(0),
138  fAcceptedJets(0),
139  fAcceptedTracks(0)
140 {
141  // Constructor
143  fRandom = new TRandom3(0);
144 }
145 
146 //________________________________________________________________________
148 {
149  // Destructor.
150 }
151 
152 //________________________________________________________________________
154 {
156 
157  // ### Basic container settings
159  if(fJetsCont) { //get particles connected to jets
160  fJetsCont->PrintCuts();
162  } else { //no jets, just analysis tracks
164  }
165  if(fTracksCont) fTracksCont->SetClassName("AliVTrack");
166 
167  // ### Create all histograms
168 
169  // Change the event rejection histogram -> Add a custom value
170  fHistEventRejection->GetXaxis()->SetBinLabel(14,"JetCrit");
171 
172  // Track QA plots
173  AddHistogram2D<TH2D>("hTrackPt", "Tracks p_{T} distribution", "", 300, 0., 300., fNumberOfCentralityBins, 0, 100, "p_{T} (GeV/c)", "Centrality", "dN^{Tracks}/dp_{T}");
174  AddHistogram2D<TH2D>("hTrackPhi", "Track angular distribution in #phi", "LEGO2", 180, 0., 2*TMath::Pi(), fNumberOfCentralityBins, 0, 100, "#phi", "Centrality", "dN^{Tracks}/(d#phi)");
175  AddHistogram2D<TH2D>("hTrackEta", "Track angular distribution in #eta", "LEGO2", 100, -2.5, 2.5, fNumberOfCentralityBins, 0, 100, "#eta", "Centrality", "dN^{Tracks}/(d#eta)");
176  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");
177 
178  AddHistogram2D<TH2D>("hLeadingTrackPt", "Leading tracks p_{T} distribution", "", 300, 0., 300., fNumberOfCentralityBins, 0, 100, "p_{T} (GeV/c)", "Centrality", "dN^{Tracks}/dp_{T}");
179  AddHistogram2D<TH2D>("hLeadingTrackPhi", "Leading tracks angular distribution in #phi", "LEGO2", 180, 0., 2*TMath::Pi(), fNumberOfCentralityBins, 0, 100, "#phi", "Centrality", "dN^{Tracks}/(d#phi)");
180  AddHistogram2D<TH2D>("hLeadingTrackEta", "Leading tracks angular distribution in #eta", "LEGO2", 100, -2.5, 2.5, fNumberOfCentralityBins, 0, 100, "#eta", "Centrality", "dN^{Tracks}/(d#eta)");
181  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");
182 
183  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})");
184  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})");
185 
186 
187  // Jet QA plots
188  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}");
189  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}");
190  AddHistogram2D<TH2D>("hJetPhi", "Jet angular distribution #phi", "LEGO2", 180, 0., 2*TMath::Pi(), fNumberOfCentralityBins, 0, 100, "#phi", "Centrality", "dN^{Jets}/d#phi");
191  AddHistogram2D<TH2D>("hJetEta", "Jet angular distribution #eta", "LEGO2", 100, -2.5, 2.5, fNumberOfCentralityBins, 0, 100, "#eta","Centrality","dN^{Jets}/d#eta");
192  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}");
193  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}");
194  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");
195  AddHistogram2D<TH2D>("hJetArea", "Jet area", "LEGO2", 200, 0., 2., fNumberOfCentralityBins, 0, 100, "Jet A", "Centrality", "dN^{Jets}/dA");
196  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}");
197  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}");
198 
199  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}");
200  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}");
201 
202  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}");
203  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}");
204 
205  // Random cone plots
206  AddHistogram2D<TH2D>("hRandomConePt", "Random cone p_{T} distribution", "", 400, -100., 300., fNumberOfCentralityBins, 0, 100, "p_{T, cone} (GeV/c)", "Centrality", "dN^{Tracks}/dp_{T}");
207  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}");
208 
209  // Leading/subleading, background ...
210 
211  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}");
212  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}");
213  AddHistogram2D<TH2D>("hLeadingJetPhi", "Jet angular distribution #phi", "LEGO2", 180, 0., 2*TMath::Pi(), fNumberOfCentralityBins, 0, 100, "#phi", "Centrality", "dN^{Jets}/d#phi");
214  AddHistogram2D<TH2D>("hLeadingJetEta", "Jet angular distribution #eta", "LEGO2", 100, -2.5, 2.5, fNumberOfCentralityBins, 0, 100, "#eta","Centrality","dN^{Jets}/d#eta");
215  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}");
216  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}");
217  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");
218  AddHistogram2D<TH2D>("hLeadingJetArea", "Jet area", "LEGO2", 200, 0., 2., fNumberOfCentralityBins, 0, 100, "Jet A", "Centrality", "dN^{Jets}/dA");
219  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}");
220  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}");
221 
222  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}");
223  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}");
224  AddHistogram2D<TH2D>("hSubleadingJetPhi", "Jet angular distribution #phi", "LEGO2", 180, 0., 2*TMath::Pi(), fNumberOfCentralityBins, 0, 100, "#phi", "Centrality", "dN^{Jets}/d#phi");
225  AddHistogram2D<TH2D>("hSubleadingJetEta", "Jet angular distribution #eta", "LEGO2", 100, -2.5, 2.5, fNumberOfCentralityBins, 0, 100, "#eta","Centrality","dN^{Jets}/d#eta");
226  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}");
227  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}");
228  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");
229  AddHistogram2D<TH2D>("hSubleadingJetArea", "Jet area", "LEGO2", 200, 0., 2., fNumberOfCentralityBins, 0, 100, "Jet A", "Centrality", "dN^{Jets}/dA");
230  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}");
231  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}");
232 
233  AddHistogram2D<TH2D>("hTrackCount", "Number of tracks in acceptance vs. centrality", "LEGO2", 500, 0., 5000., fNumberOfCentralityBins, 0, 100, "N tracks","Centrality", "dN^{Events}/dN^{Tracks}");
234  AddHistogram2D<TH2D>("hJetCount", "Number of jets in acceptance vs. centrality", "LEGO2", 100, 0., 100., fNumberOfCentralityBins, 0, 100, "N Jets","Centrality", "dN^{Events}/dN^{Jets}");
235  AddHistogram2D<TH2D>("hFakeFactor", "Fake factor distribution", "LEGO2", 1000, 0., 100., fNumberOfCentralityBins, 0, 100, "Fake factor","Centrality", "dN^{Jets}/df");
236  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");
237  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");
238 
239  AddHistogram2D<TH2D>("hBackgroundPt", "Background p_{T} distribution", "", 150, 0., 150., fNumberOfCentralityBins, 0, 100, "Background p_{T} (GeV/c)", "Centrality", "dN^{Events}/dp_{T}");
240  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}");
241  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}");
242  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}");
243  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}");
244 
245  PostData(1, fOutput); // Post data for ALL output slots > 0 here.
246 }
247 
248 
249 //________________________________________________________________________
251 
253 
254  // ### Add the jets as basic correlation particles to the event
255  if (!(fInputEvent->FindListObject(Form("%s", fJetParticleArrayName.Data()))))
256  {
257  fJetsOutput = new TClonesArray("AliPicoTrack");
258  fJetsOutput->SetName(fJetParticleArrayName.Data());
259  fInputEvent->AddObject(fJetsOutput);
260  }
261  else
262  AliError(Form("%s: Object with name %s already in event!", GetName(), Form("%s", fJetParticleArrayName.Data())));
263 
264  // ### Add the tracks as basic correlation particles to the event (optional)
265  if(fTrackParticleArrayName != "")
266  {
267  if (!(fInputEvent->FindListObject(Form("%s", fTrackParticleArrayName.Data()))))
268  {
269  fTracksOutput = new TClonesArray("AliPicoTrack");
270  fTracksOutput->SetName(fTrackParticleArrayName.Data());
271  fInputEvent->AddObject(fTracksOutput);
272  }
273  else
274  AliError(Form("%s: Object with name %s already in event!", GetName(), Form("%s", fTrackParticleArrayName.Data())));
275  }
276 
277  // ### Import generated jets from toymodel for matching (optional)
278  if(fJetMatchingArrayName != "")
279  {
280  fJetsInput = static_cast<TClonesArray*>(InputEvent()->FindListObject(Form("%s", fJetMatchingArrayName.Data())));
281  if(!fJetsInput)
282  AliFatal(Form("Importing jets for matching failed! Array '%s' not found!", fJetMatchingArrayName.Data()));
283  }
284  else if(fJetOutputMode==4 || fJetOutputMode==5 || fJetOutputMode==7)
285  AliFatal(Form("fJetMatchingArrayName must be set in jet output mode 4,5, or 7."));
286 
287 
288  // ### Jets tree (optional)
290  {
291  fJetsTree = new TTree("ExtractedJets", "ExtractedJets");
292  fJetsTree->Branch("Jets", "AliBasicJet", &fJetsTreeBuffer, 1000);
293  fOutput->Add(fJetsTree);
294  }
295 
296 }
297 
298 //________________________________________________________________________
300 {
301 
302  // In case of special selection criteria, trigger on certain events
303  if(fEventCriteriumMode==0) // "minimum bias"
304  {
305  // do nothing
306  }
307  else if(fEventCriteriumMode==1) // background constraints
308  {
310  {
311  fHistEventRejection->Fill("JetCrit", 1);
312  return kFALSE;
313  }
314  }
315  else if(fEventCriteriumMode==2) // Minimum leading jet pT
316  {
317  if(fLeadingJet)
318  {
320  {
321  fHistEventRejection->Fill("JetCrit", 1);
322  return kFALSE;
323  }
324  }
325  }
326  else if(fEventCriteriumMode==3) // Simple dijet trigger
327  {
329  {
332  {
333  fHistEventRejection->Fill("JetCrit", 1);
334  return kFALSE;
335  }
336  else // dijet pT fulfilled, check back-to-back criterium
337  {
338  Double_t deltaPhi = TMath::Min(TMath::Abs(fLeadingJet->Phi()-fSubleadingJet->Phi()),TMath::TwoPi() - TMath::Abs(fLeadingJet->Phi()-fSubleadingJet->Phi()));
339  if(deltaPhi <= fEventCriteriumMinJetDeltaPhi)
340  {
341  fHistEventRejection->Fill("JetCrit", 1);
342  return kFALSE;
343  }
344  }
345  }
346  }
347  return kTRUE;
348 }
349 
350 //________________________________________________________________________
352 {
353  if(fJetOutputMode==3) // output leading&subleading jet
354  {
355  if((jet!=fLeadingJet) && (jet!=fSubleadingJet))
356  return kFALSE;
357  }
358  else if(fJetOutputMode==1) // output the leading jet
359  {
360  if(jet!=fLeadingJet)
361  return kFALSE;
362  }
363  else if(fJetOutputMode==2) // output the subleading jet
364  {
365  if(jet!=fSubleadingJet)
366  return kFALSE;
367  }
368  else if(fJetOutputMode==6)
369  {
371  return kFALSE;
372  }
373 
374  if((fJetOutputMode==4) || (fJetOutputMode==7)) // matching jets only
375  return (jet==fMatchedJet);
376  else if(fJetOutputMode==5) // non-matching jets only
377  return (jet!=fMatchedJet);
378 
379  return kTRUE;
380 }
381 
382 //________________________________________________________________________
384 {
385  // All jets
386  FillHistogram("hJetPtRaw", jet->Pt(), fCent);
387  FillHistogram("hJetPt", jet->Pt() - fJetsCont->GetRhoVal()*jet->Area(), fCent);
388  FillHistogram("hJetPhi", jet->Phi(), fCent);
389  FillHistogram("hJetEta", jet->Eta(), fCent);
390  FillHistogram("hJetEtaPt", jet->Eta(), jet->Pt() - fJetsCont->GetRhoVal()*jet->Area());
391  FillHistogram("hJetPhiPt", jet->Phi(), jet->Pt() - fJetsCont->GetRhoVal()*jet->Area());
392  FillHistogram("hJetPhiEta", jet->Phi(), jet->Eta());
393  FillHistogram("hJetArea", jet->Area(), fCent);
394  FillHistogram("hJetAreaPt", jet->Area(), jet->Pt() - fJetsCont->GetRhoVal()*jet->Area());
395  FillHistogram("hJetPtLeadingHadron", jet->Pt() - fJetsCont->GetRhoVal()*jet->Area(), fJetsCont->GetLeadingHadronPt(jet));
396 
397  FillHistogram("hBackgroundPtJetPt_Cent0_100", fJetsCont->GetRhoVal(), jet->Pt() - fJetsCont->GetRhoVal()*jet->Area());
398  if( (fCent >= 0) && (fCent < 10) )
399  FillHistogram("hBackgroundPtJetPt_Cent0_10", fJetsCont->GetRhoVal(), jet->Pt() - fJetsCont->GetRhoVal()*jet->Area());
400 
401  // Fake jet rejection (0810.1219)
402  Double_t fakeFactor = CalculateFakeFactor(jet);
403  FillHistogram("hFakeFactor", fakeFactor, fCent);
404  FillHistogram("hFakeFactorJetPt_Cent0_100", fakeFactor, jet->Pt() - fJetsCont->GetRhoVal()*jet->Area());
405  if( (fCent >= 0) && (fCent < 10) )
406  FillHistogram("hFakeFactorJetPt_Cent0_10", fakeFactor, jet->Pt() - fJetsCont->GetRhoVal()*jet->Area());
407 
408 
409  // Leading jet plots
410  if(jet==fLeadingJet)
411  {
412  FillHistogram("hLeadingJetPtRaw", jet->Pt(), fCent);
413  FillHistogram("hLeadingJetPt", jet->Pt() - fJetsCont->GetRhoVal()*jet->Area(), fCent);
414  FillHistogram("hLeadingJetPhi", jet->Phi(), fCent);
415  FillHistogram("hLeadingJetEta", jet->Eta(), fCent);
416  FillHistogram("hLeadingJetEtaPt", jet->Eta(), jet->Pt() - fJetsCont->GetRhoVal()*jet->Area());
417  FillHistogram("hLeadingJetPhiPt", jet->Phi(), jet->Pt() - fJetsCont->GetRhoVal()*jet->Area());
418  FillHistogram("hLeadingJetPhiEta", jet->Phi(), jet->Eta());
419  FillHistogram("hLeadingJetArea", jet->Area(), fCent);
420  FillHistogram("hLeadingJetAreaPt", jet->Area(), jet->Pt() - fJetsCont->GetRhoVal()*jet->Area());
421  FillHistogram("hLeadingJetPtLeadingHadron", jet->Pt() - fJetsCont->GetRhoVal()*jet->Area(), fJetsCont->GetLeadingHadronPt(jet));
422  }
423 
424  // Subleading jet plot
425  else if(jet==fSubleadingJet)
426  {
427  FillHistogram("hSubleadingJetPtRaw", jet->Pt(), fCent);
428  FillHistogram("hSubleadingJetPt", jet->Pt() - fJetsCont->GetRhoVal()*jet->Area(), fCent);
429  FillHistogram("hSubleadingJetPhi", jet->Phi(), fCent);
430  FillHistogram("hSubleadingJetEta", jet->Eta(), fCent);
431  FillHistogram("hSubleadingJetEtaPt", jet->Eta(), jet->Pt() - fJetsCont->GetRhoVal()*jet->Area());
432  FillHistogram("hSubleadingJetPhiPt", jet->Phi(), jet->Pt() - fJetsCont->GetRhoVal()*jet->Area());
433  FillHistogram("hSubleadingJetPhiEta", jet->Phi(), jet->Eta());
434  FillHistogram("hSubleadingJetArea", jet->Area(), fCent);
435  FillHistogram("hSubleadingJetAreaPt", jet->Area(), jet->Pt() - fJetsCont->GetRhoVal()*jet->Area());
436  FillHistogram("hSubleadingJetPtLeadingHadron", jet->Pt() - fJetsCont->GetRhoVal()*jet->Area(), fJetsCont->GetLeadingHadronPt(jet));
437  }
438 }
439 
440 //________________________________________________________________________
442 {
443  FillHistogram("hTrackPt", track->Pt(), fCent);
444  FillHistogram("hTrackPhi", track->Phi(), fCent);
445  FillHistogram("hTrackEta", track->Eta(), fCent);
446  FillHistogram("hTrackEtaPt", track->Eta(), track->Pt());
447  FillHistogram("hTrackPhiPt", track->Phi(), track->Pt());
448  FillHistogram("hTrackPhiEta", track->Phi(), track->Eta());
449 }
450 
451 //________________________________________________________________________
453 {
454  // Loop over all jet constituents
455  for(Int_t i = 0; i < jet->GetNumberOfTracks(); i++)
456  {
457  AliVParticle* constituent = static_cast<AliVParticle*>(jet->TrackAt(i, fTracksCont->GetArray()));
458  if(!constituent)
459  continue;
460 
461  // Fill jet constituent plots
462  FillHistogram("hJetConstituentPt_Cent0_100", jet->Pt() - fJetsCont->GetRhoVal()*jet->Area(), constituent->Pt());
463  if( (fCent >= 0) && (fCent < 10) )
464  FillHistogram("hJetConstituentPt_Cent0_10", jet->Pt() - fJetsCont->GetRhoVal()*jet->Area(), constituent->Pt());
465 
466  }
467 
468  FillHistogram("hJetConstituentCount_Cent0_100", jet->Pt() - fJetsCont->GetRhoVal()*jet->Area(), jet->GetNumberOfTracks());
469  if( (fCent >= 0) && (fCent < 10) )
470  FillHistogram("hJetConstituentCount_Cent0_10", jet->Pt() - fJetsCont->GetRhoVal()*jet->Area(), jet->GetNumberOfTracks());
471 
472  FillHistogram("hBackgroundPtConstCount_Cent0_100", fJetsCont->GetRhoVal(), jet->GetNumberOfTracks());
473  if( (fCent >= 0) && (fCent < 10) )
474  FillHistogram("hBackgroundPtConstCount_Cent0_10", fJetsCont->GetRhoVal(), jet->GetNumberOfTracks());
475 }
476 
477 //________________________________________________________________________
479 {
480  Double_t tmpPt = jet->Pt() - fJetsCont->GetRhoVal()*jet->Area();
481  // Special matching jet modus: Change pT to the pt of the input match jet
482  // Note: in mode 7, there are only passed matched jets to this function
483  if(fJetOutputMode==7)
484  tmpPt = fMatchedJetReference->Pt();
485 
486  new ((*fJetsOutput)[fAcceptedJets]) AliPicoTrack(tmpPt, jet->Eta(), jet->Phi(), jet->Charge(), 0, 0);
487  fAcceptedJets++;
488 }
489 
490 //________________________________________________________________________
492 {
493  if(fTrackParticleArrayName != "")
494  {
495  new ((*fTracksOutput)[fAcceptedTracks]) AliPicoTrack(track->Pt(), track->Eta(), track->Phi(), track->Charge(), 0, 0); // only Pt,Eta,Phi are interesting for correlations;
496  fAcceptedTracks++;
497  }
498 }
499 
500 //________________________________________________________________________
502 {
503  // Check pT threshold
504  if( ((jet->Pt()-jet->Area()*fJetsCont->GetRhoVal()) < fExtractionMinPt) || ((jet->Pt()-jet->Area()*fJetsCont->GetRhoVal()) >= fExtractionMaxPt) )
505  return;
506 
507  // Discard jets statistically
508  if(fRandom->Rndm() >= fExtractionPercentage)
509  return;
510 
511  AliVHeader* eventIDHeader = InputEvent()->GetHeader();
512  Long64_t eventID = 0;
513  if(eventIDHeader)
514  eventID = eventIDHeader->GetEventIdAsLong();
515 
516  // if only the two initial collision partons will be added, get PYTHIA info on them
517  Int_t partid = 0;
518  if(fJetOutputMode==6)
519  {
520  if(!fPythiaInfo)
521  AliError("fPythiaInfo object not available. Is it activated with SetGeneratePythiaInfoObject()?");
522  else if(jet==fInitialPartonMatchedJet1)
523  partid = fPythiaInfo->GetPartonFlag6();
524  else if (jet==fInitialPartonMatchedJet2)
525  partid = fPythiaInfo->GetPartonFlag7();
526  }
527 
528  AliBasicJet basicJet(jet->Eta(), jet->Phi(), jet->Pt(), jet->Charge(), fJetsCont->GetJetRadius(), jet->Area(), partid, fJetsCont->GetRhoVal(), eventID, fCent);
529  // Add constituents
530  for(Int_t i = 0; i < jet->GetNumberOfTracks(); i++)
531  {
532  AliVParticle* particle = static_cast<AliVParticle*>(jet->TrackAt(i, fTracksCont->GetArray()));
533  if(!particle) continue;
534  basicJet.AddJetConstituent(particle->Eta(), particle->Phi(), particle->Pt(), particle->Charge());
535  }
536  if(jet==fMatchedJet) // set the true pT from the matched jets (only possible in modes 4 & 7)
537  basicJet.SetTruePt(fMatchedJetReference->Pt());
538 
539  fJetsTreeBuffer = &basicJet;
540  fJetsTree->Fill();
541 }
542 
543 //________________________________________________________________________
545 {
547 
549  return kFALSE;
550 
551  // ####### Jet loop
552  fAcceptedJets = 0;
553  fJetsCont->ResetCurrentID();
554  while(AliEmcalJet *jet = fJetsCont->GetNextAcceptJet())
555  {
556  if(!IsJetSelected(jet))
557  continue;
558 
559  // Jet plots
560  FillHistogramsJets(jet);
562 
563  // Add jet to output array
565  AddJetToTree(jet);
566  AddJetToOutputArray(jet);
567  }
568 
569  // ####### Particle loop
570  // Throw random cone
571  Double_t tmpRandConeEta = fJetsCont->GetJetEtaMin() + fRandom->Rndm()*TMath::Abs(fJetsCont->GetJetEtaMax()-fJetsCont->GetJetEtaMin());
572  Double_t tmpRandConePhi = fRandom->Rndm()*TMath::TwoPi();
573  Double_t tmpRandConePt = 0; // to be determined
574 
575  fAcceptedTracks = 0;
576  fTracksCont->ResetCurrentID();
577  Int_t trackcount = 0;
578  while(AliVTrack *track = static_cast<AliVTrack*>(fTracksCont->GetNextAcceptParticle()))
579  {
580  // Track plots
581  FillHistogramsTracks(track);
582 
583  if(IsTrackInCone(track, tmpRandConeEta, tmpRandConePhi, fJetsCont->GetJetRadius()))
584  tmpRandConePt += track->Pt();
585 
586  // Add track to output array
587  trackcount++;
588  AddTrackToOutputArray(track);
589  }
590 
591  // ####### Event properties
592  FillHistogram("hRandomConePt", tmpRandConePt - fJetsCont->GetRhoVal()*fJetsCont->GetJetRadius()*fJetsCont->GetJetRadius()*TMath::Pi(), fCent);
593  FillHistogram("hRandomConeRawPt", tmpRandConePt, fCent);
594 
595  FillHistogram("hBackgroundPt", fJetsCont->GetRhoVal(), fCent);
596  FillHistogram("hJetCount", fAcceptedJets, fCent);
597  FillHistogram("hTrackCount", trackcount, fCent);
598  // NOTE: It is possible to use fTracksCont->GetLeadingParticle() since we do not apply additional track cuts
599  AliVTrack* leadTrack = static_cast<AliVTrack*>(fTracksCont->GetLeadingParticle());
600  if(leadTrack)
601  {
602  FillHistogram("hLeadingTrackPt", leadTrack->Pt(), fCent);
603  FillHistogram("hLeadingTrackPhi", leadTrack->Phi(), fCent);
604  FillHistogram("hLeadingTrackEta", leadTrack->Eta(), fCent);
605  FillHistogram("hLeadingTrackPhiEta", leadTrack->Phi(), leadTrack->Eta());
606  }
607 
608  return kTRUE;
609 }
610 
611 //########################################################################
612 // HELPERS
613 //########################################################################
614 
615 //________________________________________________________________________
617 {
618  if(!fPythiaInfo)
619  AliError("fPythiaInfo object not available. Is it activated with SetGeneratePythiaInfoObject()?");
620 
621  Double_t bestMatchDeltaR1 = 999.;
622  Double_t bestMatchDeltaR2 = 999.;
623 
624  fJetsCont->ResetCurrentID();
625  while(AliEmcalJet *jet = fJetsCont->GetNextAcceptJet())
626  {
627  // Check via geometrical matching if jet is connected to the initial collision
628  Double_t deltaEta1 = TMath::Abs(jet->Eta()-fPythiaInfo->GetPartonEta6());
629  Double_t deltaEta2 = TMath::Abs(jet->Eta()-fPythiaInfo->GetPartonEta7());
630  Double_t deltaPhi1 = TMath::Min(TMath::Abs(jet->Phi()-fPythiaInfo->GetPartonPhi6()),TMath::TwoPi() - TMath::Abs(jet->Phi()-fPythiaInfo->GetPartonPhi6()));
631  Double_t deltaPhi2 = TMath::Min(TMath::Abs(jet->Phi()-fPythiaInfo->GetPartonPhi7()),TMath::TwoPi() - TMath::Abs(jet->Phi()-fPythiaInfo->GetPartonPhi7()));
632 
633  Double_t deltaR1 = TMath::Sqrt(deltaEta1*deltaEta1 + deltaPhi1*deltaPhi1);
634  Double_t deltaR2 = TMath::Sqrt(deltaEta2*deltaEta2 + deltaPhi2*deltaPhi2);
635 
636  if(deltaR1 < bestMatchDeltaR1)
637  {
638  bestMatchDeltaR1 = deltaR1;
640  }
641  if(deltaR2 < bestMatchDeltaR2)
642  {
643  bestMatchDeltaR2 = deltaR2;
645  }
646  }
647 
648  if(bestMatchDeltaR1 > 0.3)
650  if(bestMatchDeltaR2 > 0.3)
652 }
653 
654 //________________________________________________________________________
656 {
657  fMatchedJet = 0;
659  // Search leading jet in matching array
660  AliEmcalJet* leadingMatchJet = 0;
661  Double_t leadingPt = -999.;
662  for(Int_t i=0; i<fJetsInput->GetEntries(); i++)
663  {
664  AliEmcalJet* tmpJet = static_cast<AliEmcalJet*>(fJetsInput->At(i));
665  UInt_t dummy = 0;
666  if(!fJetsCont->AcceptJet(tmpJet , dummy))
667  continue;
668 
669  if(tmpJet->Pt() > leadingPt)
670  {
671  leadingMatchJet = tmpJet;
672  leadingPt = tmpJet->Pt();
673  }
674  }
675 
676  if(!leadingMatchJet)
677  return;
678 
679  // Loop over all jets and check for jet that matches best
680  Double_t bestMatchDeltaR = 999.;
681  fJetsCont->ResetCurrentID();
682  while(AliEmcalJet *jet = fJetsCont->GetNextAcceptJet())
683  {
684  // Check via geometrical matching if jet is connected to the initial collision
685  Double_t deltaEta = TMath::Abs(jet->Eta()-leadingMatchJet->Eta());
686  Double_t deltaPhi = TMath::Min(TMath::Abs(jet->Phi()-leadingMatchJet->Phi()),TMath::TwoPi() - TMath::Abs(jet->Phi()-leadingMatchJet->Phi()));
687  Double_t deltaR = TMath::Sqrt(deltaEta*deltaEta + deltaPhi*deltaPhi);
688 
689  if(deltaR < bestMatchDeltaR)
690  {
691  bestMatchDeltaR = deltaR;
692  fMatchedJet = jet;
693  fMatchedJetReference = leadingMatchJet;
694  }
695  }
696 
697  // Don't accept the best match if it is too far away
698  if(bestMatchDeltaR > 1.3*fJetsCont->GetJetRadius())
699  {
700 // cout << Form("Found NO matching jet. Best guess is R=%f with %f GeV/c (input pT=%f GeV/c)", bestMatchDeltaR, fMatchedJet->Pt()-fMatchedJet->Area()*fJetsCont->GetRhoVal(), fMatchedJetReference->Pt()) << endl;
701  fMatchedJet = 0;
703  }
704 // else
705 // cout << Form("Found a matching jet (R=%f) with %f GeV/c (input pT=%f GeV/c)", bestMatchDeltaR, fMatchedJet->Pt()-fMatchedJet->Area()*fJetsCont->GetRhoVal(), fMatchedJetReference->Pt()) << endl;
706 }
707 
708 //________________________________________________________________________
710 {
711  // This is to use a full cone in phi even at the edges of phi (2pi -> 0) (0 -> 2pi)
712  Double_t trackPhi = 0.0;
713  if (track->Phi() > (TMath::TwoPi() - (radius-phi)))
714  trackPhi = track->Phi() - TMath::TwoPi();
715  else if (track->Phi() < (phi+radius - TMath::TwoPi()))
716  trackPhi = track->Phi() + TMath::TwoPi();
717  else
718  trackPhi = track->Phi();
719 
720  if ( TMath::Abs(trackPhi-phi)*TMath::Abs(trackPhi-phi) + TMath::Abs(track->Eta()-eta)*TMath::Abs(track->Eta()-eta) <= radius*radius)
721  return kTRUE;
722 
723  return kFALSE;
724 }
725 
726 
727 //________________________________________________________________________
729 {
730  // Calculate leading + subleading jet
732  if(fJetOutputMode==6)
734  else if(fJetOutputMode==4 || fJetOutputMode==5 || fJetOutputMode==7)
735  GetMatchingJets();
736 }
737 
738 //________________________________________________________________________
740 {
741  Double_t fakeFactor = 0;
742 
743  // Loop over all jet constituents
744  for(Int_t i = 0; i < jet->GetNumberOfTracks(); i++)
745  {
746  AliVParticle* constituent = static_cast<AliVParticle*>(jet->TrackAt(i, fTracksCont->GetArray()));
747 
748  Double_t deltaPhi = TMath::Min(TMath::Abs(jet->Phi()-constituent->Phi()),TMath::TwoPi() - TMath::Abs(jet->Phi()-constituent->Phi()));
749  Double_t deltaR = TMath::Sqrt( (jet->Eta() - constituent->Eta())*(jet->Eta() - constituent->Eta()) + deltaPhi*deltaPhi );
750  fakeFactor += constituent->Pt() * TMath::Sin(deltaR);
751  }
752 
753  return fakeFactor;
754 }
755 
756 //________________________________________________________________________
758 {
759  fEventCriteriumMode = type;
760 
761  if(fEventCriteriumMode==0)
762  AliWarning("Set event criterium to 'default' -- no further selection criterium.");
763  else if(fEventCriteriumMode==1)
764  AliWarning("Set event criterium to 'background' -- select events with certain backgrounds");
765  else if(fEventCriteriumMode==2)
766  AliWarning("Set event criterium to 'simple jet trigger' -- select events with certain minimum leading jet pT (bgrd corr.)");
767  else if(fEventCriteriumMode==3)
768  AliWarning("Set event criterium to 'simple dijet trigger' -- select events with certain minimum leading + subleading jet pT (bgrd corr.)");
769  else
770  {
771  AliFatal("Event criterium not valid.");
772  }
773 }
774 
775 
776 //________________________________________________________________________
777 void AliAnalysisTaskChargedJetsHadronCF::GetLeadingJets(const char* opt, AliEmcalJet*& jetLeading, AliEmcalJet*& jetSubLeading)
778 {
779  // Customized from AliJetContainer::GetLeadingJet()
780  // Get the leading+subleading jet; if opt contains "rho" the sorting is according to pt-A*rho
781 
782  TString option(opt);
783  option.ToLower();
784 
785  jetLeading = 0;
786  jetSubLeading = 0;
787 
788  fJetsCont->ResetCurrentID();
789  Double_t tmpLeadingPt = 0;
790  Double_t tmpSubleadingPt = 0;
791 
792  if (option.Contains("rho")) {
793  while (AliEmcalJet* jet = fJetsCont->GetNextAcceptJet()) {
794  if ( (jet->Pt()-jet->Area()*fJetsCont->GetRhoVal()) > tmpLeadingPt )
795  {
796  jetSubLeading = jetLeading;
797  jetLeading = jet;
798  tmpSubleadingPt = tmpLeadingPt;
799  tmpLeadingPt = jet->Pt()-jet->Area()*fJetsCont->GetRhoVal();
800  }
801  else if ( (jet->Pt()-jet->Area()*fJetsCont->GetRhoVal()) > tmpSubleadingPt )
802  {
803  jetSubLeading = jet;
804  tmpSubleadingPt = jet->Pt()-jet->Area()*fJetsCont->GetRhoVal();
805  }
806  }
807  }
808  else {
809  while (AliEmcalJet* jet = fJetsCont->GetNextAcceptJet()) {
810  if ( (jet->Pt()) > tmpLeadingPt )
811  {
812  jetSubLeading = jetLeading;
813  jetLeading = jet;
814  tmpSubleadingPt = tmpLeadingPt;
815  tmpLeadingPt = jet->Pt();
816  }
817  else if ( (jet->Pt()) > tmpSubleadingPt )
818  {
819  jetSubLeading = jet;
820  tmpSubleadingPt = jet->Pt();
821  }
822  }
823  }
824 }
825 
826 //________________________________________________________________________
828 {
829  // Method for the correct logarithmic binning of histograms
830  TAxis *axis = h->GetAxis(axisNumber);
831  int bins = axis->GetNbins();
832 
833  Double_t from = axis->GetXmin();
834  Double_t to = axis->GetXmax();
835  Double_t *newBins = new Double_t[bins + 1];
836 
837  newBins[0] = from;
838  Double_t factor = pow(to/from, 1./bins);
839 
840  for (int i = 1; i <= bins; i++) {
841  newBins[i] = factor * newBins[i-1];
842  }
843  axis->Set(bins, newBins);
844  delete [] newBins;
845 }
846 
847 //________________________________________________________________________
849 {
850  TH1* tmpHist = static_cast<TH1*>(fOutput->FindObject(key));
851  if(!tmpHist)
852  {
853  AliError(Form("Cannot find histogram <%s> ",key)) ;
854  return;
855  }
856 
857  tmpHist->Fill(x);
858 }
859 
860 //________________________________________________________________________
862 {
863  TH1* tmpHist = static_cast<TH1*>(fOutput->FindObject(key));
864  if(!tmpHist)
865  {
866  AliError(Form("Cannot find histogram <%s> ",key));
867  return;
868  }
869 
870  if (tmpHist->IsA()->GetBaseClass("TH1"))
871  static_cast<TH1*>(tmpHist)->Fill(x,y); // Fill x with y
872  else if (tmpHist->IsA()->GetBaseClass("TH2"))
873  static_cast<TH2*>(tmpHist)->Fill(x,y); // Fill x,y with 1
874 }
875 
876 //________________________________________________________________________
878 {
879  TH2* tmpHist = static_cast<TH2*>(fOutput->FindObject(key));
880  if(!tmpHist)
881  {
882  AliError(Form("Cannot find histogram <%s> ",key));
883  return;
884  }
885 
886  tmpHist->Fill(x,y,add);
887 }
888 
889 //________________________________________________________________________
891 {
892  TH3* tmpHist = static_cast<TH3*>(fOutput->FindObject(key));
893  if(!tmpHist)
894  {
895  AliError(Form("Cannot find histogram <%s> ",key));
896  return;
897  }
898 
899  if(add)
900  tmpHist->Fill(x,y,z,add);
901  else
902  tmpHist->Fill(x,y,z);
903 }
904 
905 
906 //________________________________________________________________________
907 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)
908 {
909  T* tmpHist = new T(name, title, xBins, xMin, xMax);
910 
911  tmpHist->GetXaxis()->SetTitle(xTitle);
912  tmpHist->GetYaxis()->SetTitle(yTitle);
913  tmpHist->SetOption(options);
914  tmpHist->SetMarkerStyle(kFullCircle);
915  tmpHist->Sumw2();
916 
917  fOutput->Add(tmpHist);
918 
919  return tmpHist;
920 }
921 
922 //________________________________________________________________________
923 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)
924 {
925  T* tmpHist = new T(name, title, xBins, xMin, xMax, yBins, yMin, yMax);
926  tmpHist->GetXaxis()->SetTitle(xTitle);
927  tmpHist->GetYaxis()->SetTitle(yTitle);
928  tmpHist->GetZaxis()->SetTitle(zTitle);
929  tmpHist->SetOption(options);
930  tmpHist->SetMarkerStyle(kFullCircle);
931  tmpHist->Sumw2();
932 
933  fOutput->Add(tmpHist);
934 
935  return tmpHist;
936 }
937 
938 //________________________________________________________________________
939 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)
940 {
941  T* tmpHist = new T(name, title, xBins, xMin, xMax, yBins, yMin, yMax, zBins, zMin, zMax);
942  tmpHist->GetXaxis()->SetTitle(xTitle);
943  tmpHist->GetYaxis()->SetTitle(yTitle);
944  tmpHist->GetZaxis()->SetTitle(zTitle);
945  tmpHist->SetOption(options);
946  tmpHist->SetMarkerStyle(kFullCircle);
947  tmpHist->Sumw2();
948 
949  fOutput->Add(tmpHist);
950 
951  return tmpHist;
952 }
953 
954 //________________________________________________________________________
956 {
957  // Called once at the end of the analysis.
958 }
959 
Short_t Charge() const
Definition: AliEmcalJet.h:107
Double_t fEventCriteriumMinSubleadingJetPt
Min subleading jet.
Double_t Area() const
Definition: AliEmcalJet.h:114
Double_t fEventCriteriumMinBackground
Minimum background.
Double_t GetRhoVal() const
double Double_t
Definition: External.C:58
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.
AliEmcalJet * fMatchedJet
! jet matched to input jet (calculated event-by-event)
AliJetContainer * GetJetContainer(Int_t i=0) const
Definition: External.C:244
Float_t GetPartonEta7() const
Double_t Eta() const
Definition: AliEmcalJet.h:105
long long Long64_t
Definition: External.C:43
Double_t Phi() const
Definition: AliEmcalJet.h:101
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.
Double_t GetJetEtaMax() const
Float_t GetPartonPhi7() const
virtual Bool_t AcceptJet(Int_t i, UInt_t &rejectionReason) const
void BinLogAxis(const THn *h, Int_t axisNumber)
Int_t fJetOutputMode
mode which jets are written to array (0: all accepted, 1: leading, 2: subleading, 3: leading+subleadi...
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:123
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
AliParticleContainer * GetParticleContainer() const
Double_t fEventCriteriumMaxBackground
Maximum background.
int Int_t
Definition: External.C:63
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="")
Double_t fExtractionPercentage
percentage that is recorded
Double_t fCent
!event centrality
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 Pt() const
Definition: AliEmcalJet.h:93
Bool_t IsTrackInCone(AliVParticle *track, Double_t eta, Double_t phi, Double_t radius)
void AddJetConstituent(Float_t eta, Float_t phi, Float_t pt, Short_t charge)
Float_t GetJetRadius() const
AliEmcalList * fOutput
!output list
Short_t TrackAt(Int_t idx) const
Definition: AliEmcalJet.h:144
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
TClonesArray * fJetsInput
! Array of generated jets imported into task (toy model)
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.
const char Option_t
Definition: External.C:48
Double_t fExtractionMaxPt
maximum pt of recorded jets
virtual AliVParticle * GetNextAcceptParticle()
bool Bool_t
Definition: External.C:53
Int_t fAcceptedJets
! number accepted jets (calculated event-by-event)
AliEmcalJet * fMatchedJetReference
! matching input jet (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
Int_t fAcceptedTracks
! number accepted tracks (calculated event-by-event)