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.5 2007/08/17 12:40:04 schutz
21 * New analysis classes by Gustavo Conesa
23 * Revision 1.4.4.2 2007/07/26 10:32:09 schutz
24 * new analysis classes in the the new analysis framework
29 //_________________________________________________________________________
30 // Class for the analysis of gamma - hadron correlations
31 //*-- Author: Gustavo Conesa (LNF-INFN)
32 //////////////////////////////////////////////////////////////////////////////
35 // --- ROOT system ---
36 #include "Riostream.h"
38 //---- AliRoot system ----
40 #include "AliNeutralMesonSelection.h"
41 #include "AliAnaGammaHadron.h"
43 ClassImp(AliAnaGammaHadron)
46 //____________________________________________________________________________
47 AliAnaGammaHadron::AliAnaGammaHadron() :
48 AliAnaGammaCorrelation(),
49 fhPhiCharged(0), fhPhiNeutral(0), fhEtaCharged(0), fhEtaNeutral(0),
50 fhDeltaPhiGammaCharged(0), fhDeltaPhiGammaNeutral(0),
51 fhDeltaEtaGammaCharged(0), fhDeltaEtaGammaNeutral(0),
52 fhDeltaPhiChargedPt(0),
53 fhCorrelationGammaNeutral(0), fhCorrelationGammaCharged(0)
57 SetCorrelationType(kHadron);
58 //Initialize parameters
62 //____________________________________________________________________________
63 AliAnaGammaHadron::AliAnaGammaHadron(const AliAnaGammaHadron & g) :
64 AliAnaGammaCorrelation(g),
65 fhPhiCharged(g.fhPhiCharged), fhPhiNeutral(g.fhPhiNeutral),
66 fhEtaCharged(g.fhEtaCharged), fhEtaNeutral(g.fhEtaNeutral),
67 fhDeltaPhiGammaCharged(g.fhDeltaPhiGammaCharged),
68 fhDeltaPhiGammaNeutral(g.fhDeltaPhiGammaNeutral),
69 fhDeltaEtaGammaCharged(g.fhDeltaEtaGammaCharged),
70 fhDeltaEtaGammaNeutral(g.fhDeltaEtaGammaNeutral),
71 fhDeltaPhiChargedPt(g.fhDeltaPhiChargedPt),
72 fhCorrelationGammaNeutral(g.fhCorrelationGammaNeutral),
73 fhCorrelationGammaCharged(g.fhCorrelationGammaCharged)
79 //_________________________________________________________________________
80 AliAnaGammaHadron & AliAnaGammaHadron::operator = (const AliAnaGammaHadron & source)
82 // assignment operator
84 if(this == &source)return *this;
85 ((AliAnaGammaCorrelation *)this)->operator=(source);
87 fhPhiCharged = source.fhPhiCharged ; fhPhiNeutral = source.fhPhiNeutral ;
88 fhEtaCharged = source.fhEtaCharged ; fhEtaNeutral = source.fhEtaNeutral ;
89 fhDeltaPhiGammaCharged = source.fhDeltaPhiGammaCharged ;
90 fhDeltaPhiGammaNeutral = source.fhDeltaPhiGammaNeutral ;
91 fhDeltaEtaGammaCharged = source.fhDeltaEtaGammaCharged ;
92 fhDeltaEtaGammaNeutral = source.fhDeltaEtaGammaNeutral ;
93 fhDeltaPhiChargedPt = source.fhDeltaPhiChargedPt ;
95 fhCorrelationGammaNeutral = source.fhCorrelationGammaNeutral ;
96 fhCorrelationGammaCharged = source.fhCorrelationGammaCharged ;
102 //____________________________________________________________________________
103 AliAnaGammaHadron::~AliAnaGammaHadron()
106 delete fhPhiCharged ;
107 delete fhPhiNeutral ;
108 delete fhEtaCharged ;
109 delete fhEtaNeutral ;
110 delete fhDeltaPhiGammaCharged ;
111 delete fhDeltaPhiGammaNeutral ;
112 delete fhDeltaEtaGammaCharged ;
113 delete fhDeltaEtaGammaNeutral ;
114 delete fhDeltaPhiChargedPt ;
116 delete fhCorrelationGammaNeutral ;
117 delete fhCorrelationGammaCharged ;
122 //________________________________________________________________________
123 TList * AliAnaGammaHadron::GetCreateOutputObjects()
126 // Create histograms to be saved in output file and
127 // store them in fOutputContainer
128 TList * outputContainer = new TList() ;
129 outputContainer->SetName("GammaCorrelationHistos") ;
131 fhPhiCharged = new TH2F
132 ("PhiCharged","#phi_{#pi^{#pm}} vs p_{T #gamma}",
134 fhPhiCharged->SetYTitle("#phi_{#pi^{#pm}} (rad)");
135 fhPhiCharged->SetXTitle("p_{T #gamma} (GeV/c)");
137 fhEtaCharged = new TH2F
138 ("EtaCharged","#eta_{#pi^{#pm}} vs p_{T #gamma}",
140 fhEtaCharged->SetYTitle("#eta_{#pi^{#pm}} (rad)");
141 fhEtaCharged->SetXTitle("p_{T #gamma} (GeV/c)");
143 fhDeltaPhiGammaCharged = new TH2F
144 ("DeltaPhiGammaCharged","#phi_{#gamma} - #phi_{charged #pi} vs p_{T #gamma}",
145 200,0,120,200,0,6.4);
146 fhDeltaPhiGammaCharged->SetYTitle("#Delta #phi");
147 fhDeltaPhiGammaCharged->SetXTitle("p_{T #gamma} (GeV/c)");
149 fhDeltaPhiChargedPt = new TH2F
150 ("DeltaPhiChargedPt","#phi_{#gamma} - #phi_{charged #pi} vs p_{T #pi}",
151 200,0,120,200,0,6.4);
152 fhDeltaPhiChargedPt->SetYTitle("#Delta #phi");
153 fhDeltaPhiChargedPt->SetXTitle("p_{T #pi} (GeV/c)");
155 fhDeltaEtaGammaCharged = new TH2F
156 ("DeltaEtaGammaCharged","#eta_{#gamma} - #eta_{#pi^{#pm}} vs p_{T #gamma}",
158 fhDeltaEtaGammaCharged->SetYTitle("#Delta #eta");
159 fhDeltaEtaGammaCharged->SetXTitle("p_{T #gamma} (GeV/c)");
161 fhCorrelationGammaCharged =
162 new TH2F("CorrelationGammaCharged","z_{#gamma #pi} = p_{T #pi^{#pm}} / p_{T #gamma}",
163 240,0.,120.,1000,0.,1.2);
164 fhCorrelationGammaCharged->SetYTitle("z_{#gamma #pi}");
165 fhCorrelationGammaCharged->SetXTitle("p_{T #gamma}");
167 outputContainer->Add(fhPhiCharged) ;
168 outputContainer->Add(fhEtaCharged) ;
169 outputContainer->Add(fhDeltaPhiGammaCharged) ;
170 outputContainer->Add(fhDeltaEtaGammaCharged) ;
171 outputContainer->Add(fhCorrelationGammaCharged) ;
172 outputContainer->Add(fhDeltaPhiChargedPt) ;
174 if(!AreJetsOnlyInCTS()){
175 //---- kHadron and kJetLeadCone ----
176 fhPhiNeutral = new TH2F
177 ("PhiNeutral","#phi_{#pi^{0}} vs p_{T #gamma}",
179 fhPhiNeutral->SetYTitle("#phi_{#pi^{0}} (rad)");
180 fhPhiNeutral->SetXTitle("p_{T #gamma} (GeV/c)");
182 fhEtaNeutral = new TH2F
183 ("EtaNeutral","#eta_{#pi^{0}} vs p_{T #gamma}",
185 fhEtaNeutral->SetYTitle("#eta_{#pi^{0}} (rad)");
186 fhEtaNeutral->SetXTitle("p_{T #gamma} (GeV/c)");
188 fhDeltaPhiGammaNeutral = new TH2F
189 ("DeltaPhiGammaNeutral","#phi_{#gamma} - #phi_{#pi^{0}} vs p_{T #gamma}",
190 200,0,120,200,0,6.4);
191 fhDeltaPhiGammaNeutral->SetYTitle("#Delta #phi");
192 fhDeltaPhiGammaNeutral->SetXTitle("p_{T #gamma} (GeV/c)");
194 fhDeltaEtaGammaNeutral = new TH2F
195 ("DeltaEtaGammaNeutral","#eta_{#gamma} - #eta_{#pi^{#pm}} vs p_{T #gamma}",
197 fhDeltaEtaGammaNeutral->SetYTitle("#Delta #eta");
198 fhDeltaEtaGammaNeutral->SetXTitle("p_{T #gamma} (GeV/c)");
200 fhCorrelationGammaNeutral =
201 new TH2F("CorrelationGammaNeutral","z_{#gamma #pi} = p_{T #pi^{0}} / p_{T #gamma}",
202 240,0.,120.,1000,0.,1.2);
203 fhCorrelationGammaNeutral->SetYTitle("z_{#gamma #pi}");
204 fhCorrelationGammaNeutral->SetXTitle("p_{T #gamma}");
206 outputContainer->Add(fhPhiNeutral) ;
207 outputContainer->Add(fhEtaNeutral) ;
208 outputContainer->Add(fhDeltaPhiGammaNeutral) ;
209 outputContainer->Add(fhDeltaEtaGammaNeutral) ;
210 outputContainer->Add(fhCorrelationGammaNeutral) ;
213 SetOutputContainer(outputContainer);
215 return outputContainer;
218 //____________________________________________________________________________
219 void AliAnaGammaHadron::InitParameters()
222 //Initialize the parameters of the analysis.
225 SetDeltaPhiCutRange(1.5,4.5);
226 SetJetsOnlyInCTS(kFALSE) ;
230 //__________________________________________________________________
231 void AliAnaGammaHadron::Print(const Option_t * opt) const
234 //Print some relevant parameters set for the analysis
238 Info("Print", "%s %s", GetName(), GetTitle() ) ;
239 printf("Correlation analysis = %d\n", kHadron) ;
240 printf("pT Hadron > %f\n", GetMinPtHadron()) ;
241 printf("Phi gamma-Hadron < %f\n", GetDeltaPhiMaxCut()) ;
242 printf("Phi gamma-Hadron > %f\n", GetDeltaPhiMinCut()) ;
247 //____________________________________________________________________________
248 void AliAnaGammaHadron::MakeGammaCorrelation(TParticle * pGamma, TClonesArray * plCTS, TClonesArray * plCalo)
250 //Gamma Hadron Correlation Analysis
251 AliDebug(2, "Make gamma-hadron correlation");
253 MakeGammaChargedCorrelation(pGamma, plCTS);
254 if(!AreJetsOnlyInCTS())
255 MakeGammaNeutralCorrelation(pGamma, plCalo);
260 //____________________________________________________________________________
261 void AliAnaGammaHadron::MakeGammaChargedCorrelation(TParticle * pGamma, TClonesArray * pl)
263 //Gamma Charged Hadron Correlation Analysis
264 AliDebug(2,"Make gamma-charged hadron correlation");
266 Double_t ptg = pGamma->Pt();
267 Double_t phig = pGamma->Phi();
269 Double_t rat = -100.;
270 Double_t phi = -100. ;
272 for(Int_t ipr = 0;ipr < pl->GetEntries() ; ipr ++ ){
274 TParticle * particle = dynamic_cast<TParticle *>(pl->At(ipr)) ;
278 phi = particle->Phi() ;
280 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()));
282 fhEtaCharged->Fill(ptg,particle->Eta());
283 fhPhiCharged->Fill(ptg,phi);
284 fhDeltaEtaGammaCharged->Fill(ptg,pGamma->Eta()-particle->Eta());
285 fhDeltaPhiGammaCharged->Fill(ptg,phig-phi);
286 fhDeltaPhiChargedPt->Fill(pt,phig-phi);
288 //Selection within angular and energy limits
289 if(((phig-phi)> GetDeltaPhiMinCut()) && ((phig-phi)<GetDeltaPhiMaxCut()) && pt > GetMinPtHadron()){
290 AliDebug(2,Form("Selected: pt %f, phi %f",pt,phi));
291 fhCorrelationGammaCharged->Fill(ptg,rat);
296 //____________________________________________________________________________
297 void AliAnaGammaHadron::MakeGammaNeutralCorrelation(TParticle * pGamma, TClonesArray * pl)
299 //Gamma Neutral Hadron Correlation Analysis
300 AliDebug(2,"Make gamma-neutral hadron correlation");
303 Double_t rat = -100.;
304 Double_t phi = -100. ;
305 Double_t ptg = pGamma->Pt();
306 Double_t phig = pGamma->Phi();
309 TParticle * particlei = 0;
310 TParticle * particlej = 0;
311 TLorentzVector gammai;
312 TLorentzVector gammaj;
318 while ( (particlei = (TParticle*)next()) ) {
320 ksPdg = particlei->GetPdgCode();
321 AliDebug(2, Form("neutral particles opposite to gamma: pt %f, pdg %d", particlei->Pt(),ksPdg));
322 //2 gamma overlapped, found with PID
324 pt = particlei->Pt();
326 phi = particlei->Phi() ;
327 fhEtaNeutral->Fill(ptg,particlei->Eta());
328 fhPhiNeutral->Fill(ptg,phi);
329 fhDeltaEtaGammaNeutral->Fill(ptg,pGamma->Eta()-particlei->Eta());
330 fhDeltaPhiGammaNeutral->Fill(ptg,phig-phi);
332 //Selection within angular and energy limits
333 if( (phig-phi)>GetDeltaPhiMinCut() && (phig-phi)<GetDeltaPhiMaxCut() && pt > GetMinPtHadron()){
334 fhCorrelationGammaNeutral ->Fill(ptg,rat);
335 AliDebug(2,Form("Selected pi0: pt %f, phi %f",pt,phi));
339 //Make invariant mass analysis
340 else if(ksPdg == 22){// gamma i
342 //Search the photon companion in case it comes from a Pi0 decay
343 //Apply several cuts to select the good pair;
344 particlei->Momentum(gammai);
347 while ( (particlej = (TParticle*)next2()) ) {
349 if(jPrimary>iPrimary){
350 ksPdg = particlej->GetPdgCode();
351 particlej->Momentum(gammaj);
354 phi = (gammai+gammaj).Phi();
357 rat = (gammai+gammaj).Pt()/ptg ;
360 fhEtaNeutral->Fill(ptg,(gammai+gammaj).Eta());
361 fhPhiNeutral->Fill(ptg,phi);
362 fhDeltaEtaGammaNeutral->Fill(ptg,pGamma->Eta()-(gammai+gammaj).Eta());
363 fhDeltaPhiGammaNeutral->Fill(ptg,phig-phi);
365 //Select good pair (good phit, pt cuts, aperture and invariant mass)
366 if(GetNeutralMesonSelection()->SelectPair(pGamma, gammai, gammaj)){
367 AliDebug(2,Form("Selected gamma pair: pt %f, phi %f",(gammai+gammaj).Pt(),phi));
368 //correlation histogram
369 fhCorrelationGammaNeutral ->Fill(ptg,rat);