]> git.uio.no Git - u/mrichter/AliRoot.git/blame - PWG4/AliAnaGammaParton.cxx
Corrected coding violations
[u/mrichter/AliRoot.git] / PWG4 / AliAnaGammaParton.cxx
CommitLineData
bdcfac30 1/**************************************************************************
2 * Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
3 * *
4 * Author: The ALICE Off-line Project. *
5 * Contributors are mentioned in the code where appropriate. *
6 * *
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 **************************************************************************/
15/* $Id$ */
16
17/* History of cvs commits:
18 *
19 * $Log$
20 * Revision 1.1.2.1 2007/07/26 10:32:09 schutz
21 * new analysis classes in the the new analysis framework
22 *
23 *
24 */
25//_________________________________________________________________________
26// Class for the analysis of gamma-parton correlations
27//*-- Author: Gustavo Conesa (LNF-INFN)
28//////////////////////////////////////////////////////////////////////////////
29
30
31// --- ROOT system ---
32#include "Riostream.h"
33
34//---- AliRoot system ----
35#include "AliAnaGammaParton.h"
36#include "AliLog.h"
37
38 ClassImp(AliAnaGammaParton)
39
40
41//____________________________________________________________________________
42 AliAnaGammaParton::AliAnaGammaParton() :
43 AliAnaGammaCorrelation(),
44 fhDeltaEtaParton(0), fhDeltaPhiParton(0),
45 fhDeltaPtParton(0), fhPtRatParton(0)
46{
47 //Default Ctor
48
49 SetCorrelationType(kParton);
50 //Initialize parameters
51 InitParameters();
52}
53
54//____________________________________________________________________________
55AliAnaGammaParton::AliAnaGammaParton(const AliAnaGammaParton & g) :
56 AliAnaGammaCorrelation(g),
57 fhDeltaEtaParton(g.fhDeltaEtaParton), fhDeltaPhiParton(g.fhDeltaPhiParton),
58 fhDeltaPtParton(g.fhDeltaPtParton), fhPtRatParton(g.fhPtRatParton)
59{
60 // cpy ctor
61
62}
63
64//_________________________________________________________________________
65AliAnaGammaParton & AliAnaGammaParton::operator = (const AliAnaGammaParton & source)
66{
67 // assignment operator
68
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;
75
76 return *this;
77
78}
79
80//____________________________________________________________________________
81AliAnaGammaParton::~AliAnaGammaParton()
82{
83
84 delete fhDeltaEtaParton ;
85 delete fhDeltaPhiParton ;
86 delete fhDeltaPtParton ;
87 delete fhPtRatParton ;
88
89}
90
91
92//________________________________________________________________________
93TList * AliAnaGammaParton::GetCreateOutputObjects()
94{
95 // Create histograms to be saved in output file and
96 // store them in fOutputContainer
97
98 AliDebug(1,"Init parton histograms");
99
100 TList * outputContainer = new TList() ;
101 outputContainer->SetName("GammaPartonHistos") ;
102
103 //---kParton---
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);
110
111 fhDeltaEtaParton = new TH2F
112 ("DeltaEtaParton","#eta_{#gamma} - #eta_{parton} vs p_{T #gamma}",
113 200,0,120,200,-2,2);
114 fhDeltaEtaParton->SetYTitle("#Delta #eta");
115 fhDeltaEtaParton->SetXTitle("p_{T #gamma} (GeV/c)");
116 outputContainer->Add(fhDeltaEtaParton);
117
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);
124
125 fhPtRatParton = new TH2F
126 ("PtRatParton","#p_{T parton} / #p_{T #gamma} vs p_{T #gamma}",
127 200,0,120,200,0,5);
128 fhPtRatParton->SetYTitle("ratio");
129 fhPtRatParton->SetXTitle("p_{T #gamma} (GeV/c)");
130 outputContainer->Add(fhPtRatParton);
131
132 SetOutputContainer(outputContainer);
133
134 return outputContainer;
135}
136
137 //____________________________________________________________________________
138void AliAnaGammaParton::InitParameters()
139{
140
141 //Initialize the parameters of the analysis.
142
143 ;
144
145}
146
147//__________________________________________________________________
148void AliAnaGammaParton::Print(const Option_t * opt) const
149{
150
151 //Print some relevant parameters set for the analysis
152 if(! opt)
153 return;
154
155}
156
157//__________________________________________________________________
158void AliAnaGammaParton::MakeGammaCorrelation(TParticle * pGamma, TClonesArray *pl, TClonesArray *)
159{
160 //Gamma Parton Correlation Analysis
161 AliDebug(2, "Begin parton analysis");
162
163 Double_t ptg = pGamma->Pt();
164 Double_t phig = pGamma->Phi();
165 Double_t etag = pGamma->Eta();
166
167 Double_t pt = -100.;
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)) ;
172
173 if(particle->GetPdgCode() !=22 && (ipr ==4 || ipr == 5)){// 6 or 7 in list.
174 //Only good for gamma-jet events
175 pt = particle->Pt();
176 phi = particle->Phi() ;
177 eta = particle->Eta() ;
178 }
179 }
180
181 fhDeltaEtaParton->Fill(ptg,etag-eta);
182 fhDeltaPhiParton->Fill(ptg,phig-phi);
183 fhDeltaPtParton->Fill(ptg,ptg-pt);
184 fhPtRatParton->Fill(ptg,pt/ptg);
185
186 AliDebug(2, "End of parton analysis");
187
188}