]> git.uio.no Git - u/mrichter/AliRoot.git/blobdiff - TOF/AliTOFpidESD.h
Fix coding convention violations (Domenico, Mariella)
[u/mrichter/AliRoot.git] / TOF / AliTOFpidESD.h
index c4c300bb2dc61137c17d6e16d373cc11e8222ff9..9116a5bfe883bf091a7ee4f72b57dea86d42e946 100644 (file)
@@ -1,82 +1,61 @@
 #ifndef ALITOFPIDESD_H
 #define ALITOFPIDESD_H
+
 /* Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
  * See cxx source for full Copyright notice                               */
 
 //-------------------------------------------------------
 //                    TOF PID class
-// A very naive design... Should be made better by the detector experts...
 //   Origin: Iouri Belikov, CERN, Jouri.Belikov@cern.ch 
 //-------------------------------------------------------
 
-#include <TObject.h>
+#include "TObject.h"
+#include "AliPID.h"
 
-class AliESD;
-class TFile;
-class TTree;
+class AliESDEvent;
+class AliESDtrack;
 
 class AliTOFpidESD : public TObject {
-enum {kMaxCluster=77777}; //maximal number of the TOF clusters
-public:
-  AliTOFpidESD(){fR=376.; fDy=2.5; fDz=3.5; fN=0; fEventN=0;}
-  AliTOFpidESD(Double_t *param) throw (const Char_t *);
-  ~AliTOFpidESD(){UnloadClusters();}
-
-  Int_t MakePID(AliESD *event);
-  Int_t LoadClusters(const TFile *f);
-  Int_t LoadClusters(TTree *f);
-  void  UnloadClusters();
-  void SetEventNumber(Int_t n) {fEventN=n;}
-
-  Int_t GetEventNumber() const {return fEventN;}
-
 public:
-  class AliTOFcluster {
-  public:
-    AliTOFcluster(Double_t *h, Int_t *l,Int_t idx) {
-      fR=h[0]; fPhi=h[1]; fZ=h[2]; fTDC=h[3]; fADC=h[4];
-      fLab[0]=l[0]; fLab[1]=l[1]; fLab[2]=l[2];
-      fIdx=idx;
-    }
-    void Use() {fADC=-fADC;}
-
-    Double_t GetR() const {return fR;}
-    Double_t GetPhi() const {return fPhi;}
-    Double_t GetZ()   const {return fZ;}
-    Double_t GetTDC() const {return fTDC;}
-    Double_t GetADC() const {return TMath::Abs(fADC);}
-    Int_t IsUsed() const {return (fADC<0) ? 1 : 0;}
-    Int_t GetLabel(Int_t n) const {return fLab[n];}
-    Int_t GetIndex() const {return fIdx;}
-  private:
-    Int_t fLab[3]; //track labels
-    Double_t fR;   //r-coordinate
-    Double_t fPhi; //phi-coordinate
-    Double_t fZ;   //z-coordinate
-    Double_t fTDC; //TDC count
-    Double_t fADC; //ADC count
-    Int_t fIdx;    //index of this cluster
-  };
+  AliTOFpidESD();
+  AliTOFpidESD(Double_t *param);
+ ~AliTOFpidESD(){}
+  void     SetTimeZero(Double_t t0) { fTime0=t0; }
+  Double_t GetTimeZero() const { return fTime0; }
+
+  void     SetMaxMismatchProbability(Double_t p) {fPmax=p;}
+  Double_t GetMaxMismatchProbability() const {return fPmax;}
+
+  Int_t MakePID(AliESDEvent *event);
+  Int_t MakePID(AliESDEvent *event, Double_t timeZero);
+
+  Bool_t ExpectedSignals(const AliESDtrack *t, 
+                          Double_t s[], 
+                          Int_t n=AliPID::kSPECIES) const;
+  Bool_t ExpectedSigmas(const AliESDtrack *t, 
+                         Double_t s[],
+                         Int_t n=AliPID::kSPECIES) const;
+  Bool_t NumberOfSigmas(const AliESDtrack *t, 
+                         Double_t s[],
+                         Int_t n=AliPID::kSPECIES) const;
+
+  Double_t GetExpectedSignal(const AliESDtrack *t,
+                     AliPID::EParticleType n=AliPID::kKaon) const;
+  Double_t GetExpectedSigma(const AliESDtrack *t,
+                     AliPID::EParticleType n=AliPID::kKaon) const;
+  Double_t GetNumberOfSigmas(const AliESDtrack *t,
+                     AliPID::EParticleType n=AliPID::kKaon) const;
 
 private:
-  Int_t InsertCluster(AliTOFcluster *c);
-  Int_t FindClusterIndex(Double_t z) const;
-
-  Int_t fEventN;          //event number
-
-  Double_t fR;            // mean readius of the TOF barrel
-  Double_t fDy;           // size of the TOF cell in R*Phi
-  Double_t fDz;           // size of the TOF cell in Z
+  Double_t GetMismatchProbability(Double_t p,Double_t mass) const;
 
   Double_t fSigma;        // intrinsic TOF resolution
   Double_t fRange;        // one particle type PID range (in sigmas)
+  Double_t fPmax;         // "maximal" probability of mismathing (at ~0.5 GeV/c)
+  Double_t fTime0;        // time zero
 
-  Int_t fN;                  // number of the TOF clusters
-  AliTOFcluster *fClusters[kMaxCluster];  // pointers to the TOF clusters
-
-  ClassDef(AliTOFpidESD,1)   // TOF PID class
+  ClassDef(AliTOFpidESD,3)   // TOF PID class
 };
 
 #endif
-
-