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