1 /**************************************************************************
2 * Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
4 * Author: The ALICE Off-line Project. *
5 * Contributors are mentioned in the code where appropriate. *
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 **************************************************************************/
16 //_________________________________________________________________________
17 // Do photon/pi0 analysis for isolation and correlation
18 // at the generator level. Only for kine stack (ESDs)
21 // -- Author: Gustavo Conesa (LPSC-CNRS-Grenoble)
22 //////////////////////////////////////////////////////////////////////////////
24 // --- ROOT system ---
26 #include "TParticle.h"
27 #include "TDatabasePDG.h"
29 //---- ANALYSIS system ----
30 #include "AliAnaGeneratorKine.h"
32 #include "AliGenPythiaEventHeader.h"
34 ClassImp(AliAnaGeneratorKine)
37 //__________________________________________
38 AliAnaGeneratorKine::AliAnaGeneratorKine() :
39 AliAnaCaloTrackCorrBaseClass(),
40 fTriggerDetector(""),fCalorimeter(""),
41 fMinChargedPt(0), fMinNeutralPt(0),
43 fParton2(0), fParton3(0),
44 fParton6(0), fParton7(0),
47 fhPtHard(0), fhPtParton(0), fhPtJet(0),
48 fhPtPartonPtHard(0), fhPtJetPtHard(0), fhPtJetPtParton(0),
49 fhPtPhoton(0), fhPtPi0(0)
53 //Initialize parameters
56 for(Int_t i = 0; i < 4; i++)
58 fhPtPhotonLeading[i] = fhPtPi0Leading[i] = 0;
59 fhPtPhotonLeadingSumPt[i] = fhPtPi0LeadingSumPt[i] = 0;
60 fhPtPhotonLeadingIsolated[i] = fhPtPi0LeadingIsolated[i] = 0;
61 for(Int_t j = 0; j < 2; j++)
63 fhZHardPhoton[j][i] = fhZHardPi0[j][i] = 0;
64 fhZHardPhotonIsolated[j][i] = fhZHardPi0Isolated[j][i] = 0;
65 fhZPartonPhoton[j][i] = fhZPartonPi0[j][i] = 0;
66 fhZPartonPhotonIsolated[j][i] = fhZPartonPi0Isolated[j][i] = 0;
67 fhZJetPhoton[j][i] = fhZJetPi0[j][i] = 0;
68 fhZJetPhotonIsolated[j][i] = fhZJetPi0Isolated[j][i] = 0;
69 fhXEPhoton[j][i] = fhXEPi0[j][i] = 0;
70 fhXEPhotonIsolated[j][i] = fhXEPi0Isolated[j][i] = 0;
71 fhXEUEPhoton[j][i] = fhXEUEPi0[j][i] = 0;
72 fhXEUEPhotonIsolated[j][i] = fhXEUEPi0Isolated[j][i] = 0;
74 fhPtPartonTypeNearPhoton[j][i] = fhPtPartonTypeNearPi0[j][i] = 0;
75 fhPtPartonTypeNearPhotonIsolated[j][i] = fhPtPartonTypeNearPi0Isolated[j][i] = 0;
77 fhPtPartonTypeAwayPhoton[j][i] = fhPtPartonTypeAwayPi0[j][i] = 0;
78 fhPtPartonTypeAwayPhotonIsolated[j][i] = fhPtPartonTypeAwayPi0Isolated[j][i] = 0;
84 //___________________________________________________________________________
85 Bool_t AliAnaGeneratorKine::CorrelateWithPartonOrJet(TLorentzVector trigger,
92 //Correlate trigger with partons or jets, get z
94 //Get the index of the mother
95 iparton = (fStack->Particle(indexTrig))->GetFirstMother();
96 TParticle * mother = fStack->Particle(iparton);
99 iparton = mother->GetFirstMother();
100 if(iparton < 0) { printf("AliAnaGeneratorKine::CorrelateWithPartonOrJet() - Negative index, skip event\n"); return kFALSE; }
101 mother = fStack->Particle(iparton);
104 //printf("Mother is parton %d with pdg %d\n",imom,mother->GetPdgCode());
108 //printf("This particle is not from hard process - pdg %d, parton index %d\n",pdgTrig, iparton);
112 Float_t ptTrig = trigger.Pt();
113 Float_t partonPt = fParton6->Pt();
114 Float_t jetPt = fJet6.Pt();
117 partonPt = fParton6->Pt();
121 //Get id of parton in near and away side
128 //printf("parton 6 pdg = %d, parton 7 pdg = %d\n",fParton6->GetPdgCode(),fParton7->GetPdgCode());
132 nearPDG = fParton6->GetPdgCode();
133 awayPDG = fParton7->GetPdgCode();
137 nearPDG = fParton7->GetPdgCode();
138 awayPDG = fParton6->GetPdgCode();
141 if (nearPDG == 22) near = 0;
142 else if(nearPDG == 21) near = 1;
145 if (awayPDG == 22) away = 0;
146 else if(awayPDG == 21) away = 1;
149 for( Int_t i = 0; i < 4; i++ )
154 fhPtPartonTypeNearPi0[leading[i]][i]->Fill(ptTrig,near);
155 fhPtPartonTypeAwayPi0[leading[i]][i]->Fill(ptTrig,away);
158 fhPtPartonTypeNearPi0Isolated[leading[i]][i]->Fill(ptTrig,near);
159 fhPtPartonTypeAwayPi0Isolated[leading[i]][i]->Fill(ptTrig,away);
165 fhPtPartonTypeNearPhoton[leading[i]][i]->Fill(ptTrig,near);
166 fhPtPartonTypeAwayPhoton[leading[i]][i]->Fill(ptTrig,away);
169 fhPtPartonTypeNearPhotonIsolated[leading[i]][i]->Fill(ptTrig,near);
170 fhPtPartonTypeAwayPhotonIsolated[leading[i]][i]->Fill(ptTrig,away);
179 fhPtPartonPtHard->Fill(fPtHard, partonPt/fPtHard);
180 fhPtJetPtHard ->Fill(fPtHard, jetPt/fPtHard);
181 fhPtJetPtParton ->Fill(fPtHard, jetPt/partonPt);
183 Float_t zHard = ptTrig / fPtHard;
184 Float_t zPart = ptTrig / partonPt;
185 Float_t zJet = ptTrig / jetPt;
187 //if(zHard > 1 ) printf("*** Particle energy larger than pT hard z=%f\n",zHard);
189 //printf("Z: hard %2.2f, parton %2.2f, jet %2.2f\n",zHard,zPart,zJet);
191 for( Int_t i = 0; i < 4; i++ )
195 fhZHardPi0[leading[i]][i] ->Fill(ptTrig,zHard);
196 fhZPartonPi0[leading[i]][i]->Fill(ptTrig,zPart);
197 fhZJetPi0[leading[i]][i] ->Fill(ptTrig,zJet );
201 fhZHardPi0Isolated[leading[i]][i] ->Fill(ptTrig,zHard);
202 fhZPartonPi0Isolated[leading[i]][i]->Fill(ptTrig,zPart);
203 fhZJetPi0Isolated[leading[i]][i] ->Fill(ptTrig,zJet);
210 fhZHardPhoton[leading[i]][i] ->Fill(ptTrig,zHard);
211 fhZPartonPhoton[leading[i]][i]->Fill(ptTrig,zPart);
212 fhZJetPhoton[leading[i]][i] ->Fill(ptTrig,zJet );
216 fhZHardPhotonIsolated[leading[i]][i] ->Fill(ptTrig,zHard);
217 fhZPartonPhotonIsolated[leading[i]][i]->Fill(ptTrig,zPart);
218 fhZJetPhotonIsolated[leading[i]][i] ->Fill(ptTrig,zJet);
228 //____________________________________________________
229 TList * AliAnaGeneratorKine::GetCreateOutputObjects()
231 // Create histograms to be saved in output file
233 TList * outputContainer = new TList() ;
234 outputContainer->SetName("GenKineHistos") ;
236 Int_t nptbins = GetHistogramRanges()->GetHistoPtBins();
237 Float_t ptmax = GetHistogramRanges()->GetHistoPtMax();
238 Float_t ptmin = GetHistogramRanges()->GetHistoPtMin();
240 Int_t nptsumbins = GetHistogramRanges()->GetHistoNPtSumBins();
241 Float_t ptsummax = GetHistogramRanges()->GetHistoPtSumMax();
242 Float_t ptsummin = GetHistogramRanges()->GetHistoPtSumMin();
245 fhPtHard = new TH1F("hPtHard"," pt hard for selected triggers",nptbins,ptmin,ptmax);
246 fhPtHard->SetXTitle("#it_{p}_{T}^{hard} (GeV/#it_{c})");
247 outputContainer->Add(fhPtHard);
249 fhPtParton = new TH1F("hPtParton"," pt parton for selected triggers",nptbins,ptmin,ptmax);
250 fhPtParton->SetXTitle("#it_{p}_{T}^{parton} (GeV/#it_{c})");
251 outputContainer->Add(fhPtParton);
253 fhPtJet = new TH1F("hPtJet"," pt jet for selected triggers",nptbins,ptmin,ptmax);
254 fhPtJet->SetXTitle("#it_{p}_{T}^{jet} (GeV/#it_{c})");
255 outputContainer->Add(fhPtJet);
257 fhPtPartonPtHard = new TH2F("hPtPartonPtHard","parton pt / pt hard for selected triggers",nptbins,ptmin,ptmax,200,0,2);
258 fhPtPartonPtHard->SetXTitle("#it_{p}_{T}^{hard} (GeV/#it_{c})");
259 fhPtPartonPtHard->SetYTitle("#it_{p}_{T}^{parton}/#it_{p}_{T}^{hard}");
260 outputContainer->Add(fhPtPartonPtHard);
262 fhPtJetPtHard = new TH2F("hPtJetPtHard","jet pt / pt hard for selected triggers",nptbins,ptmin,ptmax,200,0,2);
263 fhPtJetPtHard->SetXTitle("#it_{p}_{T}^{hard} (GeV/#it_{c})");
264 fhPtJetPtHard->SetYTitle("#it_{p}_{T}^{jet}/#it_{p}_{T}^{hard}");
265 outputContainer->Add(fhPtJetPtHard);
267 fhPtJetPtParton = new TH2F("hPtJetPtParton","parton pt / pt hard for selected triggers",nptbins,ptmin,ptmax,200,0,2);
268 fhPtJetPtParton->SetXTitle("#it_{p}_{T}^{hard} (GeV/#it_{c})");
269 fhPtJetPtParton->SetYTitle("#it_{p}_{T}^{jet}/#it_{p}_{T}^{parton}");
270 outputContainer->Add(fhPtJetPtParton);
272 fhPtPhoton = new TH1F("hPtPhoton","Input #gamma",nptbins,ptmin,ptmax);
273 fhPtPhoton->SetXTitle("#it_{p}_{T} (GeV/#it_{c})");
274 outputContainer->Add(fhPtPhoton);
276 fhPtPi0 = new TH1F("hPtPi0","Input #pi^{0}",nptbins,ptmin,ptmax);
277 fhPtPi0->SetXTitle("#it_{p}_{T} (GeV/#it_{c})");
278 outputContainer->Add(fhPtPi0);
280 TString name [] = {"","_EMC","_Photon","_EMC_Photon"};
281 TString title [] = {"",", neutral in EMCal",", neutral only #gamma-like",", neutral in EMCal and only #gamma-like"};
282 TString leading[] = {"NotLeading","Leading"};
284 for(Int_t i = 0; i < 4; i++)
289 fhPtPhotonLeading[i] = new TH1F(Form("hPtPhotonLeading%s",name[i].Data()),
290 Form("#gamma: Leading of all particles%s",title[i].Data()),
291 nptbins,ptmin,ptmax);
292 fhPtPhotonLeading[i]->SetXTitle("#it_{p}_{T} (GeV/#it_{c})");
293 outputContainer->Add(fhPtPhotonLeading[i]);
295 fhPtPi0Leading[i] = new TH1F(Form("hPtPi0Leading%s",name[i].Data()),
296 Form("#pi^{0}: Leading of all particles%s",title[i].Data()),
297 nptbins,ptmin,ptmax);
298 fhPtPi0Leading[i]->SetXTitle("#it_{p}_{T} (GeV/#it_{c})");
299 outputContainer->Add(fhPtPi0Leading[i]);
301 fhPtPhotonLeadingIsolated[i] = new TH1F(Form("hPtPhotonLeadingIsolated%s",name[i].Data()),
302 Form("#gamma: Leading of all particles%s, isolated",title[i].Data()),
303 nptbins,ptmin,ptmax);
304 fhPtPhotonLeadingIsolated[i]->SetXTitle("#it_{p}_{T} (GeV/#it_{c})");
305 outputContainer->Add(fhPtPhotonLeadingIsolated[i]);
307 fhPtPi0LeadingIsolated[i] = new TH1F(Form("hPtPi0LeadingIsolated%s",name[i].Data()),
308 Form("#pi^{0}: Leading of all particles%s, isolated",title[i].Data()),
309 nptbins,ptmin,ptmax);
310 fhPtPi0LeadingIsolated[i]->SetXTitle("#it_{p}_{T} (GeV/#it_{c})");
311 outputContainer->Add(fhPtPi0LeadingIsolated[i]);
313 fhPtPhotonLeadingSumPt[i] = new TH2F(Form("hPtPhotonLeadingSumPt%s",name[i].Data()),
314 Form("#gamma: Leading of all particles%s",title[i].Data()),
315 nptbins,ptmin,ptmax,nptsumbins,ptsummin,ptsummax);
316 fhPtPhotonLeadingSumPt[i]->SetXTitle("#it_{p}_{T} (GeV/#it_{c})");
317 fhPtPhotonLeadingSumPt[i]->SetYTitle("#Sigma #it_{p}_{T} (GeV/#it_{c})");
318 outputContainer->Add(fhPtPhotonLeadingSumPt[i]);
320 fhPtPi0LeadingSumPt[i] = new TH2F(Form("hPtPi0LeadingSumPt%s",name[i].Data()),
321 Form("#pi^{0}: Leading of all particles%s",title[i].Data()),
322 nptbins,ptmin,ptmax,nptsumbins,ptsummin,ptsummax);
323 fhPtPi0LeadingSumPt[i]->SetXTitle("#it_{p}_{T} (GeV/#it_{c})");
324 fhPtPi0LeadingSumPt[i]->SetYTitle("#Sigma #it_{p}_{T} (GeV/#it_{c})");
325 outputContainer->Add(fhPtPi0LeadingSumPt[i]);
328 // Leading or not loop
329 for(Int_t j = 0; j < 2; j++)
333 fhPtPartonTypeNearPhoton[j][i] = new TH2F(Form("hPtPartonTypeNearPhoton%s%s",leading[j].Data(),name[i].Data()),
334 Form("#gamma: %s of all particles%s",leading[j].Data(),title[i].Data()),
335 nptbins,ptmin,ptmax,3,0,3);
336 fhPtPartonTypeNearPhoton[j][i]->SetXTitle("#it_{p}_{T} (GeV/#it_{c})");
337 fhPtPartonTypeNearPhoton[j][i]->SetYTitle("Parton type");
338 fhPtPartonTypeNearPhoton[j][i]->GetYaxis()->SetBinLabel(1,"#gamma");
339 fhPtPartonTypeNearPhoton[j][i]->GetYaxis()->SetBinLabel(2,"g");
340 fhPtPartonTypeNearPhoton[j][i]->GetYaxis()->SetBinLabel(3,"q");
341 outputContainer->Add(fhPtPartonTypeNearPhoton[j][i]);
343 fhPtPartonTypeNearPi0[j][i] = new TH2F(Form("hPtPartonTypeNearPi0%s%s",leading[j].Data(),name[i].Data()),
344 Form("#pi^{0}: %s of all particles%s",leading[j].Data(),title[i].Data()),
345 nptbins,ptmin,ptmax,3,0,3);
346 fhPtPartonTypeNearPi0[j][i]->SetXTitle("#it_{p}_{T} (GeV/#it_{c})");
347 fhPtPartonTypeNearPi0[j][i]->SetYTitle("Parton type");
348 fhPtPartonTypeNearPi0[j][i]->GetYaxis()->SetBinLabel(1,"#gamma");
349 fhPtPartonTypeNearPi0[j][i]->GetYaxis()->SetBinLabel(2,"g");
350 fhPtPartonTypeNearPi0[j][i]->GetYaxis()->SetBinLabel(3,"q");
351 outputContainer->Add(fhPtPartonTypeNearPi0[j][i]);
353 fhPtPartonTypeNearPhotonIsolated[j][i] = new TH2F(Form("hPtPartonTypeNearPhoton%sIsolated%s",leading[j].Data(),name[i].Data()),
354 Form("#gamma: %s of all particles%s, isolated",leading[j].Data(),title[i].Data()),
355 nptbins,ptmin,ptmax,3,0,3);
356 fhPtPartonTypeNearPhotonIsolated[j][i]->SetXTitle("#it_{p}_{T} (GeV/#it_{c})");
357 fhPtPartonTypeNearPhotonIsolated[j][i]->SetYTitle("Parton type");
358 fhPtPartonTypeNearPhotonIsolated[j][i]->GetYaxis()->SetBinLabel(1,"#gamma");
359 fhPtPartonTypeNearPhotonIsolated[j][i]->GetYaxis()->SetBinLabel(2,"g");
360 fhPtPartonTypeNearPhotonIsolated[j][i]->GetYaxis()->SetBinLabel(3,"q");
361 outputContainer->Add(fhPtPartonTypeNearPhotonIsolated[j][i]);
363 fhPtPartonTypeNearPi0Isolated[j][i] = new TH2F(Form("hPtPartonTypeNearPi0%sIsolated%s",leading[j].Data(),name[i].Data()),
364 Form("#pi^{0}: %s of all particles%s, isolated",leading[j].Data(),title[i].Data()),
365 nptbins,ptmin,ptmax,3,0,3);
366 fhPtPartonTypeNearPi0Isolated[j][i]->SetXTitle("#it_{p}_{T} (GeV/#it_{c})");
367 fhPtPartonTypeNearPi0Isolated[j][i]->SetYTitle("Parton type");
368 fhPtPartonTypeNearPi0Isolated[j][i]->GetYaxis()->SetBinLabel(1,"#gamma");
369 fhPtPartonTypeNearPi0Isolated[j][i]->GetYaxis()->SetBinLabel(2,"g");
370 fhPtPartonTypeNearPi0Isolated[j][i]->GetYaxis()->SetBinLabel(3,"q");
371 outputContainer->Add(fhPtPartonTypeNearPi0Isolated[j][i]);
376 fhPtPartonTypeAwayPhoton[j][i] = new TH2F(Form("hPtPartonTypeAwayPhoton%s%s",leading[j].Data(),name[i].Data()),
377 Form("#gamma: %s of all particles%s",leading[j].Data(),title[i].Data()),
378 nptbins,ptmin,ptmax,3,0,3);
379 fhPtPartonTypeAwayPhoton[j][i]->SetXTitle("#it_{p}_{T} (GeV/#it_{c})");
380 fhPtPartonTypeAwayPhoton[j][i]->SetYTitle("Parton type");
381 fhPtPartonTypeAwayPhoton[j][i]->GetYaxis()->SetBinLabel(1,"#gamma");
382 fhPtPartonTypeAwayPhoton[j][i]->GetYaxis()->SetBinLabel(2,"g");
383 fhPtPartonTypeAwayPhoton[j][i]->GetYaxis()->SetBinLabel(3,"q");
384 outputContainer->Add(fhPtPartonTypeAwayPhoton[j][i]);
386 fhPtPartonTypeAwayPi0[j][i] = new TH2F(Form("hPtPartonTypeAwayPi0%s%s",leading[j].Data(),name[i].Data()),
387 Form("#pi^{0}: %s of all particles%s",leading[j].Data(),title[i].Data()),
388 nptbins,ptmin,ptmax,3,0,3);
389 fhPtPartonTypeAwayPi0[j][i]->SetXTitle("#it_{p}_{T} (GeV/#it_{c})");
390 fhPtPartonTypeAwayPi0[j][i]->SetYTitle("Parton type");
391 fhPtPartonTypeAwayPi0[j][i]->GetYaxis()->SetBinLabel(1,"#gamma");
392 fhPtPartonTypeAwayPi0[j][i]->GetYaxis()->SetBinLabel(2,"g");
393 fhPtPartonTypeAwayPi0[j][i]->GetYaxis()->SetBinLabel(3,"q");
394 outputContainer->Add(fhPtPartonTypeAwayPi0[j][i]);
396 fhPtPartonTypeAwayPhotonIsolated[j][i] = new TH2F(Form("hPtPartonTypeAwayPhoton%sIsolated%s",leading[j].Data(),name[i].Data()),
397 Form("#gamma: %s of all particles%s, isolated",leading[j].Data(),title[i].Data()),
398 nptbins,ptmin,ptmax,3,0,3);
399 fhPtPartonTypeAwayPhotonIsolated[j][i]->SetXTitle("#it_{p}_{T} (GeV/#it_{c})");
400 fhPtPartonTypeAwayPhotonIsolated[j][i]->SetYTitle("Parton type");
401 fhPtPartonTypeAwayPhotonIsolated[j][i]->GetYaxis()->SetBinLabel(1,"#gamma");
402 fhPtPartonTypeAwayPhotonIsolated[j][i]->GetYaxis()->SetBinLabel(2,"g");
403 fhPtPartonTypeAwayPhotonIsolated[j][i]->GetYaxis()->SetBinLabel(3,"q");
404 outputContainer->Add(fhPtPartonTypeAwayPhotonIsolated[j][i]);
406 fhPtPartonTypeAwayPi0Isolated[j][i] = new TH2F(Form("hPtPartonTypeAwayPi0%sIsolated%s",leading[j].Data(),name[i].Data()),
407 Form("#pi^{0}: %s of all particles%s, isolated",leading[j].Data(),title[i].Data()),
408 nptbins,ptmin,ptmax,3,0,3);
409 fhPtPartonTypeAwayPi0Isolated[j][i]->SetXTitle("#it_{p}_{T} (GeV/#it_{c})");
410 fhPtPartonTypeAwayPi0Isolated[j][i]->SetYTitle("Parton type");
411 fhPtPartonTypeAwayPi0Isolated[j][i]->GetYaxis()->SetBinLabel(1,"#gamma");
412 fhPtPartonTypeAwayPi0Isolated[j][i]->GetYaxis()->SetBinLabel(2,"g");
413 fhPtPartonTypeAwayPi0Isolated[j][i]->GetYaxis()->SetBinLabel(3,"q");
414 outputContainer->Add(fhPtPartonTypeAwayPi0Isolated[j][i]);
418 fhZHardPhoton[j][i] = new TH2F(Form("hZHardPhoton%s%s",leading[j].Data(),name[i].Data()),
419 Form("#it_{z}_{Hard} of #gamma: %s of all particles%s",leading[j].Data(),title[i].Data()),
420 nptbins,ptmin,ptmax,200,0,2);
421 fhZHardPhoton[j][i]->SetYTitle("#it_{p}_{T}^{particle}/#it_{p}_{T}^{hard}");
422 fhZHardPhoton[j][i]->SetXTitle("#it_{p}_{T}^{particle} (GeV/#it_{c})");
423 outputContainer->Add(fhZHardPhoton[j][i]);
425 fhZHardPi0[j][i] = new TH2F(Form("hZHardPi0%s%s",leading[j].Data(),name[i].Data()),
426 Form("#it_{z}_{Hard} of #pi^{0}: %s of all particles%s",leading[j].Data(),title[i].Data()),
427 nptbins,ptmin,ptmax,200,0,2);
428 fhZHardPi0[j][i]->SetYTitle("#it_{p}_{T}^{particle}/#it_{p}_{T}^{hard}");
429 fhZHardPi0[j][i]->SetXTitle("#it_{p}_{T}^{particle} (GeV/#it_{c})");
430 outputContainer->Add(fhZHardPi0[j][i]);
432 fhZHardPhotonIsolated[j][i] = new TH2F(Form("hZHardPhoton%sIsolated%s",leading[j].Data(),name[i].Data()),
433 Form("#it_{z}_{Hard} of #gamma: %s of all particles%s, isolated",leading[j].Data(),title[i].Data()),
434 nptbins,ptmin,ptmax,200,0,2);
435 fhZHardPhotonIsolated[j][i]->SetYTitle("#it_{p}_{T}^{particle}/#it_{p}_{T}^{hard}");
436 fhZHardPhotonIsolated[j][i]->SetXTitle("#it_{p}_{T}^{particle} (GeV/#it_{c})");
437 outputContainer->Add(fhZHardPhotonIsolated[j][i]);
439 fhZHardPi0Isolated[j][i] = new TH2F(Form("hZHardPi0%sIsolated%s",leading[j].Data(),name[i].Data()),
440 Form("#it_{z}_{Hard} of #pi^{0}: %s of all particles%s, isolated",leading[j].Data(),title[i].Data()),
441 nptbins,ptmin,ptmax,200,0,2);
442 fhZHardPi0Isolated[j][i]->SetYTitle("#it_{p}_{T}^{particle}/#it_{p}_{T}^{hard}");
443 fhZHardPi0Isolated[j][i]->SetXTitle("#it_{p}_{T}^{particle} (GeV/#it_{c})");
444 outputContainer->Add(fhZHardPi0Isolated[j][i]);
448 fhZPartonPhoton[j][i] = new TH2F(Form("hZPartonPhoton%s%s",leading[j].Data(),name[i].Data()),
449 Form("#it_{z}_{Parton} of #gamma: %s of all particles%s",leading[j].Data(),title[i].Data()),
450 nptbins,ptmin,ptmax,200,0,2);
451 fhZPartonPhoton[j][i]->SetYTitle("#it_{p}_{T}^{particle}/#it_{p}_{T}^{hard}");
452 fhZPartonPhoton[j][i]->SetXTitle("#it_{p}_{T}^{particle} (GeV/#it_{c})");
453 outputContainer->Add(fhZPartonPhoton[j][i]);
455 fhZPartonPi0[j][i] = new TH2F(Form("hZPartonPi0%s%s",leading[j].Data(),name[i].Data()),
456 Form("#it_{z}_{Parton} of #pi^{0}: %s of all particles%s",leading[j].Data(),title[i].Data()),
457 nptbins,ptmin,ptmax,200,0,2);
458 fhZPartonPi0[j][i]->SetYTitle("#it_{p}_{T}^{particle}/#it_{p}_{T}^{hard}");
459 fhZPartonPi0[j][i]->SetXTitle("#it_{p}_{T}^{particle} (GeV/#it_{c})");
460 outputContainer->Add(fhZPartonPi0[j][i]);
462 fhZPartonPhotonIsolated[j][i] = new TH2F(Form("hZPartonPhoton%sIsolated%s",leading[j].Data(),name[i].Data()),
463 Form("#it_{z}_{Parton} of #gamma: %s of all particles%s, isolated",leading[j].Data(),title[i].Data()),
464 nptbins,ptmin,ptmax,200,0,2);
465 fhZPartonPhotonIsolated[j][i]->SetYTitle("#it_{p}_{T}^{particle}/#it_{p}_{T}^{hard}");
466 fhZPartonPhotonIsolated[j][i]->SetXTitle("#it_{p}_{T}^{particle} (GeV/#it_{c})");
467 outputContainer->Add(fhZPartonPhotonIsolated[j][i]);
469 fhZPartonPi0Isolated[j][i] = new TH2F(Form("hZPartonPi0%sIsolated%s",leading[j].Data(),name[i].Data()),
470 Form("#it_{z}_{Parton} of #pi^{0}: %s of all particles%s, isolated",leading[j].Data(),title[i].Data()),
471 nptbins,ptmin,ptmax,200,0,2);
472 fhZPartonPi0Isolated[j][i]->SetYTitle("#it_{p}_{T}^{particle}/#it_{p}_{T}^{hard}");
473 fhZPartonPi0Isolated[j][i]->SetXTitle("#it_{p}_{T}^{particle} (GeV/#it_{c})");
474 outputContainer->Add(fhZPartonPi0Isolated[j][i]);
479 fhZJetPhoton[j][i] = new TH2F(Form("hZJetPhoton%s%s",leading[j].Data(),name[i].Data()),
480 Form("#it_{z}_{Jet} of #gamma: %s of all particles%s",leading[j].Data(),title[i].Data()),
481 nptbins,ptmin,ptmax,200,0,2);
482 fhZJetPhoton[j][i]->SetYTitle("#it_{p}_{T}^{particle}/#it_{p}_{T}^{hard}");
483 fhZJetPhoton[j][i]->SetXTitle("#it_{p}_{T}^{particle} (GeV/#it_{c})");
484 outputContainer->Add(fhZJetPhoton[j][i]);
486 fhZJetPi0[j][i] = new TH2F(Form("hZJetPi0%s%s",leading[j].Data(),name[i].Data()),
487 Form("#it_{z}_{Jet} of #pi^{0}: %s of all particles%s",leading[j].Data(),title[i].Data()),
488 nptbins,ptmin,ptmax,200,0,2);
489 fhZJetPi0[j][i]->SetYTitle("#it_{p}_{T}^{particle}/#it_{p}_{T}^{hard}");
490 fhZJetPi0[j][i]->SetXTitle("#it_{p}_{T}^{particle} (GeV/#it_{c})");
491 outputContainer->Add(fhZJetPi0[j][i]);
493 fhZJetPhotonIsolated[j][i] = new TH2F(Form("hZJetPhoton%sIsolated%s",leading[j].Data(),name[i].Data()),
494 Form("#it_{z}_{Jet} of #gamma: %s of all particles%s, isolated",leading[j].Data(),title[i].Data()),
495 nptbins,ptmin,ptmax,200,0,2);
496 fhZJetPhotonIsolated[j][i]->SetYTitle("#it_{p}_{T}^{particle}/#it_{p}_{T}^{hard}");
497 fhZJetPhotonIsolated[j][i]->SetXTitle("#it_{p}_{T}^{particle} (GeV/#it_{c})");
498 outputContainer->Add(fhZJetPhotonIsolated[j][i]);
500 fhZJetPi0Isolated[j][i] = new TH2F(Form("hZJetPi0%sIsolated%s",leading[j].Data(),name[i].Data()),
501 Form("#it_{z}_{Jet} of #pi^{0}: %s of all particles%s, isolated",leading[j].Data(),title[i].Data()),
502 nptbins,ptmin,ptmax,200,0,2);
503 fhZJetPi0Isolated[j][i]->SetYTitle("#it_{p}_{T}^{particle}/#it_{p}_{T}^{hard}");
504 fhZJetPi0Isolated[j][i]->SetXTitle("#it_{p}_{T}^{particle} (GeV/#it_{c})");
505 outputContainer->Add(fhZJetPi0Isolated[j][i]);
510 fhXEPhoton[j][i] = new TH2F(Form("hXEPhoton%s%s",leading[j].Data(),name[i].Data()),
511 Form("#it_{z}_{Jet} of #gamma: %s of all particles%s",leading[j].Data(),title[i].Data()),
512 nptbins,ptmin,ptmax,200,0,2);
513 fhXEPhoton[j][i]->SetYTitle("#it_{p}_{T}^{particle}/#it_{p}_{T}^{hard}");
514 fhXEPhoton[j][i]->SetXTitle("#it_{p}_{T}^{particle} (GeV/#it_{c})");
515 outputContainer->Add(fhXEPhoton[j][i]);
517 fhXEPi0[j][i] = new TH2F(Form("hXEPi0%s%s",leading[j].Data(),name[i].Data()),
518 Form("#it_{z}_{Jet} of #pi^{0}: %s of all particles%s",leading[j].Data(),title[i].Data()),
519 nptbins,ptmin,ptmax,200,0,2);
520 fhXEPi0[j][i]->SetYTitle("#it_{p}_{T}^{particle}/#it_{p}_{T}^{hard}");
521 fhXEPi0[j][i]->SetXTitle("#it_{p}_{T}^{particle} (GeV/#it_{c})");
522 outputContainer->Add(fhXEPi0[j][i]);
524 fhXEPhotonIsolated[j][i] = new TH2F(Form("hXEPhoton%sIsolated%s",leading[j].Data(),name[i].Data()),
525 Form("#it_{z}_{Jet} of #gamma: %s of all particles%s, isolated",leading[j].Data(),title[i].Data()),
526 nptbins,ptmin,ptmax,200,0,2);
527 fhXEPhotonIsolated[j][i]->SetYTitle("#it_{p}_{T}^{particle}/#it_{p}_{T}^{hard}");
528 fhXEPhotonIsolated[j][i]->SetXTitle("#it_{p}_{T}^{particle} (GeV/#it_{c})");
529 outputContainer->Add(fhXEPhotonIsolated[j][i]);
531 fhXEPi0Isolated[j][i] = new TH2F(Form("hXEPi0%sIsolated%s",leading[j].Data(),name[i].Data()),
532 Form("#it_{z}_{Jet} of #pi^{0}: %s of all particles%s, isolated",leading[j].Data(),title[i].Data()),
533 nptbins,ptmin,ptmax,200,0,2);
534 fhXEPi0Isolated[j][i]->SetYTitle("#it_{p}_{T}^{particle}/#it_{p}_{T}^{hard}");
535 fhXEPi0Isolated[j][i]->SetXTitle("#it_{p}_{T}^{particle} (GeV/#it_{c})");
536 outputContainer->Add(fhXEPi0Isolated[j][i]);
541 fhXEUEPhoton[j][i] = new TH2F(Form("hXEUEPhoton%s%s",leading[j].Data(),name[i].Data()),
542 Form("#it_{z}_{Jet} of #gamma: %s of all particles%s",leading[j].Data(),title[i].Data()),
543 nptbins,ptmin,ptmax,200,0,2);
544 fhXEUEPhoton[j][i]->SetYTitle("#it_{p}_{T}^{particle}/#it_{p}_{T}^{hard}");
545 fhXEUEPhoton[j][i]->SetXTitle("#it_{p}_{T}^{particle} (GeV/#it_{c})");
546 outputContainer->Add(fhXEUEPhoton[j][i]);
548 fhXEUEPi0[j][i] = new TH2F(Form("hXEUEPi0%s%s",leading[j].Data(),name[i].Data()),
549 Form("#it_{z}_{Jet} of #pi^{0}: %s of all particles%s",leading[j].Data(),title[i].Data()),
550 nptbins,ptmin,ptmax,200,0,2);
551 fhXEUEPi0[j][i]->SetYTitle("#it_{p}_{T}^{particle}/#it_{p}_{T}^{hard}");
552 fhXEUEPi0[j][i]->SetXTitle("#it_{p}_{T}^{particle} (GeV/#it_{c})");
553 outputContainer->Add(fhXEUEPi0[j][i]);
555 fhXEUEPhotonIsolated[j][i] = new TH2F(Form("hXEUEPhoton%sIsolated%s",leading[j].Data(),name[i].Data()),
556 Form("#it_{z}_{Jet} of #gamma: %s of all particles%s, isolated",leading[j].Data(),title[i].Data()),
557 nptbins,ptmin,ptmax,200,0,2);
558 fhXEUEPhotonIsolated[j][i]->SetYTitle("#it_{p}_{T}^{particle}/#it_{p}_{T}^{hard}");
559 fhXEUEPhotonIsolated[j][i]->SetXTitle("#it_{p}_{T}^{particle} (GeV/#it_{c})");
560 outputContainer->Add(fhXEUEPhotonIsolated[j][i]);
562 fhXEUEPi0Isolated[j][i] = new TH2F(Form("hXEUEPi0%sIsolated%s",leading[j].Data(),name[i].Data()),
563 Form("#it_{z}_{Jet} of #pi^{0}: %s of all particles%s, isolated",leading[j].Data(),title[i].Data()),
564 nptbins,ptmin,ptmax,200,0,2);
565 fhXEUEPi0Isolated[j][i]->SetYTitle("#it_{p}_{T}^{particle}/#it_{p}_{T}^{hard}");
566 fhXEUEPi0Isolated[j][i]->SetXTitle("#it_{p}_{T}^{particle} (GeV/#it_{c})");
567 outputContainer->Add(fhXEUEPi0Isolated[j][i]);
571 return outputContainer;
575 //____________________________________________
576 void AliAnaGeneratorKine::GetPartonsAndJets()
578 // Fill data members with partons,jets and generated pt hard
580 fStack = GetMCStack() ;
584 printf("AliAnaGeneratorKine::MakeAnalysisFillHistograms() - No Stack available, STOP\n");
588 fParton2 = fStack->Particle(2) ;
589 fParton3 = fStack->Particle(3) ;
590 fParton6 = fStack->Particle(6) ;
591 fParton7 = fStack->Particle(7) ;
593 Float_t p6phi = fParton6->Phi();
594 if(p6phi < 0) p6phi +=TMath::TwoPi();
595 Float_t p7phi = fParton7->Phi();
596 if(p7phi < 0) p7phi +=TMath::TwoPi();
598 //printf("parton6: pt %2.2f, eta %2.2f, phi %2.2f with pdg %d\n",fParton6->Pt(),fParton6->Eta(),p6phi, fParton6->GetPdgCode());
599 //printf("parton7: pt %2.2f, eta %2.2f, phi %2.2f with pdg %d\n",fParton7->Pt(),fParton7->Eta(),p7phi, fParton7->GetPdgCode());
601 // Get the jets, only for pythia
602 if(!strcmp(GetReader()->GetGenEventHeader()->ClassName(), "AliGenPythiaEventHeader"))
604 AliGenPythiaEventHeader* pygeh= (AliGenPythiaEventHeader*) GetReader()->GetGenEventHeader();
606 fPtHard = pygeh->GetPtHard();
608 //printf("pt Hard %2.2f\n",fPtHard);
610 const Int_t nTriggerJets = pygeh->NTriggerJets();
612 Float_t tmpjet[]={0,0,0,0};
614 // select the closest jet to parton
618 for(Int_t ijet = 0; ijet< nTriggerJets; ijet++)
620 pygeh->TriggerJet(ijet, tmpjet);
622 TLorentzVector jet(tmpjet[0],tmpjet[1],tmpjet[2],tmpjet[3]);
623 Float_t jphi = jet.Phi();
624 if(jphi < 0) jphi +=TMath::TwoPi();
626 Double_t radius6 = GetIsolationCut()->Radius(fParton6->Eta(), p6phi, jet.Eta() , jphi) ;
627 Double_t radius7 = GetIsolationCut()->Radius(fParton7->Eta(), p7phi, jet.Eta() , jphi) ;
629 //printf("jet %d: pt %2.2f, eta %2.2f, phi %2.2f, r6 %2.2f, r7 %2.2f\n",ijet,jet.Pt(),jet.Eta(),jphi,radius6, radius7);
645 //printf("jet6: pt %2.2f, eta %2.2f, phi %2.2f\n",fJet6.Pt(),fJet6.Eta(),fJet6.Phi());
646 //printf("jet7: pt %2.2f, eta %2.2f, phi %2.2f\n",fJet7.Pt(),fJet7.Eta(),fJet6.Phi());
650 fhPtHard ->Fill(fPtHard);
651 fhPtJet ->Fill(fJet6.Pt());
652 fhPtJet ->Fill(fJet7.Pt());
653 fhPtParton ->Fill(fParton6->Pt());
654 fhPtParton ->Fill(fParton7->Pt());
658 //_____________________________________________________
659 void AliAnaGeneratorKine::GetXE(TLorentzVector trigger,
667 // Calculate the real XE and the UE XE
669 Float_t ptTrig = trigger.Pt();
670 Float_t etaTrig = trigger.Eta();
671 Float_t phiTrig = trigger.Phi();
672 if(phiTrig < 0 ) phiTrig += TMath::TwoPi();
674 //Loop on primaries, start from position 8, no partons
675 for(Int_t ipr = 8; ipr < fStack->GetNprimary(); ipr ++ )
677 TParticle * particle = fStack->Particle(ipr) ;
679 if(ipr==indexTrig) continue;
682 Int_t pdg = particle->GetPdgCode();
683 Int_t status = particle->GetStatusCode();
685 // Compare trigger with final state particles
686 if( status != 1) continue ;
688 Double_t charge = TDatabasePDG::Instance()->GetParticle(pdg)->Charge();
690 if(charge==0) continue; // construct xe only with charged
692 Float_t pt = particle->Pt();
693 Float_t eta = particle->Eta();
694 Float_t phi = particle->Phi();
695 if(phi < 0 ) phi += TMath::TwoPi();
697 if( pt < fMinChargedPt) continue ;
699 if(TMath::Abs(eta) > 0.8) continue ; // TPC acceptance cut
702 Double_t radius = GetIsolationCut()->Radius(etaTrig, phiTrig, eta , phi) ;
704 Float_t xe = -pt/ptTrig*TMath::Cos(phi-phiTrig);
706 //Get the index of the mother
707 Int_t ipartonAway = particle->GetFirstMother();
708 if(ipartonAway < 0) return;
709 TParticle * mother = fStack->Particle(ipartonAway);
710 while (ipartonAway > 7)
712 ipartonAway = mother->GetFirstMother();
713 if(ipartonAway < 0) break;
714 mother = fStack->Particle(ipartonAway);
717 if((ipartonAway==6 || ipartonAway==7) && iparton!=ipartonAway)
719 //printf("xE: iparton %d, ipartonAway %d\n",iparton,ipartonAway);
720 if(radius > 1 ) continue; // avoid particles too far from trigger
722 for( Int_t i = 0; i < 4; i++ )
727 fhXEPi0[leading[i]][i] ->Fill(ptTrig,xe);
731 fhXEPi0Isolated[leading[i]][i] ->Fill(ptTrig,xe);
738 fhXEPhoton[leading[i]][i] ->Fill(ptTrig,xe);
742 fhXEPhotonIsolated[leading[i]][i] ->Fill(ptTrig,xe);
749 if(ipartonAway!=6 && ipartonAway!=7)
752 //printf("xE UE: iparton %d, ipartonAway %d\n",iparton,ipartonAway);
754 for( Int_t i = 0; i < 4; i++ )
759 fhXEUEPi0[leading[i]][i] ->Fill(ptTrig,xe);
763 fhXEUEPi0Isolated[leading[i]][i] ->Fill(ptTrig,xe);
770 fhXEUEPhoton[leading[i]][i] ->Fill(ptTrig,xe);
774 fhXEUEPhotonIsolated[leading[i]][i] ->Fill(ptTrig,xe);
786 //________________________________________
787 void AliAnaGeneratorKine::InitParameters()
790 //Initialize the parameters of the analysis.
791 AddToHistogramsName("AnaGenKine_");
793 fCalorimeter = "EMCAL";
794 fTriggerDetector = "EMCAL";
801 //_____________________________________________________________________
802 void AliAnaGeneratorKine::IsLeadingAndIsolated(TLorentzVector trigger,
808 // Check if the trigger is the leading particle and if it is isolated
809 // In case of neutral particles check all neutral or neutral in EMCAL acceptance
811 Float_t ptMaxCharged = 0; // all charged
812 Float_t ptMaxNeutral = 0; // all neutral
813 Float_t ptMaxNeutEMCAL = 0; // for neutral, select them in EMCAL acceptance
814 Float_t ptMaxNeutPhot = 0; // for neutral, take only photons
815 Float_t ptMaxNeutEMCALPhot = 0; // for neutral, take only photons in EMCAL acceptance
827 Float_t ptTrig = trigger.Pt();
828 Float_t etaTrig = trigger.Eta();
829 Float_t phiTrig = trigger.Phi();
830 if(phiTrig < 0 ) phiTrig += TMath::TwoPi();
832 // Minimum track or cluster energy
835 Float_t ptThresIC = GetIsolationCut()->GetPtThreshold();
836 Float_t sumThresIC = GetIsolationCut()->GetPtThreshold();
837 Float_t rThresIC = GetIsolationCut()->GetConeSize();
838 Float_t isoMethod = GetIsolationCut()->GetICMethod();
842 Int_t nICNeutral = 0;
843 Int_t nICNeutEMCAL = 0;
844 Int_t nICNeutPhot = 0;
845 Int_t nICNeutEMCALPhot = 0;
849 Float_t sumNePtPhot = 0;
850 Float_t sumNePtEMC = 0;
851 Float_t sumNePtEMCPhot = 0;
854 //Loop on primaries, start from position 8, no partons
855 for(Int_t ipr = 8; ipr < fStack->GetNprimary(); ipr ++ )
857 if(ipr == indexTrig) continue;
858 TParticle * particle = fStack->Particle(ipr) ;
860 Int_t imother= particle->GetFirstMother();
861 //printf("Leading ipr %d - mother %d\n",ipr, imother);
863 if(imother==indexTrig) continue ;
865 Int_t pdg = particle->GetPdgCode();
866 Int_t status = particle->GetStatusCode();
868 // Compare trigger with final state particles
869 if( status != 1) continue ;
871 Float_t pt = particle->Pt();
872 Float_t eta = particle->Eta();
873 Float_t phi = particle->Phi();
874 if(phi < 0 ) phi += TMath::TwoPi();
876 Double_t charge = TDatabasePDG::Instance()->GetParticle(pdg)->Charge();
879 Double_t radius = GetIsolationCut()->Radius(etaTrig, phiTrig, eta , phi) ;
883 if(pt < fMinNeutralPt) continue ;
885 if( ptMaxNeutral < pt ) ptMaxNeutral = pt;
887 if( radius < rThresIC )
889 if( pt > ptThresIC ) nICNeutral++ ;
893 Bool_t phPDG = kFALSE;
894 if(pdg==22 || pdg==111) phPDG = kTRUE;
896 //if(pt > ptTrig) printf(" --- pdg %d, phPDG %d pT %2.2f, pTtrig %2.2f, eta %2.2f, phi %2.2f\n",pdg,phPDG,pt,ptTrig,particle->Eta(), particle->Phi()*TMath::RadToDeg());
899 if( ptMaxNeutPhot < pt) ptMaxNeutPhot = pt;
901 if( radius < rThresIC )
903 if(pt > ptThresIC) nICNeutPhot++ ;
908 //Calorimeter acceptance
909 Bool_t inCalo = GetFiducialCut()->IsInFiducialCut(trigger,fCalorimeter) ;
911 if(!inCalo) continue;
913 if( ptMaxNeutEMCAL < pt ) ptMaxNeutEMCAL = pt;
914 if( radius < rThresIC )
916 if( pt > ptThresIC ) nICNeutEMCAL++ ;
922 if( ptMaxNeutEMCALPhot < pt ) ptMaxNeutEMCALPhot = pt;
923 if( radius < rThresIC )
925 if (pt > ptThresIC) nICNeutEMCALPhot++ ;
926 sumNePtEMCPhot += pt;
933 if( pt < fMinChargedPt) continue ;
935 Bool_t inTPC = GetFiducialCut()->IsInFiducialCut(trigger,"CTS") ;
939 if( ptMaxCharged < pt ) ptMaxCharged = pt;
941 if( radius < rThresIC )
943 //printf("UE track? pTtrig %2.2f, pt %2.2f, etaTrig %2.2f, eta %2.2f, phiTrig %2.2f, phi %2.2f, radius %2.2f\n",
944 // ptTrig, pt,etaTrig, eta, phiTrig*TMath::RadToDeg(), phi*TMath::RadToDeg(),radius);
945 if( pt > ptThresIC ) nICTrack++ ;
953 if(ptTrig > ptMaxCharged)
955 //printf("pt charged %2.2f, pt neutral %2.2f, pt neutral emcal %2.2f, pt photon %2.2f, pt photon emcal %2.2f\n",
956 // ptMaxCharged, ptMaxNeutral, ptMaxNeutEMCAL,ptMaxNeutPhot, ptMaxNeutEMCALPhot);
957 if(ptTrig > ptMaxNeutral ) leading[0] = kTRUE ;
958 if(ptTrig > ptMaxNeutEMCAL ) leading[1] = kTRUE ;
959 if(ptTrig > ptMaxNeutPhot ) leading[2] = kTRUE ;
960 if(ptTrig > ptMaxNeutEMCALPhot) leading[3] = kTRUE ;
963 //printf("N in cone over threshold: tracks %d, neutral %d, neutral emcal %d, photon %d, photon emcal %d\n",
964 // nICTrack, nICNeutral ,nICNeutEMCAL,nICNeutPhot, nICNeutEMCALPhot);
967 // Isolation decision
968 if( isoMethod == AliIsolationCut::kPtThresIC )
972 if(nICNeutral == 0 ) isolated[0] = kTRUE ;
973 if(nICNeutEMCAL == 0 ) isolated[1] = kTRUE ;
974 if(nICNeutPhot == 0 ) isolated[2] = kTRUE ;
975 if(nICNeutEMCALPhot == 0 ) isolated[3] = kTRUE ;
978 else if( isoMethod == AliIsolationCut::kSumPtIC )
980 if(sumChPt + sumNePt < sumThresIC ) isolated[0] = kTRUE ;
981 if(sumChPt + sumNePtEMC < sumThresIC ) isolated[1] = kTRUE ;
982 if(sumChPt + sumNePtPhot < sumThresIC ) isolated[2] = kTRUE ;
983 if(sumChPt + sumNePtEMCPhot < sumThresIC ) isolated[3] = kTRUE ;
987 //----------------------------------------------------
988 // Fill histograms if conditions apply for all 4 cases
989 for( Int_t i = 0; i < 4; i++ )
995 fhPtPi0Leading[i]->Fill(ptTrig);
997 if (i == 0) fhPtPi0LeadingSumPt[i]->Fill(ptTrig, sumChPt + sumNePt);
998 else if(i == 1) fhPtPi0LeadingSumPt[i]->Fill(ptTrig, sumChPt + sumNePtEMC);
999 else if(i == 2) fhPtPi0LeadingSumPt[i]->Fill(ptTrig, sumChPt + sumNePtPhot);
1000 else if(i == 3) fhPtPi0LeadingSumPt[i]->Fill(ptTrig, sumChPt + sumNePtEMCPhot);
1002 if(isolated[i]) fhPtPi0LeadingIsolated[i]->Fill(ptTrig);
1005 else if(pdgTrig==22)
1009 fhPtPhotonLeading[i]->Fill(ptTrig);
1011 if (i == 0) fhPtPhotonLeadingSumPt[i]->Fill(ptTrig, sumChPt + sumNePt);
1012 else if(i == 1) fhPtPhotonLeadingSumPt[i]->Fill(ptTrig, sumChPt + sumNePtEMC);
1013 else if(i == 2) fhPtPhotonLeadingSumPt[i]->Fill(ptTrig, sumChPt + sumNePtPhot);
1014 else if(i == 3) fhPtPhotonLeadingSumPt[i]->Fill(ptTrig, sumChPt + sumNePtEMCPhot);
1016 if(isolated[i]) fhPtPhotonLeadingIsolated[i]->Fill(ptTrig);
1019 } // conditions loop
1023 //_____________________________________________________
1024 void AliAnaGeneratorKine::MakeAnalysisFillHistograms()
1026 //Particle-Parton Correlation Analysis, fill histograms
1028 TLorentzVector trigger;
1030 GetPartonsAndJets();
1032 for(Int_t ipr = 0; ipr < fStack->GetNprimary(); ipr ++ )
1034 TParticle * particle = fStack->Particle(ipr) ;
1036 Int_t pdgTrig = particle->GetPdgCode();
1037 Int_t statusTrig = particle->GetStatusCode();
1038 Int_t imother = particle->GetFirstMother();
1039 Float_t ptTrig = particle->Pt();
1041 // Select final state photons (prompt, fragmentation) or pi0s
1043 //Check the origin of the photon, accept if prompt or initial/final state radiation
1044 if(pdgTrig == 22 && statusTrig == 1)
1046 if(imother > 8) continue;
1048 // If not photon, trigger on pi0
1049 else if(pdgTrig != 111) continue;
1051 // Acceptance and kinematical cuts
1052 if( ptTrig < GetMinPt() ) continue ;
1054 Bool_t in = GetFiducialCut()->IsInFiducialCut(trigger,fTriggerDetector) ;
1056 if(! in ) continue ;
1058 particle->Momentum(trigger);
1060 // printf("Particle %d: pdg %d status %d, mother index %d, pT %2.2f, eta %2.2f, phi %2.2f \n",
1061 // ipr, pdgTrig, statusTrig, imother, ptTrig, particle->Eta(), particle->Phi()*TMath::RadToDeg());
1065 // printf("\t pi0 daughters %d, %d\n", particle->GetDaughter(0), particle->GetDaughter(1));
1068 if (pdgTrig==22 ) fhPtPhoton->Fill(ptTrig);
1069 else if(pdgTrig==111) fhPtPi0 ->Fill(ptTrig);
1071 // Check if it is leading
1073 Bool_t isolated[4] ;
1075 IsLeadingAndIsolated(trigger, ipr, pdgTrig, leading, isolated);
1078 Int_t ok = CorrelateWithPartonOrJet(trigger, ipr, pdgTrig, leading, isolated, iparton);
1081 GetXE(trigger,ipr,pdgTrig,leading,isolated,iparton) ;
1085 if(GetDebug() > 1) printf("AliAnaGeneratorKine::MakeAnalysisFillHistograms() - End fill histograms \n");