]> git.uio.no Git - u/mrichter/AliRoot.git/blobdiff - PHOS/AliPHOSFastRecParticle.h
Corrected signature of Isxxx methods
[u/mrichter/AliRoot.git] / PHOS / AliPHOSFastRecParticle.h
index 9c270cef3e8a4b40f54d6d20ca479944c6240c4c..603b5aee15d5f472ab8efe8875a2d0eb51d3a80f 100644 (file)
@@ -7,14 +7,15 @@
 
 //_________________________________________________________________________
 //  A  Particle modified by PHOS response and produced by AliPHOSvFast
+//  This is also a base class for AliPHOSRecParticle produced by AliPHOSPIDv1
+//  Defines the particle type
 //  To become a general class of AliRoot ?    
-//               
+//--               
 //*-- Author: Yves Schutz (SUBATECH)
 
 // --- ROOT system ---
 
 #include "TParticle.h"
-#include "TVector3.h"
 
 // --- Standard library ---
 
@@ -28,9 +29,8 @@ class AliPHOSFastRecParticle : public TParticle {
   
   AliPHOSFastRecParticle(const AliPHOSFastRecParticle & rp) ;  // ctor
   AliPHOSFastRecParticle(const TParticle & p) ;  // ctor
-  virtual ~AliPHOSFastRecParticle(){
-    // dtor
-  }
+  virtual ~AliPHOSFastRecParticle(){ } //dtor
+
   virtual Int_t DistancetoPrimitive(Int_t px, Int_t py) ; 
   virtual void Draw(Option_t *option) ;  
   virtual void ExecuteEvent(Int_t event, Int_t px, Int_t py) ;
@@ -45,99 +45,33 @@ class AliPHOSFastRecParticle : public TParticle {
     return fType ; 
   } 
   
-  void SetPIDBit(UInt_t fSet)
-    {
-      fType |= (1<<fSet) ; 
-    } 
-  
-  Bool_t TestPIDBit(UInt_t fTest){
-    if (fType & (1<<fTest) )
-      return  kTRUE ;  
-    else
-      return kFALSE ;
-  }
-  
-  Bool_t IsPhotonHiPu_LoEf()  {
-    Bool_t pid=kFALSE ;
-    if(TestPIDBit(8)&& //PCA
-       TestPIDBit(5)&& //TOF
-       TestPIDBit(2))  //RCPV
-      pid = kTRUE;
-    return pid ;
-  }
-  
-  Bool_t IsPhotonMed_Pu_Ef(){
-    Bool_t pid=kFALSE ;
-    if(TestPIDBit(7)&& //PCA
-       TestPIDBit(4)&& //TOF
-       TestPIDBit(1))  //RCPV
-      pid = kTRUE ;
-    return pid ;
-  }
+  void SetPIDBit(UInt_t fSet) {
+    // Set PID bit number fSet
+    fType |= (1<<fSet) ; 
+  } 
   
-  Bool_t IsPhotonHiEf_LoPu()  {
-    Bool_t pid=kFALSE ;
-    if(TestPIDBit(6)&& //PCA
-       TestPIDBit(3)&& //TOF
-       TestPIDBit(0))  //RCPV
-      pid = kTRUE ;
-    return pid ;
-  }
-  Bool_t IsPhoton()  {
-    Bool_t pid=kFALSE ;
-    if(IsPhotonHiEf_LoPu()) pid = kTRUE ;
-    return pid ;
+  Bool_t TestPIDBit(UInt_t fTest) const {
+    // Check PID bit number fTest
+    if (fType & (1<<fTest) ) return  kTRUE ;   
+    else return kFALSE ;
   }
   
-  Bool_t IsFastChargedHadron()  {
-    Bool_t pid=kFALSE ;
-    if(TestPIDBit(5)&&TestPIDBit(4)&&TestPIDBit(3)) //TOF
-      pid = kTRUE ;
-    return pid ;
-  }
-  Bool_t IsSlowChargedHadron()  {
-    Bool_t pid=kFALSE ;
-    if(TestPIDBit(1)||TestPIDBit(0)) //CPV
-      pid = kTRUE ;
-    return pid ;
-  }
-  Bool_t IsFastNeutralHadron()  {
-    Bool_t pid=kFALSE ;
-    if(TestPIDBit(5)&&TestPIDBit(4)&&TestPIDBit(3)&& //TOF
-       TestPIDBit(2)&&TestPIDBit(1)&&TestPIDBit(0))//RCPV
-      pid = kTRUE ;
-    return pid ;
-  }
-  Bool_t IsSlowNeutralHadron()  {
-    Bool_t pid=kFALSE ;
-    if(TestPIDBit(2)&&TestPIDBit(1)&&TestPIDBit(0))//RCPV
-      pid = kTRUE ;
-    return pid ;
-  }
+  Bool_t IsPhoton           (TString purity = "low") const;
+  Bool_t IsPi0              (TString purity = "low") const;
+  Bool_t IsElectron         (TString purity = "low") const;
+  Bool_t IsHadron           () const;
+  Bool_t IsChargedHadron    () const;
+  Bool_t IsNeutralHadron    () const;
+  Bool_t IsFastChargedHadron() const;
+  Bool_t IsSlowChargedHadron() const;
+  Bool_t IsFastNeutralHadron() const;
+  Bool_t IsSlowNeutralHadron() const;
 
-  Bool_t IsFastChargedEM()  {
-    Bool_t pid=kFALSE ;
-    if((TestPIDBit(8)||TestPIDBit(7)||TestPIDBit(6))&&
-       TestPIDBit(5)&&TestPIDBit(4)&&TestPIDBit(3))//TOF
-      pid = kTRUE ;
-    return pid ;
-  }
-  
-  Bool_t IsSlowChargedEM()  {
-    Bool_t pid=kFALSE ;
-    if(TestPIDBit(8)||TestPIDBit(7)||TestPIDBit(6))
-      pid = kTRUE ;
-    return pid ;
-  }
-  
-  TString Name() ; 
+  TString Name() const ; 
   virtual void Paint(Option_t * option="");
-  virtual void Print(const char * opt) ; 
+  virtual void Print(Option_t * option="") const ; 
   
-  void SetType(Int_t type) { 
-    // sets the particle type 
-    fType = type ; 
-  }        
+  void SetType(Int_t type) ;
   
   void SetIndexInList(Int_t val) { 
     // sets the value of the index in the list 
@@ -148,7 +82,6 @@ class AliPHOSFastRecParticle : public TParticle {
                       kNEUTRALEMFAST, kNEUTRALHAFAST,  kNEUTRALEMSLOW, kNEUTRALHASLOW, 
                       kCHARGEDEMFAST, kCHARGEDHAFAST,  kCHARGEDEMSLOW, kCHARGEDHASLOW } ; 
   
-  
   typedef TClonesArray  FastRecParticlesList ; 
   
  protected:
@@ -157,7 +90,6 @@ class AliPHOSFastRecParticle : public TParticle {
   Int_t fType ;        // particle type obtained by "virtual" reconstruction
  private:
 
-
   ClassDef(AliPHOSFastRecParticle,2)  // Reconstructed Particle produced by the fast simulation 
 
 };