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 /* History of cvs commits:
20 * Revision 1.7 2007/10/29 13:48:42 gustavo
21 * Corrected coding violations
23 * Revision 1.5 2007/08/17 12:40:04 schutz
24 * New analysis classes by Gustavo Conesa
26 * Revision 1.4.4.2 2007/07/26 10:32:09 schutz
27 * new analysis classes in the the new analysis framework
32 //_________________________________________________________________________
33 // Class for the analysis of gamma - hadron correlations
34 //*-- Author: Gustavo Conesa (LNF-INFN)
35 //////////////////////////////////////////////////////////////////////////////
38 // --- ROOT system ---
39 #include "Riostream.h"
41 //---- AliRoot system ----
43 #include "AliNeutralMesonSelection.h"
44 #include "AliAnaGammaHadron.h"
46 ClassImp(AliAnaGammaHadron)
49 //____________________________________________________________________________
50 AliAnaGammaHadron::AliAnaGammaHadron() :
51 AliAnaGammaCorrelation(),
52 fhPhiCharged(0), fhPhiNeutral(0), fhEtaCharged(0), fhEtaNeutral(0),
53 fhDeltaPhiGammaCharged(0), fhDeltaPhiGammaNeutral(0),
54 fhDeltaEtaGammaCharged(0), fhDeltaEtaGammaNeutral(0),
55 fhDeltaPhiChargedPt(0),
56 fhCorrelationGammaNeutral(0), fhCorrelationGammaCharged(0)
60 SetCorrelationType(kHadron);
61 //Initialize parameters
65 //____________________________________________________________________________
66 AliAnaGammaHadron::AliAnaGammaHadron(const AliAnaGammaHadron & g) :
67 AliAnaGammaCorrelation(g),
68 fhPhiCharged(g.fhPhiCharged), fhPhiNeutral(g.fhPhiNeutral),
69 fhEtaCharged(g.fhEtaCharged), fhEtaNeutral(g.fhEtaNeutral),
70 fhDeltaPhiGammaCharged(g.fhDeltaPhiGammaCharged),
71 fhDeltaPhiGammaNeutral(g.fhDeltaPhiGammaNeutral),
72 fhDeltaEtaGammaCharged(g.fhDeltaEtaGammaCharged),
73 fhDeltaEtaGammaNeutral(g.fhDeltaEtaGammaNeutral),
74 fhDeltaPhiChargedPt(g.fhDeltaPhiChargedPt),
75 fhCorrelationGammaNeutral(g.fhCorrelationGammaNeutral),
76 fhCorrelationGammaCharged(g.fhCorrelationGammaCharged)
82 //_________________________________________________________________________
83 AliAnaGammaHadron & AliAnaGammaHadron::operator = (const AliAnaGammaHadron & source)
85 // assignment operator
87 if(this == &source)return *this;
88 ((AliAnaGammaCorrelation *)this)->operator=(source);
90 fhPhiCharged = source.fhPhiCharged ; fhPhiNeutral = source.fhPhiNeutral ;
91 fhEtaCharged = source.fhEtaCharged ; fhEtaNeutral = source.fhEtaNeutral ;
92 fhDeltaPhiGammaCharged = source.fhDeltaPhiGammaCharged ;
93 fhDeltaPhiGammaNeutral = source.fhDeltaPhiGammaNeutral ;
94 fhDeltaEtaGammaCharged = source.fhDeltaEtaGammaCharged ;
95 fhDeltaEtaGammaNeutral = source.fhDeltaEtaGammaNeutral ;
96 fhDeltaPhiChargedPt = source.fhDeltaPhiChargedPt ;
98 fhCorrelationGammaNeutral = source.fhCorrelationGammaNeutral ;
99 fhCorrelationGammaCharged = source.fhCorrelationGammaCharged ;
105 //____________________________________________________________________________
106 AliAnaGammaHadron::~AliAnaGammaHadron()
108 // Remove all pointers except analysis output pointers.
112 //________________________________________________________________________
113 TList * AliAnaGammaHadron::GetCreateOutputObjects()
116 // Create histograms to be saved in output file and
117 // store them in fOutputContainer
118 TList * outputContainer = new TList() ;
119 outputContainer->SetName("GammaCorrelationHistos") ;
121 fhPhiCharged = new TH2F
122 ("PhiCharged","#phi_{#pi^{#pm}} vs p_{T #gamma}",
124 fhPhiCharged->SetYTitle("#phi_{#pi^{#pm}} (rad)");
125 fhPhiCharged->SetXTitle("p_{T #gamma} (GeV/c)");
127 fhEtaCharged = new TH2F
128 ("EtaCharged","#eta_{#pi^{#pm}} vs p_{T #gamma}",
130 fhEtaCharged->SetYTitle("#eta_{#pi^{#pm}} (rad)");
131 fhEtaCharged->SetXTitle("p_{T #gamma} (GeV/c)");
133 fhDeltaPhiGammaCharged = new TH2F
134 ("DeltaPhiGammaCharged","#phi_{#gamma} - #phi_{charged #pi} vs p_{T #gamma}",
135 200,0,120,200,0,6.4);
136 fhDeltaPhiGammaCharged->SetYTitle("#Delta #phi");
137 fhDeltaPhiGammaCharged->SetXTitle("p_{T #gamma} (GeV/c)");
139 fhDeltaPhiChargedPt = new TH2F
140 ("DeltaPhiChargedPt","#phi_{#gamma} - #phi_{charged #pi} vs p_{T #pi}",
141 200,0,120,200,0,6.4);
142 fhDeltaPhiChargedPt->SetYTitle("#Delta #phi");
143 fhDeltaPhiChargedPt->SetXTitle("p_{T #pi} (GeV/c)");
145 fhDeltaEtaGammaCharged = new TH2F
146 ("DeltaEtaGammaCharged","#eta_{#gamma} - #eta_{#pi^{#pm}} vs p_{T #gamma}",
148 fhDeltaEtaGammaCharged->SetYTitle("#Delta #eta");
149 fhDeltaEtaGammaCharged->SetXTitle("p_{T #gamma} (GeV/c)");
151 fhCorrelationGammaCharged =
152 new TH2F("CorrelationGammaCharged","z_{#gamma #pi} = p_{T #pi^{#pm}} / p_{T #gamma}",
153 240,0.,120.,1000,0.,1.2);
154 fhCorrelationGammaCharged->SetYTitle("z_{#gamma #pi}");
155 fhCorrelationGammaCharged->SetXTitle("p_{T #gamma}");
157 outputContainer->Add(fhPhiCharged) ;
158 outputContainer->Add(fhEtaCharged) ;
159 outputContainer->Add(fhDeltaPhiGammaCharged) ;
160 outputContainer->Add(fhDeltaEtaGammaCharged) ;
161 outputContainer->Add(fhCorrelationGammaCharged) ;
162 outputContainer->Add(fhDeltaPhiChargedPt) ;
164 if(!AreJetsOnlyInCTS()){
165 //---- kHadron and kJetLeadCone ----
166 fhPhiNeutral = new TH2F
167 ("PhiNeutral","#phi_{#pi^{0}} vs p_{T #gamma}",
169 fhPhiNeutral->SetYTitle("#phi_{#pi^{0}} (rad)");
170 fhPhiNeutral->SetXTitle("p_{T #gamma} (GeV/c)");
172 fhEtaNeutral = new TH2F
173 ("EtaNeutral","#eta_{#pi^{0}} vs p_{T #gamma}",
175 fhEtaNeutral->SetYTitle("#eta_{#pi^{0}} (rad)");
176 fhEtaNeutral->SetXTitle("p_{T #gamma} (GeV/c)");
178 fhDeltaPhiGammaNeutral = new TH2F
179 ("DeltaPhiGammaNeutral","#phi_{#gamma} - #phi_{#pi^{0}} vs p_{T #gamma}",
180 200,0,120,200,0,6.4);
181 fhDeltaPhiGammaNeutral->SetYTitle("#Delta #phi");
182 fhDeltaPhiGammaNeutral->SetXTitle("p_{T #gamma} (GeV/c)");
184 fhDeltaEtaGammaNeutral = new TH2F
185 ("DeltaEtaGammaNeutral","#eta_{#gamma} - #eta_{#pi^{#pm}} vs p_{T #gamma}",
187 fhDeltaEtaGammaNeutral->SetYTitle("#Delta #eta");
188 fhDeltaEtaGammaNeutral->SetXTitle("p_{T #gamma} (GeV/c)");
190 fhCorrelationGammaNeutral =
191 new TH2F("CorrelationGammaNeutral","z_{#gamma #pi} = p_{T #pi^{0}} / p_{T #gamma}",
192 240,0.,120.,1000,0.,1.2);
193 fhCorrelationGammaNeutral->SetYTitle("z_{#gamma #pi}");
194 fhCorrelationGammaNeutral->SetXTitle("p_{T #gamma}");
196 outputContainer->Add(fhPhiNeutral) ;
197 outputContainer->Add(fhEtaNeutral) ;
198 outputContainer->Add(fhDeltaPhiGammaNeutral) ;
199 outputContainer->Add(fhDeltaEtaGammaNeutral) ;
200 outputContainer->Add(fhCorrelationGammaNeutral) ;
203 SetOutputContainer(outputContainer);
205 return outputContainer;
208 //____________________________________________________________________________
209 void AliAnaGammaHadron::InitParameters()
212 //Initialize the parameters of the analysis.
215 SetDeltaPhiCutRange(1.5,4.5);
216 SetJetsOnlyInCTS(kFALSE) ;
220 //__________________________________________________________________
221 void AliAnaGammaHadron::Print(const Option_t * opt) const
224 //Print some relevant parameters set for the analysis
228 Info("Print", "%s %s", GetName(), GetTitle() ) ;
229 printf("Correlation analysis = %d\n", kHadron) ;
230 printf("pT Hadron > %f\n", GetMinPtHadron()) ;
231 printf("Phi gamma-Hadron < %f\n", GetDeltaPhiMaxCut()) ;
232 printf("Phi gamma-Hadron > %f\n", GetDeltaPhiMinCut()) ;
237 //____________________________________________________________________________
238 void AliAnaGammaHadron::MakeGammaCorrelation(TParticle * pGamma, TClonesArray * plCTS, TClonesArray * plCalo)
240 //Gamma Hadron Correlation Analysis
241 AliDebug(2, "Make gamma-hadron correlation");
243 MakeGammaChargedCorrelation(pGamma, plCTS);
244 if(!AreJetsOnlyInCTS())
245 MakeGammaNeutralCorrelation(pGamma, plCalo);
250 //____________________________________________________________________________
251 void AliAnaGammaHadron::MakeGammaChargedCorrelation(TParticle * pGamma, TClonesArray * pl)
253 //Gamma Charged Hadron Correlation Analysis
254 AliDebug(2,"Make gamma-charged hadron correlation");
256 Double_t ptg = pGamma->Pt();
257 Double_t phig = pGamma->Phi();
259 Double_t rat = -100.;
260 Double_t phi = -100. ;
262 for(Int_t ipr = 0;ipr < pl->GetEntries() ; ipr ++ ){
264 TParticle * particle = dynamic_cast<TParticle *>(pl->At(ipr)) ;
268 phi = particle->Phi() ;
270 AliDebug(3,Form("pt %f, phi %f, phi gamma %f. Cuts: delta phi min %f, max%f, pT min %f",pt,phi,phig,GetDeltaPhiMinCut(),GetDeltaPhiMaxCut(),GetMinPtHadron()));
272 fhEtaCharged->Fill(ptg,particle->Eta());
273 fhPhiCharged->Fill(ptg,phi);
274 fhDeltaEtaGammaCharged->Fill(ptg,pGamma->Eta()-particle->Eta());
275 fhDeltaPhiGammaCharged->Fill(ptg,phig-phi);
276 fhDeltaPhiChargedPt->Fill(pt,phig-phi);
278 //Selection within angular and energy limits
279 if(((phig-phi)> GetDeltaPhiMinCut()) && ((phig-phi)<GetDeltaPhiMaxCut()) && pt > GetMinPtHadron()){
280 AliDebug(2,Form("Selected: pt %f, phi %f",pt,phi));
281 fhCorrelationGammaCharged->Fill(ptg,rat);
286 //____________________________________________________________________________
287 void AliAnaGammaHadron::MakeGammaNeutralCorrelation(TParticle * pGamma, TClonesArray * pl)
289 //Gamma Neutral Hadron Correlation Analysis
290 AliDebug(2,"Make gamma-neutral hadron correlation");
293 Double_t rat = -100.;
294 Double_t phi = -100. ;
295 Double_t ptg = pGamma->Pt();
296 Double_t phig = pGamma->Phi();
299 TParticle * particlei = 0;
300 TParticle * particlej = 0;
301 TLorentzVector gammai;
302 TLorentzVector gammaj;
308 while ( (particlei = (TParticle*)next()) ) {
310 ksPdg = particlei->GetPdgCode();
311 AliDebug(2, Form("neutral particles opposite to gamma: pt %f, pdg %d", particlei->Pt(),ksPdg));
312 //2 gamma overlapped, found with PID
314 pt = particlei->Pt();
316 phi = particlei->Phi() ;
317 fhEtaNeutral->Fill(ptg,particlei->Eta());
318 fhPhiNeutral->Fill(ptg,phi);
319 fhDeltaEtaGammaNeutral->Fill(ptg,pGamma->Eta()-particlei->Eta());
320 fhDeltaPhiGammaNeutral->Fill(ptg,phig-phi);
322 //Selection within angular and energy limits
323 if( (phig-phi)>GetDeltaPhiMinCut() && (phig-phi)<GetDeltaPhiMaxCut() && pt > GetMinPtHadron()){
324 fhCorrelationGammaNeutral ->Fill(ptg,rat);
325 AliDebug(2,Form("Selected pi0: pt %f, phi %f",pt,phi));
329 //Make invariant mass analysis
330 else if(ksPdg == 22){// gamma i
332 //Search the photon companion in case it comes from a Pi0 decay
333 //Apply several cuts to select the good pair;
334 particlei->Momentum(gammai);
337 while ( (particlej = (TParticle*)next2()) ) {
339 if(jPrimary>iPrimary){
340 ksPdg = particlej->GetPdgCode();
341 particlej->Momentum(gammaj);
344 phi = (gammai+gammaj).Phi();
347 rat = (gammai+gammaj).Pt()/ptg ;
350 fhEtaNeutral->Fill(ptg,(gammai+gammaj).Eta());
351 fhPhiNeutral->Fill(ptg,phi);
352 fhDeltaEtaGammaNeutral->Fill(ptg,pGamma->Eta()-(gammai+gammaj).Eta());
353 fhDeltaPhiGammaNeutral->Fill(ptg,phig-phi);
355 //Select good pair (good phit, pt cuts, aperture and invariant mass)
356 if(GetNeutralMesonSelection()->SelectPair(pGamma, gammai, gammaj)){
357 AliDebug(2,Form("Selected gamma pair: pt %f, phi %f",(gammai+gammaj).Pt(),phi));
358 //correlation histogram
359 fhCorrelationGammaNeutral ->Fill(ptg,rat);