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.1.2.1 2007/07/26 10:32:09 schutz
21 * new analysis classes in the the new analysis framework
25 //_________________________________________________________________________
26 // Class for the analysis of gamma-parton correlations
27 //*-- Author: Gustavo Conesa (LNF-INFN)
28 //////////////////////////////////////////////////////////////////////////////
31 // --- ROOT system ---
32 #include "Riostream.h"
34 //---- AliRoot system ----
35 #include "AliAnaGammaParton.h"
38 ClassImp(AliAnaGammaParton)
41 //____________________________________________________________________________
42 AliAnaGammaParton::AliAnaGammaParton() :
43 AliAnaGammaCorrelation(),
44 fhDeltaEtaParton(0), fhDeltaPhiParton(0),
45 fhDeltaPtParton(0), fhPtRatParton(0)
49 SetCorrelationType(kParton);
50 //Initialize parameters
54 //____________________________________________________________________________
55 AliAnaGammaParton::AliAnaGammaParton(const AliAnaGammaParton & g) :
56 AliAnaGammaCorrelation(g),
57 fhDeltaEtaParton(g.fhDeltaEtaParton), fhDeltaPhiParton(g.fhDeltaPhiParton),
58 fhDeltaPtParton(g.fhDeltaPtParton), fhPtRatParton(g.fhPtRatParton)
64 //_________________________________________________________________________
65 AliAnaGammaParton & AliAnaGammaParton::operator = (const AliAnaGammaParton & source)
67 // assignment operator
69 if(this == &source)return *this;
70 ((AliAnaGammaCorrelation *)this)->operator=(source);
71 fhDeltaEtaParton = source.fhDeltaEtaParton;
72 fhDeltaPhiParton = source.fhDeltaPhiParton;
73 fhDeltaPtParton = source.fhDeltaPtParton;
74 fhPtRatParton = source.fhPtRatParton;
80 //____________________________________________________________________________
81 AliAnaGammaParton::~AliAnaGammaParton()
84 delete fhDeltaEtaParton ;
85 delete fhDeltaPhiParton ;
86 delete fhDeltaPtParton ;
87 delete fhPtRatParton ;
92 //________________________________________________________________________
93 TList * AliAnaGammaParton::GetCreateOutputObjects()
95 // Create histograms to be saved in output file and
96 // store them in fOutputContainer
98 AliDebug(1,"Init parton histograms");
100 TList * outputContainer = new TList() ;
101 outputContainer->SetName("GammaPartonHistos") ;
104 fhDeltaPhiParton = new TH2F
105 ("DeltaPhiParton","#phi_{#gamma} - #phi_{parton} vs p_{T #gamma}",
106 200,0,120,200,0,6.4);
107 fhDeltaPhiParton->SetYTitle("#Delta #phi");
108 fhDeltaPhiParton->SetXTitle("p_{T #gamma} (GeV/c)");
109 outputContainer->Add(fhDeltaPhiParton);
111 fhDeltaEtaParton = new TH2F
112 ("DeltaEtaParton","#eta_{#gamma} - #eta_{parton} vs p_{T #gamma}",
114 fhDeltaEtaParton->SetYTitle("#Delta #eta");
115 fhDeltaEtaParton->SetXTitle("p_{T #gamma} (GeV/c)");
116 outputContainer->Add(fhDeltaEtaParton);
118 fhDeltaPtParton = new TH2F
119 ("DeltaPtParton","#p_{T #gamma} - #p_{T parton} vs p_{T #gamma}",
120 200,0,120,100,-10,10);
121 fhDeltaPtParton->SetYTitle("#Delta #p_{T}");
122 fhDeltaPtParton->SetXTitle("p_{T #gamma} (GeV/c)");
123 outputContainer->Add(fhDeltaPtParton);
125 fhPtRatParton = new TH2F
126 ("PtRatParton","#p_{T parton} / #p_{T #gamma} vs p_{T #gamma}",
128 fhPtRatParton->SetYTitle("ratio");
129 fhPtRatParton->SetXTitle("p_{T #gamma} (GeV/c)");
130 outputContainer->Add(fhPtRatParton);
132 SetOutputContainer(outputContainer);
134 return outputContainer;
137 //____________________________________________________________________________
138 void AliAnaGammaParton::InitParameters()
141 //Initialize the parameters of the analysis.
147 //__________________________________________________________________
148 void AliAnaGammaParton::Print(const Option_t * opt) const
151 //Print some relevant parameters set for the analysis
157 //__________________________________________________________________
158 void AliAnaGammaParton::MakeGammaCorrelation(TParticle * pGamma, TClonesArray *pl, TClonesArray *)
160 //Gamma Parton Correlation Analysis
161 AliDebug(2, "Begin parton analysis");
163 Double_t ptg = pGamma->Pt();
164 Double_t phig = pGamma->Phi();
165 Double_t etag = pGamma->Eta();
168 Double_t eta = -100.;
169 Double_t phi = -100. ;
170 for(Int_t ipr = 0;ipr < pl->GetEntries() ; ipr ++ ){//fCaloList==parton list
171 TParticle * particle = dynamic_cast<TParticle *>(pl->At(ipr)) ;
173 if(particle->GetPdgCode() !=22 && (ipr ==4 || ipr == 5)){// 6 or 7 in list.
174 //Only good for gamma-jet events
176 phi = particle->Phi() ;
177 eta = particle->Eta() ;
181 fhDeltaEtaParton->Fill(ptg,etag-eta);
182 fhDeltaPhiParton->Fill(ptg,phig-phi);
183 fhDeltaPtParton->Fill(ptg,ptg-pt);
184 fhPtRatParton->Fill(ptg,pt/ptg);
186 AliDebug(2, "End of parton analysis");