Update of PID class (Rossella)
authordainese <dainese@f7af4fe6-9843-0410-8265-dc069ae4e863>
Fri, 4 Jun 2010 13:45:48 +0000 (13:45 +0000)
committerdainese <dainese@f7af4fe6-9843-0410-8265-dc069ae4e863>
Fri, 4 Jun 2010 13:45:48 +0000 (13:45 +0000)
PWG3/vertexingHF/AliAODPidHF.cxx
PWG3/vertexingHF/AliAODPidHF.h
PWG3/vertexingHF/AliAnalysisTaskSELambdac.cxx
PWG3/vertexingHF/AliAnalysisTaskSELambdac.h

index 65423bc72d5cd83c9f24a3a87a3e66b3f4330e79..4c6ac6f0367e24b8d2bd64feb4b20fbef01fcd92 100644 (file)
@@ -17,7 +17,7 @@
 //***********************************************************
 // Class AliAODPidHF
 // class for PID with AliAODRecoDecayHF
-// Authors: D. Caffarri caffarri@bo.infn.it, A.Dainese andrea.dainese@pd.infn.it, S. Dash dash@to.infn.it, F. Prino prino@to.infn.it, R. Romita r.romita@gsi.de, Y. Wang yifei@pi0.physi.uni-heidelberg.de
+// Authors: D. Caffarri caffarri@pd.infn.it, A.Dainese andrea.dainese@pd.infn.it, S. Dash dash@to.infn.it, F. Prino prino@to.infn.it, R. Romita r.romita@gsi.de, Y. Wang yifei@pi0.physi.uni-heidelberg.de
 //***********************************************************
 #include "AliAODPidHF.h"
 #include "AliAODPid.h"
@@ -34,24 +34,53 @@ ClassImp(AliAODPidHF)
 
 //------------------------------
 AliAODPidHF::AliAODPidHF():
-  fSigma(3.),
-  fPriors()
+  AliAODPid(),
+  fnNSigma(5),
+  fnSigma(),
+  fTOFSigma(160.),
+  fnPriors(5),
+  fPriors(),
+  fnPLimit(2),
+  fPLimit(),
+  fAsym(kFALSE)
 {
  //
  // Default constructor
  //
+ fPLimit=new Double_t[fnPLimit];
+ fnSigma=new Double_t[fnNSigma];
+ fPriors=new Double_t[fnPriors];
+
+ for(Int_t i=0;i<fnNSigma;i++){
+  fnSigma[i]=0.;
+ }
+ for(Int_t i=0;i<fnPriors;i++){
+  fPriors[i]=0.;
+ }
+ for(Int_t i=0;i<fnPLimit;i++){
+  fPLimit[i]=0.;
+ }
 
 }
 //----------------------
 AliAODPidHF::~AliAODPidHF()
 {
       // destructor
+ //   if(fPLimit) delete fPLimit;
+ //   if(fnSigma)  delete fnSigma;
+ //   if(fPriors)  delete fPriors;
 }
 //------------------------
 AliAODPidHF::AliAODPidHF(const AliAODPidHF& pid) :
   AliAODPid(pid),
-  fSigma(pid.fSigma),
-  fPriors(pid.fPriors)
+  fnNSigma(pid.fnNSigma),
+  fnSigma(pid.fnSigma),
+  fTOFSigma(pid.fTOFSigma),
+  fnPriors(pid.fnPriors),
+  fPriors(pid.fPriors),
+  fnPLimit(pid.fnPLimit),
+  fPLimit(pid.fPLimit),
+  fAsym(pid.fAsym)
   {
   
   for(Int_t i=0;i<5;i++){
@@ -61,8 +90,8 @@ AliAODPidHF::AliAODPidHF(const AliAODPidHF& pid) :
   }
 
 //----------------------
-Int_t AliAODPidHF::RawSignalPID(AliAODTrack *track, TString detector){
-
+Int_t AliAODPidHF::RawSignalPID(AliAODTrack *track, TString detector) const{
+// raw PID for single detectors, returns the particle type with smaller sigma
    Int_t specie=-1;
    if(detector.Contains("ITS")) return ApplyPidITSRaw(track,specie);
    if(detector.Contains("TPC")) return ApplyPidTPCRaw(track,specie);
@@ -72,8 +101,8 @@ Int_t AliAODPidHF::RawSignalPID(AliAODTrack *track, TString detector){
 
 }
 //---------------------------
-Bool_t AliAODPidHF::IsKaonRaw (AliAODTrack *track, TString detector){
-
+Bool_t AliAODPidHF::IsKaonRaw(AliAODTrack *track, TString detector) const{
+// checks if the track can be a kaon, raw PID applied for single detectors
  Int_t specie=0;
 
  if(detector.Contains("ITS")) specie=ApplyPidITSRaw(track,3);
@@ -84,7 +113,8 @@ Bool_t AliAODPidHF::IsKaonRaw (AliAODTrack *track, TString detector){
  return kFALSE;
 }
 //---------------------------
-Bool_t AliAODPidHF::IsPionRaw (AliAODTrack *track, TString detector){
+Bool_t AliAODPidHF::IsPionRaw (AliAODTrack *track, TString detector) const{
+// checks if the track can be a pion, raw PID applied for single detectors
 
  Int_t specie=0;
 
@@ -96,7 +126,8 @@ Bool_t AliAODPidHF::IsPionRaw (AliAODTrack *track, TString detector){
  return kFALSE;
 }
 //---------------------------
-Bool_t AliAODPidHF::IsProtonRaw (AliAODTrack *track, TString detector){
+Bool_t AliAODPidHF::IsProtonRaw (AliAODTrack *track, TString detector) const{
+// checks if the track can be a proton raw PID applied for single detectors
 
  Int_t specie=0;
  if(detector.Contains("ITS")) specie=ApplyPidITSRaw(track,4);
@@ -108,7 +139,8 @@ Bool_t AliAODPidHF::IsProtonRaw (AliAODTrack *track, TString detector){
  return kFALSE;
 }
 //--------------------------
-Bool_t AliAODPidHF::IsElectronRaw (AliAODTrack *track, TString detector){
+Bool_t AliAODPidHF::IsElectronRaw(AliAODTrack *track, TString detector) const{
+// checks if the track can be an electron raw PID applied for single detectors
 
  Int_t specie=-1;
  if(detector.Contains("ITS")) specie=ApplyPidITSRaw(track,0);
@@ -120,7 +152,8 @@ Bool_t AliAODPidHF::IsElectronRaw (AliAODTrack *track, TString detector){
  return kFALSE;
 }
 //--------------------------
-Int_t AliAODPidHF::ApplyPidTPCRaw(AliAODTrack *track,Int_t specie){
+Int_t AliAODPidHF::ApplyPidTPCRaw(AliAODTrack *track,Int_t specie) const{
+// n-sigma cut, TPC PID
 
   if(!CheckStatus(track,"TPC")) return -1;
   AliAODPid *pidObj = track->GetDetPid();
@@ -130,11 +163,11 @@ Int_t AliAODPidHF::ApplyPidTPCRaw(AliAODTrack *track,Int_t specie){
   AliTPCPIDResponse tpcResponse;
   Int_t pid=-1;
   if(specie<0){  // from RawSignalPID : should return the particle specie to wich the de/dx is closer to the bethe-block curve -> performance to be checked
-   Double_t nsigmaMax=fSigma;
+   Double_t nsigmaMax=fnSigma[0];
    for(Int_t ipart=0;ipart<5;ipart++){
     AliPID::EParticleType type=AliPID::EParticleType(ipart);
     Double_t nsigma = TMath::Abs(tpcResponse.GetNumberOfSigmas(mom,dedx,track->GetTPCNcls(),type));
-    if((nsigma<nsigmaMax) && (nsigma<fSigma)) {
+    if((nsigma<nsigmaMax) && (nsigma<fnSigma[0])) {
      pid=ipart;
      nsigmaMax=nsigma;
     }
@@ -142,7 +175,7 @@ Int_t AliAODPidHF::ApplyPidTPCRaw(AliAODTrack *track,Int_t specie){
   }else{ // asks only for one particle specie
    AliPID::EParticleType type=AliPID::EParticleType(specie);
     Double_t nsigma = TMath::Abs(tpcResponse.GetNumberOfSigmas(mom,dedx,track->GetTPCNcls(),type));
-   if (nsigma>fSigma) {
+   if (nsigma>fnSigma[0]) {
     pid=-1; 
    }else{
     pid=specie;
@@ -153,7 +186,8 @@ Int_t AliAODPidHF::ApplyPidTPCRaw(AliAODTrack *track,Int_t specie){
 
 }
 //----------------------------
-Int_t AliAODPidHF::ApplyPidITSRaw(AliAODTrack *track,Int_t specie){
+Int_t AliAODPidHF::ApplyPidITSRaw(AliAODTrack *track,Int_t specie) const{
+// truncated mean, ITS PID
 
   if(!CheckStatus(track,"ITS")) return -1;
 
@@ -164,11 +198,11 @@ Int_t AliAODPidHF::ApplyPidITSRaw(AliAODTrack *track,Int_t specie){
   AliITSPIDResponse itsResponse;
   Int_t pid=-1;
   if(specie<0){  // from RawSignalPID : should return the particle specie to wich the de/dx is closer to the bethe-block curve -> performance to be checked
-   Double_t nsigmaMax=fSigma;
+   Double_t nsigmaMax=fnSigma[4];
    for(Int_t ipart=0;ipart<5;ipart++){
     AliPID::EParticleType type=AliPID::EParticleType(ipart);
     Double_t nsigma = TMath::Abs(itsResponse.GetNumberOfSigmas(mom,dedx,type));
-    if((nsigma<nsigmaMax) && (nsigma<fSigma)) {
+    if((nsigma<nsigmaMax) && (nsigma<fnSigma[4])) {
      pid=ipart;
      nsigmaMax=nsigma;
     }
@@ -176,7 +210,7 @@ Int_t AliAODPidHF::ApplyPidITSRaw(AliAODTrack *track,Int_t specie){
   }else{ // asks only for one particle specie
    AliPID::EParticleType type=AliPID::EParticleType(specie);
     Double_t nsigma = TMath::Abs(itsResponse.GetNumberOfSigmas(mom,dedx,type));
-   if (nsigma>fSigma) {
+   if (nsigma>fnSigma[4]) {
     pid=-1; 
    }else{
     pid=specie;
@@ -185,30 +219,34 @@ Int_t AliAODPidHF::ApplyPidITSRaw(AliAODTrack *track,Int_t specie){
  return pid; 
 }
 //----------------------------
-Int_t AliAODPidHF::ApplyPidTOFRaw(AliAODTrack *track,Int_t specie){
+Int_t AliAODPidHF::ApplyPidTOFRaw(AliAODTrack *track,Int_t specie) const{
+// n-sigma cut, TOF PID
 
  if(!CheckStatus(track,"TOF")) return -1;
 
  Double_t time[AliPID::kSPECIESN];
  AliAODPid *pidObj = track->GetDetPid();
  pidObj->GetIntegratedTimes(time);
- AliTOFPIDResponse tofResponse;
+ Double_t sigTOF=pidObj->GetTOFsignal();
+// AliTOFPIDResponse tofResponse;
  Int_t pid=-1;
 
   if(specie<0){  // from RawSignalPID : should return the particle specie to wich the de/dx is closer to the bethe-block curve -> performance to be checked
-   Double_t nsigmaMax=fSigma;
+   Double_t nsigmaMax=fTOFSigma*fnSigma[3];
    for(Int_t ipart=0;ipart<5;ipart++){
-    AliPID::EParticleType type=AliPID::EParticleType(ipart);
-    Double_t nsigma = tofResponse.GetExpectedSigma(track->P(),time[type],AliPID::ParticleMass(type));
-    if((nsigma<nsigmaMax) && (nsigma<fSigma)) {
+    //AliPID::EParticleType type=AliPID::EParticleType(ipart);
+    //Double_t nsigma = tofResponse.GetExpectedSigma(track->P(),time[type],AliPID::ParticleMass(type));
+    Double_t nsigma=TMath::Abs(sigTOF-time[ipart]);
+    if((nsigma<nsigmaMax) && (nsigma<fnSigma[3]*fTOFSigma)) {
      pid=ipart;
      nsigmaMax=nsigma;
     }
    }
   }else{ // asks only for one particle specie
-   AliPID::EParticleType type=AliPID::EParticleType(specie);
-   Double_t nsigma = TMath::Abs(tofResponse.GetExpectedSigma(track->P(),time[type],AliPID::ParticleMass(type)));
-   if (nsigma>fSigma) {
+   //AliPID::EParticleType type=AliPID::EParticleType(specie);
+   //Double_t nsigma = TMath::Abs(tofResponse.GetExpectedSigma(track->P(),time[type],AliPID::ParticleMass(type)));
+    Double_t nsigma=TMath::Abs(sigTOF-time[specie]);
+   if (nsigma>fnSigma[3]*fTOFSigma) {
     pid=-1; 
    }else{
     pid=specie;
@@ -218,7 +256,8 @@ Int_t AliAODPidHF::ApplyPidTOFRaw(AliAODTrack *track,Int_t specie){
 
 }
 //------------------------------
-void AliAODPidHF::CombinedProbability(AliAODTrack *track,Bool_t *type){
+void AliAODPidHF::CombinedProbability(AliAODTrack *track,Bool_t *type) const{
+// combined PID stored inside the AOD track
 
  const Double_t *pid=track->PID();
  Float_t max=0.;
@@ -234,7 +273,8 @@ void AliAODPidHF::CombinedProbability(AliAODTrack *track,Bool_t *type){
  return;
 }
 //--------------------
-void AliAODPidHF::BayesianProbability(AliAODTrack *track,TString detectors,Double_t *pid){
+void AliAODPidHF::BayesianProbability(AliAODTrack *track,TString detectors,Double_t *pid) const{
+// bayesian PID for single detectors or combined
 
   if(detectors.Contains("ITS")) {BayesianProbabilityITS(track,pid);return;}
   if(detectors.Contains("TPC")) {BayesianProbabilityTPC(track,pid);return;}
@@ -260,8 +300,9 @@ void AliAODPidHF::BayesianProbability(AliAODTrack *track,TString detectors,Doubl
 
 }
 //------------------------------------
-void AliAODPidHF::BayesianProbabilityITS(AliAODTrack *track,Double_t *prob){
+void AliAODPidHF::BayesianProbabilityITS(AliAODTrack *track,Double_t *prob) const{
 
+// bayesian PID for ITS
  AliAODpidUtil pid;
  Double_t itspid[AliPID::kSPECIES];
  pid.MakeITSPID(track,itspid);
@@ -272,7 +313,8 @@ void AliAODPidHF::BayesianProbabilityITS(AliAODTrack *track,Double_t *prob){
 
 }
 //------------------------------------
-void AliAODPidHF::BayesianProbabilityTPC(AliAODTrack *track,Double_t *prob){
+void AliAODPidHF::BayesianProbabilityTPC(AliAODTrack *track,Double_t *prob) const{
+// bayesian PID for TPC
 
  AliAODpidUtil pid;
  Double_t tpcpid[AliPID::kSPECIES];
@@ -288,11 +330,12 @@ void AliAODPidHF::BayesianProbabilityTPC(AliAODTrack *track,Double_t *prob){
 
 }
 //------------------------------------
-void AliAODPidHF::BayesianProbabilityTOF(AliAODTrack *track,Double_t *prob){
+void AliAODPidHF::BayesianProbabilityTOF(AliAODTrack *track,Double_t *prob) const{
+// bayesian PID for TOF
 
  AliAODpidUtil pid;
  Double_t tofpid[AliPID::kSPECIES];
//pid.MakeTOFPID(track,tofpid);
+ pid.MakeTOFPID(track,tofpid);
  for(Int_t ind=0;ind<AliPID::kSPECIES;ind++){
   prob[ind]=tofpid[ind]*fPriors[ind]/(tofpid[0]*fPriors[0]+tofpid[1]*fPriors[1]+tofpid[2]*fPriors[2]+tofpid[3]*fPriors[3]+tofpid[4]*fPriors[4]);
  }
@@ -300,7 +343,8 @@ void AliAODPidHF::BayesianProbabilityTOF(AliAODTrack *track,Double_t *prob){
 
 }
 //---------------------------------
-void AliAODPidHF::BayesianProbabilityTRD(AliAODTrack *track,Double_t *prob){
+void AliAODPidHF::BayesianProbabilityTRD(AliAODTrack *track,Double_t *prob) const{
+// bayesian PID for TRD
 
  AliAODpidUtil pid;
  Double_t trdpid[AliPID::kSPECIES];
@@ -316,8 +360,9 @@ void AliAODPidHF::BayesianProbabilityTRD(AliAODTrack *track,Double_t *prob){
 
  }
 //--------------------------------
-Bool_t AliAODPidHF::CheckStatus(AliAODTrack *track,TString detectors){
+Bool_t AliAODPidHF::CheckStatus(AliAODTrack *track,TString detectors) const{
 
+// Quality cuts on the tracks, detector by detector
 
  if(detectors.Contains("ITS")){
   if ((track->GetStatus()&AliESDtrack::kITSin)==0) return kFALSE;
@@ -355,3 +400,130 @@ Bool_t AliAODPidHF::CheckStatus(AliAODTrack *track,TString detectors){
 
  return kTRUE;
 }
+//--------------------------------------------
+Bool_t AliAODPidHF::TPCRawAsym(AliAODTrack* track,Int_t specie) const{
+// TPC nsigma cut PID, different sigmas in different p bins
+
+  if(!CheckStatus(track,"TPC")) return kFALSE;
+  AliAODPid *pidObj = track->GetDetPid();
+  Double_t mom = pidObj->GetTPCmomentum();
+  Double_t dedx=pidObj->GetTPCsignal();
+  
+  AliTPCPIDResponse tpcResponse;
+  AliPID::EParticleType type=AliPID::EParticleType(specie);
+  Double_t nsigma = TMath::Abs(tpcResponse.GetNumberOfSigmas(mom,dedx,track->GetTPCNcls(),type)); 
+
+  if(mom<fPLimit[0] && nsigma<fnSigma[0]) return kTRUE;
+  if(mom<fPLimit[1] && mom>fPLimit[0] && nsigma<fnSigma[1]) return kTRUE;
+  if(mom>fPLimit[1] && nsigma<fnSigma[2]) return kTRUE;
+
+ return kFALSE;
+}
+//------------------
+Int_t AliAODPidHF::MatchTPCTOF(AliAODTrack *track,Int_t mode,Int_t specie,Bool_t compat){
+// combination of the PID info coming from TPC and TOF
+ if(mode==1){
+  //TOF || TPC (a la' Andrea R.)
+ // convention (temporary): 
+ // for the single detectors: -1 = kFALSE, 1 = kTRUE, 0 = compatible
+ // the method returns the sum of the response of the 2 detectors
+  if(!CheckStatus(track,"TPC") && !CheckStatus(track,"TOF")) return 0;
+
+  Int_t TPCinfo=0;
+  if(CheckStatus(track,"TPC")) {
+   if(fAsym) {
+    if(TPCRawAsym(track,specie)) TPCinfo=1;
+   }else{
+    if(specie==2 && IsPionRaw(track,"TPC")) TPCinfo=1;
+    if(specie==3 && IsKaonRaw(track,"TPC")) TPCinfo=1;
+    if(specie==4 && IsProtonRaw(track,"TPC")) TPCinfo=1;
+   }
+
+
+  if(compat && TPCinfo<0){
+   SetSigma(0,3.);
+   if(specie==2 && IsPionRaw(track,"TPC")) TPCinfo=0;
+   if(specie==3 && IsKaonRaw(track,"TPC")) TPCinfo=0;
+   if(specie==4 && IsProtonRaw(track,"TPC")) TPCinfo=0;
+  }
+
+ }
+
+ if(!CheckStatus(track,"TOF")) return TPCinfo;
+
+ Int_t TOFinfo=-1;
+  if(specie==2 && IsPionRaw(track,"TOF")) TOFinfo=1;
+  if(specie==3 && IsKaonRaw(track,"TOF")) TOFinfo=1;
+  if(specie==4 && IsProtonRaw(track,"TOF")) TOFinfo=1;
+
+ if(compat && TOFinfo>0){
+  Double_t ptrack=track->P();
+  if(ptrack>1.5) TOFinfo=0;
+ }
+
+ return TPCinfo+TOFinfo;
+ }
+ if(mode==2){
+  //TPC & TOF (a la' Yifei)
+ // convention (temporary): -1 = kFALSE, 1 = kTRUE, 0 = not identified
+  Int_t TPCinfo=1; 
+  if(CheckStatus(track,"TPC")) {
+   if(fAsym){
+    if(!TPCRawAsym(track,specie)) TPCinfo=-1;
+   }else{
+    if(specie==2 && !IsPionRaw(track,"TPC")) TPCinfo=-1;
+    if(specie==3 && !IsKaonRaw(track,"TPC")) TPCinfo=-1;
+    if(specie==4 && !IsProtonRaw(track,"TPC")) TPCinfo=-1;
+   }
+  }
+
+  Int_t TOFinfo=1;
+  if(!CheckStatus(track,"TOF")) return TPCinfo;
+
+   if(specie==2 && !IsPionRaw(track,"TOF")) TOFinfo=-1;
+   if(specie==3 && !IsKaonRaw(track,"TOF")) TOFinfo=-1;
+   if(specie==4 && !IsProtonRaw(track,"TOF")) TOFinfo=-1;
+
+   if(TOFinfo==1 && TPCinfo==1) return 1;
+   return -1;
+
+ }
+
+ if(mode==3){
+ //TPC for p<fPLimit[0], TOF for p>=fPLimit[0] (a la' Andrea A.)
+ // convention (temporary): -1 = kFALSE, 1 = kTRUE, 0 = not identified
+  
+  if(!CheckStatus(track,"TPC") && !CheckStatus(track,"TOF")) return 0;
+
+  Double_t ptrack=track->P();
+  
+
+  Int_t TPCinfo=-1;
+
+   if(ptrack<fPLimit[0]) {  
+    if(!CheckStatus(track,"TPC")) return 0;
+    if(fAsym) {
+     if(TPCRawAsym(track,specie)) TPCinfo=1;
+    }else{
+     if(specie==2 && IsPionRaw(track,"TPC")) TPCinfo=1;
+     if(specie==3 && IsKaonRaw(track,"TPC")) TPCinfo=1;
+     if(specie==4 && IsProtonRaw(track,"TPC")) TPCinfo=1;
+    } 
+    return TPCinfo;
+   }
+
+   Int_t TOFinfo=-1;
+   if(ptrack>=fPLimit[0]){
+    if(!CheckStatus(track,"TOF")) return 0;
+    if(specie==2 && IsPionRaw(track,"TOF")) TOFinfo=1;
+    if(specie==3 && IsKaonRaw(track,"TOF")) TOFinfo=1;
+    if(specie==4 && IsProtonRaw(track,"TOF")) TOFinfo=1;
+    return TOFinfo;
+   }
+
+ }
+
+ return -1;
+}
+   
index 4df9c91645c8d4fb8e199d5c5759dfe8368a6bd6..0968eba684247c75c4fe2ad5206375450615700c 100644 (file)
@@ -7,13 +7,13 @@
 //***********************************************************
 //// Class AliAODPidHF
 //// class for PID with AliAODRecoDecayHF 
-//// Authors: D. Caffarri caffarri@bo.infn.it, A.Dainese andrea.dainese@pd.infn.it, S. Dash dash@to.infn.it, F. Prino prino@to.infn.it, R. Romita r.romita@gsi.de, Y. Wang yifei@pi0.physi.uni-heidelberg.de
+//// Authors: D. Caffarri caffarri@pd.infn.it, A.Dainese andrea.dainese@pd.infn.it, S. Dash dash@to.infn.it, F. Prino prino@to.infn.it, R. Romita r.romita@gsi.de, Y. Wang yifei@pi0.physi.uni-heidelberg.de
 ////***********************************************************
 
 #include "AliAODPid.h"
 #include "AliAODTrack.h"
 
-class AliAODPidHF : public AliAODPid {
+class AliAODPidHF : public AliAODPid{
 
  public:
 
@@ -23,35 +23,51 @@ class AliAODPidHF : public AliAODPid {
  virtual ~AliAODPidHF();
 
  //Setters
- void SetSigma(Double_t sigma){fSigma=sigma;return;}
+ void SetSigma(Double_t *sigma){fnSigma=sigma;return;}
+ void SetSigma(Int_t idet,Double_t sigma){fnSigma[idet]=sigma;return;}
+ void SetTofSigma(Double_t sigma){fTOFSigma=sigma;return;}
  void SetPriors(Double_t *priors){fPriors=priors;return;}
+ void SetPLimit(Double_t *plim){fPLimit=plim;return;}
+ void SetAsym(Bool_t asym){fAsym=asym;return;}
  
 
- Int_t RawSignalPID (AliAODTrack *track, TString detector);
- Bool_t IsKaonRaw (AliAODTrack *track, TString detector);
- Bool_t IsPionRaw (AliAODTrack *track, TString detector);
- Bool_t IsProtonRaw (AliAODTrack *track, TString detector);
- Bool_t IsElectronRaw (AliAODTrack *track, TString detector);
- void BayesianProbability(AliAODTrack *track,TString detectors,Double_t *pid);
- void CombinedProbability(AliAODTrack *track,Bool_t *type); //0 = pion, 1 = kaon, 2 = proton
- Bool_t CheckStatus(AliAODTrack *track,TString detectors);
+ Int_t RawSignalPID (AliAODTrack *track, TString detector) const;
+ Bool_t IsKaonRaw (AliAODTrack *track, TString detector) const;
+ Bool_t IsPionRaw (AliAODTrack *track, TString detector) const;
+ Bool_t IsProtonRaw (AliAODTrack *track, TString detector) const;
+ Bool_t IsElectronRaw (AliAODTrack *track, TString detector) const;
+ void BayesianProbability(AliAODTrack *track,TString detectors,Double_t *pid) const;
+ void CombinedProbability(AliAODTrack *track,Bool_t *type) const; //0 = pion, 1 = kaon, 2 = proton
+ Bool_t CheckStatus(AliAODTrack *track,TString detectors) const;
+
+ Bool_t TPCRawAsym(AliAODTrack* track,Int_t specie) const;
+ Int_t MatchTPCTOF(AliAODTrack *track,Int_t mode,Int_t specie,Bool_t compat);
+
+
 
  protected:
 
- Int_t ApplyPidTPCRaw(AliAODTrack *track,Int_t specie);
- Int_t ApplyPidTOFRaw(AliAODTrack *track,Int_t specie);
- Int_t ApplyPidITSRaw(AliAODTrack *track,Int_t specie);
- void BayesianProbabilityITS(AliAODTrack *track,Double_t *prob);
- void BayesianProbabilityTPC(AliAODTrack *track,Double_t *prob);
- void BayesianProbabilityTOF(AliAODTrack *track,Double_t *prob);
- void BayesianProbabilityTRD(AliAODTrack *track,Double_t *prob);
+ Int_t ApplyPidTPCRaw(AliAODTrack *track,Int_t specie) const;
+ Int_t ApplyPidTOFRaw(AliAODTrack *track,Int_t specie) const;
+ Int_t ApplyPidITSRaw(AliAODTrack *track,Int_t specie) const;
+ void BayesianProbabilityITS(AliAODTrack *track,Double_t *prob) const;
+ void BayesianProbabilityTPC(AliAODTrack *track,Double_t *prob) const;
+ void BayesianProbabilityTOF(AliAODTrack *track,Double_t *prob) const;
+ void BayesianProbabilityTRD(AliAODTrack *track,Double_t *prob) const;
 
  private:
- Double_t fSigma; // sigma for the raw signal PID 
- Double_t *fPriors; // set of priors
+ Int_t fnNSigma;
+ Double_t *fnSigma; // [fnNSigma], sigma for the raw signal PID: 0-2 for TPC, 3 for TOF, 4 for ITS 
+ Double_t fTOFSigma; // TOF precision 
+ Int_t fnPriors;
+ Double_t *fPriors; // [fnPriors], set of priors
+ Int_t fnPLimit;
+ Double_t *fPLimit; // [fnPLimit], limit of p intervals for asimmetric PID: fPLimit<p[0], fPLimit[0]<p<fPLimit[1], p>fPLimit[1]
+ Bool_t fAsym; // asimmetric PID required
 
 
- ClassDef(AliAODPidHF,3)
+ ClassDef(AliAODPidHF,3) // AliAODPid for heavy flavor PID
 
 };
 
index 467db92721d92830a5700798d758e8413ffe0564..0ef1f458a025b4319b2dd8a91cd4f8fcc8eb7260 100644 (file)
@@ -55,12 +55,42 @@ AliAnalysisTaskSELambdac::AliAnalysisTaskSELambdac():
 AliAnalysisTaskSE(),
 fOutput(0), 
 fHistNEvents(0),
+fWellIDProt3sig(0),
+fWellIDProt2sig(0),
+fWellIDProt3sigSe(0),
+fWellIDProt2sigSe(0),
+fWellIDProt3sigRe(0),
+fWellIDProt2sigRe(0),
+fWellIDKaon3sig(0),
+fWellIDKaon3sigSe(0),
+fWellIDKaon3sigRe(0),
+fWellIDKaon2sig(0),
+fWellIDKaon2sigSe(0),
+fWellIDKaon2sigRe(0),
+fRealProt(0),
+fRealKaon(0),
+fFakeProt3sig(0),
+fFakeProt2sig(0),
+fFakeProt3sigSe(0),
+fFakeProt2sigSe(0),
+fFakeProt3sigRe(0),
+fFakeProt2sigRe(0),
+fFakeKaon3sig(0),
+fFakeKaon3sigSe(0),
+fFakeKaon3sigRe(0),
+fFakeKaon2sig(0),
+fFakeKaon2sigSe(0),
+fFakeKaon2sigRe(0),
 fTPCSignal3Sigma(0),
 fTPCSignal3SigmaReK(0),
+fTPCSignal3SigmaSedK(0),
 fTPCSignal3SigmaRep(0),
+fTPCSignal3SigmaSedp(0),
 fTPCSignal2Sigma(0),
 fTPCSignal2SigmaReK(0),
+fTPCSignal2SigmaSedK(0),
 fTPCSignal2SigmaRep(0),
+fTPCSignal2SigmaSedp(0),
 fNtupleLambdac(0),
 fUpmasslimit(2.486),
 fLowmasslimit(2.086),
@@ -84,12 +114,42 @@ AliAnalysisTaskSELambdac::AliAnalysisTaskSELambdac(const char *name,Bool_t fillN
 AliAnalysisTaskSE(name),
 fOutput(0),
 fHistNEvents(0),
+fWellIDProt3sig(0),
+fWellIDProt2sig(0),
+fWellIDProt3sigSe(0),
+fWellIDProt2sigSe(0),
+fWellIDProt3sigRe(0),
+fWellIDProt2sigRe(0),
+fWellIDKaon3sig(0),
+fWellIDKaon3sigSe(0),
+fWellIDKaon3sigRe(0),
+fWellIDKaon2sig(0),
+fWellIDKaon2sigSe(0),
+fWellIDKaon2sigRe(0),
+fRealProt(0),
+fRealKaon(0),
+fFakeProt3sig(0),
+fFakeProt2sig(0),
+fFakeProt3sigSe(0),
+fFakeProt2sigSe(0),
+fFakeProt3sigRe(0),
+fFakeProt2sigRe(0),
+fFakeKaon3sig(0),
+fFakeKaon3sigSe(0),
+fFakeKaon3sigRe(0),
+fFakeKaon2sig(0),
+fFakeKaon2sigSe(0),
+fFakeKaon2sigRe(0),
 fTPCSignal3Sigma(0),
 fTPCSignal3SigmaReK(0),
+fTPCSignal3SigmaSedK(0),
 fTPCSignal3SigmaRep(0),
+fTPCSignal3SigmaSedp(0),
 fTPCSignal2Sigma(0),
 fTPCSignal2SigmaReK(0),
+fTPCSignal2SigmaSedK(0),
 fTPCSignal2SigmaRep(0),
+fTPCSignal2SigmaSedp(0),
 fNtupleLambdac(0),
 fUpmasslimit(2.486),
 fLowmasslimit(2.086),
@@ -434,12 +494,42 @@ void AliAnalysisTaskSELambdac::UserCreateOutputObjects()
     fMassHistLSTC[indexLS]->Sumw2();
   }
 
+  fRealProt=new TH1F("fRealProt","fRealProt",100,0, 10);
+  fRealKaon=new TH1F("fRealKaon","fRealKaon",100,0, 10);
+  fWellIDProt3sig=new TH1F("fWellIDProt3sig","fWellIDProt3sig",100,0, 10);
+  fWellIDProt2sig=new TH1F("fWellIDProt2sig","fWellIDProt2sig",100,0, 10);
+  fWellIDProt3sigSe=new TH1F("fWellIDProt3sigSe","fWellIDProt3sigSe",100,0, 10);
+  fWellIDProt2sigSe=new TH1F("fWellIDProt2sigSe","fWellIDProt2sigSe",100,0, 10);
+  fWellIDProt3sigRe=new TH1F("fWellIDProt3sigRe","fWellIDProt3sigRe",100,0, 10);
+  fWellIDProt2sigRe=new TH1F("fWellIDProt2sigRe","fWellIDProt2sigRe",100,0, 10);
+  fWellIDKaon3sig=new TH1F("fWellIDKaon3sig","fWellIDKaon3sig",100,0, 10);
+  fWellIDKaon2sig=new TH1F("fWellIDKaon2sig","fWellIDKaon2sig",100,0, 10);
+  fWellIDKaon3sigSe=new TH1F("fWellIDKaon3sigSe","fWellIDKaon3sigSe",100,0, 10);
+  fWellIDKaon2sigSe=new TH1F("fWellIDKaon2sigSe","fWellIDKaon2sigSe",100,0, 10);
+  fWellIDKaon3sigRe=new TH1F("fWellIDKaon3sigRe","fWellIDKaon3sigRe",100,0, 10);
+  fWellIDKaon2sigRe=new TH1F("fWellIDKaon2sigRe","fWellIDKaon2sigRe",100,0, 10);
   fTPCSignal3Sigma=new TH2F("fTPCSignal3Sigma","fTPCSignal3Sigma",100,0, 10, 100, 0, 100);
-  fTPCSignal3SigmaReK=new TH2F("fTPCSignal3SigmaReK","fTPCSignal3SigmaRe",100,0, 10, 100, 0, 100);
-  fTPCSignal3SigmaRep=new TH2F("fTPCSignal3SigmaRep","fTPCSignal3SigmaRe",100,0, 10, 100, 0, 100);
+  fTPCSignal3SigmaReK=new TH2F("fTPCSignal3SigmaReK","fTPCSignal3SigmaReK",100,0, 10, 100, 0, 100);
+  fTPCSignal3SigmaSedK=new TH2F("fTPCSignal3SigmaSedK","fTPCSignal3SigmaSedK",100,0, 10, 100, 0, 100);
+  fTPCSignal3SigmaRep=new TH2F("fTPCSignal3SigmaRep","fTPCSignal3SigmaRep",100,0, 10, 100, 0, 100);
+  fTPCSignal3SigmaSedp=new TH2F("fTPCSignal3SigmaSedp","fTPCSignal3SigmaSedp",100,0, 10, 100, 0, 100);
   fTPCSignal2Sigma=new TH2F("fTPCSignal2Sigma","fTPCSignal2Sigma",100,0, 10, 100, 0, 100);
-  fTPCSignal2SigmaReK=new TH2F("fTPCSignal2SigmaReK","fTPCSignal2SigmaRe",100,0, 10, 100, 0, 100);
-  fTPCSignal2SigmaRep=new TH2F("fTPCSignal2SigmaRep","fTPCSignal2SigmaRe",100,0, 10, 100, 0, 100);
+  fTPCSignal2SigmaReK=new TH2F("fTPCSignal2SigmaReK","fTPCSignal2SigmaReK",100,0, 10, 100, 0, 100);
+  fTPCSignal2SigmaSedK=new TH2F("fTPCSignal2SigmaSedK","fTPCSignal2SigmaSedK",100,0, 10, 100, 0, 100);
+  fTPCSignal2SigmaRep=new TH2F("fTPCSignal2SigmaRep","fTPCSignal2SigmaRep",100,0, 10, 100, 0, 100);
+  fTPCSignal2SigmaSedp=new TH2F("fTPCSignal2SigmaSedp","fTPCSignal2SigmaSedp",100,0, 10, 100, 0, 100);
+  fFakeProt3sig=new TH1F("fFakeProt3sig","fFakeProt3sig",100,0, 10);
+  fFakeProt2sig=new TH1F("fFakeProt2sig","fFakeProt2sig",100,0, 10);
+  fFakeProt3sigSe=new TH1F("fFakeProt3sigSe","fFakeProt3sigSe",100,0, 10);
+  fFakeProt2sigSe=new TH1F("fFakeProt2sigSe","fFakeProt2sigSe",100,0, 10);
+  fFakeProt3sigRe=new TH1F("fFakeProt3sigRe","fFakeProt3sigRe",100,0, 10);
+  fFakeProt2sigRe=new TH1F("fFakeProt2sigRe","fFakeProt2sigRe",100,0, 10);
+  fFakeKaon3sig=new TH1F("fFakeKaon3sig","fFakeKaon3sig",100,0, 10);
+  fFakeKaon2sig=new TH1F("fFakeKaon2sig","fFakeKaon2sig",100,0, 10);
+  fFakeKaon3sigSe=new TH1F("fFakeKaon3sigSe","fFakeKaon3sigSe",100,0, 10);
+  fFakeKaon2sigSe=new TH1F("fFakeKaon2sigSe","fFakeKaon2sigSe",100,0, 10);
+  fFakeKaon3sigRe=new TH1F("fFakeKaon3sigRe","fFakeKaon3sigRe",100,0, 10);
+  fFakeKaon2sigRe=new TH1F("fFakeKaon2sigRe","fFakeKaon2sigRe",100,0, 10);
   
   for(Int_t i=0; i<3*fNPtBins; i++){
     fOutput->Add(fMassHist[i]);
@@ -454,12 +544,41 @@ void AliAnalysisTaskSELambdac::UserCreateOutputObjects()
 
     fOutput->Add(fTPCSignal3Sigma);
     fOutput->Add(fTPCSignal3SigmaReK);
+    fOutput->Add(fTPCSignal3SigmaSedK);
     fOutput->Add(fTPCSignal3SigmaRep);
+    fOutput->Add(fTPCSignal3SigmaSedp);
     fOutput->Add(fTPCSignal2Sigma);
     fOutput->Add(fTPCSignal2SigmaReK);
+    fOutput->Add(fTPCSignal2SigmaSedK);
     fOutput->Add(fTPCSignal2SigmaRep);
-  
-
+    fOutput->Add(fTPCSignal2SigmaSedp);
+    fOutput->Add(fWellIDProt3sig);
+    fOutput->Add(fWellIDProt2sig);
+    fOutput->Add(fWellIDProt3sigSe);
+    fOutput->Add(fWellIDProt2sigSe);
+    fOutput->Add(fWellIDProt3sigRe);
+    fOutput->Add(fWellIDProt2sigRe);
+    fOutput->Add(fWellIDKaon3sig);
+    fOutput->Add(fWellIDKaon2sig);
+    fOutput->Add(fWellIDKaon3sigSe);
+    fOutput->Add(fWellIDKaon2sigSe);
+    fOutput->Add(fWellIDKaon3sigRe);
+    fOutput->Add(fWellIDKaon2sigRe);
+
+    fOutput->Add(fRealProt);
+    fOutput->Add(fRealKaon);
+    fOutput->Add(fFakeProt3sig);
+    fOutput->Add(fFakeProt2sig);
+    fOutput->Add(fFakeProt3sigSe);
+    fOutput->Add(fFakeProt2sigSe);
+    fOutput->Add(fFakeProt3sigRe);
+    fOutput->Add(fFakeProt2sigRe);
+    fOutput->Add(fFakeKaon3sig);
+    fOutput->Add(fFakeKaon2sig);
+    fOutput->Add(fFakeKaon3sigSe);
+    fOutput->Add(fFakeKaon2sigSe);
+    fOutput->Add(fFakeKaon3sigRe);
+    fOutput->Add(fFakeKaon2sigRe);
   fHistNEvents = new TH1F("fHistNEvents", "Number of processed events; ; Events",3,-1.5,1.5);
   fHistNEvents->Sumw2();
   fHistNEvents->SetMinimum(0);
@@ -601,15 +720,13 @@ void AliAnalysisTaskSELambdac::UserExec(Option_t */*option*/)
       Double_t field=aod->GetMagneticField();
       if(fReadMC && fMCPid){
        
-       if(IspKpiMC(d,arrayMC)) {
+       if(IspKpiMC(d,arrayMC,pdgs)) {
         invMasspKpi=d->InvMassLcpKpi();
        if(fUseKF){
         pdgs[0]=2212;pdgs[1]=321;pdgs[2]=211;
         if(!VertexingKF(d,pdgs,field)) invMasspKpi=-1.;
        }
        }
-       IspiKpReal(d);
-       IspiKpResonant(d,field);
        if(IspiKpMC(d,arrayMC)) {
         invMasspiKp=d->InvMassLcpiKp();
        if(fUseKF){
@@ -626,7 +743,8 @@ void AliAnalysisTaskSELambdac::UserExec(Option_t */*option*/)
         if(!VertexingKF(d,pdgs,field)) invMasspKpi=-1.;
        }
        }
-       if(IspiKpReal(d)) {
+       if(fReadMC) IspKpiMC(d,arrayMC,pdgs);
+       if(IspiKpReal(d,pdgs)) {
         invMasspiKp=d->InvMassLcpiKp();
        if(fUseKF){
         pdgs[0]=211;pdgs[1]=321;pdgs[2]=2212;
@@ -815,7 +933,7 @@ void AliAnalysisTaskSELambdac::Terminate(Option_t */*option*/)
  Int_t index=0;
  
 
//Int_t indexLS=0;
+ Int_t indexLS=0;
  for(Int_t i=0;i<fNPtBins;i++){
     index=GetHistoIndex(i);
     hisname.Form("hMassPt%d",i);
@@ -873,21 +991,52 @@ void AliAnalysisTaskSELambdac::Terminate(Option_t */*option*/)
     fMassHistTC[index]=dynamic_cast<TH1F*>(fOutput->FindObject(hisname.Data()));
  
  }
+    fWellIDProt3sig=dynamic_cast<TH1F*>(fOutput->FindObject(fWellIDProt3sig));
+    fWellIDProt2sig=dynamic_cast<TH1F*>(fOutput->FindObject(fWellIDProt2sig));
+    fWellIDProt3sigSe=dynamic_cast<TH1F*>(fOutput->FindObject(fWellIDProt3sigSe));
+    fWellIDProt2sigSe=dynamic_cast<TH1F*>(fOutput->FindObject(fWellIDProt2sigSe));
+    fWellIDProt2sigRe=dynamic_cast<TH1F*>(fOutput->FindObject(fWellIDProt2sigRe));
+    fWellIDProt3sigRe=dynamic_cast<TH1F*>(fOutput->FindObject(fWellIDProt3sigRe));
+    fWellIDKaon3sig=dynamic_cast<TH1F*>(fOutput->FindObject(fWellIDKaon3sig));
+    fWellIDKaon2sig=dynamic_cast<TH1F*>(fOutput->FindObject(fWellIDKaon2sig));
+    fWellIDKaon3sigSe=dynamic_cast<TH1F*>(fOutput->FindObject(fWellIDKaon3sigSe));
+    fWellIDKaon2sigSe=dynamic_cast<TH1F*>(fOutput->FindObject(fWellIDKaon2sigSe));
+    fWellIDKaon2sigRe=dynamic_cast<TH1F*>(fOutput->FindObject(fWellIDKaon2sigRe));
+    fWellIDKaon3sigRe=dynamic_cast<TH1F*>(fOutput->FindObject(fWellIDKaon3sigRe));
     fTPCSignal3Sigma=dynamic_cast<TH2F*>(fOutput->FindObject(fTPCSignal3Sigma));
     fTPCSignal3SigmaReK=dynamic_cast<TH2F*>(fOutput->FindObject(fTPCSignal3SigmaReK));
+    fTPCSignal3SigmaSedK=dynamic_cast<TH2F*>(fOutput->FindObject(fTPCSignal3SigmaSedK));
     fTPCSignal3SigmaRep=dynamic_cast<TH2F*>(fOutput->FindObject(fTPCSignal3SigmaRep));
+    fTPCSignal3SigmaSedp=dynamic_cast<TH2F*>(fOutput->FindObject(fTPCSignal3SigmaSedp));
     fTPCSignal2Sigma=dynamic_cast<TH2F*>(fOutput->FindObject(fTPCSignal2Sigma));
     fTPCSignal2SigmaReK=dynamic_cast<TH2F*>(fOutput->FindObject(fTPCSignal2SigmaReK));
+    fTPCSignal2SigmaSedK=dynamic_cast<TH2F*>(fOutput->FindObject(fTPCSignal2SigmaSedK));
+    fTPCSignal2SigmaSedp=dynamic_cast<TH2F*>(fOutput->FindObject(fTPCSignal2SigmaSedp));
     fTPCSignal2SigmaRep=dynamic_cast<TH2F*>(fOutput->FindObject(fTPCSignal2SigmaRep));
+    fFakeProt3sig=dynamic_cast<TH1F*>(fOutput->FindObject(fFakeProt3sig));
+    fFakeProt2sig=dynamic_cast<TH1F*>(fOutput->FindObject(fFakeProt2sig));
+    fFakeProt3sigSe=dynamic_cast<TH1F*>(fOutput->FindObject(fFakeProt3sigSe));
+    fFakeProt2sigSe=dynamic_cast<TH1F*>(fOutput->FindObject(fFakeProt2sigSe));
+    fFakeProt2sigRe=dynamic_cast<TH1F*>(fOutput->FindObject(fFakeProt2sigRe));
+    fFakeProt3sigRe=dynamic_cast<TH1F*>(fOutput->FindObject(fFakeProt3sigRe));
+    fFakeKaon3sig=dynamic_cast<TH1F*>(fOutput->FindObject(fFakeKaon3sig));
+    fFakeKaon2sig=dynamic_cast<TH1F*>(fOutput->FindObject(fFakeKaon2sig));
+    fFakeKaon3sigSe=dynamic_cast<TH1F*>(fOutput->FindObject(fFakeKaon3sigSe));
+    fFakeKaon2sigSe=dynamic_cast<TH1F*>(fOutput->FindObject(fFakeKaon2sigSe));
+    fFakeKaon2sigRe=dynamic_cast<TH1F*>(fOutput->FindObject(fFakeKaon2sigRe));
+    fFakeKaon3sigRe=dynamic_cast<TH1F*>(fOutput->FindObject(fFakeKaon3sigRe));
+
+    fRealProt=dynamic_cast<TH1F*>(fOutput->FindObject(fRealProt));
+    fRealKaon=dynamic_cast<TH1F*>(fOutput->FindObject(fRealKaon));
 
   if(fFillNtuple){
     fNtupleLambdac = dynamic_cast<TNtuple*>(GetOutputData(3));
   }
 
-  //TCanvas *c1=new TCanvas("c1","D+ invariant mass distribution",500,500);
+  TCanvas *c1=new TCanvas("c1","D+ invariant mass distribution",500,500);
   //c1->cd();
   //TH1F *hMassPt=(TH1F*)fOutput->FindObject("hMassPt3TC");
 //hMassPt->Draw();
fRealProt->Draw();
  
  return;
 }
@@ -1038,9 +1187,9 @@ Bool_t AliAnalysisTaskSELambdac::GetLambdacDaugh(AliAODMCParticle *part,TClonesA
          return kFALSE;
 }
 //-----------------------------
-Bool_t AliAnalysisTaskSELambdac::IspKpiMC(AliAODRecoDecayHF3Prong *d,TClonesArray *arrayMC){
+Bool_t AliAnalysisTaskSELambdac::IspKpiMC(AliAODRecoDecayHF3Prong *d,TClonesArray *arrayMC,Int_t *pdgs){
 
-   Int_t lab[3]={0,0,0},pdgs[3]={0,0,0};
+   Int_t lab[3]={0,0,0};//,pdgs[3]={0,0,0};
    for(Int_t i=0;i<3;i++){
     AliAODTrack *daugh=(AliAODTrack*)d->GetDaughter(i);
     lab[i]=daugh->GetLabel();
@@ -1072,61 +1221,22 @@ Bool_t AliAnalysisTaskSELambdac::IspiKpMC(AliAODRecoDecayHF3Prong *d,TClonesArra
    return kFALSE;
 }
 //--------------------------------------
-Bool_t AliAnalysisTaskSELambdac::IspiKpReal(AliAODRecoDecayHF3Prong *d){
+Bool_t AliAnalysisTaskSELambdac::IspiKpReal(AliAODRecoDecayHF3Prong *d,Int_t *pdgs){
 
   AliAODPidHF* pidObj=new AliAODPidHF();
   Bool_t type[2]={kFALSE,kFALSE};
   for(Int_t i=0;i<3;i++){
 //   Bool_t pid[3]={kFALSE,kFALSE,kFALSE};
-   AliAODTrack *track=(AliAODTrack*)d->GetDaughter(i);
-   AliAODPid *pidObjtrk=track->GetDetPid();
-//   pidObj->CombinedProbability(track,pid);
-
-//   Int_t i2=i-1;
-//   type[i2]=pid[i];
-   Double_t dedx=pidObjtrk->GetTPCsignal();
-   Double_t mom = pidObjtrk->GetTPCmomentum();
-   //printf("TPC mom= %f\n",mom);
-    pidObj->SetSigma(3.);
-   if(pidObj->IsProtonRaw(track,"TPC")){ 
-    fTPCSignal3Sigma->Fill(mom,dedx);
- //   if(i==2) type[1]=kTRUE;
-    pidObj->SetSigma(1.);
-    //if(!pidObj->IsPionRaw(track,"TPC") && !pidObj->IsKaonRaw(track,"TPC"))
-    if(!pidObj->IsKaonRaw(track,"TPC")){
-     fTPCSignal3SigmaRep->Fill(mom,dedx);
-    }
-   }
-    pidObj->SetSigma(3.);
-   if(pidObj->IsKaonRaw(track,"TPC")) {
-    fTPCSignal3Sigma->Fill(mom,dedx);
- //   if(i==1) type[0]=kTRUE;
-    pidObj->SetSigma(1.);
-    //if(!pidObj->IsPionRaw(track,"TPC") && !pidObj->IsProtonRaw(track,"TPC"))
-    if(!pidObj->IsPionRaw(track,"TPC")){
-     fTPCSignal3SigmaReK->Fill(mom,dedx);
-    }
-   }
+  AliAODTrack *track=(AliAODTrack*)d->GetDaughter(i);
+   //test asymmetric TPC PID
+     Double_t plim[2]={0.6,2.};
+     Double_t sigmas[5]={2.,1.,2.,3.,0.};
+     pidObj->SetPLimit(plim);
+     pidObj->SetSigma(sigmas);
+     if(i==1) type[i]=pidObj->MatchTPCTOF(track,2,3,kFALSE);
+     if(i==2) type[i]=pidObj->MatchTPCTOF(track,2,4,kFALSE);
+     //pidinfo=pidObj->MatchTPCTOF(track,3,3,kFALSE);
 
-    pidObj->SetSigma(2.);
-   if(pidObj->IsProtonRaw(track,"TPC")){ 
-    if(i==2) type[1]=kTRUE;
-    fTPCSignal2Sigma->Fill(mom,dedx);
-    pidObj->SetSigma(1.);
-    //if(!pidObj->IsPionRaw(track,"TPC") && !pidObj->IsKaonRaw(track,"TPC"))
-    if(!pidObj->IsKaonRaw(track,"TPC")){
-     fTPCSignal2SigmaRep->Fill(mom,dedx);
-    }
-   }
-   if(pidObj->IsKaonRaw(track,"TPC")) {
-    if(i==1) type[0]=kTRUE;
-    fTPCSignal2Sigma->Fill(mom,dedx);
-    pidObj->SetSigma(1.);
-    //if(!pidObj->IsPionRaw(track,"TPC") && !pidObj->IsProtonRaw(track,"TPC"))
-    if(!pidObj->IsPionRaw(track,"TPC")){
-     fTPCSignal2SigmaReK->Fill(mom,dedx);
-    }
-   }
   }
 
   if(type[0] && type[1]) {delete pidObj;return kTRUE;}
@@ -1138,15 +1248,15 @@ Bool_t AliAnalysisTaskSELambdac::IspKpiReal(AliAODRecoDecayHF3Prong *d){
 
   AliAODPidHF* pidObj=new AliAODPidHF();
   Bool_t type[2]={kFALSE,kFALSE};
-    pidObj->SetSigma(2.);
   for(Int_t i=0;i<2;i++){
    //Bool_t pid[3]={kFALSE,kFALSE,kFALSE};
    AliAODTrack *track=(AliAODTrack*)d->GetDaughter(i);
-  // pidObj->CombinedProbability(track,pid);
-  // if(i==0) type[i]=pid[2];
-  // if(i==1) type[i]=pid[i];
-   if(pidObj->IsProtonRaw(track,"TPC") && i==0) type[1]=kTRUE;
-   if(pidObj->IsKaonRaw(track,"TPC") && i==1) type[0]=kTRUE;
+     Double_t plim[2]={0.6,2.};
+     Double_t sigmas[5]={2.,1.,2.,3.,0.};
+     pidObj->SetPLimit(plim);
+     pidObj->SetSigma(sigmas);
+     if(i==1) type[i]=pidObj->MatchTPCTOF(track,2,3,kFALSE);
+     if(i==0) type[i]=pidObj->MatchTPCTOF(track,2,4,kFALSE);
   }
   if(type[0] && type[1]) {delete pidObj;return kTRUE;}
   delete pidObj;
index 021bbb51fefd99431fdd197820ff36a96a820eac..15569b386bce5cc73a4fa8d7a3a2d046c9c1750a 100644 (file)
@@ -49,8 +49,8 @@ class AliAnalysisTaskSELambdac : public AliAnalysisTaskSE
   Int_t GetNBinsPt(){return fNPtBins;}
   Double_t GetPtBinLimit(Int_t ibin);
   Bool_t IspiKpMC(AliAODRecoDecayHF3Prong *d,TClonesArray *arrayMC);
-  Bool_t IspKpiMC(AliAODRecoDecayHF3Prong *d,TClonesArray *arrayMC);
-  Bool_t IspiKpReal(AliAODRecoDecayHF3Prong *d);
+  Bool_t IspKpiMC(AliAODRecoDecayHF3Prong *d,TClonesArray *arrayMC,Int_t *pdgs);
+  Bool_t IspiKpReal(AliAODRecoDecayHF3Prong *d,Int_t *pdgs);
   Bool_t IspKpiReal(AliAODRecoDecayHF3Prong *d);
   Bool_t IspiKpResonant(AliAODRecoDecayHF3Prong *d,Double_t field);
   Bool_t IspKpiResonant(AliAODRecoDecayHF3Prong *d,Double_t field);
@@ -94,12 +94,42 @@ class AliAnalysisTaskSELambdac : public AliAnalysisTaskSE
   TH1F *fPtMaxHistLS[3*kMaxPtBins];//!hist. for LS cuts variable 5 (LC)
   TH1F *fDCAHistLS[3*kMaxPtBins];//!hist. for LS cuts variable 6 (LC)
   TH1F *fMassHistLSTC[5*kMaxPtBins];//!hist. for LS inv mass (TC)
+  TH1F *fWellIDProt3sig;
+  TH1F *fWellIDProt2sig;
+  TH1F *fWellIDProt3sigSe;
+  TH1F *fWellIDProt2sigSe;
+  TH1F *fWellIDProt3sigRe;
+  TH1F *fWellIDProt2sigRe;
+  TH1F *fWellIDKaon3sig;
+  TH1F *fWellIDKaon3sigSe;
+  TH1F *fWellIDKaon3sigRe;
+  TH1F *fWellIDKaon2sig;
+  TH1F *fWellIDKaon2sigSe;
+  TH1F *fWellIDKaon2sigRe;
+  TH1F *fRealProt;
+  TH1F *fRealKaon;
+  TH1F *fFakeProt3sig;
+  TH1F *fFakeProt2sig;
+  TH1F *fFakeProt3sigSe;
+  TH1F *fFakeProt2sigSe;
+  TH1F *fFakeProt3sigRe;
+  TH1F *fFakeProt2sigRe;
+  TH1F *fFakeKaon3sig;
+  TH1F *fFakeKaon3sigSe;
+  TH1F *fFakeKaon3sigRe;
+  TH1F *fFakeKaon2sig;
+  TH1F *fFakeKaon2sigSe;
+  TH1F *fFakeKaon2sigRe;
   TH2F *fTPCSignal3Sigma;//!hist. for LS inv mass (TC)
   TH2F *fTPCSignal3SigmaReK;//!hist. for LS inv mass (TC)
+  TH2F *fTPCSignal3SigmaSedK;//!hist. for LS inv mass (TC)
   TH2F *fTPCSignal3SigmaRep;//!hist. for LS inv mass (TC)
+  TH2F *fTPCSignal3SigmaSedp;//!hist. for LS inv mass (TC)
   TH2F *fTPCSignal2Sigma;//!hist. for LS inv mass (TC)
   TH2F *fTPCSignal2SigmaReK;//!hist. for LS inv mass (TC)
+  TH2F *fTPCSignal2SigmaSedK;//!hist. for LS inv mass (TC)
   TH2F *fTPCSignal2SigmaRep;//!hist. for LS inv mass (TC)
+  TH2F *fTPCSignal2SigmaSedp;//!hist. for LS inv mass (TC)
   TNtuple *fNtupleLambdac; //! output ntuple
   Float_t fUpmasslimit;  //upper inv mass limit for histos
   Float_t fLowmasslimit; //lower inv mass limit for histos