Compilation on Windows/Cygwin
[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$
3788def4 20 * Revision 1.3 2007/09/26 11:07:19 schutz
21 * Update classes for the new analysis framwork
22 *
bdcfac30 23 * Revision 1.1.2.1 2007/07/26 10:32:09 schutz
24 * new analysis classes in the the new analysis framework
25 *
26 *
27 */
28//_________________________________________________________________________
29// Class for the analysis of gamma-parton correlations
30//*-- Author: Gustavo Conesa (LNF-INFN)
31//////////////////////////////////////////////////////////////////////////////
32
33
34// --- ROOT system ---
35#include "Riostream.h"
36
37//---- AliRoot system ----
38#include "AliAnaGammaParton.h"
39#include "AliLog.h"
40
41 ClassImp(AliAnaGammaParton)
42
43
44//____________________________________________________________________________
45 AliAnaGammaParton::AliAnaGammaParton() :
46 AliAnaGammaCorrelation(),
47 fhDeltaEtaParton(0), fhDeltaPhiParton(0),
48 fhDeltaPtParton(0), fhPtRatParton(0)
49{
50 //Default Ctor
51
52 SetCorrelationType(kParton);
53 //Initialize parameters
54 InitParameters();
55}
56
57//____________________________________________________________________________
58AliAnaGammaParton::AliAnaGammaParton(const AliAnaGammaParton & g) :
59 AliAnaGammaCorrelation(g),
60 fhDeltaEtaParton(g.fhDeltaEtaParton), fhDeltaPhiParton(g.fhDeltaPhiParton),
61 fhDeltaPtParton(g.fhDeltaPtParton), fhPtRatParton(g.fhPtRatParton)
62{
63 // cpy ctor
64
65}
66
67//_________________________________________________________________________
68AliAnaGammaParton & AliAnaGammaParton::operator = (const AliAnaGammaParton & source)
69{
70 // assignment operator
71
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;
78
79 return *this;
80
81}
82
83//____________________________________________________________________________
84AliAnaGammaParton::~AliAnaGammaParton()
85{
3788def4 86 // Remove all pointers except analysis output pointers.
87
bdcfac30 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}