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.2 2007/08/17 12:40:04 schutz
21 * New analysis classes by Gustavo Conesa
23 * Revision 1.1.2.1 2007/07/26 10:32:09 schutz
24 * new analysis classes in the the new analysis framework
29 //_________________________________________________________________________
30 // Base class for reading data: MonteCarlo, ESD or AOD, of PHOS EMCAL and
31 // Central Barrel Tracking detectors.
32 // Not all MC particles/tracks/clusters are kept, some kinematical restrictions are done.
33 // Mother class of : AliGammaDataReader: Fills ESD data in 3 TClonesArrays (PHOS, EMCAL, CTS)
34 // : AliGammaMCReader: Fills Kinematics data in 3 TClonesArrays (PHOS, EMCAL, CTS)
35 // : AliGammaMCDataReader: Fills ESD data in 3 TClonesArrays (PHOS, EMCAL, CTS)
36 // and MC data in other 3 TClonesArray
37 //*-- Author: Gustavo Conesa (LNF-INFN)
38 //////////////////////////////////////////////////////////////////////////////
41 // --- ROOT system ---
45 //---- ANALYSIS system ----
46 #include "AliGammaReader.h"
48 ClassImp(AliGammaReader)
51 //____________________________________________________________________________
52 AliGammaReader::AliGammaReader() :
53 TObject(), fDataType(0),
54 fSwitchOnEMCAL(0), fSwitchOnPHOS(0), fSwitchOnCTS(0),
55 fCTSEtaCut(0.), fEMCALEtaCut(0.), fPHOSEtaCut(0.),
56 fNeutralPtCut(0.), fChargedPtCut(0.),
57 fEMCALIPDistance(0.), fPHOSIPDistance(0.),
58 fEMCALMinAngle(0.), fPHOSMinAngle(0.),
59 fEMCALPID(0),fPHOSPID(0),
60 fEMCALPhotonWeight(0.), fEMCALPi0Weight(0.), fEMCALElectronWeight(0.),
61 fEMCALChargeWeight(0.),fEMCALNeutralWeight(0.),
62 fPHOSPhotonWeight(0.), fPHOSPi0Weight(0.), fPHOSElectronWeight(0.),
63 fPHOSChargeWeight(0.) , fPHOSNeutralWeight(0.) ,
64 fPHOSWeightFormula(0), fPHOSPhotonWeightFormula(0x0), fPHOSPi0WeightFormula(0x0)
73 //Initialize parameters
77 //____________________________________________________________________________
78 AliGammaReader::AliGammaReader(const AliGammaReader & g) :
79 TObject(g), fDataType(g.fDataType),
80 fSwitchOnEMCAL(g.fSwitchOnEMCAL), fSwitchOnPHOS(g.fSwitchOnPHOS), fSwitchOnCTS(g.fSwitchOnCTS),
81 fCTSEtaCut(g.fCTSEtaCut), fEMCALEtaCut(g.fEMCALEtaCut), fPHOSEtaCut(g.fPHOSEtaCut),
82 fNeutralPtCut(g.fNeutralPtCut), fChargedPtCut(g.fChargedPtCut),
83 fEMCALIPDistance(g.fEMCALIPDistance), fPHOSIPDistance(g.fPHOSIPDistance),
84 fEMCALMinAngle(g.fEMCALMinAngle), fPHOSMinAngle(g.fPHOSMinAngle),
85 fEMCALPID(g.fEMCALPID),
87 fEMCALPhotonWeight(g.fEMCALPhotonWeight),
88 fEMCALPi0Weight(g.fEMCALPi0Weight),
89 fEMCALElectronWeight(g.fEMCALElectronWeight),
90 fEMCALChargeWeight(g.fEMCALChargeWeight),
91 fEMCALNeutralWeight(g.fEMCALNeutralWeight),
92 fPHOSPhotonWeight(g.fPHOSPhotonWeight),
93 fPHOSPi0Weight(g.fPHOSPi0Weight),
94 fPHOSElectronWeight(g.fPHOSElectronWeight),
95 fPHOSChargeWeight(g.fPHOSChargeWeight),
96 fPHOSNeutralWeight(g.fPHOSNeutralWeight),
97 fPHOSWeightFormula(g.fPHOSWeightFormula),
98 fPHOSPhotonWeightFormula(g.fPHOSPhotonWeightFormula),
99 fPHOSPi0WeightFormula(g.fPHOSPi0WeightFormula)
103 fPhiEMCALCut[0]=g.fPhiEMCALCut[0];
104 fPhiEMCALCut[1]=g.fPhiEMCALCut[1];
105 fPhiPHOSCut[0]=g.fPhiPHOSCut[0];
106 fPhiPHOSCut[1]=g.fPhiPHOSCut[1];
109 //_________________________________________________________________________
110 AliGammaReader & AliGammaReader::operator = (const AliGammaReader & source)
112 // assignment operator
114 if(&source == this) return *this;
116 fDataType = source.fDataType ;
118 fSwitchOnEMCAL = source.fSwitchOnEMCAL;
119 fSwitchOnPHOS = source.fSwitchOnPHOS;
120 fSwitchOnCTS = source.fSwitchOnCTS;
122 fCTSEtaCut = source.fCTSEtaCut;
123 fEMCALEtaCut = source.fEMCALEtaCut;
124 fPHOSEtaCut = source.fPHOSEtaCut;
125 fNeutralPtCut = source.fNeutralPtCut;
126 fChargedPtCut = source.fChargedPtCut;
128 fPhiEMCALCut[0]=source.fPhiEMCALCut[0];
129 fPhiEMCALCut[1]=source.fPhiEMCALCut[1];
130 fPhiPHOSCut[0]=source.fPhiPHOSCut[0];
131 fPhiPHOSCut[1]=source.fPhiPHOSCut[1];
133 fEMCALIPDistance = source.fEMCALIPDistance;
134 fPHOSIPDistance = source.fPHOSIPDistance;
135 fEMCALMinAngle = source.fEMCALMinAngle;
136 fPHOSMinAngle = source.fPHOSMinAngle;
138 fEMCALPID = source.fEMCALPID ;
139 fPHOSPID = source.fPHOSPID ;
141 fEMCALPhotonWeight = source. fEMCALPhotonWeight ;
142 fEMCALPi0Weight = source.fEMCALPi0Weight ;
143 fEMCALElectronWeight = source.fEMCALElectronWeight;
144 fEMCALChargeWeight = source.fEMCALChargeWeight;
145 fEMCALNeutralWeight = source.fEMCALNeutralWeight;
147 fPHOSPhotonWeight = source.fPHOSPhotonWeight ;
148 fPHOSPi0Weight = source.fPHOSPi0Weight ;
149 fPHOSElectronWeight = source.fPHOSElectronWeight;
150 fPHOSChargeWeight = source.fPHOSChargeWeight;
151 fPHOSNeutralWeight = source.fPHOSNeutralWeight;
153 fPHOSWeightFormula = source.fPHOSWeightFormula;
154 fPHOSPhotonWeightFormula = source.fPHOSPhotonWeightFormula;
155 fPHOSPi0WeightFormula = source.fPHOSPi0WeightFormula;
162 //_______________________________________________________________
163 void AliGammaReader::InitParameters()
166 //Initialize the parameters of the analysis.
169 fSwitchOnEMCAL = kTRUE ;
170 fSwitchOnPHOS = kTRUE ;
171 fSwitchOnCTS = kTRUE ;
176 fPhiEMCALCut[0] = 80 *TMath::DegToRad();
177 fPhiEMCALCut[1] = 190*TMath::DegToRad();
178 fPhiPHOSCut[0] = 220. *TMath::DegToRad();
179 fPhiPHOSCut[1] = 320.*TMath::DegToRad();
180 fNeutralPtCut = 0.5 ;
181 fChargedPtCut = 0.5 ;
183 fEMCALMinAngle = 2.5 * TMath::DegToRad() ;
184 fPHOSMinAngle = 0.45 * TMath::DegToRad() ; //3.6 ;
185 fEMCALIPDistance = 450. ;//cm
186 fPHOSIPDistance = 445. ;//cm 460 (EMCA) - 15 (CPV)
188 //pid, only for ESD data
192 fEMCALPhotonWeight = 0.8 ;
193 fEMCALPi0Weight = 0.5 ;
194 fEMCALElectronWeight = 0.8 ;
195 fEMCALChargeWeight = 0.5 ;
196 fEMCALNeutralWeight = 0.5 ;
198 fPHOSPhotonWeight = 0.75 ;
199 fPHOSPi0Weight = 0.8 ;
200 fPHOSElectronWeight = 0.5 ;
201 fPHOSChargeWeight = 0.5 ;
202 fPHOSNeutralWeight = 0.5 ;
204 //Formula to set the PID weight threshold for photon or pi0
205 fPHOSWeightFormula = kTRUE;
206 fPHOSPhotonWeightFormula =
207 new TFormula("photonWeight","0.98*(x<40)+ 0.68*(x>=100)+(x>=40 && x<100)*(0.98+x*(6e-3)-x*x*(2e-04)+x*x*x*(1.1e-06))");
208 fPHOSPi0WeightFormula =
209 new TFormula("pi0Weight","0.98*(x<65)+ 0.915*(x>=100)+(x>=65 && x-x*(1.95e-3)-x*x*(4.31e-05)+x*x*x*(3.61e-07))");
214 //________________________________________________________________
215 void AliGammaReader::Print(const Option_t * opt) const
218 //Print some relevant parameters set for the analysis
222 Info("Print", "%s %s", GetName(), GetTitle() ) ;
223 printf("Data type : %d\n", fDataType) ;
225 printf(" EMCAL on? : %d\n", fSwitchOnEMCAL) ;
226 printf(" PHOS on? : %d\n", fSwitchOnPHOS) ;
227 printf(" CTS on? : %d\n", fSwitchOnCTS) ;
229 printf("CTS Eta cut : %f\n", fCTSEtaCut) ;
230 printf("EMCAL Eta cut : %f\n", fEMCALEtaCut) ;
231 printf("PHOS Eta cut : %f\n", fPHOSEtaCut) ;
232 printf("Phi EMCAL cut : [%f, %f]\n", fPhiEMCALCut[0],fPhiEMCALCut[1]) ;
233 printf("Phi PHOS cut : [%f, %f]\n", fPhiPHOSCut[0],fPhiPHOSCut[1]) ;
234 printf("pT neutral cut : %f GeV/c\n", fNeutralPtCut) ;
235 printf("pT charged cut : %f GeV/c\n", fChargedPtCut) ;
237 if(fDataType == kMC || fDataType == kMCData){
238 printf("IP distance to PHOS : %f\n", fPHOSIPDistance) ;
239 printf("IP distance to EMCAL : %f\n", fEMCALIPDistance) ;
240 printf("Min gamma decay aperture angle in PHOS : %f\n", fPHOSMinAngle) ;
241 printf("Min gamma decay aperture angle in EMCAL : %f\n", fEMCALMinAngle) ;
244 if(fDataType != kMC){
245 printf("PHOS PID on? = %d\n", fPHOSPID) ;
246 printf("EMCAL PID on? = %d\n", fEMCALPID) ;
247 printf("PHOS PID weight , photon %f, pi0 %f, e %f, charge %f, neutral %f \n",
248 fPHOSPhotonWeight, fPHOSPi0Weight,
249 fPHOSElectronWeight, fPHOSChargeWeight, fPHOSNeutralWeight) ;
250 printf("EMCAL PID weight, photon %f, pi0 %f, e %f, charge %f, neutral %f\n",
251 fEMCALPhotonWeight, fEMCALPi0Weight,
252 fEMCALElectronWeight, fEMCALChargeWeight, fEMCALNeutralWeight) ;
254 printf("PHOS Parametrized weight on? = %d\n", fPHOSWeightFormula) ;
255 if(fPHOSWeightFormula){
256 printf(">>>>>>>>>>> Photon weight formula<<<<<<<<<<<<\n");
257 fPHOSPhotonWeightFormula->Print();
258 printf(">>>>>>>>>>> Pi0 weight formula<<<<<<<<<<<<\n");
259 fPHOSPhotonWeightFormula->Print();