First version of combined PID (Yu.Belikov)
authorhristov <hristov@f7af4fe6-9843-0410-8265-dc069ae4e863>
Mon, 26 May 2003 09:37:39 +0000 (09:37 +0000)
committerhristov <hristov@f7af4fe6-9843-0410-8265-dc069ae4e863>
Mon, 26 May 2003 09:37:39 +0000 (09:37 +0000)
16 files changed:
ITS/AliITSpidESD.cxx [new file with mode: 0644]
ITS/AliITSpidESD.h [new file with mode: 0644]
ITS/ITSLinkDef.h
ITS/libITS.pkg
STEER/AliESDanalysis.C
STEER/AliESDpid.cxx [new file with mode: 0644]
STEER/AliESDpid.h [new file with mode: 0644]
STEER/AliESDtest.C
STEER/AliESDtrack.cxx
STEER/AliESDtrack.h
STEER/STEERLinkDef.h
STEER/libSTEER.pkg
TPC/AliTPCpidESD.cxx [new file with mode: 0644]
TPC/AliTPCpidESD.h [new file with mode: 0644]
TPC/TPCLinkDef.h
TPC/libTPC.pkg

diff --git a/ITS/AliITSpidESD.cxx b/ITS/AliITSpidESD.cxx
new file mode 100644 (file)
index 0000000..d502949
--- /dev/null
@@ -0,0 +1,79 @@
+/**************************************************************************
+ * Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
+ *                                                                        *
+ * Author: The ALICE Off-line Project.                                    *
+ * Contributors are mentioned in the code where appropriate.              *
+ *                                                                        *
+ * Permission to use, copy, modify and distribute this software and its   *
+ * documentation strictly for non-commercial purposes is hereby granted   *
+ * without fee, provided that the above copyright notice appears in all   *
+ * copies and that both the copyright notice and this permission notice   *
+ * appear in the supporting documentation. The authors make no claims     *
+ * about the suitability of this software for any purpose. It is          *
+ * provided "as is" without express or implied warranty.                  *
+ **************************************************************************/
+
+//-----------------------------------------------------------------
+//           Implementation of the ITS PID class
+// Very naive one... Should be made better by the detector experts...
+//      Origin: Iouri Belikov, CERN, Jouri.Belikov@cern.ch
+//-----------------------------------------------------------------
+
+#include "AliITSpidESD.h"
+#include "AliESD.h"
+#include "AliESDtrack.h"
+
+ClassImp(AliITSpidESD)
+
+//_________________________________________________________________________
+AliITSpidESD::AliITSpidESD(Double_t *param)
+{
+  //
+  //  The main constructor
+  //
+  fMIP=param[0];
+  fRes=param[1];
+  fRange=param[2];
+}
+
+Double_t AliITSpidESD::Bethe(Double_t bg) {
+  //
+  // This is the Bethe-Bloch function normalised to 1 at the minimum
+  //
+  Double_t bg2=bg*bg;
+  Double_t bethe=(1.+ bg2)/bg2*(log(5940*bg2) - bg2/(1.+ bg2));
+  return bethe/11.091;
+}
+
+//_________________________________________________________________________
+Int_t AliITSpidESD::MakePID(AliESD *event)
+{
+  //
+  //  This function calculates the "detector response" PID probabilities 
+  //
+  static const Double_t masses[]={
+    0.000511, 0.105658, 0.139570, 0.493677, 0.938272, 1.875613
+  };
+  Int_t ntrk=event->GetNumberOfTracks();
+  for (Int_t i=0; i<ntrk; i++) {
+    AliESDtrack *t=event->GetTrack(i);
+    if ((t->GetStatus()&AliESDtrack::kITSin )==0)
+      if ((t->GetStatus()&AliESDtrack::kITSout)==0) continue;
+    Int_t ns=AliESDtrack::kSPECIES;
+    Double_t p[10];
+    for (Int_t j=0; j<ns; j++) {
+      Double_t mass=masses[j];
+      Double_t mom=t->GetP();
+      Double_t dedx=t->GetITSsignal()/fMIP;
+      Double_t bethe=Bethe(mom/mass); 
+      Double_t sigma=fRes*bethe;
+      if (TMath::Abs(dedx-bethe) > fRange*sigma) {
+       p[j]=0.;
+        continue;
+      }
+      p[j]=TMath::Exp(-0.5*(dedx-bethe)*(dedx-bethe)/(sigma*sigma));
+    }
+    t->SetITSpid(p);
+  }
+  return 0;
+}
diff --git a/ITS/AliITSpidESD.h b/ITS/AliITSpidESD.h
new file mode 100644 (file)
index 0000000..92bfc40
--- /dev/null
@@ -0,0 +1,29 @@
+#ifndef ALIITSpIDESD_H
+#define ALIITSpIDESD_H
+/* Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
+ * See cxx source for full Copyright notice                               */
+
+//-------------------------------------------------------
+//                    ITS PID class
+// A very naive design... Should be made better by the detector experts...
+//   Origin: Iouri Belikov, CERN, Jouri.Belikov@cern.ch 
+//-------------------------------------------------------
+#include <Rtypes.h>
+
+class AliESD;
+
+class AliITSpidESD {
+public:
+  AliITSpidESD(Double_t *param);
+  Int_t MakePID(AliESD *event);
+  static Double_t Bethe(Double_t bg);
+private:
+  Double_t fMIP;          // dEdx for MIP
+  Double_t fRes;          // relative dEdx resolution
+  Double_t fRange;        // one particle type PID range (in sigmas)
+  ClassDef(AliITSpidESD,1)   // ITS PID class
+};
+
+#endif
+
+
index c7f54aa851473fbaf14b985666a986139a241cfc..282a64dc67c2d2f71a7619c3d545526b83a4a8b9 100644 (file)
 #pragma link C++ class  AliITSclusterSSD+;
 #pragma link C++ class  AliITSpackageSSD+;
 #pragma link C++ class  AliITSPid+;
+#pragma link C++ class  AliITSpidESD+;
 #pragma link C++ class  AliITStrackV2Pid+;
 // Classes used for Tracking
 #pragma link C++ class  AliITSTrackV1+;
index ae331349cb1d614a49fa12b6b233f507da4cb2dd..1acfcd6ba8c2e96d8742c1c21bc186775a88f883 100644 (file)
@@ -44,7 +44,7 @@ SRCS          = AliITS.cxx AliITSv1.cxx AliITSv5.cxx AliITSvSPD02.cxx \
                AliITSFindClustersV2.cxx \
                AliITSRiemannFit.cxx \
                AliITSFDigitizer.cxx \
-               AliITSDDLRawData.cxx
+               AliITSDDLRawData.cxx AliITSpidESD.cxx
 #              AliITSAlignmentTrack.cxx AliITSAlignmentModule.cxx \
 
 HDRS:=  $(SRCS:.cxx=.h)
index 9c011060708fb00d892f5aa65435f5f5c2f98c09..7593cb6958706928fc49f022353e17c4cda28196 100644 (file)
@@ -1,7 +1,7 @@
 //********************************************************************
-//     Example (very basic for the moment) of the data analysis 
+//     Example (very naive for the moment) of the data analysis 
 //                    using the ESD classes
-//
+//       It demonstrates the idea of the "combined PID".
 // Origin: Iouri Belikov, CERN, Jouri.Belikov@cern.ch
 //********************************************************************
 
 #endif
 
 Int_t AliESDanalysis(Int_t nev=1) { 
-   TH2F *tpcHist=new TH2F("tpcHist","dE/dX vs momentum",50,0.,2.,50,0.,400.);
-   TH2F *itsHist=new TH2F("itsHits","dE/dX vs momentum",50,0.,2.,50,0.,200.);
+  TH2F *tpcHist=
+     new TH2F("tpcHist","TPC dE/dX vs momentum",100,0.,4.,100,0.,500.);
+  tpcHist->SetXTitle("p (GeV/c)"); tpcHist->SetYTitle("dE/dx (Arb. Units)");
+     tpcHist->SetMarkerStyle(8); 
+     tpcHist->SetMarkerSize(0.3);
+  TH2F *elHist=new TH2F("elHist","dE/dX vs momentum",100,0.,4.,50,0.,500.);
+     elHist->SetMarkerStyle(8); 
+     elHist->SetMarkerSize(0.3);
+
+  TH2F *piHist=new TH2F("piHist","dE/dX vs momentum",100,0.,4.,50,0.,500.);
+     piHist->SetMarkerColor(2); 
+     piHist->SetMarkerStyle(8); 
+     piHist->SetMarkerSize(0.3);
+
+  TH2F *kaHist=new TH2F("kaHist","dE/dX vs momentum",100,0.,4.,100,0.,500.);
+     kaHist->SetMarkerColor(4); 
+     kaHist->SetMarkerStyle(8); 
+     kaHist->SetMarkerSize(0.3);
+
+  TH2F *prHist=new 
+   TH2F("prHist","Classification into e, pi, K and p",100,0.,4.,100,0.,500.);
+   prHist->SetXTitle("p (GeV/c)"); prHist->SetYTitle("dE/dx (Arb. Units)");
+     prHist->SetMarkerColor(6); 
+     prHist->SetMarkerStyle(8); 
+     prHist->SetMarkerSize(0.3);
    
    TFile *ef=TFile::Open("AliESDs.root");
    if (!ef->IsOpen()) {cerr<<"Can't AliESDs.root !\n"; return 1;}
@@ -28,6 +52,9 @@ Int_t AliESDanalysis(Int_t nev=1) {
    TKey *key=0;
    TIter next(ef->GetListOfKeys());
 
+   //****** Tentative particle type "concentrations"
+   Double_t c[5]={0.05, 0., 0.85, 0.10, 0.05};
+
    //******* The loop over events
    while ((key=(TKey*)next())!=0) {
      cerr<<"Processing event number : "<<n++<<endl;
@@ -38,15 +65,32 @@ Int_t AliESDanalysis(Int_t nev=1) {
      //****** The loop over tracks
      while (ntrk--) {
        AliESDtrack *t=event->GetTrack(ntrk);
+
        Double_t p=t->GetP();
+
        if (t->GetStatus()&AliESDtrack::kTPCin) {
         Double_t dedx=t->GetTPCsignal();
          tpcHist->Fill(p,dedx,1);
        }
-       if (t->GetStatus()&AliESDtrack::kITSin) {
-        Double_t dedx=t->GetITSsignal();
-         itsHist->Fill(p,dedx,1);
+
+       if (t->GetStatus()&AliESDtrack::kESDpid) {
+         Double_t dedx=t->GetTPCsignal();
+        Double_t r[10]; t->GetESDpid(r);
+         Double_t rc=0.;
+         Int_t i;
+         for (i=0; i<AliESDtrack::kSPECIES; i++) rc+=(c[i]*r[i]);
+         if (rc==0.) continue;
+
+        //Here we apply Bayes' formula
+         Double_t w[10];
+         for (i=0; i<AliESDtrack::kSPECIES; i++) w[i]=c[i]*r[i]/rc;
+
+         if (w[4]>w[3] && w[4]>w[2] && w[4]>w[0]) prHist->Fill(p,dedx,1);
+         if (w[3]>w[4] && w[3]>w[2] && w[3]>w[0]) kaHist->Fill(p,dedx,1);
+         if (w[2]>w[3] && w[2]>w[4] && w[2]>w[0]) piHist->Fill(p,dedx,1);
+         if (w[0]>w[3] && w[0]>w[2] && w[0]>w[4]) elHist->Fill(p,dedx,1);
        }
+
      } 
      delete event;
    }
@@ -58,7 +102,10 @@ Int_t AliESDanalysis(Int_t nev=1) {
    c1->cd(1);
    tpcHist->Draw();
    c1->cd(2);
-   itsHist->Draw();
+   prHist->Draw();
+   kaHist->Draw("same");
+   piHist->Draw("same");
+   elHist->Draw("same");
 
    ef->Close();
 
diff --git a/STEER/AliESDpid.cxx b/STEER/AliESDpid.cxx
new file mode 100644 (file)
index 0000000..1b92e34
--- /dev/null
@@ -0,0 +1,53 @@
+/**************************************************************************
+ * Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
+ *                                                                        *
+ * Author: The ALICE Off-line Project.                                    *
+ * Contributors are mentioned in the code where appropriate.              *
+ *                                                                        *
+ * Permission to use, copy, modify and distribute this software and its   *
+ * documentation strictly for non-commercial purposes is hereby granted   *
+ * without fee, provided that the above copyright notice appears in all   *
+ * copies and that both the copyright notice and this permission notice   *
+ * appear in the supporting documentation. The authors make no claims     *
+ * about the suitability of this software for any purpose. It is          *
+ * provided "as is" without express or implied warranty.                  *
+ **************************************************************************/
+
+//-----------------------------------------------------------------
+//           Implementation of the combined PID class
+//
+//      Origin: Iouri Belikov, CERN, Jouri.Belikov@cern.ch
+//-----------------------------------------------------------------
+
+#include "AliESDpid.h"
+#include "AliESD.h"
+#include "AliESDtrack.h"
+
+ClassImp(AliESDpid)
+
+//_________________________________________________________________________
+Int_t AliESDpid::MakePID(AliESD *event)
+{
+  Int_t ntrk=event->GetNumberOfTracks();
+  for (Int_t i=0; i<ntrk; i++) {
+    Int_t ns=AliESDtrack::kSPECIES;
+    Double_t p[10]={1.,1.,1.,1.,1.,1.,1.,1.,1.,1.};
+
+    AliESDtrack *t=event->GetTrack(i);
+
+    if ((t->GetStatus()&AliESDtrack::kITSpid )!=0) {
+      Double_t d[10];
+      t->GetITSpid(d);
+      for (Int_t j=0; j<ns; j++) p[j]*=d[j];
+    }
+
+    if ((t->GetStatus()&AliESDtrack::kTPCpid )!=0) {
+      Double_t d[10];
+      t->GetTPCpid(d);
+      for (Int_t j=0; j<ns; j++) p[j]*=d[j];
+    }
+
+    t->SetESDpid(p);
+  }
+  return 0;
+}
diff --git a/STEER/AliESDpid.h b/STEER/AliESDpid.h
new file mode 100644 (file)
index 0000000..72071e4
--- /dev/null
@@ -0,0 +1,25 @@
+#ifndef ALIESDPID_H
+#define ALIESDPID_H
+/* Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
+ * See cxx source for full Copyright notice                               */
+
+//-------------------------------------------------------
+//                    Combined PID class
+//
+//   Origin: Iouri Belikov, CERN, Jouri.Belikov@cern.ch 
+//-------------------------------------------------------
+#include <Rtypes.h>
+
+class AliESD;
+
+class AliESDpid {
+public:
+  AliESDpid(){}
+  static Int_t MakePID(AliESD *event);
+private:
+  ClassDef(AliESDpid,1)   // TPC PID class
+};
+
+#endif
+
+
index 12570bd5b5555022c4a2b3b814f06cf385303b2e..8c721282ebfec3cb5d15c0c83cc52304b8793015 100644 (file)
   #include "TStopwatch.h"
 
   #include "AliESD.h"
+  #include "AliESDpid.h"
+  #include "AliTPCpidESD.h"
   #include "AliTPCParam.h"
   #include "AliTPCtracker.h"
   #include "AliITSgeom.h"
   #include "AliITStrackerV2.h"
+  #include "AliITSpidESD.h"
 #endif
 
 Int_t AliESDtest(Int_t nev=1) { 
@@ -36,6 +39,9 @@ Int_t AliESDtest(Int_t nev=1) {
    //An instance of the TPC tracker
    AliTPCtracker tpcTracker(par);
 
+   //An instance of the TPC PID maker
+   Double_t parTPC[]={47.,0.1,3.};
+   AliTPCpidESD tpcPID(parTPC);
 
    //File with the ITS clusters
    TFile *itscf=TFile::Open("AliITSclustersV2.root");
@@ -48,7 +54,11 @@ Int_t AliESDtest(Int_t nev=1) {
 
    //An instance of the ITS tracker
    AliITStrackerV2 itsTracker(geom);
-
+   
+   //An instance of the ITS PID maker
+   Double_t parITS[]={34.,0.12,3.};
+   AliITSpidESD itsPID(parITS);
+   
    TFile *ef=TFile::Open("AliESDs.root","new");
    if (!ef->IsOpen()) {cerr<<"Can't AliESDs.root !\n"; return 1;}
 
@@ -71,9 +81,14 @@ Int_t AliESDtest(Int_t nev=1) {
 
      rc+=itsTracker.PropagateBack(event); 
      itsTracker.UnloadClusters();
+     itsPID.MakePID(event);
      
      rc+=tpcTracker.PropagateBack(event);
      tpcTracker.UnloadClusters();
+     tpcPID.MakePID(event);
+
+    //Here is the combined PID
+     AliESDpid::MakePID(event);
 
      if (rc==0) {
         Char_t ename[100]; 
index df87488bde25a8fc4cf95acda42650ae62d386e5..ea507e889685c2935f8b2b5f573fd0055eca9882 100644 (file)
@@ -168,3 +168,26 @@ Int_t AliESDtrack::GetTPCclusters(UInt_t *idx) const {
   for (Int_t i=0; i<fTPCncls; i++) idx[i]=fTPCindex[i];
   return fTPCncls;
 }
+
+//_______________________________________________________________________
+void AliESDtrack::SetTPCpid(const Double_t *p) {  
+  for (Int_t i=0; i<kSPECIES; i++) fTPCr[i]=p[i];
+  SetStatus(AliESDtrack::kTPCpid);
+}
+
+//_______________________________________________________________________
+void AliESDtrack::GetTPCpid(Double_t *p) const {
+  for (Int_t i=0; i<kSPECIES; i++) p[i]=fTPCr[i];
+}
+
+//_______________________________________________________________________
+void AliESDtrack::SetESDpid(const Double_t *p) {  
+  for (Int_t i=0; i<kSPECIES; i++) fR[i]=p[i];
+  SetStatus(AliESDtrack::kESDpid);
+}
+
+//_______________________________________________________________________
+void AliESDtrack::GetESDpid(Double_t *p) const {
+  for (Int_t i=0; i<kSPECIES; i++) p[i]=fR[i];
+}
+
index b721f1a7213b3c43bad093a3f102f826f33823ff..125d30471931a13dbf32a576b8ec93a328384896 100644 (file)
@@ -22,6 +22,8 @@ public:
   Bool_t UpdateTrackParams(const AliKalmanTrack *t, ULong_t flags);
   void SetIntegratedLength(Double_t l) {fTrackLength=l;}
   void SetIntegratedTimes(const Double_t *times);
+  void SetESDpid(const Double_t *p);
+  void GetESDpid(Double_t *p) const;
   
   ULong_t GetStatus() const {return fFlags;}
   Int_t GetLabel() const {return fLabel;}
@@ -35,17 +37,22 @@ public:
   void GetPxPyPz(Double_t *p) const;
   void GetXYZ(Double_t *r) const;
 
+  void SetTPCpid(const Double_t *p);
+  void GetTPCpid(Double_t *p) const;
   Float_t GetTPCsignal() const {return fTPCsignal;}
   Int_t GetTPCclusters(UInt_t *idx) const;
 
+  void SetITSpid(const Double_t *p) {;}
+  void GetITSpid(Double_t *p) const {;}
   Float_t GetITSsignal() const {return fITSsignal;}
   Int_t GetITSclusters(UInt_t *idx) const;
 
   enum {
-    kITSin=0x0001,kITSout=0x0002,kITSrefit=0x0004,kITSPID=0x0008,
-    kTPCin=0x0010,kTPCout=0x0020,kTPCrefit=0x0040,kTPCPID=0x0080,
-    kTRDin=0x0100,kTRDout=0x0200,kTRDrefit=0x0400,kTRDPID=0x0800,
-    kTOFin=0x1000,kTOFout=0x2000,kTOFrefit=0x4000,kTOFPID=0x8000,
+    kITSin=0x0001,kITSout=0x0002,kITSrefit=0x0004,kITSpid=0x0008,
+    kTPCin=0x0010,kTPCout=0x0020,kTPCrefit=0x0040,kTPCpid=0x0080,
+    kTRDin=0x0100,kTRDout=0x0200,kTRDrefit=0x0400,kTRDpid=0x0800,
+    kTOFin=0x1000,kTOFout=0x2000,kTOFrefit=0x4000,kTOFpid=0x8000,
+    kESDpid=0x40000000,
     kTIME=0x80000000
   }; 
   enum {kSPECIES=5}; // Number of particle species recognized by the PID
@@ -84,7 +91,7 @@ protected:
   Int_t   fTPCncls;        // number of clusters assigned in the TPC
   UInt_t  fTPCindex[180];  //! indices of the assigned TPC clusters
   Float_t fTPCsignal;      // detector's PID signal
-  Float_t fTPCr[kSPECIES]; //! "detector response probabilities" (for the PID)
+  Float_t fTPCr[kSPECIES]; // "detector response probabilities" (for the PID)
 
   // TRD related track information
   // TOF related track information
index d7c3d862df92b34585873a91e9bb6ded08e895ec..8b6c4195d3e04990e4727663e21abf444dc3c829 100644 (file)
@@ -59,6 +59,7 @@
 #pragma link C++ class  AliESD+;
 #pragma link C++ class  AliESDtrack+;
 #pragma link C++ class  AliESDvertex+;
+#pragma link C++ class  AliESDpid+;
 #pragma link C++ class  AliTrackMap+;
 #pragma link C++ class  AliTrackMapper+;
 #pragma link C++ class  AliCollisionGeometry+;
index 874d603c00bb8883f524a348a01a8eb9aa2ddd6b..27b678d5b453956d2444cb555c1738002b79e224 100644 (file)
@@ -16,7 +16,7 @@ AliMergeCombi.cxx AliMagFMaps.cxx AliFieldMap.cxx \
 AliGausCorr.cxx AliTrackReference.cxx AliESD.cxx \
 AliTrackMap.cxx AliTrackMapper.cxx AliCollisionGeometry.cxx \
 AliMemoryWatcher.cxx AliBarrelTrack.cxx \
-AliESDtrack.cxx AliESDvertex.cxx
+AliESDtrack.cxx AliESDvertex.cxx AliESDpid.cxx
 
 HDRS:= $(SRCS:.cxx=.h) 
 
diff --git a/TPC/AliTPCpidESD.cxx b/TPC/AliTPCpidESD.cxx
new file mode 100644 (file)
index 0000000..c84c84d
--- /dev/null
@@ -0,0 +1,79 @@
+/**************************************************************************
+ * Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
+ *                                                                        *
+ * Author: The ALICE Off-line Project.                                    *
+ * Contributors are mentioned in the code where appropriate.              *
+ *                                                                        *
+ * Permission to use, copy, modify and distribute this software and its   *
+ * documentation strictly for non-commercial purposes is hereby granted   *
+ * without fee, provided that the above copyright notice appears in all   *
+ * copies and that both the copyright notice and this permission notice   *
+ * appear in the supporting documentation. The authors make no claims     *
+ * about the suitability of this software for any purpose. It is          *
+ * provided "as is" without express or implied warranty.                  *
+ **************************************************************************/
+
+//-----------------------------------------------------------------
+//           Implementation of the TPC PID class
+// Very naive one... Should be made better by the detector experts...
+//      Origin: Iouri Belikov, CERN, Jouri.Belikov@cern.ch
+//-----------------------------------------------------------------
+
+#include "AliTPCpidESD.h"
+#include "AliESD.h"
+#include "AliESDtrack.h"
+
+ClassImp(AliTPCpidESD)
+
+//_________________________________________________________________________
+AliTPCpidESD::AliTPCpidESD(Double_t *param)
+{
+  //
+  //  The main constructor
+  //
+  fMIP=param[0];
+  fRes=param[1];
+  fRange=param[2];
+}
+
+Double_t AliTPCpidESD::Bethe(Double_t bg) {
+  //
+  // This is the Bethe-Bloch function normalised to 1 at the minimum
+  //
+  Double_t bg2=bg*bg;
+  Double_t bethe=(1.+ bg2)/bg2*(log(5940*bg2) - bg2/(1.+ bg2));
+  return bethe/11.091;
+}
+
+//_________________________________________________________________________
+Int_t AliTPCpidESD::MakePID(AliESD *event)
+{
+  //
+  //  This function calculates the "detector response" PID probabilities 
+  //
+  static const Double_t masses[]={
+    0.000511, 0.105658, 0.139570, 0.493677, 0.938272, 1.875613
+  };
+  Int_t ntrk=event->GetNumberOfTracks();
+  for (Int_t i=0; i<ntrk; i++) {
+    AliESDtrack *t=event->GetTrack(i);
+    if ((t->GetStatus()&AliESDtrack::kTPCin )==0)
+      if ((t->GetStatus()&AliESDtrack::kTPCout)==0) continue;
+    Int_t ns=AliESDtrack::kSPECIES;
+    Double_t p[10];
+    for (Int_t j=0; j<ns; j++) {
+      Double_t mass=masses[j];
+      Double_t mom=t->GetP();
+      Double_t dedx=t->GetTPCsignal()/fMIP;
+      Double_t bethe=Bethe(mom/mass); 
+      Double_t sigma=fRes*bethe;
+      if (TMath::Abs(dedx-bethe) > fRange*sigma) {
+       p[j]=0.;
+        continue;
+      }
+      p[j]=TMath::Exp(-0.5*(dedx-bethe)*(dedx-bethe)/(sigma*sigma));
+    }
+    t->SetTPCpid(p);
+  }
+  return 0;
+}
diff --git a/TPC/AliTPCpidESD.h b/TPC/AliTPCpidESD.h
new file mode 100644 (file)
index 0000000..09a6c48
--- /dev/null
@@ -0,0 +1,29 @@
+#ifndef ALITPCpIDESD_H
+#define ALITPCpIDESD_H
+/* Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
+ * See cxx source for full Copyright notice                               */
+
+//-------------------------------------------------------
+//                    TPC PID class
+// A very naive design... Should be made better by the detector experts...
+//   Origin: Iouri Belikov, CERN, Jouri.Belikov@cern.ch 
+//-------------------------------------------------------
+#include <Rtypes.h>
+
+class AliESD;
+
+class AliTPCpidESD {
+public:
+  AliTPCpidESD(Double_t *param);
+  Int_t MakePID(AliESD *event);
+  static Double_t Bethe(Double_t bg);
+private:
+  Double_t fMIP;          // dEdx for MIP
+  Double_t fRes;          // relative dEdx resolution
+  Double_t fRange;        // one particle type PID range (in sigmas)
+  ClassDef(AliTPCpidESD,1)   // TPC PID class
+};
+
+#endif
+
+
index 2fa7af8ec77a7a662ce2f869310841159a37c82d..eb8f880e9b6cff3c12a7db95ee85bc1e9a07f16a 100644 (file)
@@ -82,6 +82,7 @@
 #pragma link C++ class  AliTPCKalmanSegment+;
 
 #pragma link C++ class  AliTPCPid+;
+#pragma link C++ class  AliTPCpidESD+;
 #pragma link C++ class  AliTPCtrackPid+;
 
 
index dab4348ce25b3aee7f483d01b01d9792ce10bd07..af30b16e71e484d1f544d6b8e724f722d4e5fa12 100644 (file)
@@ -15,7 +15,7 @@ SRCS:=  AliTPC.cxx  AliTPCv0.cxx    AliTPCv1.cxx      AliTPCv2.cxx  \
        AliTPCpolyTrack.cxx \
        AliTPCBuffer.cxx AliTPCBuffer160.cxx \
        AliTPCCompression.cxx AliTPCDDLRawData.cxx \
-       AliTPCHuffman.cxx AliTPCPid.cxx AliTPCtrackPid.cxx
+       AliTPCHuffman.cxx AliTPCPid.cxx AliTPCtrackPid.cxx AliTPCpidESD.cxx
 HDRS:= $(SRCS:.cxx=.h)