]>
Commit | Line | Data |
---|---|---|
5f8029d4 | 1 | //////////////////////////////////////////////////////////////////////////////// |
2 | // // | |
3 | // AliFemtoCutMonitorParticlePtPDGV0 - the cut monitor for particles to study // | |
4 | // the difference between reconstructed V0s and MC V0s // | |
5 | // // | |
6 | //////////////////////////////////////////////////////////////////////////////// | |
7 | #include "AliFemtoCutMonitorParticlePtPDGV0.h" | |
8 | #include "AliFemtoModelHiddenInfo.h" | |
9 | #include <TH1D.h> | |
10 | #include <TH2D.h> | |
11 | #include <TList.h> | |
12 | #include <TMath.h> | |
13 | ||
14 | AliFemtoCutMonitorParticlePtPDGV0::AliFemtoCutMonitorParticlePtPDGV0(): | |
15 | fPtPDG(0),ftpcHist(0),fPtMostProbable(0), | |
16 | fPtFakeLambdas(0), fFakeProtonDaughters(0), fFakeAntiProtonDaughters(0), fFakePionPlusDaughters(0), fFakePionMinusDaughters(0), | |
17 | //fPtRPi(0),fPtRK(0),fPtRP(0), | |
18 | fPtV0(0), fPtPosProton(0), | |
19 | fPtNegProton(0), | |
20 | fPtPosPion(0), | |
21 | fPtNegPion(0), | |
22 | fMass(0.13957) | |
23 | { | |
24 | // Default constructor | |
25 | } | |
26 | ||
27 | AliFemtoCutMonitorParticlePtPDGV0::AliFemtoCutMonitorParticlePtPDGV0(const char *aName, float aMass): | |
28 | AliFemtoCutMonitor(), | |
29 | fPtPDG(0),ftpcHist(0),fPtMostProbable(0), | |
30 | fPtFakeLambdas(0), fFakeProtonDaughters(0), fFakeAntiProtonDaughters(0), fFakePionPlusDaughters(0), fFakePionMinusDaughters(0), | |
31 | //fPtRPi(0),fPtRK(0),fPtRP(0), | |
32 | fPtV0(0), fPtPosProton(0), | |
33 | fPtNegProton(0), | |
34 | fPtPosPion(0), | |
35 | fPtNegPion(0), | |
36 | fMass(aMass) | |
37 | { | |
38 | // Normal constructor | |
39 | char name[200]; | |
40 | snprintf(name, 200, "PtPDG%s", aName); | |
41 | fPtPDG = new TH2D(name, "PDG vs Pt", 10, 0.0, 5.0, 8000, -4000, 4000); | |
42 | snprintf(name, 200, "tpcHist%s", aName); | |
43 | ftpcHist=new TH2D(name,"TPC dE/dX vs momentum",100,0.1,2.7,100,0.,6.); | |
44 | snprintf(name, 200, "PtOfV0s%s", aName); | |
45 | fPtMostProbable = new TH1D(name, "Pt of V0s", 250, 0.1, 5.0); | |
46 | snprintf(name, 200, "PtFakeLambdas%s", aName); | |
47 | fPtFakeLambdas = new TH1D(name, "fake lambdas Pt", 250, 0.1, 5.0); | |
48 | snprintf(name, 200, "PtFakePionPlus%s", aName); | |
49 | fFakePionPlusDaughters = new TH1D(name, "fake pion+ daughters", 250, 0.1, 5.0); | |
50 | snprintf(name, 200, "PtFakeProtonPlus%s", aName); | |
51 | fFakeProtonDaughters = new TH1D(name, "fake proton daughters", 250, 0.1, 5.0); | |
52 | snprintf(name, 200, "PtFakePionMinus%s", aName); | |
53 | fFakePionMinusDaughters = new TH1D(name, "fake pion- daughters", 250, 0.1, 5.0); | |
54 | snprintf(name, 200, "PtFakeProtonPlus%s", aName); | |
55 | fFakeAntiProtonDaughters = new TH1D(name, "fake anti-proton daughters", 250, 0.1, 5.0); | |
56 | ||
57 | ||
58 | ||
59 | // fPtRPi = new TH1D(name, "right pdg pions Pt", 250, 0.1, 5.0); | |
60 | // snprintf(name, 200, "PtFakeK%s", aName); | |
61 | // snprintf(name, 200, "PtRK%s", aName); | |
62 | // fPtRK = new TH1D(name, "right pdg kaons Pt", | |
63 | // snprintf(name, 200, "PtRP%s", aName); | |
64 | // fPtRP = new TH1D(name, "right pdg protons Pt", 250, 0.1, 5.0); | |
65 | ||
66 | snprintf(name, 200, "PtRealLambdas%s", aName); | |
67 | fPtV0 = new TH1D(name, "Pt of real Lambdas in the sample", 250, 0.1, 5.0); | |
68 | snprintf(name, 200, "PtRealPosP%s", aName); | |
69 | fPtPosProton = new TH1D(name, "Pt of real protons in the sample", 250, 0.1, 5.0); | |
70 | snprintf(name, 200, "PtRealNegP%s", aName); | |
71 | fPtNegProton = new TH1D(name, "Pt of real antiprotons in the sample", 250, 0.1, 5.0); | |
72 | snprintf(name, 200, "PtRealPosPi%s", aName); | |
73 | fPtPosPion = new TH1D(name, "Pt of real pion+ in the sample", 250, 0.1, 5.0); | |
74 | snprintf(name, 200, "PtRealNegPi%s", aName); | |
75 | fPtNegPion = new TH1D(name, "Pt of real pion- in the sample", 250, 0.1, 5.0); | |
76 | ||
77 | } | |
78 | ||
79 | AliFemtoCutMonitorParticlePtPDGV0::AliFemtoCutMonitorParticlePtPDGV0(const AliFemtoCutMonitorParticlePtPDGV0 &aCut): | |
80 | AliFemtoCutMonitor(), | |
81 | fPtPDG(0),ftpcHist(0),fPtMostProbable(0), | |
82 | fPtFakeLambdas(0), fFakeProtonDaughters(0), fFakeAntiProtonDaughters(0), fFakePionPlusDaughters(0), fFakePionMinusDaughters(0), | |
83 | //fPtRPi(0),fPtRK(0),fPtRP(0), | |
84 | fPtV0(0), fPtPosProton(0), | |
85 | fPtNegProton(0), | |
86 | fPtPosPion(0), | |
87 | fPtNegPion(0), | |
88 | fMass(0.13957) | |
89 | { | |
90 | // copy constructor | |
91 | if (fPtPDG) delete fPtPDG; | |
92 | fPtPDG = new TH2D(*aCut.fPtPDG); | |
93 | ftpcHist= new TH2D(*aCut.ftpcHist); | |
94 | fPtMostProbable= new TH1D(*aCut.fPtMostProbable); | |
95 | fPtFakeLambdas= new TH1D(*aCut.fPtFakeLambdas); | |
96 | fFakeProtonDaughters= new TH1D(*aCut.fFakeProtonDaughters); | |
97 | fFakeAntiProtonDaughters= new TH1D(*aCut.fFakeAntiProtonDaughters); | |
98 | fFakePionPlusDaughters= new TH1D(*aCut.fFakePionPlusDaughters); | |
99 | fFakePionMinusDaughters= new TH1D(*aCut.fFakePionMinusDaughters); | |
100 | ||
101 | // fPtRPi= new TH1D(*aCut.fPtRPi); | |
102 | // fPtRK= new TH1D(*aCut.fPtRK); | |
103 | // fPtRP= new TH1D(*aCut.fPtRP); | |
104 | ||
105 | ||
106 | ||
107 | ||
108 | fPtV0= new TH1D(*aCut.fPtV0); | |
109 | fPtPosProton= new TH1D(*aCut.fPtPosProton); | |
110 | fPtNegProton= new TH1D(*aCut.fPtNegProton); | |
111 | fPtPosPion= new TH1D(*aCut.fPtPosPion); | |
112 | fPtNegPion= new TH1D(*aCut.fPtNegPion); | |
113 | ||
114 | fMass = aCut.fMass; | |
115 | } | |
116 | ||
117 | AliFemtoCutMonitorParticlePtPDGV0::~AliFemtoCutMonitorParticlePtPDGV0() | |
118 | { | |
119 | // Destructor | |
120 | delete fPtPDG; | |
121 | delete ftpcHist; | |
122 | delete fPtMostProbable; | |
123 | // delete fPtRPi; | |
124 | // delete fPtRK; | |
125 | // delete fPtRP; | |
126 | ||
127 | delete fPtFakeLambdas; | |
128 | delete fFakeProtonDaughters; | |
129 | delete fFakePionPlusDaughters; | |
130 | delete fFakeAntiProtonDaughters; | |
131 | delete fFakePionMinusDaughters; | |
132 | ||
133 | delete fPtV0; | |
134 | delete fPtPosProton; | |
135 | delete fPtNegProton; | |
136 | delete fPtPosPion; | |
137 | delete fPtNegPion; | |
138 | ||
139 | } | |
140 | ||
141 | AliFemtoCutMonitorParticlePtPDGV0& AliFemtoCutMonitorParticlePtPDGV0::operator=(const AliFemtoCutMonitorParticlePtPDGV0& aCut) | |
142 | { | |
143 | // assignment operator | |
144 | if (this == &aCut) | |
145 | return *this; | |
146 | ||
147 | if (fPtPDG) delete fPtPDG; | |
148 | fPtPDG = new TH2D(*aCut.fPtPDG); | |
149 | ||
150 | if (ftpcHist) delete ftpcHist; | |
151 | ftpcHist = new TH2D(*aCut.ftpcHist); | |
152 | ||
153 | if (fPtFakeLambdas) delete fPtFakeLambdas; | |
154 | fPtFakeLambdas = new TH1D(*aCut.fPtFakeLambdas); | |
155 | ||
156 | if (fFakeProtonDaughters) delete fFakeProtonDaughters; | |
157 | fFakeProtonDaughters = new TH1D(*aCut.fFakeProtonDaughters); | |
158 | ||
159 | if (fFakeAntiProtonDaughters) delete fFakeAntiProtonDaughters; | |
160 | fFakeAntiProtonDaughters = new TH1D(*aCut.fFakeAntiProtonDaughters); | |
161 | ||
162 | if (fFakePionPlusDaughters) delete fFakePionPlusDaughters; | |
163 | fFakePionPlusDaughters = new TH1D(*aCut.fFakePionPlusDaughters); | |
164 | ||
165 | if (fFakePionMinusDaughters) delete fFakePionMinusDaughters; | |
166 | fFakePionMinusDaughters = new TH1D(*aCut.fFakePionMinusDaughters); | |
167 | ||
168 | // if (fPtRPi) delete fPtRPi; | |
169 | // fPtRPi = new TH1D(*aCut.fPtRPi); | |
170 | ||
171 | // if (fPtRK) delete fPtRK; | |
172 | // fPtRK = new TH1D(*aCut.fPtRK); | |
173 | ||
174 | // if (fPtRP) delete fPtRP; | |
175 | // fPtRP = new TH1D(*aCut.fPtRP); | |
176 | ||
177 | if (fPtV0) delete fPtV0; | |
178 | fPtV0 = new TH1D(*aCut.fPtV0); | |
179 | ||
180 | if (fPtPosProton) delete fPtPosProton; | |
181 | fPtPosProton = new TH1D(*aCut.fPtPosProton); | |
182 | ||
183 | if (fPtNegProton) delete fPtNegProton; | |
184 | fPtNegProton = new TH1D(*aCut.fPtNegProton); | |
185 | ||
186 | if (fPtPosPion) delete fPtPosPion; | |
187 | fPtPosPion = new TH1D(*aCut.fPtPosPion); | |
188 | ||
189 | if (fPtNegPion) delete fPtNegPion; | |
190 | fPtNegPion = new TH1D(*aCut.fPtNegPion); | |
191 | ||
192 | return *this; | |
193 | } | |
194 | ||
195 | AliFemtoString AliFemtoCutMonitorParticlePtPDGV0::Report(){ | |
196 | // Prepare report from the execution | |
197 | string stemp = "*** AliFemtoCutMonitorParticlePtPDGV0 report"; | |
198 | AliFemtoString returnThis = stemp; | |
199 | return returnThis; | |
200 | } | |
201 | ||
202 | void AliFemtoCutMonitorParticlePtPDGV0::Fill(const AliFemtoV0* aV0) | |
203 | { | |
204 | ||
205 | // Fill in the monitor histograms with the values from the current track | |
206 | // float tEnergy = ::sqrt(aV0->P().mag2()+fMass*fMass); | |
207 | // float tRapidity = 0.5*::log((tEnergy+aV0->P().z())/(tEnergy-aV0->P().z())); | |
208 | float tPt = aV0->PtV0();//::sqrt((aV0->P().x())*(aV0->P().x())+(aV0->P().y())*(aV0->P().y())); | |
209 | float tPtPos = aV0->PtPos(); | |
210 | float tPtNeg = aV0->PtNeg(); | |
211 | // float tEta = -TMath::Log(TMath::Tan(aV0->P().theta()/2.0)); | |
212 | // float tPhi = aV0->P().phi(); | |
213 | //float tP = ::sqrt((aV0->P().z())*(aV0->P().z())+(aV0->P().x())*(aV0->P().x())+(aV0->P().y())*(aV0->P().y()));; | |
214 | // float dedx = aV0->TPCsignalN(); | |
215 | // float w[10]; | |
216 | // w[0] = aV0->PidProbElectron(); | |
217 | // w[1] = aV0->PidProbMuon(); | |
218 | // w[2] = aV0->PidProbPion(); | |
219 | // w[3] = aV0->PidProbKaon(); | |
220 | // w[4] = aV0->PidProbProton(); | |
221 | ||
222 | Int_t pdg1=0, pdgPosDaughter=0, pdgNegDaughter=0; | |
223 | AliFemtoModelHiddenInfo *info = ( AliFemtoModelHiddenInfo *) aV0->GetHiddenInfo(); | |
224 | if(info)pdg1 = info->GetPDGPid(); | |
225 | if(info)pdgPosDaughter=info->GetPDGPidPos(); | |
226 | if(info)pdgNegDaughter=info->GetPDGPidNeg(); | |
227 | ||
228 | ||
229 | //most probable particle | |
230 | fPtMostProbable->Fill(tPt); | |
231 | ||
232 | //contaminations | |
233 | if (abs(pdg1)!=3122)fPtFakeLambdas->Fill(tPt); | |
234 | if (pdgPosDaughter!=2212)fFakeProtonDaughters->Fill(tPtPos); | |
235 | if (pdgPosDaughter!=211)fFakePionPlusDaughters->Fill(tPtPos); | |
236 | if (pdgNegDaughter!=-2212)fFakeAntiProtonDaughters->Fill(tPtNeg); | |
237 | if (pdgNegDaughter!=-211)fFakePionMinusDaughters->Fill(tPtNeg); | |
238 | ||
239 | ||
240 | //spectra of different particle species we've got | |
241 | if (abs(pdg1)==3122)fPtV0->Fill(tPt); | |
242 | if (abs(pdgNegDaughter)==2212)fPtNegProton->Fill(tPtNeg); | |
243 | if (abs(pdgPosDaughter)==2212)fPtPosProton->Fill(tPtPos); | |
244 | if (abs(pdgPosDaughter)==211)fPtPosPion->Fill(tPtPos); | |
245 | if (abs(pdgNegDaughter)==211)fPtNegPion->Fill(tPtNeg); | |
246 | ||
247 | Float_t pdg=pdg1; | |
248 | //if(abs(pdg1)==3122)pdg=0.0; //lambda | |
249 | //if(abs(pdg1)==211) pdg=1.0; //pion | |
250 | //if(abs(pdg1)==2212)pdg=2.0; //proton | |
251 | ||
252 | //cout<<"pdg from CutMonitor.."<<pdg1<<"pdg"<<pdg<<endl; | |
253 | ||
254 | ||
255 | fPtPDG->Fill(pdg, tPt); | |
256 | // ftpcHist->Fill(tP,dedx); | |
257 | ||
258 | ||
259 | } | |
260 | ||
261 | void AliFemtoCutMonitorParticlePtPDGV0::Write() | |
262 | { | |
263 | // Write out the relevant histograms | |
264 | ||
265 | fPtPDG->Write(); | |
266 | //ftpcHist->Write(); | |
267 | fPtMostProbable->Write(); | |
268 | fPtFakeLambdas->Write(); | |
269 | fFakeProtonDaughters->Write(); | |
270 | fFakePionPlusDaughters->Write(); | |
271 | fFakeAntiProtonDaughters->Write(); | |
272 | fFakePionMinusDaughters->Write(); | |
273 | // fPtRPi->Write(); | |
274 | // fPtRK->Write(); | |
275 | // fPtRP->Write(); | |
276 | fPtV0->Write(); | |
277 | fPtPosProton->Write(); | |
278 | fPtNegProton->Write(); | |
279 | fPtPosPion->Write(); | |
280 | fPtNegPion->Write(); | |
281 | } | |
282 | ||
283 | TList *AliFemtoCutMonitorParticlePtPDGV0::GetOutputList() | |
284 | { | |
285 | TList *tOutputList = new TList(); | |
286 | tOutputList->Add(fPtPDG); | |
287 | //tOutputList->Add(ftpcHist); | |
288 | tOutputList->Add(fPtMostProbable); | |
289 | tOutputList->Add(fPtFakeLambdas); | |
290 | tOutputList->Add(fFakeProtonDaughters); | |
291 | tOutputList->Add(fFakePionPlusDaughters); | |
292 | tOutputList->Add(fFakeAntiProtonDaughters); | |
293 | tOutputList->Add(fFakePionMinusDaughters); | |
294 | ||
295 | tOutputList->Add(fPtV0); | |
296 | tOutputList->Add(fPtPosProton); | |
297 | tOutputList->Add(fPtNegProton); | |
298 | tOutputList->Add(fPtPosPion); | |
299 | tOutputList->Add(fPtNegPion); | |
300 | ||
301 | return tOutputList; | |
302 | } |