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