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 // Several studies done on clean samples of electrons, pions and kaons
19 // Compatible with both ESDs and AODs
22 // Matus Kalisky <matus.kalisky@cern.ch>
23 // Markus Heide <mheide@uni-muenster.de>
24 // Markus Fasel <M.Fasel@gsi.de>
27 #include <TIterator.h>
30 #include <TObjArray.h>
31 #include <TParticle.h>
35 #include "AliAODMCParticle.h"
36 #include "AliAODPid.h"
37 #include "AliAODTrack.h"
38 #include "AliESDtrack.h"
40 #include "AliMCEvent.h"
41 #include "AliMCParticle.h"
43 #include "AliESDpid.h"
44 //#include "AliTRDPIDResponseLQ1D.h"
45 #include "AliVEvent.h"
46 #include "AliVParticle.h"
47 #include "AliExternalTrackParam.h"
50 #include "AliHFEcollection.h"
51 #include "AliHFEpidQA.h"
52 #include "AliHFEV0pid.h"
53 #include "AliHFEV0pidMC.h"
54 #include "AliHFEpidTRD.h"
58 //__________________________________________
59 AliHFEpidQA::AliHFEpidQA():
69 // Default constructor
71 fESDpid = new AliESDpid;
74 //__________________________________________
75 AliHFEpidQA::~AliHFEpidQA(){
79 if(fV0pid) delete fV0pid;
80 if(fV0pidMC) delete fV0pidMC;
81 if(fOutput) delete fOutput;
82 if(fESDpid) delete fESDpid;
83 // if(fTRDpidResponse) delete fTRDpidResponse;
86 //__________________________________________
87 void AliHFEpidQA::Init(){
89 // Prepare task output
92 fV0pid = new AliHFEV0pid;
93 if(HasV0pidQA()) fV0pid->InitQA();
94 fV0pidMC = new AliHFEV0pidMC();
97 fOutput = new AliHFEcollection("pidQA", "PID QA output");
99 // 1st: Histos for purity studies
100 fOutput->CreateTH2F("purityElectron", "Electron Putrity", 2, -0.5, 1.5, 20, 0.1, 10);
101 fOutput->BinLogAxis("purityElectron" ,1);
102 fOutput->CreateTH2F("purityPionK0", "K0 Pion Putrity", 2, -0.5, 1.5, 20, 0.1, 10);
103 fOutput->BinLogAxis("purityPionK0" ,1);
104 fOutput->CreateTH2F("purityPionL", "Lambda Pion Putrity", 2, -0.5, 1.5, 20, 0.1, 10);
105 fOutput->BinLogAxis("purityPionL" ,1);
106 fOutput->CreateTH2F("purityProton", "Proton Putrity", 2, -0.5, 1.5, 20, 0.1, 10);
107 fOutput->BinLogAxis("purityProton" ,1);
109 // Histograms for TRD Electron Likelihood
110 fOutput->CreateTH2F("hTRDelLikeElectron", "TRD Electron Likelihoods for Electrons; p (GeV/c); likelihood", 20, 0.1, 10, 100, 0., 1.);
111 fOutput->BinLogAxis("hTRDelLikeElectron", 0);
112 fOutput->CreateTH2F("hTRDelLikePionK0", "TRD Electron Likelihoods for K0 Pions; p (GeV/c); likelihood", 20, 0.1, 10, 100, 0., 1.);
113 fOutput->BinLogAxis("hTRDelLikePionK0", 0);
114 fOutput->CreateTH2F("hTRDelLikePionL", "TRD Electron Likelihoods for Lambda Pions; p (GeV/c); likelihood", 20, 0.1, 10, 100, 0., 1.);
115 fOutput->BinLogAxis("hTRDelLikePionL", 0);
116 fOutput->CreateTH2F("hTRDelLikeProton", "TRD Electron Likelihoods for Protons; p (GeV/c); likelihood", 20, 0.1, 10, 100, 0., 1.);
117 fOutput->BinLogAxis("hTRDelLikeProton", 0);
120 fOutput->CreateTH2F("hTPC_dEdx_Electron", "TPC dEdx for conversion electrons; p (GeV/c); dEdx (a.u.)", 20, 0.1, 10, 200, 0, 200);
121 fOutput->BinLogAxis("hTPC_dEdx_Electron", 0);
122 fOutput->CreateTH2F("hTPC_dEdx_PionK0", "TPC dEdx for K0 pions; p (GeV/c); dEdx (a.u.)", 20, 0.1, 10, 200, 0, 200);
123 fOutput->BinLogAxis("hTPC_dEdx_PionK0", 0);
124 fOutput->CreateTH2F("hTPC_dEdx_PionL", "TPC dEdx for Lambda pions; p (GeV/c); dEdx (a.u.)", 20, 0.1, 10, 200, 0, 200);
125 fOutput->BinLogAxis("hTPC_dEdx_PionL", 0);
126 fOutput->CreateTH2F("hTPC_dEdx_Proton", "TPC dEdx for Lambda proton; p (GeV/c); dEdx (a.u.)", 20, 0.1, 10, 200, 0, 200);
127 fOutput->BinLogAxis("hTPC_dEdx_Proton", 0);
129 fOutput->CreateTH2F("hTPCnSigmaElectron", "TPC number of sigmas for conversion electrons; p (GeV/c); number of sigmas", 20, 0.1, 10, 100, -7, 7);
130 fOutput->BinLogAxis("hTPCnSigmaElectron", 0);
131 fOutput->CreateTH2F("hTPCnSigmaPionK0", "TPC number of sigmas for K0 pions; p (GeV/c); number of sigmas", 20, 0.1, 10, 100, -7, 7);
132 fOutput->BinLogAxis("hTPCnSigmaPionK0", 0);
133 fOutput->CreateTH2F("hTPCnSigmaPionL", "TPC number of sigmas for Lambda pions; p (GeV/c); number of sigmas", 20, 0.1, 10, 100, -7, 7);
134 fOutput->BinLogAxis("hTPCnSigmaPionL", 0);
135 fOutput->CreateTH2F("hTPCnSigmaProton", "TPC number of sigmas for Lambda protons; p (GeV/c); number of sigmas", 20, 0.1, 10, 100, -7, 7);
136 fOutput->BinLogAxis("hTPCnSigmaProton", 0);
138 fOutput->CreateTH2F("hTPC_PID", "TPC pid all tracks; tpc pid probability; species",100, 0, 1, 5, -0.5, 4.5 );
139 fOutput->CreateTH2F("hTPC_PID_p_Electron", "TPC PID for conversion electrons; p (GeV/c); TPC PID", 100, 0.1, 10, 5, -0.5, 4.5);
140 fOutput->BinLogAxis("hTPC_PID_p_Electron", 0);
141 fOutput->CreateTH2F("hTPC_PID_p_PionK0", "TPC PID for K0 pions; p (GeV/c); TPC PID", 100, 0.1, 10, 5, -0.5, 4.5);
142 fOutput->BinLogAxis("hTPC_PID_p_PionK0", 0);
143 fOutput->CreateTH2F("hTPC_PID_p_PionL", "TPC PID for Lambda pions; p (GeV/c); TPC PID", 100, 0.1, 10, 5, -0.5, 4.5);
144 fOutput->BinLogAxis("hTPC_PID_p_PionL", 0);
145 fOutput->CreateTH2F("hTPC_PID_p_Proton", "TPC PID for Lambda protons; p (GeV/c); TPC PID", 100, 0.1, 10, 5, -0.5, 4.5);
146 fOutput->BinLogAxis("hTPC_PID_p_Proton", 0);
150 fOutput->CreateTH2F("hTRD_Electron_trk", "all Electron candidate tracklets; p (GeV/c); N TRD tracklets", 100, 0.1, 10, 7, -0.5, 6.5);
151 fOutput->BinLogAxis("hTRD_Electron_trk", 0);
152 fOutput->CreateTH1F("hTRD_Electron_Y_like", "YES - V0 electron eff. for fixed likelihood cut; p (GeV/c); counts", 25, 0.1, 10);
153 fOutput->BinLogAxis("hTRD_Electron_Y_like", 0);
154 fOutput->CreateTH1F("hTRD_Electron_N_like", "NO - V0 electron eff. for fixed likelihood cut; p (GeV/c); counts", 25, 0.1, 10);
155 fOutput->BinLogAxis("hTRD_Electron_N_like", 0);
156 fOutput->CreateTH2F("hTRD_El_like_Electron", "V0 electron likelihoods for electrons; p (GeV/c); likelihood", 25, 0.1, 10, 1000, 0., 1.);
157 fOutput->BinLogAxis("hTRD_El_like_Electron", 0);
158 fOutput->CreateTH2F("hTRD_El_like_Pion", "V0 electron likelihoods for poins; p (GeV/c); likelihood", 25, 0.1, 10, 1000, 0., 1.);
159 fOutput->BinLogAxis("hTRD_El_like_Pion", 0);
160 fOutput->CreateTH2F("hTRD_El_like_Proton", "V0 electron likelihoods for protons; p (GeV/c); likelihood", 25, 0.1, 10, 1000, 0., 1.);
161 fOutput->BinLogAxis("hTRD_El_like_Proton", 0);
166 fOutput->CreateTH2F("hTOF_PID", "TOF pid all tracks; tof pid probability; species",100, 0, 1,5, -0.5, 4.5 );
168 fOutput->CreateTH2F("hTOF_PID_p_Electron", "TOF PID for gamma converisons; p_T (GeV/c); counts", 100, 0.1, 10, 5, -0.5, 4.5);
169 fOutput->BinLogAxis("hTOF_PID_p_Electron", 0);
170 fOutput->CreateTH2F("hTOF_PID_p_PionK0", "TOF PID for K0 pions; p_T (GeV/c); counts", 100, 0.1, 10, 5, -0.5, 4.5);
171 fOutput->BinLogAxis("hTOF_PID_p_PionK0", 0);
172 fOutput->CreateTH2F("hTOF_PID_p_PionL", "TOF PID for Lambda pions; p_T (GeV/c); counts", 100, 0.1, 10, 5, -0.5, 4.5);
173 fOutput->BinLogAxis("hTOF_PID_p_PionL", 0);
174 fOutput->CreateTH2F("hTOF_PID_p_Proton", "TOF PID for Lambda protons; p_T (GeV/c); counts", 100, 0.1, 10, 5, -0.5, 4.5);
175 fOutput->BinLogAxis("hTOF_PID_p_Proton", 0);
177 fOutput->CreateTH2F("hTOF_beta_Electron", "TOF beta for gamma conversions; #beta; p (GeV/c)", 120, 0, 1.2, 100, 0.1, 10);
178 fOutput->BinLogAxis("hTOF_beta_Electron", 1);
179 fOutput->CreateTH2F("hTOF_beta_PionK0", "TOF beta for K0 pions; #beta; p (GeV/c)", 120, 0, 1.2, 100, 0.1, 10);
180 fOutput->BinLogAxis("hTOF_beta_PionK0", 1);
181 fOutput->CreateTH2F("hTOF_beta_PionL", "TOF beta Lambda pions; #beta; p (GeV/c)", 120, 0, 1.2, 100, 0.1, 10);
182 fOutput->BinLogAxis("hTOF_beta_PionL", 1);
183 fOutput->CreateTH2F("hTOF_beta_Proton", "TOF beta for Lambda protons; #beta; p (GeV/c)", 120, 0, 1.2, 100, 0.1, 10);
184 fOutput->BinLogAxis("hTOF_beta_Proton", 1);
189 /* if(HasRecalculateTRDpid()){
190 fTRDpidResponse = new AliTRDPIDResponseLQ1D;
191 fTRDpidResponse->LoadReferences();
195 //__________________________________________
196 void AliHFEpidQA::Process(AliVEvent *inputEvent){
201 if(fRun >= 104065 && fRun <= 104892){
206 AliError("V0pid not available! Forgotten to initialize?");
210 if(fMC) fV0pidMC->SetMCEvent(fMC);
212 fV0pid->Process(inputEvent);
213 TObjArray *electrons = fV0pid->GetListOfElectrons();
214 TObjArray *pionsK0 = fV0pid->GetListOfPionsK0();
215 TObjArray *pionsL = fV0pid->GetListOfPionsL();
216 TObjArray *protons = fV0pid->GetListOfProtons();
219 fV0pidMC->Process(electrons, AliHFEV0pid::kRecoElectron);
220 fV0pidMC->Process(pionsK0, AliHFEV0pid::kRecoPionK0);
221 fV0pidMC->Process(pionsL, AliHFEV0pid::kRecoPionL);
222 fV0pidMC->Process(protons, AliHFEV0pid::kRecoProton);
225 AliDebug(2, Form("Number of Electrons : %d", electrons->GetEntries()));
226 AliDebug(2, Form("Number of K0 Pions : %d", pionsK0->GetEntries()));
227 AliDebug(2, Form("Number of Lambda Pions : %d", pionsL->GetEntries()));
228 AliDebug(2, Form("Number of Protons : %d", protons->GetEntries()));
230 AliDebug(2, "MC Information available. Doing Purity checks...");
231 // Calculate the purity of the clean samples using MC
232 MakePurity(electrons, AliHFEV0pid::kRecoElectron);
233 MakePurity(pionsK0, AliHFEV0pid::kRecoPionK0);
234 MakePurity(pionsL, AliHFEV0pid::kRecoPionL);
235 MakePurity(protons, AliHFEV0pid::kRecoProton);
237 // Now we can do studies on the PID itself
238 // TRD PID: Fill electron Likelihoods for the particle species
239 FillTRDelectronLikelihoods(electrons, AliHFEV0pid::kRecoElectron);
240 FillTRDelectronLikelihoods(pionsK0, AliHFEV0pid::kRecoPionK0);
241 FillTRDelectronLikelihoods(pionsL, AliHFEV0pid::kRecoPionL);
242 FillTRDelectronLikelihoods(protons, AliHFEV0pid::kRecoProton);
244 FillPIDresponse(electrons, AliHFEV0pid::kRecoElectron);
245 FillPIDresponse(pionsK0, AliHFEV0pid::kRecoPionK0);
246 FillPIDresponse(pionsL, AliHFEV0pid::kRecoPionL);
247 FillPIDresponse(protons, AliHFEV0pid::kRecoProton);
249 // Analysis done, flush the containers
253 //__________________________________________
254 void AliHFEpidQA::MakePurity(TObjArray *tracks, Int_t species){
256 // Fill the QA histos for a given species
259 AliDebug(3, Form("Doing Purity checks for species %d", species));
263 case AliHFEV0pid::kRecoElectron:
264 pdg = TMath::Abs(kElectron);
265 sprintf(hname, "purityElectron");
267 case AliHFEV0pid::kRecoPionK0:
268 pdg = TMath::Abs(kPiPlus);
269 sprintf(hname, "purityPionK0");
271 case AliHFEV0pid::kRecoPionL:
272 pdg = TMath::Abs(kPiPlus);
273 sprintf(hname, "purityPionL");
275 case AliHFEV0pid::kRecoProton:
276 pdg = TMath::Abs(kProton);
277 sprintf(hname, "purityProton");
279 default: // non investigated species
280 AliDebug(3, "Species not investigated");
283 AliDebug(3, Form("Number of tracks: %d", tracks->GetEntries()));
284 TIterator *trackIter = tracks->MakeIterator();
285 AliVParticle *recTrack = NULL, *mcTrack = NULL;
286 while((recTrack = dynamic_cast<AliVParticle *>(trackIter->Next()))){
287 Int_t label = recTrack->GetLabel();
288 AliDebug(4, Form("MC Label %d", label));
289 mcTrack =fMC->GetTrack(TMath::Abs(label));
291 AliDebug(4, "MC track not available");
292 continue; // we don't know
297 if(!TString(mcTrack->IsA()->GetName()).CompareTo("AliMCParticle")){
299 AliMCParticle *mcp = dynamic_cast<AliMCParticle *>(mcTrack);
300 trackPdg = TMath::Abs(mcp->Particle()->GetPdgCode());
303 AliAODMCParticle *aodmcp = dynamic_cast<AliAODMCParticle *>(mcTrack);
304 trackPdg = TMath::Abs(aodmcp->GetPdgCode());
306 if(trackPdg == pdg) // Correct identification
307 fOutput->Fill(hname, 0., recTrack->Pt());
308 else // Wrong identification
309 fOutput->Fill(hname, 1., recTrack->Pt());
314 //__________________________________________
315 void AliHFEpidQA::FillTRDelectronLikelihoods(TObjArray * const particles, Int_t species){
317 // Fill electron Likelihoods for the TRD
318 // Required for the calculation of the electron efficiency,
319 // pion and proton efficiency and the thresholds
321 Char_t hname[256] = "hTRDelLike";
323 case AliHFEV0pid::kRecoElectron:
324 sprintf(hname, "%sElectron", hname);
326 case AliHFEV0pid::kRecoPionK0:
327 sprintf(hname, "%sPionK0", hname);
329 case AliHFEV0pid::kRecoPionL:
330 sprintf(hname, "%sPionL", hname);
332 case AliHFEV0pid::kRecoProton:
333 sprintf(hname, "%sProton", hname);
336 AliDebug(2, Form("Species %d not investigated", species));
339 AliVParticle *recTrack = NULL;
340 TIterator *trackIter = particles->MakeIterator();
341 Double_t quantities[2] = {0., 0.};
342 Double_t trdPidProbs[5];
343 while((recTrack = dynamic_cast<AliVParticle *>(trackIter->Next()))){
344 if(!TString(recTrack->IsA()->GetName()).CompareTo("AliESDtrack")){
346 AliESDtrack *esdTrack = dynamic_cast<AliESDtrack *>(recTrack);
347 if(!esdTrack->GetTRDntracklets()) continue; // require at least 1 tracklet
348 // take momentum at the innermost TRD layer
350 for(Int_t ily = 0; ily < 6; ily++){
351 if((p = esdTrack->GetTRDmomentum(ily)) > 1e-6) break;
354 if(HasRecalculateTRDpid())
355 RecalculateTRDpid(esdTrack, trdPidProbs);
357 esdTrack->GetTRDpid(trdPidProbs);
358 quantities[1] = trdPidProbs[ AliPID::kElectron];
361 AliAODTrack *aodTrack = dynamic_cast<AliAODTrack *>(recTrack);
362 if(!aodTrack->GetDetPid()) continue;
363 Float_t *trdMom = aodTrack->GetDetPid()->GetTRDmomentum(), p = 0.;
364 for(Int_t ily = 0; ily < 6; ily++){
365 if((p = trdMom[ily]) > 1e-6) break;
368 // case AOD (for the moment lacks)
369 if(HasRecalculateTRDpid()){
370 RecalculateTRDpid(aodTrack, trdPidProbs);
371 quantities[1] = trdPidProbs[AliPID::kElectron];
376 fOutput->Fill(hname, quantities[0], quantities[1]);
379 //__________________________________________
380 void AliHFEpidQA::FillPIDresponse(TObjArray * const particles, Int_t species){
382 // Fill the PID response of different detectors to V0 daughter particles
384 Char_t hname[256] = "";
385 const Char_t *typeName[5] = {"Electron", "PionK0", "PionL", "Kaon", "Proton"};
386 const Int_t typePID[5] = {0, 2, 2, 3, 4};
388 AliHFEpidTRD *pidTRD = new AliHFEpidTRD("TRDpid");
390 AliVParticle *recTrack = NULL;
391 TIterator *trackIter = particles->MakeIterator();
392 while((recTrack = dynamic_cast<AliVParticle *>(trackIter->Next()))){
394 if(!TString(recTrack->IsA()->GetName()).CompareTo("AliESDtrack")){
396 AliESDtrack *esdTrack = dynamic_cast<AliESDtrack *>(recTrack);
397 const AliExternalTrackParam *tpcIn = esdTrack->GetTPCInnerParam();
401 Double_t p = tpcIn->P();
402 //Double_t pt = tpcIn->Pt();
405 Double_t dEdx = esdTrack->GetTPCsignal();
406 sprintf(hname, "hTPC_dEdx_%s", typeName[species]);
407 fOutput->Fill(hname, p, dEdx);
409 //TPC number of sigmas
410 Double_t nsigma = fESDpid->NumberOfSigmasTPC(esdTrack,(AliPID::EParticleType)typePID[species]);
411 sprintf(hname, "hTPCnSigma%s", typeName[species]);
412 fOutput->Fill(hname, p, nsigma);
415 sprintf(hname, "hTPC_PID_p_%s", typeName[species]);
416 Double_t tpcPID[5] = {-1, -1, -1, -1, -1};
417 esdTrack->GetTPCpid(tpcPID);
420 for(Int_t k=0; k<5; ++k){
425 fOutput->Fill("hTPC_PID", tpcPID[k], k);
428 fOutput->Fill(hname, p, ix);
432 sprintf(hname, "hTOF_PID_p_%s", typeName[species]);
433 Double_t tofPID[5] = {-1., -1., -1., -1., -1};
434 esdTrack->GetTOFpid(tofPID);
436 for(Int_t k=0; k<5; ++k){
442 fOutput->Fill("hTOF_PID", tofPID[k], k);
445 fOutput->Fill(hname, p, ix);
448 //TRD first electron only
449 Int_t nTRK = (int)esdTrack->GetTRDntrackletsPID();
450 if(AliHFEV0pid::kRecoElectron == species){
451 sprintf(hname, "hTRD_%s_trk", typeName[species]);
452 fOutput->Fill(hname, p, nTRK);
456 Double_t pidProbs[AliPID::kSPECIES];
457 esdTrack->GetTRDpid(pidProbs);
458 Double_t threshold = pidTRD->GetTRDthresholds(0.9, p);
459 if(AliHFEV0pid::kRecoElectron == species && 6 == nTRK){
460 sprintf(n1, "hTRD_%s_Y_like", typeName[species]);
461 sprintf(n2, "hTRD_%s_N_like", typeName[species]);
462 if(pidProbs[typePID[0]] > threshold) fOutput->Fill(n1, p);
463 else fOutput->Fill(n2, p);
464 sprintf(hname, "hTRD_El_like_Electron");
465 fOutput->Fill(hname, p, pidProbs[typePID[species]]);
467 if( ((AliHFEV0pid::kRecoPionK0 == species) || (AliHFEV0pid::kRecoPionL == species)) && 6 == nTRK ){
468 sprintf(hname, "hTRD_El_like_Pion");
469 fOutput->Fill(hname, p, pidProbs[typePID[0]]);
471 if(AliHFEV0pid::kRecoProton == species && 6 == nTRK){
472 sprintf(hname,"hTRD_El_like_Proton");
473 fOutput->Fill(hname, p, pidProbs[typePID[0]]);
478 sprintf(hname, "hTOF_beta_%s", typeName[species]);
479 Float_t beta = TOFbeta(esdTrack);
480 fOutput->Fill(hname, beta, p);
482 // AOD - comming soon
486 }// .. tracks in TObjArray
488 if(pidTRD) delete pidTRD;
492 //__________________________________________
493 TList *AliHFEpidQA::GetOutput(){
495 // Getter for Output histograms
497 return fOutput->GetList();
500 //__________________________________________
501 TList *AliHFEpidQA::GetV0pidQA(){
503 // Getter for V0 PID QA histograms
505 return fV0pid->GetListOfQAhistograms();
508 //__________________________________________
509 TList *AliHFEpidQA::GetV0pidMC(){
511 // Getter for V0 PID QA histograms
514 return fV0pidMC->GetListOfQAhistograms();
518 //__________________________________________
519 void AliHFEpidQA::RecalculateTRDpid(AliESDtrack * /*track*/, Double_t * /*pidProbs*/) const{
520 // fTRDpidResponse->MakePID(track);
521 // track->GetTRDpid(pidProbs);
524 //__________________________________________
525 void AliHFEpidQA::RecalculateTRDpid(AliAODTrack * /*track*/, Double_t * /*pidProbs*/) const{
526 // fTRDpidResponse->MakePID(track, pidProbs);
528 //___________________________________________________________________
529 void AliHFEpidQA::CorrectT0(){
530 // temporary solutions for correction the T0 for pass4 & pass5
531 // returns corrected T0 for known runs
532 // returns 0 if the correction failed
534 AliError("Run number not set");
538 Bool_t runFound = kFALSE;
539 const Int_t corr[31][2] = {{104065, 1771614},
571 for(Int_t i=0; i<31; ++i){
572 if(fRun == corr[i][0]){
574 fT0 = (float)corr[i][1];
575 // for the pass4 & pass5
576 fT0 -= 37*1024*24.4 - 170.;
583 TString error = "Setting T0 correction FAILED, no TOF pid available for run: ";
588 //cout<<" -D: run: "<<current_run<<" , fT0: "<<fT0<<endl;
591 //___________________________________________________________________
592 Float_t AliHFEpidQA::TOFbeta(AliESDtrack * const track) const {
593 // computes the TOF beta
594 Double_t l = track->GetIntegratedLength(); // cm
595 Double_t t = track->GetTOFsignal();
596 Double_t t0 = fT0; // ps
597 if(l < 360. || l > 800.) return 0.;
598 if(t <= 0.) return 0.;
599 if(t0 <= 0.) return 0.;
601 t -= t0; // subtract the T0
604 t *= 1e-12; //ps -> s
608 Float_t beta = v / TMath::C();