]>
Commit | Line | Data |
---|---|---|
190c1f49 | 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 | ||
16 | //_________________________________________________________________________ | |
17 | // TTask class for TOF PID. | |
18 | // Use case: start root and execute the following macro | |
19 | /* | |
20 | { | |
21 | // Dynamically link some shared libs | |
22 | if (gClassTable->GetID("AliRun") < 0) { | |
23 | gROOT->LoadMacro("loadlibs.C"); | |
24 | loadlibs(); | |
25 | } | |
26 | // create an instance of the AliTOFPID class | |
27 | // You have to pass the ntuple and cuts filenames | |
28 | AliTOFPID* tofpid=new AliTOFPID("ntuple.root","cuts.root"); | |
29 | ||
30 | // option "pp" for pp events (it includes also electron in the analysis) | |
31 | // option "visual" to shows interactively histos | |
32 | // option "asC" or "asEPS" to save canvas in the current dir in .C or .eps format | |
33 | ||
34 | // make a choice: uncomment one of these lines | |
35 | // tofpid->Exec("pp","visual","asC"); | |
36 | // tofpid->Exec("pp","novisual","asC"); | |
37 | // tofpid->Exec("Pb-Pb","visual","asC"); | |
38 | // tofpid->Exec("pp","visual","asC"); | |
39 | // tofpid->Exec("pp","novisual","asEPS"); | |
40 | } | |
41 | */ | |
42 | // | |
43 | // | |
44 | // | |
45 | // | |
46 | // | |
47 | // | |
48 | // | |
49 | // | |
50 | //-- Authors: B. Zagreev , F. Pierella | |
51 | ////////////////////////////////////////////////////////////////////////////// | |
52 | ||
190c1f49 | 53 | #include "TStyle.h" |
54 | #include "TTask.h" | |
55 | #include "TTree.h" | |
56 | #include "TSystem.h" | |
57 | #include "TFile.h" | |
58 | #include "TCanvas.h" | |
59 | #include "TPad.h" | |
60 | #include "TText.h" | |
61 | #include "TLine.h" | |
62 | #include "TPaveLabel.h" | |
63 | #include "TPaveText.h" | |
190c1f49 | 64 | #include "TFile.h" |
65 | #include <TF1.h> | |
66 | #include <TF2.h> | |
67 | #include "TTask.h" | |
68 | #include "TTree.h" | |
69 | #include "TSystem.h" | |
70 | #include "TROOT.h" | |
71 | #include "TFolder.h" | |
72 | #include "TNtuple.h" | |
73 | #include "TLeaf.h" | |
919162e6 | 74 | |
75 | #include "AliConst.h" | |
76 | #include "AliTOFConstants.h" | |
77 | #include "AliTOFPID.h" | |
78 | ||
190c1f49 | 79 | #include <stdlib.h> |
80 | #include <iostream.h> | |
81 | #include <fstream.h> | |
82 | ||
83 | ClassImp(AliTOFPID) | |
84 | ||
85 | //____________________________________________________________________________ | |
86 | AliTOFPID::AliTOFPID():TTask("AliTOFPID","") | |
87 | { | |
88 | // default ctor - set the pointer member vars to zero | |
89 | felectron = 0; | |
90 | fpion = 0; | |
91 | fkaon = 0; | |
92 | fproton = 0; | |
93 | fcut = 0; | |
94 | fhfile = 0; | |
95 | fNtuple = 0; | |
96 | fgen = 0; | |
97 | foutfileName = 0; | |
98 | } | |
99 | ||
100 | //____________________________________________________________________________ | |
792995c1 | 101 | AliTOFPID::AliTOFPID(char* headerFile, char *cutsFile, const Option_t* opt):TTask("AliTOFPID","") |
190c1f49 | 102 | { |
5fff655e | 103 | felectron = 0; |
104 | fpion = 0; | |
105 | fkaon = 0; | |
106 | fproton = 0; | |
190c1f49 | 107 | fhfile = TFile::Open(headerFile); // connect file with ntuple |
108 | fcut = TFile::Open(cutsFile); // connect file for cuts | |
109 | foutfileName=headerFile; | |
5fff655e | 110 | fNtuple = 0; |
111 | fgen = 0; | |
190c1f49 | 112 | |
113 | Init(opt); | |
114 | // add Task to //root/Tasks folder | |
115 | TTask * roottasks = (TTask*)gROOT->GetRootFolder()->FindObject("Tasks") ; | |
116 | roottasks->Add(this) ; | |
117 | } | |
118 | //____________________________________________________________________________ | |
119 | void AliTOFPID::Init(const Option_t* opt) | |
120 | { | |
121 | if(strstr(opt,"pp")){ | |
122 | if(fcut->GetKey("electron")) felectron = (TCutG*)fcut->Get("electron"); | |
123 | fcut->Print(); | |
124 | if(fcut->GetKey("pion")) fpion = (TCutG*)fcut->Get("pion"); | |
125 | fcut->Print(); | |
126 | } | |
127 | if(fcut->GetKey("kaon")) fkaon = (TCutG*)fcut->Get("kaon"); | |
128 | fcut->Print(); | |
129 | if(fcut->GetKey("proton")) fproton = (TCutG*)fcut->Get("proton"); | |
130 | ||
131 | gFile->ls(); | |
132 | fNtuple= (TNtuple*)fhfile->Get("Ntuple"); // get ntuple from file | |
133 | Int_t nvar = fNtuple->GetNvar(); cout <<"N of var.="<< nvar << endl; | |
134 | fNtuple->GetEvent(0); | |
135 | ||
136 | } | |
137 | ||
138 | //____________________________________________________________________________ | |
139 | AliTOFPID::~AliTOFPID() | |
140 | { | |
141 | // | |
142 | // dtor (free used memory) | |
143 | // | |
144 | ||
145 | if (felectron) | |
146 | { | |
147 | delete felectron; | |
148 | felectron = 0; | |
149 | } | |
150 | ||
151 | if (fpion) | |
152 | { | |
153 | delete fpion; | |
154 | fpion = 0; | |
155 | } | |
156 | ||
157 | if (fkaon) | |
158 | { | |
159 | delete fkaon; | |
160 | fkaon = 0; | |
161 | } | |
162 | ||
163 | if (fproton) | |
164 | { | |
165 | delete fproton; | |
166 | fproton = 0; | |
167 | } | |
168 | ||
169 | if (fcut) | |
170 | { | |
171 | delete fcut; | |
172 | fcut = 0; | |
173 | } | |
174 | ||
175 | ||
176 | if (fhfile) | |
177 | { | |
178 | delete fhfile; | |
179 | fhfile = 0; | |
180 | } | |
181 | ||
182 | ||
183 | if (fNtuple) | |
184 | { | |
185 | delete fNtuple; | |
186 | fNtuple = 0; | |
187 | } | |
188 | ||
189 | if (fgen) | |
190 | { | |
191 | delete fgen; | |
192 | fgen = 0; | |
193 | } | |
194 | ||
195 | if (foutfileName) | |
196 | { | |
197 | delete foutfileName; | |
198 | foutfileName = 0; | |
199 | } | |
200 | } | |
201 | ||
202 | ||
203 | //____________________________________________________________________________ | |
204 | void AliTOFPID::Exec(const Option_t *eventType, const Option_t *outputmode, const Option_t *outputsavemode) | |
205 | { | |
206 | // | |
207 | // Performs PID for TOF detector | |
208 | // | |
209 | ||
210 | fTask=1; | |
211 | TAxis *xaxis; | |
212 | ////////// Create histograms ///////////////// | |
213 | // for electron only in pp case | |
214 | TH1F* eleff=0; | |
919162e6 | 215 | TH1F* eleffls=0; |
190c1f49 | 216 | TH1F *elcon=0; |
217 | TH1F *elid=0; | |
218 | TH1F *elall=0; | |
219 | ||
220 | if(strstr(eventType,"pp")){ | |
221 | eleff = new TH1F("eleff","",10,0,0.6); | |
222 | xaxis=eleff->GetYaxis(); | |
223 | xaxis->SetLabelSize(.08); | |
919162e6 | 224 | eleffls = new TH1F("eleffls","",10,0,0.6); |
225 | xaxis=eleffls->GetYaxis(); | |
226 | xaxis->SetLabelSize(.08); | |
190c1f49 | 227 | elcon = new TH1F("elcon","",10,0,0.6); |
228 | xaxis=elcon->GetXaxis(); | |
229 | xaxis->SetLabelSize(.09); | |
230 | xaxis=elcon->GetYaxis(); | |
231 | xaxis->SetLabelSize(.08); | |
232 | elid = new TH1F("elid","Identified electrons",10,0,0.6); | |
233 | elall = new TH1F("elall","Electrons",10,0,0.6); | |
234 | } | |
235 | ||
236 | // pions | |
237 | TH1F *pit = new TH1F("pit","",15,0,2.5); //part. with tracks | |
238 | TH1F *pig = new TH1F("pig","",15,0,2.5); //part. in geometry acceptance | |
239 | TH1F *pieff = new TH1F("pieff","",15,0,2.5); //efficiency | |
919162e6 | 240 | TH1F *pieffls = new TH1F("pieffls","",15,0,2.5); //efficiency (last step) |
190c1f49 | 241 | xaxis=pieff->GetYaxis(); |
242 | xaxis->SetLabelSize(.08); | |
919162e6 | 243 | xaxis=pieffls->GetYaxis(); |
244 | xaxis->SetLabelSize(.08); | |
190c1f49 | 245 | TH1F *picon = new TH1F("picon","",15,0,2.5); //contamination |
246 | xaxis=picon->GetXaxis(); | |
247 | xaxis->SetLabelSize(.09); | |
248 | xaxis=picon->GetYaxis(); | |
249 | xaxis->SetLabelSize(.08); | |
250 | TH1F *piid = new TH1F("piid","Identified pions",15,0,2.5); | |
251 | TH1F *piall = new TH1F("piall","Pions",15,0,2.5); | |
252 | TH1F *pigen = new TH1F("pigen","Pions",15,0,2.5); | |
253 | xaxis=pigen->GetXaxis(); | |
254 | xaxis->SetLabelSize(.09); | |
255 | pigen->SetXTitle("P?t! (GeV/c)"); | |
256 | xaxis->SetTitleSize(.09); | |
257 | xaxis=pigen->GetYaxis(); | |
258 | xaxis->SetLabelSize(.08); | |
259 | //pigen->SetYTitle("1/P?t!dN/dP?t! (GeV/c)^-2!"); | |
260 | xaxis->SetTitleSize(.09); | |
261 | ||
262 | // kaons | |
263 | TH1F *kat = new TH1F("kat","",15,0,2.5); | |
264 | TH1F *kag = new TH1F("kag","",15,0,2.5); | |
265 | TH1F *kaeff = new TH1F("kaeff","",15,0,2.5); | |
266 | xaxis=kaeff->GetYaxis(); | |
267 | xaxis->SetLabelSize(.08); | |
919162e6 | 268 | TH1F *kaeffls = new TH1F("kaeffls","",15,0,2.5); |
269 | xaxis=kaeffls->GetYaxis(); | |
270 | xaxis->SetLabelSize(.08); | |
190c1f49 | 271 | TH1F *kacon = new TH1F("kacon","",15,0,2.5); |
272 | xaxis=kacon->GetXaxis(); | |
273 | xaxis->SetLabelSize(.09); | |
274 | xaxis=kacon->GetYaxis(); | |
275 | xaxis->SetLabelSize(.08); | |
276 | TH1F *kaid = new TH1F("kaid","Identified kaons",15,0,2.5); | |
277 | TH1F *kaall = new TH1F("kaall","Kaons",15,0,2.5); | |
278 | TH1F *kagen = new TH1F("kagen","Kaons",15,0,2.5); | |
279 | xaxis=kagen->GetXaxis(); | |
280 | xaxis->SetLabelSize(.09); | |
281 | kagen->SetXTitle("P?t! (GeV/c)"); | |
282 | xaxis->SetTitleSize(.09); | |
283 | xaxis=kagen->GetYaxis(); | |
284 | xaxis->SetLabelSize(.08); | |
285 | //kagen->SetYTitle("1/P?t!dN/dP?t! (GeV/c)^-2!"); | |
286 | xaxis->SetTitleSize(.09); | |
287 | ||
288 | // protons | |
289 | TH1F *prt = new TH1F("prt","",15,0,4.4); | |
290 | TH1F *prg = new TH1F("prg","",15,0,4.4); | |
291 | TH1F *preff = new TH1F("preff","",15,0,4.4); | |
292 | xaxis=preff->GetYaxis(); | |
293 | xaxis->SetLabelSize(.08); | |
919162e6 | 294 | TH1F *preffls = new TH1F("preffls","",15,0,4.4); |
295 | xaxis=preffls->GetYaxis(); | |
296 | xaxis->SetLabelSize(.08); | |
190c1f49 | 297 | TH1F *prcon = new TH1F("prcon","",15,0,4.4); |
298 | xaxis=prcon->GetXaxis(); | |
299 | xaxis->SetLabelSize(.09); | |
300 | xaxis=prcon->GetYaxis(); | |
301 | xaxis->SetLabelSize(.08); | |
302 | TH1F *prid = new TH1F("prid","Identified protons",15,0,4.4); | |
303 | TH1F *prall = new TH1F("prall","Protons",15,0,4.4); | |
304 | TH1F *prgen = new TH1F("prgen","Protons",15,0,4.4); | |
305 | xaxis=prgen->GetXaxis(); | |
306 | xaxis->SetLabelSize(.09); | |
307 | prgen->SetXTitle("P?t! (GeV/c)"); | |
308 | xaxis->SetTitleSize(.09); | |
309 | xaxis=prgen->GetYaxis(); | |
310 | xaxis->SetLabelSize(.08); | |
311 | //prgen->SetYTitle("1/P?t!dN/dP?t! (GeV/c)^-2!"); | |
312 | xaxis->SetTitleSize(.09); | |
313 | ||
314 | // 2-D histos (extrapolated mass vs momentum) | |
315 | TH2F* hel=0; | |
316 | if(strstr(eventType,"pp")){ | |
317 | hel = new TH2F("hel","",1000,-.2,1.2,1000,-4.2,0.); | |
318 | hel->SetXTitle("Mass (GeV/c^{2})"); | |
319 | hel->SetYTitle("Momentum (GeV/c)"); | |
320 | } | |
321 | TH2F *hpi = new TH2F("hpi","",1000,-.2,1.2,1000,-4.2,0.); | |
322 | hpi->SetXTitle("Mass (GeV/c^{2})"); | |
323 | hpi->SetYTitle("Momentum (GeV/c)"); | |
324 | TH2F *hka = new TH2F("hka","",1000,-.2,1.2,1000,-4.2,0.); | |
325 | hka->SetXTitle("Mass (GeV/c^{2})"); | |
326 | hka->SetYTitle("Momentum (GeV/c)"); | |
327 | TH2F *hpr = new TH2F("hpr","",1000,-.2,1.2,1000,-4.2,0.); | |
328 | hpr->SetXTitle("Mass (GeV/c^{2})"); | |
329 | hpr->SetYTitle("Momentum (GeV/c)"); | |
330 | ||
331 | ||
332 | fhfile->cd(); | |
333 | Int_t nparticles = (Int_t)fNtuple->GetEntries(); | |
334 | cout << " Number of nparticles =" << nparticles << endl; | |
335 | if (nparticles <= 0) return; | |
336 | ||
337 | Float_t ka=0, pi=0, pr=0, kaal=0, pial=0, pral=0; | |
338 | Float_t pitrack=0, pimag=0, pigeom=0; | |
339 | Float_t katrack=0, kamag=0, kageom=0; | |
340 | Float_t prtrack=0, prmag=0, prgeom=0; | |
341 | Float_t pif=0, kaf=0, prf=0, pin=0, kan=0, prn=0; | |
342 | Float_t px, py, pz, x, y, z, pdgcode, mass; | |
343 | Int_t event, matc, imam; | |
344 | Int_t indexOfFile=0, numfile=0; | |
345 | //////// Loop over tracks (particles)/////////////////////// | |
346 | ||
347 | for (Int_t i=0; i < nparticles; i++) { | |
348 | fNtuple->GetEvent(i); | |
349 | event=fNtuple->GetLeaf("event")->GetValue(); | |
350 | pdgcode=fNtuple->GetLeaf("ipart")->GetValue(); | |
351 | mass=fNtuple->GetLeaf("mext")->GetValue(0); | |
352 | matc=fNtuple->GetLeaf("matc")->GetValue(0); | |
353 | imam=fNtuple->GetLeaf("imam")->GetValue(0); | |
354 | px=fNtuple->GetLeaf("pxvtx")->GetValue(0); | |
355 | py=fNtuple->GetLeaf("pyvtx")->GetValue(0); | |
356 | pz=fNtuple->GetLeaf("pzvtx")->GetValue(0); | |
357 | x=fNtuple->GetLeaf("xvtx")->GetValue(0); | |
358 | y=fNtuple->GetLeaf("yvtx")->GetValue(0); | |
359 | z=fNtuple->GetLeaf("zvtx")->GetValue(0); | |
360 | Float_t pvtx=TMath::Sqrt(px*px+py*py+pz*pz); | |
361 | Float_t ptvtx=TMath::Sqrt(px*px+py*py); | |
362 | Float_t mt=0.; | |
363 | Int_t abspdgcode=TMath::Abs(pdgcode); | |
364 | switch(abspdgcode){ | |
365 | case 321: | |
366 | mt=TMath::Sqrt(AliTOFConstants::fgkKaonMass*AliTOFConstants::fgkKaonMass+px*px+py*py); | |
367 | break; | |
368 | case 2212: | |
369 | mt=TMath::Sqrt(AliTOFConstants::fgkProtonMass*AliTOFConstants::fgkProtonMass+px*px+py*py); | |
370 | break; | |
371 | case 11: | |
372 | mt=TMath::Sqrt(AliTOFConstants::fgkElectronMass*AliTOFConstants::fgkElectronMass+px*px+py*py); | |
373 | break; | |
374 | default: | |
375 | mt=TMath::Sqrt(AliTOFConstants::fgkPionMass*AliTOFConstants::fgkPionMass+px*px+py*py); | |
376 | break; | |
377 | } | |
378 | ||
379 | if (imam == 0 && pz !=0 && TMath::ATan(TMath::Abs(ptvtx/pz))>TMath::Pi()*45./180.) | |
380 | {//only primary +/-45 | |
381 | if (fkaon->IsInside(mass,-pvtx) && matc>2) { | |
382 | ka++; | |
383 | if (fTask!=2) kaid->Fill(pvtx); else {kaid->Fill(ptvtx);} | |
919162e6 | 384 | if (TMath::Abs(pdgcode)==321) {kaf++; kaeff->Fill(pvtx); kaeffls->Fill(pvtx);} else {kan++; kacon->Fill(pvtx);} |
190c1f49 | 385 | } else if (fproton->IsInside(mass,-pvtx) && matc>1) { |
386 | pr++; | |
387 | if (fTask!=2) prid->Fill(pvtx); else | |
388 | {prid->Fill(ptvtx);} | |
919162e6 | 389 | if (TMath::Abs(pdgcode)==2212) {prf++; preff->Fill(pvtx); preffls->Fill(pvtx);} else {prn++; prcon->Fill(pvtx);} |
190c1f49 | 390 | } else if (strstr(eventType,"pp") && felectron->IsInside(mass,-pvtx) && matc>2) {elid->Fill(pvtx); |
919162e6 | 391 | if (strstr(eventType,"pp") && TMath::Abs(pdgcode)==11) {eleff->Fill(pvtx); eleffls->Fill(pvtx);} else {elcon->Fill(pvtx);} |
190c1f49 | 392 | } else if (matc>0) { |
393 | //||matc==-4&&fpion->IsInside(mass,-pvtx) | |
394 | pi++; | |
395 | if (fTask!=2) piid->Fill(pvtx); else {piid->Fill(ptvtx);} | |
919162e6 | 396 | if (TMath::Abs(pdgcode)==211) {pif++; pieff->Fill(pvtx); pieffls->Fill(pvtx);} else {pin++; picon->Fill(pvtx);} |
190c1f49 | 397 | } |
398 | ||
399 | //////////////// Normalization histograms //////////////////// | |
400 | if (strstr(eventType,"pp") && TMath::Abs(pdgcode)==11) { | |
401 | if (fTask!=2) elall->Fill(pvtx); else elall->Fill(ptvtx); | |
402 | if (fTask==1) hel->Fill(mass,-pvtx); | |
403 | ||
404 | } else if (TMath::Abs(pdgcode)==211) { | |
405 | pial++; | |
406 | if (matc!=0) { | |
407 | pitrack++; | |
408 | pit->Fill(pvtx); | |
409 | if (matc!=-1) { | |
410 | pimag++; | |
411 | if (matc>-2 || matc==-4) { | |
412 | pigeom++; | |
413 | pig->Fill(pvtx); | |
414 | } | |
415 | } | |
416 | } | |
417 | if (fTask!=2) piall->Fill(pvtx); | |
418 | else { | |
419 | piall->Fill(ptvtx,1/ptvtx); | |
420 | } | |
421 | if (fTask==1) hpi->Fill(mass,-pvtx); | |
422 | ||
423 | } else if (TMath::Abs(pdgcode)==321) { | |
424 | kaal++; | |
425 | if (matc!=0) { | |
426 | katrack++; | |
427 | kat->Fill(pvtx); | |
428 | if (matc!=-1) { | |
429 | kamag++; | |
430 | if (matc>-2 || matc==-4) { | |
431 | kageom++; | |
432 | kag->Fill(pvtx); | |
433 | } | |
434 | } | |
435 | } | |
436 | if (fTask!=2) kaall->Fill(pvtx); | |
437 | else { | |
438 | kaall->Fill(ptvtx,1/ptvtx); | |
439 | } | |
440 | if (fTask==1) hka->Fill(mass,-pvtx); | |
441 | ||
442 | } else if (TMath::Abs(pdgcode)==2212) { | |
443 | pral++; | |
444 | if (matc!=0) { | |
445 | prtrack++; | |
446 | prt->Fill(pvtx); | |
447 | if (matc!=-1) { | |
448 | prmag++; | |
449 | if (matc>-2 || matc==-4) { | |
450 | prgeom++; | |
451 | prg->Fill(pvtx); | |
452 | } | |
453 | } | |
454 | } | |
455 | if (fTask!=2) prall->Fill(pvtx); | |
456 | else { | |
457 | prall->Fill(ptvtx,1/ptvtx); | |
458 | } | |
459 | if (fTask==1) hpr->Fill(mass,-pvtx);} | |
460 | ||
461 | }// End of cuts appling | |
462 | }// End of loop over particles | |
463 | ||
464 | // display results | |
465 | cout<< "Pions in 45-135 deg. "<< pial <<" (100%)"<< endl; | |
466 | cout<< "Pions that have track "<< pitrack/pial*100 <<" %"<<endl; | |
467 | cout<< "Magnetic field "<< pimag/pial*100 <<" %"<<endl; | |
468 | cout<< "Geometry efficiency "<< pigeom/pial*100 <<" %"<<endl; | |
469 | cout<< "PID procedure "<< pif/pial*100 <<" %"<<endl; | |
470 | cout<< "Contamination "<< pin/pi*100 <<" %"<<endl; | |
471 | cout<<endl; | |
472 | cout<< "Kaons in 45-135 deg. "<< kaal <<" (100%)"<< endl; | |
473 | cout<< "Kaons that have track "<< katrack/kaal*100 <<" %"<<endl; | |
474 | cout<< "Magnetic field "<< kamag/kaal*100 <<" %"<<endl; | |
475 | cout<< "Geometry efficiency "<< kageom/kaal*100 <<" %"<<endl; | |
476 | cout<< "PID procedure(+decays) "<< kaf/kaal*100 <<" %"<<endl; | |
477 | cout<< "Contamination "<< kan/ka*100 <<" %"<<endl; | |
478 | cout<<endl; | |
479 | cout<< "Protons in 45-135 deg. "<< pral <<" (100%)"<< endl; | |
480 | cout<< "Protons that have track "<< prtrack/pral*100 <<" %"<<endl; | |
481 | cout<< "Magnetic field "<< prmag/pral*100 <<" %"<<endl; | |
482 | cout<< "Geometry efficiency "<< prgeom/pral*100 <<" %"<<endl; | |
483 | cout<< "PID procedure "<< prf/pral*100 <<" %"<<endl; | |
484 | cout<< "Contamination "<< prn/pr*100 <<" %"<<endl; | |
485 | cout<<endl; | |
486 | cout<< "All part. in 45-135 deg. "<< pial+kaal+pral <<" (100%)"<< endl; | |
487 | cout<< "All part. that have track "<< (pitrack+katrack+prtrack)/(pial+kaal+pral)*100 <<" %"<<endl; | |
488 | cout<< "Magnetic field "<< (pimag+kamag+prmag)/(pial+kaal+pral)*100 <<" %"<<endl; | |
489 | cout<< "Geometry efficiency "<< (pigeom+kageom+prgeom)/(pial+kaal+pral)*100 <<" %"<<endl; | |
490 | cout<< "PID procedure "<< (pif+kaf+prf)/(pial+kaal+pral)*100 <<" %"<<endl; | |
491 | cout<< "Contamination "<< (pin+kan+prn)/(pi+ka+pr)*100 <<" %"<<endl; | |
492 | cout<<endl; | |
493 | ||
919162e6 | 494 | TCanvas *pidCanvas=0; // overall |
495 | TCanvas *pidCanvasls=0; // last step of PID | |
190c1f49 | 496 | TCanvas *momvsmassCanvas=0; |
919162e6 | 497 | // overall Efficiency |
190c1f49 | 498 | TPad *tp=0; |
499 | TPad *pad1=0; | |
500 | TPad *pad2=0; | |
501 | TPad *pad3=0; | |
502 | TPad *pad4=0; | |
503 | TPad *pad5=0; | |
504 | TPad *pad6=0; | |
505 | TPad *pad7=0; | |
506 | TPad *pad8=0; | |
507 | ||
919162e6 | 508 | // last step Efficiency |
509 | TPad *tpls=0; | |
510 | TPad *pad1ls=0; | |
511 | TPad *pad2ls=0; | |
512 | TPad *pad3ls=0; | |
513 | TPad *pad4ls=0; | |
514 | TPad *pad5ls=0; | |
515 | TPad *pad6ls=0; | |
516 | TPad *pad7ls=0; | |
517 | TPad *pad8ls=0; | |
518 | ||
190c1f49 | 519 | //////////////////////// For fTask 1 /////////////////////////// |
520 | if (fTask==1) { | |
521 | if (strstr(eventType,"pp")){ | |
522 | eleff->Divide(elall); | |
919162e6 | 523 | eleffls->Divide(elid); |
190c1f49 | 524 | } |
919162e6 | 525 | // overall efficiency |
190c1f49 | 526 | pieff->Divide(piall); |
527 | kaeff->Divide(kaall); | |
528 | preff->Divide(prall); | |
919162e6 | 529 | |
530 | // last step efficiency | |
531 | pieffls->Divide(piid); | |
532 | kaeffls->Divide(kaid); | |
533 | preffls->Divide(prid); | |
534 | ||
190c1f49 | 535 | pit->Divide(piall); |
536 | kat->Divide(kaall); | |
537 | prt->Divide(prall); | |
538 | pig->Divide(piall); | |
539 | kag->Divide(kaall); | |
540 | prg->Divide(prall); | |
541 | if (strstr(eventType,"pp")){ | |
542 | elcon->Divide(elid); | |
543 | } | |
919162e6 | 544 | // contamination |
190c1f49 | 545 | picon->Divide(piid); |
546 | kacon->Divide(kaid); | |
547 | prcon->Divide(prid); | |
919162e6 | 548 | |
190c1f49 | 549 | //Create a canvas, set the view range, show histograms |
919162e6 | 550 | // for overall PID |
190c1f49 | 551 | if (indexOfFile==0) { |
919162e6 | 552 | // overall Efficiency canvas |
553 | pidCanvas = new TCanvas("pidCanvas","PID (Overall)",10,100,800,500); | |
190c1f49 | 554 | pidCanvas->SetBorderMode(0); |
555 | pidCanvas->SetBorderSize(0); | |
556 | pidCanvas->SetFillColor(0); | |
557 | pidCanvas->SetFillStyle(0); | |
919162e6 | 558 | |
559 | // last step Efficiency canvas | |
560 | pidCanvasls = new TCanvas("pidCanvasls","PID (Last Step)",10,100,800,500); | |
561 | pidCanvasls->SetBorderMode(0); | |
562 | pidCanvasls->SetBorderSize(0); | |
563 | pidCanvasls->SetFillColor(0); | |
564 | pidCanvasls->SetFillStyle(0); | |
565 | ||
566 | if (strstr(outputmode,"visual")) { | |
567 | pidCanvas->Draw(); | |
568 | pidCanvasls->Draw(); | |
569 | } | |
570 | ||
190c1f49 | 571 | Float_t pxs=0.25+0.125; //X size of pad |
919162e6 | 572 | Float_t pys=0.5+0.055; //y size of pad |
573 | // overall | |
574 | tp = new TPad("histo","Histograms",.1,.1,.9,.9); | |
575 | // last step | |
576 | tpls = new TPad("histo","Histograms",.1,.1,.9,.9); | |
577 | ||
190c1f49 | 578 | if (strstr(eventType,"Pb-Pb")){ |
919162e6 | 579 | // overall efficiency |
190c1f49 | 580 | //pad1 = new TPad("pad1","electron efficiency",0.,.5-.055,0.+pxs,.5-.055+pys-.00001,0,0,0); |
581 | pad2 = new TPad("pad2","pion efficiency",0.,0.5-.055,0.+pxs,0.5-.055+pys-.00001,0,0,0); | |
582 | pad3 = new TPad("pad3","kaon efficiency",0.3,0.5-.055,0.3+pxs,0.5-.055+pys-.00001,0,0,0); | |
583 | pad4 = new TPad("pad4","proton efficiency",0.6,0.5-.055,0.6+pxs,0.5-.055+pys-.00001,0,0,0); | |
919162e6 | 584 | |
585 | // contamination | |
190c1f49 | 586 | //pad5 = new TPad("pad5","electron contamination",0.,0.,0.+pxs,0.+pys,0,0,0); |
587 | pad6 = new TPad("pad6","pion contamination",0.,0.,0.+pxs,0.+pys,0,0,0); | |
588 | pad7 = new TPad("pad7","kaon contamination",.3,0.,0.3+pxs,0.+pys,0,0,0); | |
589 | pad8 = new TPad("pad8","proton contamination",.6,0.,0.6+pxs,0.+pys,0,0,0); | |
919162e6 | 590 | |
591 | // we repeat the same for the last step of PID | |
592 | //pad1ls = new TPad("pad1ls","electron efficiency",0.,.5-.055,0.+pxs,.5-.055+pys-.00001,0,0,0); | |
593 | pad2ls = new TPad("pad2ls","pion efficiency",0.,0.5-.055,0.+pxs,0.5-.055+pys-.00001,0,0,0); | |
594 | pad3ls = new TPad("pad3ls","kaon efficiency",0.3,0.5-.055,0.3+pxs,0.5-.055+pys-.00001,0,0,0); | |
595 | pad4ls = new TPad("pad4ls","proton efficiency",0.6,0.5-.055,0.6+pxs,0.5-.055+pys-.00001,0,0,0); | |
596 | ||
597 | // contamination | |
598 | //pad5 = new TPad("pad5","electron contamination",0.,0.,0.+pxs,0.+pys,0,0,0); | |
599 | pad6ls = new TPad("pad6ls","pion contamination",0.,0.,0.+pxs,0.+pys,0,0,0); | |
600 | pad7ls = new TPad("pad7ls","kaon contamination",.3,0.,0.3+pxs,0.+pys,0,0,0); | |
601 | pad8ls = new TPad("pad8ls","proton contamination",.6,0.,0.6+pxs,0.+pys,0,0,0); | |
602 | ||
190c1f49 | 603 | } |
604 | ||
605 | if (strstr(eventType,"pp")){ | |
919162e6 | 606 | // overall Efficiency |
190c1f49 | 607 | pad1 = new TPad("pad1","electron efficiency",0.,.5-.055,0.25+0.045,1.,0,0,0); |
608 | pad2 = new TPad("pad2","pion efficiency",0.25-0.015,0.5-.055,0.5+0.03,1.,0,0,0); | |
609 | pad3 = new TPad("pad3","kaon efficiency",0.5-0.03,0.5-.055,0.75+0.015,1.,0,0,0); | |
610 | pad4 = new TPad("pad4","proton efficiency",0.75-0.045,0.5-.055,1.,1.,0,0,0); | |
919162e6 | 611 | |
612 | // contamination | |
190c1f49 | 613 | pad5 = new TPad("pad5","electron contamination",0.,0.,.25+.045,.5+.055,0,0,0); |
614 | pad6 = new TPad("pad6","pion contamination",.25-.015,0.,.5+.03,.5+.055,0,0,0); | |
615 | pad7 = new TPad("pad7","kaon contamination",.5-.03,0.,.75+.015,.5+.055,0,0,0); | |
616 | pad8 = new TPad("pad8","proton contamination",.75-.045,0.,1.,.5+.055,0,0,0); | |
919162e6 | 617 | |
618 | ||
619 | // we repeat the same for the last step of PID | |
620 | pad1ls = new TPad("pad1ls","electron efficiency",0.,.5-.055,0.25+0.045,1.,0,0,0); | |
621 | pad2ls = new TPad("pad2ls","pion efficiency",0.25-0.015,0.5-.055,0.5+0.03,1.,0,0,0); | |
622 | pad3ls = new TPad("pad3ls","kaon efficiency",0.5-0.03,0.5-.055,0.75+0.015,1.,0,0,0); | |
623 | pad4ls = new TPad("pad4ls","proton efficiency",0.75-0.045,0.5-.055,1.,1.,0,0,0); | |
624 | ||
625 | // contamination | |
626 | pad5ls = new TPad("pad5ls","electron contamination",0.,0.,.25+.045,.5+.055,0,0,0); | |
627 | pad6ls = new TPad("pad6ls","pion contamination",.25-.015,0.,.5+.03,.5+.055,0,0,0); | |
628 | pad7ls = new TPad("pad7ls","kaon contamination",.5-.03,0.,.75+.015,.5+.055,0,0,0); | |
629 | pad8ls = new TPad("pad8ls","proton contamination",.75-.045,0.,1.,.5+.055,0,0,0); | |
630 | ||
631 | ||
190c1f49 | 632 | } |
633 | ||
919162e6 | 634 | // last step of PID |
635 | gStyle->SetOptStat(0); | |
636 | tpls->SetFillStyle(0); | |
637 | tpls->SetFillColor(0); | |
638 | tpls->SetBorderSize(0); | |
639 | pidCanvasls->cd(); | |
640 | TText *text1ls= new TText(.1,.2,"Contamination Efficiency"); | |
641 | text1ls->SetTextAngle(90); | |
642 | if (strstr(outputmode,"visual")) text1ls->Draw(); | |
643 | //tp->DrawText(.3,.0,"p (GeV/c"); | |
644 | pidCanvasls->cd(); | |
645 | TText *text2ls= new TText(.8,.0,"p (GeV/c)"); | |
646 | if (strstr(outputmode,"visual")) { | |
647 | text2ls->Draw(); | |
648 | tpls->Draw(); | |
649 | } | |
650 | ||
651 | // overall | |
190c1f49 | 652 | gStyle->SetOptStat(0); |
653 | tp->SetFillStyle(0); | |
654 | tp->SetFillColor(0); | |
655 | tp->SetBorderSize(0); | |
656 | pidCanvas->cd(); | |
657 | TText *text1= new TText(.1,.2,"Contamination Efficiency"); | |
658 | text1->SetTextAngle(90); | |
659 | if (strstr(outputmode,"visual")) text1->Draw(); | |
660 | //tp->DrawText(.3,.0,"p (GeV/c"); | |
661 | pidCanvas->cd(); | |
662 | TText *text2= new TText(.8,.0,"p (GeV/c)"); | |
663 | if (strstr(outputmode,"visual")) { | |
664 | text2->Draw(); | |
665 | tp->Draw(); | |
666 | } | |
919162e6 | 667 | |
190c1f49 | 668 | } |
669 | ||
670 | ||
919162e6 | 671 | // drawing histos for overall case |
190c1f49 | 672 | if (strstr(eventType,"pp")){ |
673 | pad1->SetFillStyle(0); | |
674 | pad1->SetFillColor(10); | |
675 | tp->cd(); | |
676 | if (strstr(outputmode,"visual")) pad1->Draw(); | |
677 | pad1->cd(); | |
678 | //eleff->SetLineWidth(15); | |
679 | eleff->SetLineWidth(3); | |
680 | eleff->SetMaximum(1.); | |
681 | if (indexOfFile==0) { | |
682 | //eleff->SetFillColor(33); | |
683 | //eleff->SetFillColor(30); | |
684 | //eleff->SetFillColor(0); | |
685 | //eleff->SetLineColor(4); | |
686 | eleff->SetLineColor(1); | |
919162e6 | 687 | if (strstr(outputmode,"visual")) eleff->Draw(); |
688 | } else { | |
190c1f49 | 689 | eleff->SetFillStyle(0); |
690 | eleff->SetFillColor(30); | |
691 | if (indexOfFile==2) { | |
692 | eleff->SetLineColor(3); | |
693 | eleff->SetLineWidth(3); | |
694 | } else { | |
695 | //eleff->SetLineColor(2); | |
696 | eleff->SetLineColor(1); | |
697 | eleff->SetLineStyle(2);} | |
919162e6 | 698 | if (strstr(outputmode,"visual")) eleff->Draw("same"); |
699 | } | |
190c1f49 | 700 | // eleff->Fit("pol1"); |
701 | TPaveLabel *ellab = new TPaveLabel(.42,.85,.52,1.05,"e"); | |
702 | if (strstr(outputmode,"visual")) ellab->Draw(); | |
703 | } | |
704 | ||
705 | pad2->SetFillStyle(0); | |
706 | pad2->SetFillColor(10); | |
707 | tp->cd(); | |
708 | if (strstr(outputmode,"visual")) pad2->Draw(); | |
709 | pad2->cd(); | |
710 | pieff->SetLineWidth(3); | |
711 | pieff->SetMaximum(1.); | |
712 | if (indexOfFile==0) { | |
713 | pieff->SetLineColor(1); | |
714 | if (strstr(outputmode,"visual")) pieff->Draw(); | |
715 | } else { | |
716 | pieff->SetFillStyle(0); | |
717 | pieff->SetFillColor(30); | |
718 | if (indexOfFile==1) { | |
719 | pieff->SetLineStyle(2); | |
720 | } else if (indexOfFile==2) { | |
721 | pieff->SetLineStyle(3); | |
722 | } else { | |
723 | pieff->SetLineStyle(4);} | |
919162e6 | 724 | if (strstr(outputmode,"visual")) pieff->Draw("same"); |
725 | } | |
190c1f49 | 726 | TPaveLabel *pilab = new TPaveLabel(1.7,.85,2.2,1.05,"#pi"); |
727 | if (strstr(outputmode,"visual")) pilab->Draw(); | |
728 | ||
729 | pad3->SetFillStyle(0); | |
730 | pad3->SetFillColor(10); | |
731 | tp->cd(); | |
732 | if (strstr(outputmode,"visual")) pad3->Draw(); | |
733 | pad3->cd(); | |
734 | kaeff->SetLineWidth(3); | |
735 | kaeff->SetMaximum(1.); | |
736 | if (indexOfFile==0) { | |
737 | kaeff->SetLineColor(1); | |
738 | if (strstr(outputmode,"visual")) kaeff->Draw(); | |
739 | } else { | |
740 | kaeff->SetFillStyle(0); | |
741 | kaeff->SetFillColor(30); | |
742 | if (indexOfFile==1) { | |
743 | kaeff->SetLineStyle(2); | |
744 | } else if (indexOfFile==2) { | |
745 | kaeff->SetLineStyle(3); | |
746 | } else { | |
747 | kaeff->SetLineStyle(4);} | |
919162e6 | 748 | if (strstr(outputmode,"visual")) kaeff->Draw("same"); |
749 | } | |
190c1f49 | 750 | TPaveLabel *kalab = new TPaveLabel(1.7,.85,2.2,1.05,"K"); |
751 | if (strstr(outputmode,"visual")) kalab->Draw(); | |
752 | ||
753 | pad4->SetFillStyle(0); | |
754 | pad4->SetFillColor(10); | |
755 | tp->cd(); | |
756 | if (strstr(outputmode,"visual")) pad4->Draw(); | |
757 | pad4->cd(); | |
758 | preff->SetLineWidth(3); | |
759 | preff->SetMaximum(1.); | |
760 | if (indexOfFile==0) { | |
761 | preff->SetLineColor(1); | |
762 | if (strstr(outputmode,"visual")) preff->Draw(); | |
763 | } else { | |
764 | preff->SetFillStyle(0); | |
765 | preff->SetFillColor(30); | |
766 | if (indexOfFile==1) { | |
767 | preff->SetLineStyle(2); | |
768 | } else if (indexOfFile==2) { | |
769 | preff->SetLineStyle(3); | |
770 | } else { | |
771 | preff->SetLineStyle(4);} | |
919162e6 | 772 | if (strstr(outputmode,"visual")) preff->Draw("same"); |
773 | } | |
190c1f49 | 774 | TPaveLabel *prlab = new TPaveLabel(3.2,.85,4.1,1.05,"p"); |
775 | if (strstr(outputmode,"visual")) prlab->Draw(); | |
776 | ||
777 | if (strstr(eventType,"pp")){ | |
778 | pad5->SetFillStyle(0); | |
779 | pad5->SetFillColor(10); | |
780 | tp->cd(); | |
781 | if (strstr(outputmode,"visual")) pad5->Draw(); | |
782 | pad5->cd(); | |
783 | //elcon->SetLineWidth(5); | |
784 | elcon->SetLineWidth(3); | |
785 | elcon->SetMaximum(1.); | |
786 | if (indexOfFile==0) { | |
787 | //elcon->SetFillColor(33); | |
788 | //elcon->SetFillColor(30); | |
789 | //elcon->SetLineColor(4); | |
790 | elcon->SetLineColor(1); | |
919162e6 | 791 | if (strstr(outputmode,"visual")) elcon->Draw(); |
792 | } else { | |
190c1f49 | 793 | elcon->SetFillStyle(4000); |
794 | elcon->SetFillColor(30); | |
795 | if (indexOfFile==2) { | |
796 | elcon->SetLineColor(3); | |
797 | elcon->SetLineWidth(3); | |
798 | } else { | |
799 | elcon->SetLineColor(2); | |
800 | elcon->SetLineStyle(2);} | |
919162e6 | 801 | if (strstr(outputmode,"visual")) elcon->Draw("same"); |
802 | } | |
190c1f49 | 803 | } |
804 | ||
805 | ||
806 | pad6->SetFillStyle(0); | |
807 | pad6->SetFillColor(10); | |
808 | tp->cd(); | |
809 | if (strstr(outputmode,"visual")) pad6->Draw(); | |
810 | pad6->cd(); | |
811 | picon->SetLineWidth(3); | |
812 | picon->SetMaximum(1.); | |
813 | if (indexOfFile==0) { | |
814 | picon->SetLineColor(1); | |
919162e6 | 815 | if (strstr(outputmode,"visual")) picon->Draw(); |
816 | } else { | |
190c1f49 | 817 | picon->SetFillStyle(0); |
818 | picon->SetFillColor(30); | |
819 | if (indexOfFile==1) { | |
820 | picon->SetLineStyle(2); | |
821 | } else if (indexOfFile==2) { | |
822 | picon->SetLineStyle(3); | |
823 | } else { | |
824 | picon->SetLineStyle(4); | |
825 | TLine* line; | |
826 | line = new TLine(0.2,0.85,0.9,0.85); | |
827 | line->SetLineStyle(2); | |
828 | line->SetLineWidth(1); | |
829 | if (strstr(outputmode,"visual")) line->Draw(); | |
830 | line = new TLine(0.2,0.65,0.9,0.65); | |
831 | line->SetLineWidth(2); | |
832 | if (strstr(outputmode,"visual")) line->Draw(); | |
833 | line = new TLine(0.2,0.45,0.9,0.45); | |
834 | line->SetLineStyle(3); | |
835 | line->SetLineWidth(1); | |
836 | if (strstr(outputmode,"visual")) line->Draw(); | |
837 | line = new TLine(0.2,0.25,0.9,0.25); | |
838 | line->SetLineStyle(4); | |
839 | line->SetLineWidth(1); | |
840 | if (strstr(outputmode,"visual")) line->Draw(); | |
841 | TPaveLabel *pl = new TPaveLabel(1.1,0.8,1.9,0.9,"100 ps","br"); | |
842 | pl->SetFillColor(18); | |
843 | pl->SetTextSize(0.99); | |
844 | if (strstr(outputmode,"visual")) pl->Draw(); | |
845 | pl = new TPaveLabel(1.1,0.6,1.9,0.7,"150 ps","br"); | |
846 | pl->SetFillColor(18); | |
847 | pl->SetTextSize(0.99); | |
848 | if (strstr(outputmode,"visual")) pl->Draw(); | |
849 | pl = new TPaveLabel(1.1,0.4,1.9,0.5,"200 ps","br"); | |
850 | pl->SetFillColor(18); | |
851 | pl->SetTextSize(0.99); | |
852 | if (strstr(outputmode,"visual")) pl->Draw(); | |
853 | pl = new TPaveLabel(1.1,0.2,1.9,0.3,"300 ps","br"); | |
854 | pl->SetFillColor(18); | |
855 | pl->SetTextSize(0.99); | |
856 | if (strstr(outputmode,"visual")) pl->Draw(); | |
857 | } | |
919162e6 | 858 | if (strstr(outputmode,"visual")) picon->Draw("same"); |
859 | } | |
190c1f49 | 860 | |
861 | pad7->SetFillStyle(0); | |
862 | pad7->SetFillColor(10); | |
863 | tp->cd(); | |
864 | if (strstr(outputmode,"visual")) pad7->Draw(); | |
865 | pad7->cd(); | |
866 | kacon->SetLineWidth(3); | |
867 | kacon->SetMaximum(1.); | |
868 | if (indexOfFile==0) { | |
869 | kacon->SetLineColor(1); | |
919162e6 | 870 | if (strstr(outputmode,"visual")) kacon->Draw(); |
871 | } else { | |
190c1f49 | 872 | kacon->SetFillStyle(0); |
873 | kacon->SetFillColor(30); | |
874 | if (indexOfFile==1) { | |
875 | kacon->SetLineStyle(2); | |
876 | } else if (indexOfFile==2) { | |
877 | kacon->SetLineStyle(3); | |
878 | } else { | |
879 | kacon->SetLineStyle(4);} | |
919162e6 | 880 | if (strstr(outputmode,"visual")) kacon->Draw("same"); |
881 | } | |
190c1f49 | 882 | |
883 | pad8->SetFillStyle(0); | |
884 | pad8->SetFillColor(10); | |
885 | tp->cd(); | |
886 | if (strstr(outputmode,"visual")) pad8->Draw(); | |
887 | pad8->cd(); | |
888 | prcon->SetLineWidth(3); | |
889 | prcon->SetMaximum(1.); | |
890 | if (indexOfFile==0) { | |
891 | prcon->SetLineColor(1); | |
919162e6 | 892 | if (strstr(outputmode,"visual")) prcon->Draw(); |
893 | } else { | |
190c1f49 | 894 | prcon->SetFillStyle(0); |
895 | prcon->SetFillColor(30); | |
896 | if (indexOfFile==1) { | |
897 | prcon->SetLineStyle(2); | |
898 | } else if (indexOfFile==2) { | |
899 | prcon->SetLineStyle(3); | |
900 | } else { | |
901 | prcon->SetLineStyle(4);} | |
919162e6 | 902 | if (strstr(outputmode,"visual")) prcon->Draw("same"); |
903 | } | |
904 | ||
905 | ||
906 | ||
907 | // last step case (it is just a copy of the previous lines) | |
908 | // moving to pidCanvasls canvas | |
909 | pidCanvasls->cd(); | |
910 | // drawing histos for overall case | |
911 | if (strstr(eventType,"pp")){ | |
912 | pad1ls->SetFillStyle(0); | |
913 | pad1ls->SetFillColor(10); | |
914 | tpls->cd(); | |
915 | if (strstr(outputmode,"visual")) pad1ls->Draw(); | |
916 | pad1ls->cd(); | |
917 | //eleff->SetLineWidth(15); | |
918 | eleffls->SetLineWidth(3); | |
919 | eleffls->SetMaximum(1.); | |
920 | if (indexOfFile==0) { | |
921 | //eleff->SetFillColor(33); | |
922 | //eleff->SetFillColor(30); | |
923 | //eleff->SetFillColor(0); | |
924 | //eleff->SetLineColor(4); | |
925 | eleffls->SetLineColor(1); | |
926 | if (strstr(outputmode,"visual")) eleffls->Draw(); | |
927 | } else { | |
928 | eleffls->SetFillStyle(0); | |
929 | eleffls->SetFillColor(30); | |
930 | if (indexOfFile==2) { | |
931 | eleffls->SetLineColor(3); | |
932 | eleffls->SetLineWidth(3); | |
933 | } else { | |
934 | //eleff->SetLineColor(2); | |
935 | eleffls->SetLineColor(1); | |
936 | eleffls->SetLineStyle(2);} | |
937 | if (strstr(outputmode,"visual")) eleffls->Draw("same"); | |
938 | } | |
939 | // eleff->Fit("pol1"); | |
940 | TPaveLabel *ellabls = new TPaveLabel(.42,.85,.52,1.05,"e"); | |
941 | if (strstr(outputmode,"visual")) ellabls->Draw(); | |
942 | } | |
943 | ||
944 | pad2ls->SetFillStyle(0); | |
945 | pad2ls->SetFillColor(10); | |
946 | tpls->cd(); | |
947 | if (strstr(outputmode,"visual")) pad2ls->Draw(); | |
948 | pad2ls->cd(); | |
949 | pieffls->SetLineWidth(3); | |
950 | pieffls->SetMaximum(1.); | |
951 | if (indexOfFile==0) { | |
952 | pieffls->SetLineColor(1); | |
953 | if (strstr(outputmode,"visual")) pieffls->Draw(); | |
954 | } else { | |
955 | pieffls->SetFillStyle(0); | |
956 | pieffls->SetFillColor(30); | |
957 | if (indexOfFile==1) { | |
958 | pieffls->SetLineStyle(2); | |
959 | } else if (indexOfFile==2) { | |
960 | pieffls->SetLineStyle(3); | |
961 | } else { | |
962 | pieffls->SetLineStyle(4);} | |
963 | if (strstr(outputmode,"visual")) pieffls->Draw("same"); | |
964 | } | |
965 | TPaveLabel *pilabls = new TPaveLabel(1.7,.85,2.2,1.05,"#pi"); | |
966 | if (strstr(outputmode,"visual")) pilabls->Draw(); | |
967 | ||
968 | pad3ls->SetFillStyle(0); | |
969 | pad3ls->SetFillColor(10); | |
970 | tpls->cd(); | |
971 | if (strstr(outputmode,"visual")) pad3ls->Draw(); | |
972 | pad3ls->cd(); | |
973 | kaeffls->SetLineWidth(3); | |
974 | kaeffls->SetMaximum(1.); | |
975 | if (indexOfFile==0) { | |
976 | kaeffls->SetLineColor(1); | |
977 | if (strstr(outputmode,"visual")) kaeffls->Draw(); | |
978 | } else { | |
979 | kaeffls->SetFillStyle(0); | |
980 | kaeffls->SetFillColor(30); | |
981 | if (indexOfFile==1) { | |
982 | kaeffls->SetLineStyle(2); | |
983 | } else if (indexOfFile==2) { | |
984 | kaeffls->SetLineStyle(3); | |
985 | } else { | |
986 | kaeffls->SetLineStyle(4);} | |
987 | if (strstr(outputmode,"visual")) kaeffls->Draw("same"); | |
988 | } | |
989 | TPaveLabel *kalabls = new TPaveLabel(1.7,.85,2.2,1.05,"K"); | |
990 | if (strstr(outputmode,"visual")) kalabls->Draw(); | |
991 | ||
992 | pad4ls->SetFillStyle(0); | |
993 | pad4ls->SetFillColor(10); | |
994 | tpls->cd(); | |
995 | if (strstr(outputmode,"visual")) pad4ls->Draw(); | |
996 | pad4ls->cd(); | |
997 | preffls->SetLineWidth(3); | |
998 | preffls->SetMaximum(1.); | |
999 | if (indexOfFile==0) { | |
1000 | preffls->SetLineColor(1); | |
1001 | if (strstr(outputmode,"visual")) preffls->Draw(); | |
1002 | } else { | |
1003 | preffls->SetFillStyle(0); | |
1004 | preffls->SetFillColor(30); | |
1005 | if (indexOfFile==1) { | |
1006 | preffls->SetLineStyle(2); | |
1007 | } else if (indexOfFile==2) { | |
1008 | preffls->SetLineStyle(3); | |
1009 | } else { | |
1010 | preffls->SetLineStyle(4);} | |
1011 | if (strstr(outputmode,"visual")) preffls->Draw("same"); | |
1012 | } | |
1013 | TPaveLabel *prlabls = new TPaveLabel(3.2,.85,4.1,1.05,"p"); | |
1014 | if (strstr(outputmode,"visual")) prlabls->Draw(); | |
1015 | ||
1016 | if (strstr(eventType,"pp")){ | |
1017 | pad5ls->SetFillStyle(0); | |
1018 | pad5ls->SetFillColor(10); | |
1019 | tpls->cd(); | |
1020 | if (strstr(outputmode,"visual")) pad5ls->Draw(); | |
1021 | pad5ls->cd(); | |
1022 | //elcon->SetLineWidth(5); | |
1023 | elcon->SetLineWidth(3); | |
1024 | elcon->SetMaximum(1.); | |
1025 | if (indexOfFile==0) { | |
1026 | //elcon->SetFillColor(33); | |
1027 | //elcon->SetFillColor(30); | |
1028 | //elcon->SetLineColor(4); | |
1029 | elcon->SetLineColor(1); | |
1030 | if (strstr(outputmode,"visual")) elcon->Draw(); | |
1031 | } else { | |
1032 | elcon->SetFillStyle(4000); | |
1033 | elcon->SetFillColor(30); | |
1034 | if (indexOfFile==2) { | |
1035 | elcon->SetLineColor(3); | |
1036 | elcon->SetLineWidth(3); | |
1037 | } else { | |
1038 | elcon->SetLineColor(2); | |
1039 | elcon->SetLineStyle(2);} | |
1040 | if (strstr(outputmode,"visual")) elcon->Draw("same"); | |
1041 | } | |
1042 | } | |
1043 | ||
1044 | ||
1045 | pad6ls->SetFillStyle(0); | |
1046 | pad6ls->SetFillColor(10); | |
1047 | tpls->cd(); | |
1048 | if (strstr(outputmode,"visual")) pad6ls->Draw(); | |
1049 | pad6ls->cd(); | |
1050 | picon->SetLineWidth(3); | |
1051 | picon->SetMaximum(1.); | |
1052 | if (indexOfFile==0) { | |
1053 | picon->SetLineColor(1); | |
1054 | if (strstr(outputmode,"visual")) picon->Draw(); | |
1055 | } else { | |
1056 | picon->SetFillStyle(0); | |
1057 | picon->SetFillColor(30); | |
1058 | if (indexOfFile==1) { | |
1059 | picon->SetLineStyle(2); | |
1060 | } else if (indexOfFile==2) { | |
1061 | picon->SetLineStyle(3); | |
1062 | } else { | |
1063 | picon->SetLineStyle(4); | |
1064 | TLine* line; | |
1065 | line = new TLine(0.2,0.85,0.9,0.85); | |
1066 | line->SetLineStyle(2); | |
1067 | line->SetLineWidth(1); | |
1068 | if (strstr(outputmode,"visual")) line->Draw(); | |
1069 | line = new TLine(0.2,0.65,0.9,0.65); | |
1070 | line->SetLineWidth(2); | |
1071 | if (strstr(outputmode,"visual")) line->Draw(); | |
1072 | line = new TLine(0.2,0.45,0.9,0.45); | |
1073 | line->SetLineStyle(3); | |
1074 | line->SetLineWidth(1); | |
1075 | if (strstr(outputmode,"visual")) line->Draw(); | |
1076 | line = new TLine(0.2,0.25,0.9,0.25); | |
1077 | line->SetLineStyle(4); | |
1078 | line->SetLineWidth(1); | |
1079 | if (strstr(outputmode,"visual")) line->Draw(); | |
1080 | TPaveLabel *pl = new TPaveLabel(1.1,0.8,1.9,0.9,"100 ps","br"); | |
1081 | pl->SetFillColor(18); | |
1082 | pl->SetTextSize(0.99); | |
1083 | if (strstr(outputmode,"visual")) pl->Draw(); | |
1084 | pl = new TPaveLabel(1.1,0.6,1.9,0.7,"150 ps","br"); | |
1085 | pl->SetFillColor(18); | |
1086 | pl->SetTextSize(0.99); | |
1087 | if (strstr(outputmode,"visual")) pl->Draw(); | |
1088 | pl = new TPaveLabel(1.1,0.4,1.9,0.5,"200 ps","br"); | |
1089 | pl->SetFillColor(18); | |
1090 | pl->SetTextSize(0.99); | |
1091 | if (strstr(outputmode,"visual")) pl->Draw(); | |
1092 | pl = new TPaveLabel(1.1,0.2,1.9,0.3,"300 ps","br"); | |
1093 | pl->SetFillColor(18); | |
1094 | pl->SetTextSize(0.99); | |
1095 | if (strstr(outputmode,"visual")) pl->Draw(); | |
1096 | } | |
1097 | if (strstr(outputmode,"visual")) picon->Draw("same"); | |
1098 | } | |
1099 | ||
1100 | pad7ls->SetFillStyle(0); | |
1101 | pad7ls->SetFillColor(10); | |
1102 | tpls->cd(); | |
1103 | if (strstr(outputmode,"visual")) pad7ls->Draw(); | |
1104 | pad7ls->cd(); | |
1105 | kacon->SetLineWidth(3); | |
1106 | kacon->SetMaximum(1.); | |
1107 | if (indexOfFile==0) { | |
1108 | kacon->SetLineColor(1); | |
1109 | if (strstr(outputmode,"visual")) kacon->Draw(); | |
1110 | } else { | |
1111 | kacon->SetFillStyle(0); | |
1112 | kacon->SetFillColor(30); | |
1113 | if (indexOfFile==1) { | |
1114 | kacon->SetLineStyle(2); | |
1115 | } else if (indexOfFile==2) { | |
1116 | kacon->SetLineStyle(3); | |
1117 | } else { | |
1118 | kacon->SetLineStyle(4);} | |
1119 | if (strstr(outputmode,"visual")) kacon->Draw("same"); | |
1120 | } | |
190c1f49 | 1121 | |
919162e6 | 1122 | pad8ls->SetFillStyle(0); |
1123 | pad8ls->SetFillColor(10); | |
1124 | tpls->cd(); | |
1125 | if (strstr(outputmode,"visual")) pad8ls->Draw(); | |
1126 | pad8ls->cd(); | |
1127 | prcon->SetLineWidth(3); | |
1128 | prcon->SetMaximum(1.); | |
1129 | if (indexOfFile==0) { | |
1130 | prcon->SetLineColor(1); | |
1131 | if (strstr(outputmode,"visual")) prcon->Draw(); | |
1132 | } else { | |
1133 | prcon->SetFillStyle(0); | |
1134 | prcon->SetFillColor(30); | |
1135 | if (indexOfFile==1) { | |
1136 | prcon->SetLineStyle(2); | |
1137 | } else if (indexOfFile==2) { | |
1138 | prcon->SetLineStyle(3); | |
1139 | } else { | |
1140 | prcon->SetLineStyle(4);} | |
1141 | if (strstr(outputmode,"visual")) prcon->Draw("same"); | |
1142 | } | |
1143 | ||
1144 | ||
1145 | ||
1146 | ||
1147 | ||
1148 | ||
1149 | ||
1150 | // momentum vs mass 2-D histos | |
1151 | ||
190c1f49 | 1152 | if (indexOfFile==0) { |
1153 | momvsmassCanvas = new TCanvas("momvsmassCanvas","Momentum vs mass disribution",500,10,700,700); | |
1154 | momvsmassCanvas->SetFillColor(0); | |
1155 | momvsmassCanvas->SetBorderMode(0); | |
1156 | gPad->SetFillStyle(0); | |
1157 | gPad->SetBorderMode(0); | |
1158 | gPad->SetFillColor(0); | |
1159 | // gStyle->SetOptStat(11); | |
1160 | if (numfile==4) momvsmassCanvas->Divide(1,2,0,0); | |
1161 | } else if (indexOfFile==1 && numfile == 4) { | |
1162 | momvsmassCanvas->cd(1); | |
1163 | TPaveLabel *pl = new TPaveLabel(-0.0376218,-3.03586,0.0979277,-2.70158,"100 ps","br"); | |
1164 | pl->SetFillColor(18); | |
1165 | pl->SetTextSize(0.99); | |
1166 | if (strstr(outputmode,"visual")) pl->Draw(); | |
1167 | } else if (indexOfFile==3 && numfile == 4) { | |
1168 | momvsmassCanvas->cd(2); | |
1169 | TPaveLabel *pl = new TPaveLabel(-0.0591866,-3.17077,0.076363,-2.86857,"300 ps","br"); | |
1170 | pl->SetFillColor(18); | |
1171 | pl->SetTextSize(0.99); | |
1172 | if (strstr(outputmode,"visual")) pl->Draw(); | |
1173 | } | |
1174 | if (numfile !=4) momvsmassCanvas->cd(); | |
1175 | if (numfile !=4 || indexOfFile==1 || indexOfFile==3) { | |
1176 | // hpi->PaintStat2(01); | |
1177 | hpi->SetMarkerColor(5); | |
1178 | if (strstr(outputmode,"visual")) hpi->Draw(); | |
1179 | if(strstr(eventType,"pp")){ | |
1180 | hel->SetMarkerColor(2); | |
1181 | if (strstr(outputmode,"visual")) hel->Draw("same"); | |
1182 | } | |
1183 | hka->SetMarkerColor(4); | |
1184 | if (strstr(outputmode,"visual")) hka->Draw("same"); | |
1185 | hpr->SetMarkerColor(3); | |
1186 | if (strstr(outputmode,"visual")) hpr->Draw("same"); | |
1187 | if (strstr(outputmode,"visual")) { | |
1188 | fkaon->Draw(); | |
1189 | fproton->Draw(); | |
1190 | if(strstr(eventType,"pp")){ | |
1191 | felectron->Draw(); | |
1192 | fpion->Draw(); | |
1193 | } | |
1194 | } | |
1195 | if(strstr(eventType,"pp")){ | |
1196 | //TPaveText *ep = new TPaveText(-0.05,-0.5,0.05,-0.3); | |
1197 | //ep->AddText("e"); | |
1198 | TPaveLabel *ep = new TPaveLabel(.42,.85,.52,1.05,"e"); | |
1199 | if (strstr(outputmode,"visual")) ep->Draw(); | |
1200 | } | |
1201 | ||
1202 | TPaveText *pip = new TPaveText(0.15,-1.0,0.25,-0.8); | |
1203 | pip->AddText("#pi"); | |
1204 | if (strstr(outputmode,"visual")) pip->Draw(); | |
1205 | TPaveText *kp = new TPaveText(0.5,-2.0,0.6,-1.8); | |
1206 | kp->AddText("K"); | |
1207 | if (strstr(outputmode,"visual")) kp->Draw(); | |
1208 | TPaveText *prp = new TPaveText(0.9,-2.7,1.0,-2.5); | |
1209 | prp->AddText("p"); | |
1210 | if (strstr(outputmode,"visual")) prp->Draw(); | |
1211 | // TText *text2= new TText(.59,.06,"Momentum"); | |
1212 | // text1->SetTextAngle(90); | |
1213 | // text1->Draw(); | |
1214 | //pidCanvas->DrawText(.1,.2,"Contamination Efficiency"); | |
1215 | momvsmassCanvas->Update(); | |
1216 | if(strstr(outputsavemode,"asC")) momvsmassCanvas->Print("momvsmassCanvas.C"); | |
1217 | if(strstr(outputsavemode,"asEPS")) momvsmassCanvas->Print("momvsmassCanvas.eps"); | |
1218 | pidCanvas->cd(); | |
1219 | pidCanvas->Update(); | |
1220 | if(strstr(outputsavemode,"asC")) pidCanvas->Print("pidCanvas.C"); | |
1221 | if(strstr(outputsavemode,"asEPS")) pidCanvas->Print("pidCanvas.eps"); | |
1222 | char outFileName[100]; | |
1223 | strcpy(outFileName,"histos"); | |
1224 | strcat(outFileName,foutfileName); | |
1225 | TFile *houtfile = new TFile(outFileName,"recreate"); | |
1226 | houtfile->cd(); | |
1227 | // saving canvas | |
1228 | pidCanvas->Write(0,TObject::kOverwrite); | |
1229 | momvsmassCanvas->Write(0,TObject::kOverwrite); | |
919162e6 | 1230 | // saving 1-D histos |
190c1f49 | 1231 | pit->Write(0,TObject::kOverwrite); |
1232 | pig->Write(0,TObject::kOverwrite); | |
1233 | pieff->Write(0,TObject::kOverwrite); | |
919162e6 | 1234 | pieffls->Write(0,TObject::kOverwrite); |
190c1f49 | 1235 | picon->Write(0,TObject::kOverwrite); |
1236 | piid->Write(0,TObject::kOverwrite); | |
1237 | piall->Write(0,TObject::kOverwrite); | |
1238 | pigen->Write(0,TObject::kOverwrite); | |
1239 | kat->Write(0,TObject::kOverwrite); | |
1240 | kag->Write(0,TObject::kOverwrite); | |
1241 | kaeff->Write(0,TObject::kOverwrite); | |
919162e6 | 1242 | kaeffls->Write(0,TObject::kOverwrite); |
190c1f49 | 1243 | kaid->Write(0,TObject::kOverwrite); |
1244 | kaall->Write(0,TObject::kOverwrite); | |
1245 | kagen->Write(0,TObject::kOverwrite); | |
1246 | kacon->Write(0,TObject::kOverwrite); | |
1247 | prt->Write(0,TObject::kOverwrite); | |
1248 | prg->Write(0,TObject::kOverwrite); | |
1249 | preff->Write(0,TObject::kOverwrite); | |
919162e6 | 1250 | preffls->Write(0,TObject::kOverwrite); |
190c1f49 | 1251 | prcon->Write(0,TObject::kOverwrite); |
1252 | prid->Write(0,TObject::kOverwrite); | |
1253 | prall->Write(0,TObject::kOverwrite); | |
1254 | prgen->Write(0,TObject::kOverwrite); | |
919162e6 | 1255 | // saving 2-D histos |
190c1f49 | 1256 | hpi->Write(0,TObject::kOverwrite); |
1257 | hka->Write(0,TObject::kOverwrite); | |
1258 | hpr->Write(0,TObject::kOverwrite); | |
1259 | // electron histos | |
1260 | if (hel && eleff && elcon && elid && elall){ | |
1261 | hel->Write(0,TObject::kOverwrite); | |
1262 | eleff->Write(0,TObject::kOverwrite); | |
1263 | elcon->Write(0,TObject::kOverwrite); | |
1264 | elid->Write(0,TObject::kOverwrite); | |
1265 | elall->Write(0,TObject::kOverwrite); | |
1266 | } | |
1267 | cout << "file " << houtfile << " has been created" << endl; | |
1268 | cout << "it contains PID histos and canvas" << endl; | |
1269 | houtfile->Close(); | |
1270 | houtfile->Write(0,TObject::kOverwrite); | |
1271 | } | |
1272 | } | |
1273 | ||
1274 | if (strstr(outputmode,"novisual")){ | |
1275 | // free used memory | |
1276 | delete pit ; pit=0; | |
1277 | delete pig ; pig=0; | |
1278 | delete pieff; pieff=0; | |
919162e6 | 1279 | delete pieffls; pieffls=0; |
190c1f49 | 1280 | delete picon; picon=0; |
1281 | delete piid ; piid=0; | |
1282 | delete piall; piall=0; | |
1283 | delete pigen; pigen=0; | |
1284 | delete kat ; kat=0; | |
1285 | delete kag ; kag=0; | |
1286 | delete kaeff; kaeff=0; | |
919162e6 | 1287 | delete kaeffls; kaeffls=0; |
190c1f49 | 1288 | delete kaid; kaid=0; |
1289 | delete kaall; kaall=0; | |
1290 | delete kagen; kagen=0; | |
1291 | delete kacon; kacon=0; | |
1292 | delete prt; prt=0; | |
1293 | delete prg; prg=0; | |
1294 | delete preff; preff=0; | |
919162e6 | 1295 | delete preffls; preffls=0; |
190c1f49 | 1296 | delete prcon; prcon=0; |
1297 | delete prid; prid=0; | |
1298 | delete prall; prall=0; | |
1299 | delete prgen; prgen=0; | |
1300 | // 2-D | |
1301 | delete hpi; hpi=0; | |
1302 | delete hka; hka=0; | |
1303 | delete hpr; hpr=0; | |
1304 | if (hel){ | |
1305 | delete hel; | |
1306 | hel=0; | |
1307 | } | |
1308 | if (eleff){ | |
1309 | delete eleff; | |
1310 | eleff=0; | |
1311 | } | |
919162e6 | 1312 | if (eleffls){ |
1313 | delete eleffls; | |
1314 | eleffls=0; | |
1315 | } | |
190c1f49 | 1316 | if (elcon){ |
1317 | delete elcon; | |
1318 | elcon=0; | |
1319 | } | |
1320 | if (elid){ | |
1321 | delete elid; | |
1322 | elid=0; | |
1323 | } | |
1324 | if (elall){ | |
1325 | delete elall; | |
1326 | elall=0; | |
1327 | } | |
1328 | } | |
1329 | } | |
1330 | ||
1331 | ||
1332 | //__________________________________________________________________ | |
1333 | Bool_t AliTOFPID::operator==( AliTOFPID const & tofrec)const | |
1334 | { | |
1335 | // dummy version of Equal operator. | |
1336 | // requested by coding conventions | |
1337 | return kTRUE; | |
1338 | ||
1339 | } |