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.3 2007/09/26 11:07:19 schutz
21 * Update classes for the new analysis framwork
23 * Revision 1.1.2.1 2007/07/26 10:32:09 schutz
24 * new analysis classes in the the new analysis framework
28 //_________________________________________________________________________
29 // Class for the analysis of gamma-parton correlations
30 //*-- Author: Gustavo Conesa (LNF-INFN)
31 //////////////////////////////////////////////////////////////////////////////
34 // --- ROOT system ---
35 #include "Riostream.h"
37 //---- AliRoot system ----
38 #include "AliAnaGammaParton.h"
41 ClassImp(AliAnaGammaParton)
44 //____________________________________________________________________________
45 AliAnaGammaParton::AliAnaGammaParton() :
46 AliAnaGammaCorrelation(),
47 fhDeltaEtaParton(0), fhDeltaPhiParton(0),
48 fhDeltaPtParton(0), fhPtRatParton(0)
52 SetCorrelationType(kParton);
53 //Initialize parameters
57 //____________________________________________________________________________
58 AliAnaGammaParton::AliAnaGammaParton(const AliAnaGammaParton & g) :
59 AliAnaGammaCorrelation(g),
60 fhDeltaEtaParton(g.fhDeltaEtaParton), fhDeltaPhiParton(g.fhDeltaPhiParton),
61 fhDeltaPtParton(g.fhDeltaPtParton), fhPtRatParton(g.fhPtRatParton)
67 //_________________________________________________________________________
68 AliAnaGammaParton & AliAnaGammaParton::operator = (const AliAnaGammaParton & source)
70 // assignment operator
72 if(this == &source)return *this;
73 ((AliAnaGammaCorrelation *)this)->operator=(source);
74 fhDeltaEtaParton = source.fhDeltaEtaParton;
75 fhDeltaPhiParton = source.fhDeltaPhiParton;
76 fhDeltaPtParton = source.fhDeltaPtParton;
77 fhPtRatParton = source.fhPtRatParton;
83 //____________________________________________________________________________
84 AliAnaGammaParton::~AliAnaGammaParton()
86 // Remove all pointers except analysis output pointers.
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");