AliPhysics  608b256 (608b256)
AliPIDtools.cxx
Go to the documentation of this file.
1 #include "AliESDEvent.h"
2 #include "AliTPCPIDResponse.h"
3 #include "AliPIDResponse.h"
4 #include "AliESDtrack.h"
5 #include "AliPIDtools.h"
6 
7 std::map<Int_t, AliTPCPIDResponse *> AliPIDtools::pidTPC;
8 std::map<Int_t, AliPIDResponse *> AliPIDtools::pidAll;
9 AliESDtrack AliPIDtools::dummyTrack;
10 
11 AliTPCPIDResponse* AliPIDtools::GetTPCPID(Int_t hash ) {return pidTPC[hash];}
13  recoPass+=run;
14  recoPass+=passNumber;
15  recoPass+=isMC;
16  return recoPass.Hash();
17 }
18 
20  AliTPCPIDResponse *tpcPID=pidTPC[hash];
21  if (tpcPID) return tpcPID->Bethe(bg);
22  return 0;
23 }
29 Double_t AliPIDtools::GetExpectedTPCSignal(Int_t hash, Double_t p, AliPID::EParticleType particle) {
30  Double_t xyz[3] = {0., 0., 0.};
31  Double_t pxyz[3] = {0, 0., 0.};
32  Double_t cv[21] = {0.}; // dummy parameters for dummy tracks
33  AliTPCPIDResponse *tpcPID=pidTPC[hash];
34  if (tpcPID==0) return 0;
35  pxyz[0]=p;
36  dummyTrack.Set(xyz, pxyz, cv, 1);
37  Double_t dEdx = tpcPID->GetExpectedSignal(&dummyTrack, particle, AliTPCPIDResponse::kdEdxDefault, kFALSE, kTRUE);
38  return dEdx;
39 }
46 Int_t AliPIDtools::LoadPID(Int_t run, Int_t passNumber, TString recoPass, Bool_t isMC){
47  // Int_t run=246751, passNumber=1; TString recoPass("pass1"); Bool_t isMC=0;
48  AliESDEvent ev;
49  AliPIDResponse *pid = new AliPIDResponse(isMC);
50  pid->SetUseTPCMultiplicityCorrection();
51  pid->SetOADBPath("$ALICE_PHYSICS/OADB");
52  pid->InitialiseEvent(&ev,passNumber, recoPass, run);
53  AliTPCPIDResponse &tpcpid=pid->GetTPCResponse();
54  // pid.InitFromOADB(246751,1,"pass1");
55  Int_t hash=GetHash(run,passNumber, recoPass,isMC);
56  pidAll[hash]=pid;
57  pidTPC[hash]=&tpcpid;
58  return hash;
59 }
double Double_t
Definition: External.C:58
static AliESDtrack dummyTrack
we should use better hash map
Definition: AliPIDtools.h:39
static AliTPCPIDResponse * GetTPCPID(Int_t hash)
dummy value to save CPU - unfortunately PID object use AliVtrack - for the moment create global varai...
Definition: AliPIDtools.cxx:11
static std::map< Int_t, AliTPCPIDResponse * > pidTPC
Definition: AliPIDtools.h:36
static Int_t LoadPID(Int_t run, Int_t passNumber, TString recoPass, Bool_t isMC)
Definition: AliPIDtools.cxx:46
static std::map< Int_t, AliPIDResponse * > pidAll
we should use better hash map
Definition: AliPIDtools.h:37
int Int_t
Definition: External.C:63
static Int_t GetHash(Int_t run, Int_t passNumber, TString recoPass, Bool_t isMC)
Definition: AliPIDtools.cxx:12
Bool_t isMC
static Double_t BetheBlochAleph(Int_t hash, Double_t bg)
Definition: AliPIDtools.cxx:19
bool Bool_t
Definition: External.C:53
static Double_t GetExpectedTPCSignal(Int_t hash, Double_t p, AliPID::EParticleType particle)
Definition: AliPIDtools.cxx:29