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.4.4.2 2007/07/26 10:32:09 schutz
21 * new analysis classes in the the new analysis framework
26 //_________________________________________________________________________
27 // Class for the analysis of gamma - hadron correlations
28 //*-- Author: Gustavo Conesa (LNF-INFN)
29 //////////////////////////////////////////////////////////////////////////////
32 // --- ROOT system ---
33 #include "Riostream.h"
35 //---- AliRoot system ----
37 #include "AliNeutralMesonSelection.h"
38 #include "AliAnaGammaHadron.h"
40 ClassImp(AliAnaGammaHadron)
43 //____________________________________________________________________________
44 AliAnaGammaHadron::AliAnaGammaHadron() :
45 AliAnaGammaCorrelation(),
46 fhPhiCharged(0), fhPhiNeutral(0), fhEtaCharged(0), fhEtaNeutral(0),
47 fhDeltaPhiGammaCharged(0), fhDeltaPhiGammaNeutral(0),
48 fhDeltaEtaGammaCharged(0), fhDeltaEtaGammaNeutral(0),
49 fhCorrelationGammaNeutral(0), fhCorrelationGammaCharged(0)
53 SetCorrelationType(kHadron);
54 //Initialize parameters
58 //____________________________________________________________________________
59 AliAnaGammaHadron::AliAnaGammaHadron(const AliAnaGammaHadron & g) :
60 AliAnaGammaCorrelation(g),
61 fhPhiCharged(g.fhPhiCharged), fhPhiNeutral(g.fhPhiNeutral),
62 fhEtaCharged(g.fhEtaCharged), fhEtaNeutral(g.fhEtaNeutral),
63 fhDeltaPhiGammaCharged(g.fhDeltaPhiGammaCharged),
64 fhDeltaPhiGammaNeutral(g.fhDeltaPhiGammaNeutral),
65 fhDeltaEtaGammaCharged(g.fhDeltaEtaGammaCharged),
66 fhDeltaEtaGammaNeutral(g.fhDeltaEtaGammaNeutral),
67 fhCorrelationGammaNeutral(g.fhCorrelationGammaNeutral),
68 fhCorrelationGammaCharged(g.fhCorrelationGammaCharged)
74 //_________________________________________________________________________
75 AliAnaGammaHadron & AliAnaGammaHadron::operator = (const AliAnaGammaHadron & source)
77 // assignment operator
79 if(this == &source)return *this;
80 ((AliAnaGammaCorrelation *)this)->operator=(source);
82 fhPhiCharged = source.fhPhiCharged ; fhPhiNeutral = source.fhPhiNeutral ;
83 fhEtaCharged = source.fhEtaCharged ; fhEtaNeutral = source.fhEtaNeutral ;
84 fhDeltaPhiGammaCharged = source.fhDeltaPhiGammaCharged ;
85 fhDeltaPhiGammaNeutral = source.fhDeltaPhiGammaNeutral ;
86 fhDeltaEtaGammaCharged = source.fhDeltaEtaGammaCharged ;
87 fhDeltaEtaGammaNeutral = source.fhDeltaEtaGammaNeutral ;
89 fhCorrelationGammaNeutral = source.fhCorrelationGammaNeutral ;
90 fhCorrelationGammaCharged = source.fhCorrelationGammaCharged ;
96 //____________________________________________________________________________
97 AliAnaGammaHadron::~AliAnaGammaHadron()
100 delete fhPhiCharged ;
101 delete fhPhiNeutral ;
102 delete fhEtaCharged ;
103 delete fhEtaNeutral ;
104 delete fhDeltaPhiGammaCharged ;
105 delete fhDeltaPhiGammaNeutral ;
106 delete fhDeltaEtaGammaCharged ;
107 delete fhDeltaEtaGammaNeutral ;
109 delete fhCorrelationGammaNeutral ;
110 delete fhCorrelationGammaCharged ;
115 //________________________________________________________________________
116 TList * AliAnaGammaHadron::GetCreateOutputObjects()
119 // Create histograms to be saved in output file and
120 // store them in fOutputContainer
121 TList * outputContainer = new TList() ;
122 outputContainer->SetName("GammaCorrelationHistos") ;
124 fhPhiCharged = new TH2F
125 ("PhiCharged","#phi_{#pi^{#pm}} vs p_{T #gamma}",
127 fhPhiCharged->SetYTitle("#phi_{#pi^{#pm}} (rad)");
128 fhPhiCharged->SetXTitle("p_{T #gamma} (GeV/c)");
130 fhEtaCharged = new TH2F
131 ("EtaCharged","#eta_{#pi^{#pm}} vs p_{T #gamma}",
133 fhEtaCharged->SetYTitle("#eta_{#pi^{#pm}} (rad)");
134 fhEtaCharged->SetXTitle("p_{T #gamma} (GeV/c)");
136 fhDeltaPhiGammaCharged = new TH2F
137 ("DeltaPhiGammaCharged","#phi_{#gamma} - #phi_{charged #pi} vs p_{T #gamma}",
138 200,0,120,200,0,6.4);
139 fhDeltaPhiGammaCharged->SetYTitle("#Delta #phi");
140 fhDeltaPhiGammaCharged->SetXTitle("p_{T #gamma} (GeV/c)");
142 fhDeltaEtaGammaCharged = new TH2F
143 ("DeltaEtaGammaCharged","#eta_{#gamma} - #eta_{#pi^{#pm}} vs p_{T #gamma}",
145 fhDeltaEtaGammaCharged->SetYTitle("#Delta #eta");
146 fhDeltaEtaGammaCharged->SetXTitle("p_{T #gamma} (GeV/c)");
148 fhCorrelationGammaCharged =
149 new TH2F("CorrelationGammaCharged","z_{#gamma #pi} = p_{T #pi^{#pm}} / p_{T #gamma}",
150 240,0.,120.,1000,0.,1.2);
151 fhCorrelationGammaCharged->SetYTitle("z_{#gamma #pi}");
152 fhCorrelationGammaCharged->SetXTitle("p_{T #gamma}");
154 outputContainer->Add(fhPhiCharged) ;
155 outputContainer->Add(fhEtaCharged) ;
156 outputContainer->Add(fhDeltaPhiGammaCharged) ;
157 outputContainer->Add(fhDeltaEtaGammaCharged) ;
158 outputContainer->Add(fhCorrelationGammaCharged) ;
160 if(!AreJetsOnlyInCTS()){
161 //---- kHadron and kJetLeadCone ----
162 fhPhiNeutral = new TH2F
163 ("PhiNeutral","#phi_{#pi^{0}} vs p_{T #gamma}",
165 fhPhiNeutral->SetYTitle("#phi_{#pi^{0}} (rad)");
166 fhPhiNeutral->SetXTitle("p_{T #gamma} (GeV/c)");
168 fhEtaNeutral = new TH2F
169 ("EtaNeutral","#eta_{#pi^{0}} vs p_{T #gamma}",
171 fhEtaNeutral->SetYTitle("#eta_{#pi^{0}} (rad)");
172 fhEtaNeutral->SetXTitle("p_{T #gamma} (GeV/c)");
174 fhDeltaPhiGammaNeutral = new TH2F
175 ("DeltaPhiGammaNeutral","#phi_{#gamma} - #phi_{#pi^{0}} vs p_{T #gamma}",
176 200,0,120,200,0,6.4);
177 fhDeltaPhiGammaNeutral->SetYTitle("#Delta #phi");
178 fhDeltaPhiGammaNeutral->SetXTitle("p_{T #gamma} (GeV/c)");
180 fhDeltaEtaGammaNeutral = new TH2F
181 ("DeltaEtaGammaNeutral","#eta_{#gamma} - #eta_{#pi^{#pm}} vs p_{T #gamma}",
183 fhDeltaEtaGammaNeutral->SetYTitle("#Delta #eta");
184 fhDeltaEtaGammaNeutral->SetXTitle("p_{T #gamma} (GeV/c)");
186 fhCorrelationGammaNeutral =
187 new TH2F("CorrelationGammaNeutral","z_{#gamma #pi} = p_{T #pi^{0}} / p_{T #gamma}",
188 240,0.,120.,1000,0.,1.2);
189 fhCorrelationGammaNeutral->SetYTitle("z_{#gamma #pi}");
190 fhCorrelationGammaNeutral->SetXTitle("p_{T #gamma}");
192 outputContainer->Add(fhPhiNeutral) ;
193 outputContainer->Add(fhEtaNeutral) ;
194 outputContainer->Add(fhDeltaPhiGammaNeutral) ;
195 outputContainer->Add(fhDeltaEtaGammaNeutral) ;
196 outputContainer->Add(fhCorrelationGammaNeutral) ;
199 SetOutputContainer(outputContainer);
201 return outputContainer;
204 //____________________________________________________________________________
205 void AliAnaGammaHadron::InitParameters()
208 //Initialize the parameters of the analysis.
211 SetDeltaPhiCutRange(1.5,4.5);
212 SetJetsOnlyInCTS(kFALSE) ;
216 //__________________________________________________________________
217 void AliAnaGammaHadron::Print(const Option_t * opt) const
220 //Print some relevant parameters set for the analysis
224 Info("Print", "%s %s", GetName(), GetTitle() ) ;
225 printf("Correlation analysis = %d\n", kHadron) ;
226 printf("pT Hadron > %f\n", GetMinPtHadron()) ;
227 printf("Phi gamma-Hadron < %f\n", GetDeltaPhiMaxCut()) ;
228 printf("Phi gamma-Hadron > %f\n", GetDeltaPhiMinCut()) ;
233 //____________________________________________________________________________
234 void AliAnaGammaHadron::MakeGammaCorrelation(TParticle * pGamma, TClonesArray * plCTS, TClonesArray * plCalo)
236 //Gamma Hadron Correlation Analysis
237 AliDebug(2, "Make gamma-hadron correlation");
239 MakeGammaChargedCorrelation(pGamma, plCTS);
240 if(!AreJetsOnlyInCTS())
241 MakeGammaNeutralCorrelation(pGamma, plCalo);
246 //____________________________________________________________________________
247 void AliAnaGammaHadron::MakeGammaChargedCorrelation(TParticle * pGamma, TClonesArray * pl)
249 //Gamma Charged Hadron Correlation Analysis
250 AliDebug(2,"Make gamma-charged hadron correlation");
252 Double_t ptg = pGamma->Pt();
253 Double_t phig = pGamma->Phi();
255 Double_t rat = -100.;
256 Double_t phi = -100. ;
258 for(Int_t ipr = 0;ipr < pl->GetEntries() ; ipr ++ ){
260 TParticle * particle = dynamic_cast<TParticle *>(pl->At(ipr)) ;
264 phi = particle->Phi() ;
266 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()));
268 fhEtaCharged->Fill(ptg,particle->Eta());
269 fhPhiCharged->Fill(ptg,phi);
270 fhDeltaEtaGammaCharged->Fill(ptg,pGamma->Eta()-particle->Eta());
271 fhDeltaPhiGammaCharged->Fill(ptg,phig-phi);
272 //Selection within angular and energy limits
273 if(((phig-phi)> GetDeltaPhiMinCut()) && ((phig-phi)<GetDeltaPhiMaxCut()) && pt > GetMinPtHadron()){
274 AliDebug(2,Form("Selected: pt %f, phi %f",pt,phi));
275 fhCorrelationGammaCharged->Fill(ptg,rat);
280 //____________________________________________________________________________
281 void AliAnaGammaHadron::MakeGammaNeutralCorrelation(TParticle * pGamma, TClonesArray * pl)
283 //Gamma Neutral Hadron Correlation Analysis
284 AliDebug(2,"Make gamma-neutral hadron correlation");
287 Double_t rat = -100.;
288 Double_t phi = -100. ;
289 Double_t ptg = pGamma->Pt();
290 Double_t phig = pGamma->Phi();
293 TParticle * particlei = 0;
294 TParticle * particlej = 0;
295 TLorentzVector gammai;
296 TLorentzVector gammaj;
302 while ( (particlei = (TParticle*)next()) ) {
304 ksPdg = particlei->GetPdgCode();
305 AliDebug(2, Form("neutral particles opposite to gamma: pt %f, pdg %d", particlei->Pt(),ksPdg));
306 //2 gamma overlapped, found with PID
308 pt = particlei->Pt();
310 phi = particlei->Phi() ;
311 fhEtaNeutral->Fill(ptg,particlei->Eta());
312 fhPhiNeutral->Fill(ptg,phi);
313 fhDeltaEtaGammaNeutral->Fill(ptg,pGamma->Eta()-particlei->Eta());
314 fhDeltaPhiGammaNeutral->Fill(ptg,phig-phi);
316 //Selection within angular and energy limits
317 if( (phig-phi)>GetDeltaPhiMinCut() && (phig-phi)<GetDeltaPhiMaxCut() && pt > GetMinPtHadron()){
318 fhCorrelationGammaNeutral ->Fill(ptg,rat);
319 AliDebug(2,Form("Selected pi0: pt %f, phi %f",pt,phi));
323 //Make invariant mass analysis
324 else if(ksPdg == 22){// gamma i
326 //Search the photon companion in case it comes from a Pi0 decay
327 //Apply several cuts to select the good pair;
328 particlei->Momentum(gammai);
331 while ( (particlej = (TParticle*)next2()) ) {
333 if(jPrimary>iPrimary){
334 ksPdg = particlej->GetPdgCode();
335 particlej->Momentum(gammaj);
338 phi = (gammai+gammaj).Phi();
341 rat = (gammai+gammaj).Pt()/ptg ;
344 fhEtaNeutral->Fill(ptg,(gammai+gammaj).Eta());
345 fhPhiNeutral->Fill(ptg,phi);
346 fhDeltaEtaGammaNeutral->Fill(ptg,pGamma->Eta()-(gammai+gammaj).Eta());
347 fhDeltaPhiGammaNeutral->Fill(ptg,phig-phi);
349 //Select good pair (good phit, pt cuts, aperture and invariant mass)
350 if(GetNeutralMesonSelection()->SelectPair(pGamma, gammai, gammaj)){
351 AliDebug(2,Form("Selected gamma pair: pt %f, phi %f",(gammai+gammaj).Pt(),phi));
352 //correlation histogram
353 fhCorrelationGammaNeutral ->Fill(ptg,rat);