]>
Commit | Line | Data |
---|---|---|
7d2d1773 | 1 | //Created by Christine Nattrass, Rebecca Scott, Irakli Martashvili |
2 | //University of Tennessee at Knoxville | |
3 | // | |
4 | // This class is designed for the analysis of the hadronic component of | |
5 | // transverse energy. It is used by AliAnalysisTaskHadEt. | |
6 | // This gets information about the hadronic component of the transverse energy | |
7 | // from tracks reconstructed in an event | |
8 | // it has daughters, AliAnalysisEtCommonMonteCarlo and | |
9 | // AliAnalysisEtCommonReconstructed which loop over either Monte Carlo data or | |
10 | // real data to get Et | |
11 | ||
12 | #include "AliAnalysisEtCommon.h" | |
13 | #include "TMath.h" | |
14 | #include "TList.h" | |
15 | #include "TH1F.h" | |
16 | #include "TH2F.h" | |
964c8159 | 17 | #include "TF1.h" |
7d2d1773 | 18 | #include <iostream> |
19 | #include "AliAnalysisEtCuts.h" | |
20 | #include "AliMCEvent.h" | |
21 | #include "AliVEvent.h" | |
22 | #include "AliStack.h" | |
23 | #include "AliESDtrackCuts.h" | |
24 | #include "TDatabasePDG.h" | |
25 | #include "TParticle.h" | |
26 | #include "Rtypes.h" | |
27 | #include "AliPDG.h" | |
28 | ||
29 | using namespace std; | |
30 | ||
31 | ClassImp(AliAnalysisEtCommon); | |
32 | //These are from the PDG database but by making them static the code is a bit more efficient and has no problems running with the plugin | |
33 | //Cuts are defined in $ROOTSYS/etc/pdg_table.txt | |
34 | ||
35 | Float_t AliAnalysisEtCommon::fgPionMass = 0.13957; | |
36 | Float_t AliAnalysisEtCommon::fgKaonMass = 0.493677; | |
37 | Float_t AliAnalysisEtCommon::fgProtonMass = 0.938272; | |
38 | Float_t AliAnalysisEtCommon::fgElectronMass = 0.000510999; | |
39 | Int_t AliAnalysisEtCommon::fgPiPlusCode = 211; | |
40 | Int_t AliAnalysisEtCommon::fgPiMinusCode = -211; | |
41 | Int_t AliAnalysisEtCommon::fgKPlusCode = 321; | |
42 | Int_t AliAnalysisEtCommon::fgKMinusCode = -321; | |
43 | Int_t AliAnalysisEtCommon::fgProtonCode = 2212; | |
44 | Int_t AliAnalysisEtCommon::fgAntiProtonCode = -2212; | |
45 | Int_t AliAnalysisEtCommon::fgLambdaCode = 3122; | |
46 | Int_t AliAnalysisEtCommon::fgAntiLambdaCode = -3122; | |
47 | Int_t AliAnalysisEtCommon::fgK0SCode = 310; | |
48 | Int_t AliAnalysisEtCommon::fgOmegaCode = 3334; | |
49 | Int_t AliAnalysisEtCommon::fgAntiOmegaCode = -3334; | |
50 | Int_t AliAnalysisEtCommon::fgXi0Code = 3322; | |
51 | Int_t AliAnalysisEtCommon::fgAntiXi0Code = -3322; | |
52 | Int_t AliAnalysisEtCommon::fgXiCode = 3312; | |
53 | Int_t AliAnalysisEtCommon::fgAntiXiCode = -3312; | |
54 | Int_t AliAnalysisEtCommon::fgSigmaCode = 3112; | |
55 | Int_t AliAnalysisEtCommon::fgAntiSigmaCode = -3112; | |
56 | Int_t AliAnalysisEtCommon::fgK0LCode = 130; | |
57 | Int_t AliAnalysisEtCommon::fgNeutronCode = 2112; | |
58 | Int_t AliAnalysisEtCommon::fgAntiNeutronCode = -2112; | |
59 | Int_t AliAnalysisEtCommon::fgEPlusCode = -11; | |
60 | Int_t AliAnalysisEtCommon::fgEMinusCode = 11; | |
61 | Int_t AliAnalysisEtCommon::fgMuPlusCode = -13; | |
62 | Int_t AliAnalysisEtCommon::fgMuMinusCode = 13; | |
63 | Int_t AliAnalysisEtCommon::fgGammaCode = 22; | |
64 | Int_t AliAnalysisEtCommon::fgPi0Code = 111; | |
65 | Int_t AliAnalysisEtCommon::fgEtaCode = 221; | |
66 | Int_t AliAnalysisEtCommon::fgOmega0Code = 223; | |
67 | ||
68 | ||
69 | ||
70 | Float_t AliAnalysisEtCommon::fgPtTPCCutOff = 0.15; | |
71 | Float_t AliAnalysisEtCommon::fgPtITSCutOff = 0.10; | |
72 | ||
0f6416f3 | 73 | AliAnalysisEtCommon::AliAnalysisEtCommon() : TObject() |
74 | ,fHistogramNameSuffix("") | |
75 | ,fCuts(0) | |
76 | ,fDataSet(2010) | |
77 | ,fEsdtrackCutsITSTPC(0) | |
78 | ,fEsdtrackCutsTPC(0) | |
79 | ,fEsdtrackCutsITS(0) | |
80 | ,fK0PythiaD6T(0) | |
81 | ,fLambdaPythiaD6T(0) | |
82 | ,fAntiLambdaPythiaD6T(0) | |
83 | ,fK0Data(0) | |
84 | ,fLambdaData(0) | |
85 | ,fAntiLambdaData(0) | |
86 | ,fLambdaEnhancement(0) | |
87 | ,fProtonEnhancement(0) | |
bf205f52 | 88 | ,fCentralityMethod("V0M") |
c1854447 | 89 | ,fNCentBins(21) |
b89c2382 | 90 | ,fCentBin(-1) |
7d2d1773 | 91 | {//default constructor |
92 | ||
93 | } | |
94 | ||
95 | AliAnalysisEtCommon::~AliAnalysisEtCommon() | |
96 | {//destructor | |
97 | delete fCuts; | |
98 | delete fEsdtrackCutsITSTPC; | |
99 | delete fEsdtrackCutsITS; | |
100 | delete fEsdtrackCutsTPC; | |
964c8159 | 101 | delete fK0PythiaD6T; |
102 | delete fLambdaPythiaD6T; | |
103 | delete fAntiLambdaPythiaD6T; | |
104 | delete fK0Data; | |
105 | delete fLambdaData; | |
106 | delete fAntiLambdaData; | |
f43fc416 | 107 | delete fLambdaEnhancement; |
108 | delete fProtonEnhancement; | |
7d2d1773 | 109 | } |
110 | ||
111 | Int_t AliAnalysisEtCommon::AnalyseEvent(AliVEvent *event) | |
112 | { //this line is basically here to eliminate a compiler warning that event is not used. Making it a virtual function did not work with the plugin. | |
113 | cout << "This event has " << event->GetNumberOfTracks() << " tracks" << endl; | |
114 | ResetEventValues(); | |
115 | return 0; | |
116 | } | |
117 | ||
118 | ||
119 | void AliAnalysisEtCommon::Init() | |
120 | {// clear variables, set up cuts and PDG info | |
964c8159 | 121 | //MyFunction * fptr = new MyFunction(....); // create the user function class |
122 | //TF1 * f = new TF1("f",fptr,&MyFunction::Evaluate,0,1,npar,"MyFunction","Evaluate"); // create TF1 class. | |
123 | AliAnalysisLevyPt *function = new AliAnalysisLevyPt(); | |
124 | //parameter 0 = dNdy | |
125 | //parameter 1 = temp | |
126 | //parameter 2 = power | |
ea331c5d | 127 | if(fK0PythiaD6T) delete fK0PythiaD6T; |
128 | if(fLambdaPythiaD6T) delete fLambdaPythiaD6T; | |
129 | if(fAntiLambdaPythiaD6T) delete fAntiLambdaPythiaD6T; | |
130 | if(fK0Data) delete fK0Data; | |
131 | if(fLambdaData) delete fLambdaData; | |
132 | if(fAntiLambdaData) delete fAntiLambdaData; | |
836ce14a | 133 | fK0PythiaD6T = new TF1("K0PythiaD6T",function, &AliAnalysisLevyPt::Evaluate,0,50,4,"AliAnalysisLevyPt","Evaluate"); |
134 | fLambdaPythiaD6T = new TF1("LambdaPythiaD6T",function, &AliAnalysisLevyPt::Evaluate,0,50,4,"AliAnalysisLevyPt","Evaluate"); | |
135 | fAntiLambdaPythiaD6T = new TF1("LambdaPythiaD6T",function, &AliAnalysisLevyPt::Evaluate,0,50,4,"AliAnalysisLevyPt","Evaluate"); | |
136 | fK0Data = new TF1("K0Data",function, &AliAnalysisLevyPt::Evaluate,0,50,4,"AliAnalysisLevyPt","Evaluate"); | |
137 | fLambdaData = new TF1("LambdaData",function, &AliAnalysisLevyPt::Evaluate,0,50,4,"AliAnalysisLevyPt","Evaluate"); | |
138 | fAntiLambdaData = new TF1("LambdaData",function, &AliAnalysisLevyPt::Evaluate,0,50,4,"AliAnalysisLevyPt","Evaluate"); | |
139 | fK0PythiaD6T->FixParameter(3,0.493677); | |
140 | fK0Data->FixParameter(3,0.493677); | |
141 | fLambdaPythiaD6T->FixParameter(3,1.115683); | |
142 | fAntiLambdaPythiaD6T->FixParameter(3,1.115683); | |
143 | fLambdaData->FixParameter(3,1.115683); | |
144 | fAntiLambdaData->FixParameter(3,1.115683); | |
964c8159 | 145 | if(fDataSet==2009){ |
146 | //These data are from the ALICE 900 GeV p+p paper | |
147 | fK0PythiaD6T->SetParameter(0,0.1437); | |
148 | fK0PythiaD6T->SetParameter(1,0.1497); | |
149 | fK0PythiaD6T->SetParameter(2,6.94); | |
150 | fLambdaPythiaD6T->SetParameter(0,0.0213); | |
151 | fLambdaPythiaD6T->SetParameter(1,0.1315); | |
152 | fLambdaPythiaD6T->SetParameter(2,4.60); | |
153 | fAntiLambdaPythiaD6T->SetParameter(0,0.0213); | |
154 | fAntiLambdaPythiaD6T->SetParameter(1,0.1315); | |
155 | fAntiLambdaPythiaD6T->SetParameter(2,4.60); | |
156 | fK0Data->SetParameter(0,0.184); | |
157 | fK0Data->SetParameter(1,0.168); | |
158 | fK0Data->SetParameter(2,6.6); | |
159 | fLambdaData->SetParameter(0,0.048); | |
160 | fLambdaData->SetParameter(1,0.229); | |
161 | fLambdaData->SetParameter(2,10.8); | |
162 | fAntiLambdaData->SetParameter(0,0.047); | |
163 | fAntiLambdaData->SetParameter(1,0.210); | |
164 | fAntiLambdaData->SetParameter(2,9.2); | |
165 | } | |
f43fc416 | 166 | if(fDataSet==2010 ||fDataSet==20100 ){ |
964c8159 | 167 | //These data are from the CMS analysis note on 7 TeV spectra |
168 | //http://cdsweb.cern.ch/record/1279344/files/QCD-10-007-pas.pdf | |
169 | //Note the CMS parameterization of the Levy function differs from the ALICE parameterization by a constant. | |
170 | //CMS does not list the overall constant in their fit, the ratios of the dN/dy(y=0) is used. | |
171 | fK0PythiaD6T->SetParameter(0,0.72); | |
172 | fK0PythiaD6T->SetParameter(1,0.183); | |
173 | fK0PythiaD6T->SetParameter(2,7.41); | |
174 | fLambdaPythiaD6T->SetParameter(0,0.54); | |
175 | fLambdaPythiaD6T->SetParameter(1,0.216); | |
176 | fLambdaPythiaD6T->SetParameter(2,5.71); | |
177 | fAntiLambdaPythiaD6T->SetParameter(0,0.54); | |
178 | fAntiLambdaPythiaD6T->SetParameter(1,0.216); | |
179 | fAntiLambdaPythiaD6T->SetParameter(2,5.71); | |
180 | fK0Data->SetParameter(0,1.0); | |
181 | fK0Data->SetParameter(1,0.215); | |
182 | fK0Data->SetParameter(2,6.79); | |
183 | fLambdaData->SetParameter(0,1.0); | |
184 | fLambdaData->SetParameter(1,0.290); | |
185 | fLambdaData->SetParameter(2,9.28); | |
186 | fAntiLambdaData->SetParameter(0,1.0); | |
187 | fAntiLambdaData->SetParameter(1,0.290); | |
188 | fAntiLambdaData->SetParameter(2,9.28); | |
189 | } | |
ea331c5d | 190 | if(fLambdaEnhancement) delete fLambdaEnhancement; |
f43fc416 | 191 | fLambdaEnhancement = new TF1("fLambdaEnhancement","([0]*pow(x,[1])*exp(-pow(x/[2],[3])))/([4]*exp(-pow([5]/x,[6]))+[7]*x)",0,50); |
192 | fLambdaEnhancement->SetParameter(0,0.5630487); | |
193 | fLambdaEnhancement->SetParameter(1,1.388818); | |
194 | fLambdaEnhancement->SetParameter(2,3.954147); | |
195 | fLambdaEnhancement->SetParameter(3,3.443772); | |
196 | fLambdaEnhancement->SetParameter(4,2.844288); | |
197 | fLambdaEnhancement->SetParameter(5,2); | |
198 | fLambdaEnhancement->SetParameter(6,0.4747893); | |
199 | fLambdaEnhancement->SetParameter(7,-0.2250856); | |
ea331c5d | 200 | if(fProtonEnhancement) delete fProtonEnhancement; |
f43fc416 | 201 | fProtonEnhancement = new TF1("fProtonEnhancement","[0]*pow(x,[1])*exp(-pow(x/[2],[3]))/([4]+[5]*x)",0,50); |
202 | fProtonEnhancement->SetParameter(0,0.5630487*1.6); | |
203 | fProtonEnhancement->SetParameter(1,1.388818); | |
204 | fProtonEnhancement->SetParameter(2,3.954147/1.5); | |
205 | fProtonEnhancement->SetParameter(3,3.443772/2.5); | |
206 | fProtonEnhancement->SetParameter(4,0.5); | |
207 | fProtonEnhancement->SetParameter(5,-.03); | |
7d2d1773 | 208 | } |
209 | ||
210 | void AliAnalysisEtCommon::ResetEventValues() | |
211 | {//Resets event values of et to zero | |
212 | ||
213 | if (!fCuts) { // some Init's needed | |
214 | cout << __FILE__ << ":" << __LINE__ << " : Init " << endl; | |
215 | if (!fCuts) { | |
216 | cout << " setting up Cuts " << endl; | |
217 | fCuts = new AliAnalysisEtCuts(); | |
218 | } | |
219 | } | |
220 | } | |
221 | ||
222 | ||
223 | Float_t AliAnalysisEtCommon::Et(TParticle *part, float mass){//function to calculate et in the same way as it would be calculated in a calorimeter | |
224 | if(mass+1000<0.01){//if no mass given return default. The default argument is -1000 | |
225 | if(TMath::Abs(part->GetPDG(0)->PdgCode())==2212 || TMath::Abs(part->GetPDG(0)->PdgCode())==2112){ | |
226 | if(part->GetPDG(0)->PdgCode()==-2212 || part->GetPDG(0)->PdgCode()==-2112){//antiproton or antineutron | |
227 | //for antinucleons we specifically want to return the kinetic energy plus twice the rest mass | |
228 | return (part->Energy()+part->GetMass())*TMath::Sin(part->Theta()); | |
229 | } | |
230 | if(part->GetPDG(0)->PdgCode()==2212 || part->GetPDG(0)->PdgCode()==2112){//proton or neutron | |
231 | //for nucleons we specifically want to return the kinetic energy only | |
232 | return (part->Energy()-part->GetMass())*TMath::Sin(part->Theta()); | |
233 | } | |
234 | } | |
235 | else{//otherwise go to the default | |
236 | return part->Energy()*TMath::Sin(part->Theta()); | |
237 | } | |
238 | } | |
239 | else{//otherwise use the mass that was given | |
240 | return (TMath::Sqrt(TMath::Power(part->P(),2.0)+TMath::Power(mass,2.0)))*TMath::Sin(part->Theta()); | |
241 | } | |
242 | return 0.0; | |
243 | } | |
244 | Float_t AliAnalysisEtCommon::Et(Float_t p, Float_t theta, Int_t pid, Short_t charge) const {//function to calculate et in the same way as it would be calculated in a calorimeter | |
245 | if(pid==fgPiPlusCode || pid==fgPiMinusCode){//Nothing special for pions | |
246 | return TMath::Sqrt(p*p + fgPionMass*fgPionMass) * TMath::Sin(theta); | |
247 | } | |
248 | if(pid==fgKPlusCode || pid==fgKMinusCode){//Nothing special for kaons | |
249 | return TMath::Sqrt(p*p + fgKaonMass*fgKaonMass) * TMath::Sin(theta); | |
250 | } | |
251 | if(pid==fgEPlusCode || pid==fgEMinusCode){//Nothing special for electrons | |
252 | return TMath::Sqrt(p*p + fgElectronMass*fgElectronMass) * TMath::Sin(theta); | |
253 | } | |
254 | if(pid==fgProtonCode || pid==fgAntiProtonCode){//But for protons we must be careful... | |
255 | if(charge<0.0){//antiprotns: kinetic energy plus twice the rest mass | |
256 | return (TMath::Sqrt(p*p + fgProtonMass*fgProtonMass) + fgProtonMass) * TMath::Sin(theta); | |
257 | } | |
258 | if(charge>0.0){//antiprotns: kinetic energy only | |
259 | return (TMath::Sqrt(p*p + fgProtonMass*fgProtonMass) - fgProtonMass) * TMath::Sin(theta); | |
260 | } | |
261 | } | |
262 | cerr<<"Uh-oh! Et not set properly!"<<endl; | |
263 | return 0.0; | |
264 | } | |
964c8159 | 265 | |
266 | Float_t AliAnalysisEtCommon::K0Weight(Float_t pt){ | |
267 | Float_t data = fK0Data->Eval(pt); | |
268 | Float_t mc = fK0PythiaD6T->Eval(pt); | |
269 | return data/mc; | |
270 | } | |
271 | Float_t AliAnalysisEtCommon::LambdaWeight(Float_t pt){ | |
272 | Float_t data = fLambdaData->Eval(pt); | |
273 | Float_t mc = fLambdaPythiaD6T->Eval(pt); | |
274 | return data/mc; | |
275 | } | |
276 | Float_t AliAnalysisEtCommon::AntiLambdaWeight(Float_t pt){ | |
277 | Float_t data = fAntiLambdaData->Eval(pt); | |
278 | Float_t mc = fAntiLambdaPythiaD6T->Eval(pt); | |
279 | return data/mc; | |
280 | } | |
281 | ||
f43fc416 | 282 | Float_t AliAnalysisEtCommon::LambdaBaryonEnhancement(Float_t pt){ |
283 | if(pt<0.8) return 1.0; | |
284 | return fLambdaEnhancement->Eval(pt); | |
285 | };//Function which gives the factor to reweigh a lambda or antilambda so it roughly matches baryon enhancement seen at RHIC | |
286 | Float_t AliAnalysisEtCommon::ProtonBaryonEnhancement(Float_t pt){ | |
287 | if(pt<0.8) return 1.0; | |
288 | return fProtonEnhancement->Eval(pt); | |
289 | }//Function which gives the factor to reweigh a lambda or antilambda so it roughly matches baryon enhancement seen at RHIC |