added functions to get the mass according to AliHelperParticleSpecies_t and identity...
authorlmilano <lmilano@f7af4fe6-9843-0410-8265-dc069ae4e863>
Tue, 3 Dec 2013 11:29:01 +0000 (11:29 +0000)
committerlmilano <lmilano@f7af4fe6-9843-0410-8265-dc069ae4e863>
Tue, 3 Dec 2013 11:29:01 +0000 (11:29 +0000)
PWG/Tools/AliHelperPID.cxx
PWG/Tools/AliHelperPID.h

index ac72fd9..4f3191c 100644 (file)
@@ -199,6 +199,25 @@ Int_t AliHelperPID::GetParticleSpecies(AliVTrack * trk, Bool_t FIllQAHistos){
 
 //////////////////////////////////////////////////////////////////////////////////////////////////
 
+Int_t AliHelperPID::GetParticleSpecies(AliVParticle * part) {
+  // return PID according to MC truth
+  switch(TMath::Abs(part->PdgCode())){
+  case 2212:
+    return kSpProton;
+    break;
+  case 321:
+    return kSpKaon;
+    break;
+  case 211:
+    return kSpPion;
+    break;
+  default:
+    return kSpUndefined;
+  } 
+}
+
+//////////////////////////////////////////////////////////////////////////////////////////////////
+
 Int_t AliHelperPID::GetIDBayes(AliVTrack * trk, Bool_t FIllQAHistos){ 
   
   Bool_t *IDs=GetAllCompatibleIdentitiesNSigma(trk,FIllQAHistos);
@@ -585,6 +604,17 @@ Double_t AliHelperPID::TOFBetaCalc(AliVTrack *track) const{
 
 //////////////////////////////////////////////////////////////////////////////////////////////////
 
+Double_t AliHelperPID::GetMass(AliHelperParticleSpecies_t id) const{
+  //return Mass according to AliHelperParticleSpecies_t. If undefined return -999.
+  Double_t mass=-999.;
+  if (id == kSpProton) { mass=9.38271999999999995e-01; }
+  if (id == kSpKaon)   { mass=4.93676999999999977e-01; }
+  if (id == kSpPion)    { mass=1.39570000000000000e-01; }
+  return mass;
+}
+
+//////////////////////////////////////////////////////////////////////////////////////////////////
+
 Long64_t AliHelperPID::Merge(TCollection* list)
 {
   // Merging interface.
index e57aa0d..f455d21 100644 (file)
@@ -100,7 +100,8 @@ class AliHelperPID : public TNamed
   //PID functions
   // User should call ONLY the function GetParticleSpecies and set the PID strategy in the steering macro!
   Int_t GetParticleSpecies(AliVTrack * trk, Bool_t FIllQAHistos);//calculate the PID according to the slected method.
-  
+  Int_t GetParticleSpecies(AliVParticle * part);
+
   Int_t GetIDBayes(AliVTrack * trk, Bool_t FIllQAHistos);//calculate the PID according to bayesian PID
   UInt_t CalcPIDCombined(const AliVTrack *track,const AliPIDResponse *PIDResponse, Int_t detMask, Double_t* prob) const;
   void CalculateNSigmas(AliVTrack * trk, Bool_t FIllQAHistos);//Calcuate nsigma[ipart][idet], fill NSigma histos
@@ -110,6 +111,7 @@ class AliHelperPID : public TNamed
   Int_t GetMCParticleSpecie(AliVEvent* event, AliVTrack * trk, Bool_t FIllQAHistos);//calculate the PID according to MC truth
   void CheckTOF(AliVTrack * trk);//check the TOF matching and set fHasTOFPID
   Double_t TOFBetaCalc(AliVTrack *track) const;
+  Double_t GetMass(AliHelperParticleSpecies_t id) const;
   Long64_t Merge(TCollection* list);
   
  private: