]> git.uio.no Git - u/mrichter/AliRoot.git/blame - PHOS/AliPHOSGammaJet.h
Improved formatting for Print()
[u/mrichter/AliRoot.git] / PHOS / AliPHOSGammaJet.h
CommitLineData
77414c90 1#ifndef ALIPHOSGammaJet_H
2#define ALIPHOSGammaJet_H
3/* Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
4 * See cxx source for full Copyright notice */
5/* $Id$ */
6
702ab87e 7/* History of cvs commits:
8 *
9 * $Log$
3663622c 10 * Revision 1.11 2006/01/12 17:01:00 schutz
11 * Correct few coding violations, missing comments
12 *
7b54ea5c 13 * Revision 1.9 2005/12/20 07:31:51 schutz
14 * added data members
15 *
eb0b1051 16 * Revision 1.7 2005/05/28 14:19:04 schutz
17 * Compilation warnings fixed by T.P.
18 *
702ab87e 19 */
20
77414c90 21//_________________________________________________________________________
e8daeb92 22// Class for the analysis of gamma-jet correlations.
23// Basically it seaches for a prompt photon in the PHOS acceptance,
24// if so we construct a jet around the highest pt particle in the opposite
25// side in azimuth. This jet has to fullfill several conditions to be
26// accepted. Then the fragmentation function of this jet is constructed
27
77414c90 28//*-- Author: Gustavo Conesa & Yves Schutz (IFIC, CERN)
29
30// --- ROOT system ---
31#include "TTask.h"
e8daeb92 32#include "TRandom.h"
33#include "TArrayD.h"
ea7ab9df 34#include "AliESD.h"
7b54ea5c 35#include "TChain.h"
ea7ab9df 36
e8daeb92 37class AliPHOSFastGlobalReconstruction ;
7b54ea5c 38
e8daeb92 39//#include "../PYTHIA6/AliGenPythia.h"
7b54ea5c 40
77414c90 41// --- AliRoot header files ---
42
43class AliPHOSGammaJet : public TTask {
44
45public:
46
47 AliPHOSGammaJet() ; // default ctor
48 AliPHOSGammaJet(const TString inputfilename) ; //ctor
90cceaf6 49 AliPHOSGammaJet(const AliPHOSGammaJet & gj) ; // cpy ctor
3663622c 50
e8daeb92 51 virtual ~AliPHOSGammaJet() ; //virtual dtor
1305bc01 52 virtual void Exec(Option_t *option);
53 void List() const;
e8daeb92 54 Double_t GetAngleMaxParam(Int_t i) const {return fAngleMaxParam.At(i) ; }
55 Double_t GetEtaCut() const {return fEtaCut;}
56 Double_t GetPhiEMCALCut(Int_t i) const {return fPhiEMCALCut[i];}
57 TString GetHIJINGFileName() const {return fHIJINGFileName ; }
58 TString GetHistosFileName() const {return fOutputFileName ; }
59 Double_t GetInvMassMaxCut() const {return fInvMassMaxCut ; }
60 Double_t GetInvMassMinCut() const {return fInvMassMinCut ; }
61 Double_t GetPhiMaxCut() const {return fPhiMaxCut ; }
62 Double_t GetPhiMinCut() const {return fPhiMinCut ; }
63 Double_t GetPtCut() const {return fPtCut ; }
64 Double_t GetNeutralPtCut() const {return fNeutralPtCut ; }
65 Double_t GetChargedPtCut() const {return fChargedPtCut ; }
66 Double_t GetPtJetSelectionCut() const {return fPtJetSelectionCut ; }
67 Double_t GetMinDistance() const {return fMinDistance ; }
68 Double_t GetJetRatioMaxCut() const {return fJetRatioMaxCut ; }
69 Double_t GetJetRatioMinCut() const {return fJetRatioMinCut ; }
70 Double_t GetRatioMaxCut() const {return fRatioMaxCut ; }
71 Double_t GetRatioMinCut() const {return fRatioMinCut ; }
72 Int_t GetNEvent() const {return fNEvent ; }
73 Int_t GetNCones() const {return fNCone ; }
74 Int_t GetNPtThres() const {return fNPt ; }
75 Float_t GetCone() const {return fCone ; }
76 Float_t GetPtThreshold() const {return fPtThreshold ; }
77 Float_t GetCones(Int_t i) const {return fCones[i] ; }
78 Float_t GetPtThreshold(Int_t i) const {return fPtThres[i] ; }
79 TString GetConeName(Int_t i) const {return fNameCones[i] ; }
80 TString GetPtThresName(Int_t i) const {return fNamePtThres[i] ; }
81 Bool_t GetTPCCutsLikeEMCAL() const {return fTPCCutsLikeEMCAL ; }
ea7ab9df 82 Bool_t IsESDdata() const {return fESDdata ; }
83
84 TString GetDirName() const {return fDirName ; }
85 TString GetESDTreeName() const {return fESDTree ; }
86 char * GetDirPattern() const {return fPattern ; }
e8daeb92 87
88 Bool_t IsAnyConeOrPt() const {return fAnyConeOrPt ; }
89 Bool_t IsFastReconstruction() const {return fOptFast ; }
90 Bool_t IsHIJING() const {return fHIJING ; }
91 Bool_t IsOnlyCharged() const {return fOnlyCharged ; }
1305bc01 92
93 void Plot(TString what="all", Option_t *option="") const;
702ab87e 94 void Print(const Option_t * opt)const;
1305bc01 95
96 void SetAngleMaxParam(Int_t i, Double_t par)
97 {fAngleMaxParam.AddAt(par,i) ; }
98 void SetAnyConeOrPt(Bool_t any){fAnyConeOrPt = any ;}
99 void SetEtaCut(Double_t etacut) {fEtaCut = etacut ; }
100 void SetPhiEMCALCut(Double_t phi, Int_t i){fPhiEMCALCut[i] = phi; }
101 void SetFastReconstruction(Bool_t fast){fOptFast = fast ; }
102 void SetHIJING(Bool_t opt){fHIJING = opt; }
103 void SetHIJINGFileName(TString file){fHIJINGFileName = file ; }
104 void SetNCones(Int_t n){fNCone = n ; }
105 void SetNPtThresholds(Int_t n){fNPt = n ; }
106 void SetCones(Int_t i, Float_t cone, TString sc)
107 {fCones[i] = cone ; fNameCones[i] = sc; };
108 void SetCone(Float_t cone)
109 {fCone = cone; }
110 void SetPtThreshold(Float_t pt){fPtThreshold = pt; };
111 void SetPtThresholds(Int_t i,Float_t pt, TString spt){fPtThres[i] = pt ;
112 fNamePtThres[i] = spt; };
113 void SetOnlyCharged(Bool_t opt){fOnlyCharged = opt; }
114 void SetPythiaFileName(TString file){fInputFileName = file ; }
115 void SetHistosFileName(TString file){fOutputFileName = file ; }
116 void SetInvMassCutRange(Double_t invmassmin, Double_t invmassmax)
117 {fInvMassMaxCut =invmassmax; fInvMassMinCut =invmassmin;}
118 void SetJetRatioCutRange(Double_t ratiomin, Double_t ratiomax)
119 {fJetRatioMaxCut =ratiomax; fJetRatioMinCut = ratiomin ; }
120 void SetJetTPCRatioCutRange(Double_t ratiomin, Double_t ratiomax)
121 {fJetTPCRatioMaxCut =ratiomax; fJetTPCRatioMinCut = ratiomin ; }
122 void SetNEvent(Int_t n){fNEvent = n ; }
123 void SetMinDistance(Double_t min){fMinDistance = min ; }
124 void SetPhiCutRange(Double_t phimin, Double_t phimax)
125 {fPhiMaxCut =phimax; fPhiMinCut =phimin;}
126 void SetPtCut(Double_t ptcut)
127 {fPtCut =ptcut;}
128 void SetNeutralPtCut(Double_t ptcut)
129 {fNeutralPtCut =ptcut;}
130 void SetChargedPtCut(Double_t ptcut)
131 {fChargedPtCut =ptcut;}
132 void SetPtJetSelectionCut(Double_t cut){fPtJetSelectionCut = cut; }
133 void SetJetSelection(Bool_t select){ fSelect= select ; }
134 void SetRatioCutRange(Double_t ratiomin, Double_t ratiomax)
135 {fRatioMaxCut = ratiomax; fRatioMinCut = ratiomin;}
136 void SetTPCCutsLikeEMCAL(Bool_t b){ fTPCCutsLikeEMCAL= b ; }
ea7ab9df 137 void SetESDdata(Bool_t b){ fESDdata= b ; }
1305bc01 138
ea7ab9df 139 void SetDirName(TString dn) { fDirName = dn ; }
140 void SetESDTreeName(TString en) { fESDTree = en ; }
141 void SetDirPattern(char * dp) { fPattern = dp ; }
1305bc01 142
143 private:
3663622c 144 AliPHOSGammaJet & operator = (const AliPHOSGammaJet & /*rvalue*/)
145 { return *this ;}
146
147
1305bc01 148// void AddHIJINGToList(TList & particleList, TList & particleListCh,
149// TList & particleListNe, const Int_t iEvent,
150// const TLorentzVector gamma, Double_t & rot );
151
152 void AddHIJINGToList(Int_t iEvent, TClonesArray * particleList,
153 TClonesArray * plCh, TClonesArray * plNe,
ea7ab9df 154 TClonesArray * plNePHOS);
1305bc01 155
156
ea7ab9df 157 Double_t CalculateJetRatioLimit(const Double_t ptg, const Double_t *param,
1305bc01 158 const Double_t *x);
159
160 void CreateParticleList(Int_t iEvent, TClonesArray * particleList,
161 TClonesArray * plCh, TClonesArray * plNe,
ea7ab9df 162 TClonesArray * plNePHOS);
163 void CreateParticleListFromESD(TClonesArray * particleList,
164 TClonesArray * plCh, TClonesArray * plNe,
165 TClonesArray * plNePHOS,
166 const AliESD * esd );//, Int_t iEvent);
1305bc01 167
168 void FillJetHistos(TClonesArray * pl, Double_t ptg, TString conf, TString type);
169
170 void FillJetHistosAnyConeOrPt( TClonesArray * pl, Double_t ptg, TString conf,
171 TString type, TString cone, TString ptcut);
ea7ab9df 172 Bool_t IsAngleInWindow(const Float_t angle, const Float_t e);
173 Bool_t IsJetSelected(const Double_t ptg, const Double_t ptjet,
1305bc01 174 const TString type);
175
176 void MakeJet(TClonesArray * particleList,
177 Double_t ptg, Double_t phig,
178 Double_t ptl, Double_t phil, Double_t etal,
179 TString type, TLorentzVector & jet);
180 void MakeJetAnyConeOrPt(TClonesArray * particleList, Double_t ptg,
5ef8821d 181 Double_t phig, Double_t ptl, Double_t phil,
1305bc01 182 Double_t etal, TString type);
183 void GetGammaJet(TClonesArray * pl, Double_t &pt,
e8daeb92 184 Double_t &phi, Double_t &eta, Bool_t &Is) const;
1305bc01 185
186 void GetLeadingCharge(TClonesArray * pl,
187 Double_t ptg, Double_t phig,
e8daeb92 188 Double_t &pt, Double_t &eta, Double_t &phi) const ;
1305bc01 189 void GetLeadingPi0 (TClonesArray * pl,
190 Double_t ptg, Double_t phig,
e8daeb92 191 Double_t &pt, Double_t &eta, Double_t &phi) ;
1305bc01 192
193 void InitParameters();
ea7ab9df 194 Double_t MakeEnergy(const Double_t energy) ;
1305bc01 195 void MakeHistos() ;
196 void MakePhoton(TLorentzVector & particle) ;
ea7ab9df 197 TVector3 MakePosition(const Double_t energy, const TVector3 pos) ;
1305bc01 198
77414c90 199 void Pi0Decay(Double_t mPi0, TLorentzVector &p0,
1305bc01 200 TLorentzVector &p1, TLorentzVector &p2, Double_t &angle) ;
7b54ea5c 201
202 TChain * ReadESDfromdisk(const UInt_t eventsToRead,
203 const TString dirName,
204 const TString esdTreeName = "esdTree",
205 const char * pattern = "Evt") ;
206 TChain * ReadESD(const UInt_t eventsToRead = 1,
207 TString fileName = "",
208 const TString esdTreeName = "esdTree",
209 const char * pattern = "Evt" ) ;
210
1305bc01 211 Double_t SigmaE(Double_t energy) ;
212 Double_t SigmaP(Double_t energy) ;
7b54ea5c 213
1305bc01 214 void SetJet(TParticle * part, Bool_t & b, Float_t cone, Double_t eta,
215 Double_t phi);
216
217 private:
e8daeb92 218 Bool_t fAnyConeOrPt; // To play with the jet cone size and pt th.
219 Option_t * fOptionGJ ; //! Fill most interesting histograms
1305bc01 220 // and give interesting information
221 TFile * fOutputFile ; //! Output file
222 TString fOutputFileName; //! Output file Name
223 TString fInputFileName; //!
224 TString fHIJINGFileName; //!
e8daeb92 225 Bool_t fHIJING; // Add HIJING event to PYTHIA event?
ea7ab9df 226 Bool_t fESDdata ; // Read ESD?
1305bc01 227 Double_t fEtaCut ; // Eta cut
228 Bool_t fOnlyCharged ; // Only jets of charged particles
229 Double_t fPhiEMCALCut[2] ; // Phi cut maximum
230 Double_t fPhiMaxCut ; // Phi cut maximum
231 Double_t fPhiMinCut ; // Phi cut minimun
232 Double_t fPtCut ; // Min pt in PHOS
233 Double_t fNeutralPtCut ; // Min pt detected in PHOS
234 Double_t fChargedPtCut ; // Min pt detected in TPC
235 Double_t fInvMassMaxCut ; // Invariant Mass cut maximum
236 Double_t fInvMassMinCut ; // Invariant Masscut minimun
237 Double_t fMinDistance ; // Minimal distance to resolve gamma decay.
238 Double_t fRatioMaxCut ; // Leading particle/gamma Ratio cut maximum
239 Double_t fRatioMinCut ; // Leading particle/gamma Ratio cut minimum
240 Bool_t fTPCCutsLikeEMCAL ; //Same jet energy ratio limits for both conf.
241
ea7ab9df 242 //Read ESD Paramenters
fb57ea96 243 TString fDirName ; //Name of the directory where data is
244 TString fESDTree ; //Name of the ESD Tree
245 char * fPattern ; //Pattern followed by directory data
ea7ab9df 246
1305bc01 247 //Jet selection parameters
248 //Fixed cuts (old)
249 Double_t fJetTPCRatioMaxCut ; // Leading particle/gamma Ratio cut maximum
250 Double_t fJetTPCRatioMinCut ; // Leading particle/gamma Ratio cut minimum
251 Double_t fJetRatioMaxCut ; // Jet/gamma Ratio cut maximum
252 Double_t fJetRatioMinCut ; // Jet/gamma Ratio cut minimum
253
254 //Cuts depending on jet pt
e8daeb92 255 Double_t fJetE1[2]; //Rec. jet energy parameters
256 Double_t fJetE2[2]; //Rec. jet energy parameters
257 Double_t fJetSigma1[2];//Rec. sigma of jet energy parameters
258 Double_t fJetSigma2[2];//Rec. sigma of jet energy parameters
259 Double_t fBkgMean[6]; //Background mean energy
260 Double_t fBkgRMS[6]; //Background RMS
261 Double_t fJetXMin1[6]; //X Factor to set jet min limit for pp
262 Double_t fJetXMin2[6]; //X Factor to set jet min limit for PbPb
263 Double_t fJetXMax1[6]; //X Factor to set jet max limit for pp
264 Double_t fJetXMax2[6]; //X Factor to set jet max limit for PbPb
265
266 Int_t fNEvent ; // Number of events to analyze
267 Int_t fNCone ; // Number of jet cones sizes
268 Int_t fNPt ; // Number of jet particle pT threshold
269 Double_t fCone ; // Jet cone sizes under study (!fAnyConeSize)
270 Double_t fCones[10]; // Jet cone sizes under study (fAnyConeSize)
271 TString fNameCones[10]; // String name of cone to append to histos
272 Double_t fPtThreshold; // Jet pT threshold under study(!fAnyConeSize)
273 Double_t fPtThres[10]; // Jet pT threshold under study(fAnyConeSize)
274 Double_t fPtJetSelectionCut; // Jet pt to change to low pt jets analysis
275 TString fNamePtThres[10]; // String name of pt th to append to histos
276 TObjArray * fListHistos ; //! list of Histograms
277 AliPHOSFastGlobalReconstruction * fFastRec; //Pointer to fast recons.
278 Bool_t fOptFast; // Do we want fast Rec?
1305bc01 279 TRandom fRan ; //! random number generator
280 //Energy and position parameters
281 Double_t fResPara1 ; // parameter for the energy resolution dependence
282 Double_t fResPara2 ; // parameter for the energy resolution dependence
283 Double_t fResPara3 ; // parameter for the energy resolution dependence
284 Double_t fPosParaA ; // parameter for the position resolution
285 Double_t fPosParaB ; // parameter for the position resolution
e8daeb92 286 TArrayD fAngleMaxParam ; //Max opening angle selection parameters
1305bc01 287 Bool_t fSelect ; //Select jet within limits
288
ea7ab9df 289 ClassDef(AliPHOSGammaJet,3)
1305bc01 290} ;
291
77414c90 292
77414c90 293#endif //ALIPHOSGammaJet_H
1305bc01 294
295
296