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 **************************************************************************/
17 //_________________________________________________________________________
18 // Class for the analysis of particle-parton correlations
19 // Particle (for example direct gamma) must be found in a previous analysis
20 // -- Author: Gustavo Conesa (LNF-INFN)
21 //////////////////////////////////////////////////////////////////////////////
23 // --- ROOT system ---
24 //#include "Riostream.h"
26 #include "TParticle.h"
28 //---- ANALYSIS system ----
29 #include "AliAnaParticlePartonCorrelation.h"
32 #include "AliAODPWG4ParticleCorrelation.h"
34 ClassImp(AliAnaParticlePartonCorrelation)
37 //____________________________________________________________________________
38 AliAnaParticlePartonCorrelation::AliAnaParticlePartonCorrelation() :
39 AliAnaPartCorrBaseClass(),
40 fhDeltaEtaNearParton(0), fhDeltaPhiNearParton(0),
41 fhDeltaPtNearParton(0), fhPtRatNearParton(0),
42 fhDeltaEtaAwayParton(0), fhDeltaPhiAwayParton(0),
43 fhDeltaPtAwayParton(0), fhPtRatAwayParton(0)
47 //Initialize parameters
51 //____________________________________________________________________________
52 AliAnaParticlePartonCorrelation::AliAnaParticlePartonCorrelation(const AliAnaParticlePartonCorrelation & g) :
53 AliAnaPartCorrBaseClass(g),
54 fhDeltaEtaNearParton(g.fhDeltaEtaNearParton), fhDeltaPhiNearParton(g.fhDeltaPhiNearParton),
55 fhDeltaPtNearParton(g.fhDeltaPtNearParton), fhPtRatNearParton(g.fhPtRatNearParton),
56 fhDeltaEtaAwayParton(g.fhDeltaEtaAwayParton), fhDeltaPhiAwayParton(g.fhDeltaPhiAwayParton),
57 fhDeltaPtAwayParton(g.fhDeltaPtAwayParton), fhPtRatAwayParton(g.fhPtRatAwayParton)
63 //_________________________________________________________________________
64 AliAnaParticlePartonCorrelation & AliAnaParticlePartonCorrelation::operator = (const AliAnaParticlePartonCorrelation & source)
66 // assignment operator
68 if(this == &source)return *this;
69 ((AliAnaPartCorrBaseClass *)this)->operator=(source);
71 fhDeltaEtaAwayParton = source.fhDeltaEtaAwayParton;
72 fhDeltaPhiAwayParton = source.fhDeltaPhiAwayParton;
73 fhDeltaPtAwayParton = source.fhDeltaPtAwayParton;
74 fhPtRatAwayParton = source.fhPtRatAwayParton;
75 fhDeltaEtaNearParton = source.fhDeltaEtaNearParton;
76 fhDeltaPhiNearParton = source.fhDeltaPhiNearParton;
77 fhDeltaPtNearParton = source.fhDeltaPtNearParton;
78 fhPtRatNearParton = source.fhPtRatNearParton;
85 //________________________________________________________________________
86 TList * AliAnaParticlePartonCorrelation::GetCreateOutputObjects()
88 // Create histograms to be saved in output file
90 AliDebug(1,"Init parton histograms");
92 TList * outputContainer = new TList() ;
93 outputContainer->SetName("ParticlePartonHistos") ;
95 fhDeltaPhiNearParton = new TH2F
96 ("DeltaPhiNearParton","#phi_{particle} - #phi_{parton} vs p_{T particle}",
98 fhDeltaPhiNearParton->SetYTitle("#Delta #phi");
99 fhDeltaPhiNearParton->SetXTitle("p_{T particle} (GeV/c)");
100 outputContainer->Add(fhDeltaPhiNearParton);
102 fhDeltaEtaNearParton = new TH2F
103 ("DeltaEtaNearParton","#eta_{particle} - #eta_{parton} vs p_{T particle}",
105 fhDeltaEtaNearParton->SetYTitle("#Delta #eta");
106 fhDeltaEtaNearParton->SetXTitle("p_{T particle} (GeV/c)");
107 outputContainer->Add(fhDeltaEtaNearParton);
109 fhDeltaPtNearParton = new TH2F
110 ("DeltaPtNearParton","#p_{T particle} - #p_{T parton} vs p_{T particle}",
111 200,0,120,100,-10,10);
112 fhDeltaPtNearParton->SetYTitle("#Delta #p_{T}");
113 fhDeltaPtNearParton->SetXTitle("p_{T particle} (GeV/c)");
114 outputContainer->Add(fhDeltaPtNearParton);
116 fhPtRatNearParton = new TH2F
117 ("PtRatNearParton","#p_{T parton} / #p_{T particle} vs p_{T particle}",
119 fhPtRatNearParton->SetYTitle("ratio");
120 fhPtRatNearParton->SetXTitle("p_{T particle} (GeV/c)");
121 outputContainer->Add(fhPtRatNearParton);
123 fhDeltaPhiAwayParton = new TH2F
124 ("DeltaPhiAwayParton","#phi_{particle} - #phi_{parton} vs p_{T particle}",
125 200,0,120,200,0,6.4);
126 fhDeltaPhiAwayParton->SetYTitle("#Delta #phi");
127 fhDeltaPhiAwayParton->SetXTitle("p_{T particle} (GeV/c)");
128 outputContainer->Add(fhDeltaPhiAwayParton);
130 fhDeltaEtaAwayParton = new TH2F
131 ("DeltaEtaAwayParton","#eta_{particle} - #eta_{parton} vs p_{T particle}",
133 fhDeltaEtaAwayParton->SetYTitle("#Delta #eta");
134 fhDeltaEtaAwayParton->SetXTitle("p_{T particle} (GeV/c)");
135 outputContainer->Add(fhDeltaEtaAwayParton);
137 fhDeltaPtAwayParton = new TH2F
138 ("DeltaPtAwayParton","#p_{T particle} - #p_{T parton} vs p_{T particle}",
139 200,0,120,100,-10,10);
140 fhDeltaPtAwayParton->SetYTitle("#Delta #p_{T}");
141 fhDeltaPtAwayParton->SetXTitle("p_{T particle} (GeV/c)");
142 outputContainer->Add(fhDeltaPtAwayParton);
144 fhPtRatAwayParton = new TH2F
145 ("PtRatAwayParton","#p_{T parton} / #p_{T particle} vs p_{T particle}",
147 fhPtRatAwayParton->SetYTitle("ratio");
148 fhPtRatAwayParton->SetXTitle("p_{T particle} (GeV/c)");
149 outputContainer->Add(fhPtRatAwayParton);
151 return outputContainer;
154 //____________________________________________________________________________
155 void AliAnaParticlePartonCorrelation::InitParameters()
158 //Initialize the parameters of the analysis.
159 SetInputAODName("photons");
163 //__________________________________________________________________
164 void AliAnaParticlePartonCorrelation::Print(const Option_t * opt) const
167 //Print some relevant parameters set for the analysis
173 //__________________________________________________________________
174 void AliAnaParticlePartonCorrelation::MakeAnalysisFillAOD()
176 //Particle-Parton Correlation Analysis, create AODs
177 //Add partons to the reference list of the trigger particle
178 //Partons are considered those in the first eight possitions in the stack
179 //being 0, and 1 the 2 protons, and 6 and 7 the outgoing final partons.
180 if(!GetInputAODBranch())
181 AliFatal(Form("ParticlePartonCorrelation::FillAOD: No input particles in AOD with name branch < %s > \n",GetInputAODName().Data()));
184 printf("Begin parton correlation analysis, fill AODs \n");
185 printf("In particle branch aod entries %d\n", GetInputAODBranch()->GetEntriesFast());
188 //Loop on stored AOD particles
189 Int_t naod = GetInputAODBranch()->GetEntriesFast();
190 for(Int_t iaod = 0; iaod < naod ; iaod++){
191 AliAODPWG4ParticleCorrelation* particle = (AliAODPWG4ParticleCorrelation*) (GetInputAODBranch()->At(iaod));
193 AliStack * stack = GetMCStack() ;
194 if(!stack) AliFatal("No Stack available, STOP");
196 if(stack->GetNtrack() < 8) {
197 printf("*** small number of particles, not a PYTHIA simulation? ***: n tracks %d \n", stack->GetNprimary());
201 //Fill AOD reference only with partons
202 TParticle * parton = new TParticle ;
204 for(Int_t ipr = 0;ipr < 8; ipr ++ ){
205 parton = stack->Particle(ipr) ;
206 particle->AddTrack(parton);
212 if(GetDebug() > 1) printf("End parton correlation analysis, fill AODs \n");
215 //__________________________________________________________________
216 void AliAnaParticlePartonCorrelation::MakeAnalysisFillHistograms()
218 //Particle-Parton Correlation Analysis, fill histograms
219 if(!GetInputAODBranch())
220 AliFatal(Form("ParticlePartonCorrelation::FillHistos: No input particles in AOD with name branch < %s > \n",GetInputAODName().Data()));
223 printf("Begin parton correlation analysis, fill histograms \n");
224 printf("In particle branch aod entries %d\n", GetInputAODBranch()->GetEntriesFast());
227 AliStack * stack = GetMCStack() ;
228 if(!stack) AliFatal("No Stack available, STOP");
230 //Loop on stored AOD particles
231 Int_t naod = GetInputAODBranch()->GetEntriesFast();
232 TParticle * mom =new TParticle ;
234 for(Int_t iaod = 0; iaod < naod ; iaod++){
235 AliAODPWG4ParticleCorrelation* particle = (AliAODPWG4ParticleCorrelation*) (GetInputAODBranch()->At(iaod));
237 Float_t ptTrigg = particle->Pt();
238 Float_t phiTrigg = particle->Phi();
239 Float_t etaTrigg = particle->Eta();
240 Int_t imom = particle->GetLabel();
241 Int_t iparent = 2000;
242 Int_t iawayparent = -1;
244 if(!(particle->GetRefTracks()) || (particle->GetRefTracks())->GetEntriesFast() < 7) AliFatal("Reference list with partons not filled, STOP analysis");
246 //Check and get indeces of mother and parton
247 if(imom < 8 ) iparent = imom ; //mother is already a parton
248 else if (imom < stack->GetNtrack()) {
249 mom = stack->Particle(imom);
250 iparent=mom->GetFirstMother();
251 //cout<<" iparent "<<iparent<<endl;
253 mom = stack->Particle(iparent);
254 imom = iparent ; //Mother label is of the inmediate parton daughter
255 iparent = mom->GetFirstMother();
256 //cout<<" while iparent "<<iparent<<endl;
260 if(GetDebug() > 1) printf("N reference partons %d; labels: mother %d, parent %d \n", (particle->GetRefTracks())->GetEntriesFast(), imom, iparent);
263 if(iparent < 0 || iparent > 8) {
264 if(GetDebug() > 0 ) printf("Failed to find appropriate parton, index %d", iparent);
268 //Near parton is the parton that fragmented and created the mother
269 TParticle * nearParton = (TParticle*) (particle->GetRefTracks())->At(iparent);
270 Float_t ptNearParton = nearParton->Pt();
271 Float_t phiNearParton = nearParton->Phi() ;
272 Float_t etaNearParton = nearParton->Eta() ;
274 fhDeltaEtaNearParton->Fill(ptTrigg,etaTrigg-etaNearParton);
275 fhDeltaPhiNearParton->Fill(ptTrigg,phiTrigg-phiNearParton);
276 fhDeltaPtNearParton->Fill(ptTrigg,ptTrigg-ptNearParton);
277 fhPtRatNearParton->Fill(ptTrigg,ptNearParton/ptTrigg);
279 if(iparent == 7) iawayparent =6;
280 else if(iparent == 6) iawayparent =7;
282 printf("Parent parton is not final state, skip \n");
286 //Away parton is the other final parton.
287 TParticle * awayParton = (TParticle*) (particle->GetRefTracks())->At(iawayparent);
288 Float_t ptAwayParton = awayParton->Pt();
289 Float_t phiAwayParton = awayParton->Phi() ;
290 Float_t etaAwayParton = awayParton->Eta() ;
291 fhDeltaEtaAwayParton->Fill(ptTrigg,etaTrigg-etaAwayParton);
292 fhDeltaPhiAwayParton->Fill(ptTrigg,phiTrigg-phiAwayParton);
293 fhDeltaPtAwayParton->Fill(ptTrigg,ptTrigg-ptAwayParton);
294 fhPtRatAwayParton->Fill(ptTrigg,ptAwayParton/ptTrigg);
299 if(GetDebug() > 1) printf("End parton correlation analysis, fill histograms \n");