]> 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 113f39fe35be5304246db8afa8fe4830a839c247..603b5aee15d5f472ab8efe8875a2d0eb51d3a80f 100644 (file)
@@ -5,50 +5,92 @@
 
 /* $Id$ */
 
-////////////////////////////////////////////////
-//  A  Particle modified by PHOS response     //
-//  Yves Schutz SUBATECH                      //
-//  To become a general class of AliRoot ?    //  
-//                                            //
-////////////////////////////////////////////////
+//_________________________________________________________________________
+//  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 ---
 
 // --- AliRoot header files ---
 
-#include "AliPHOSRecParticle.h" 
-
-typedef TClonesArray  FastRecParticlesList ; 
-
-
 class AliPHOSFastRecParticle : public TParticle {
-
-public:
   
-  AliPHOSFastRecParticle() {};          // ctor
+ public:
+  
+  AliPHOSFastRecParticle() ;
+  
   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) ; 
-  Int_t GetType() { return fType ; } 
-  TString Name() ; 
+  virtual void ExecuteEvent(Int_t event, Int_t px, Int_t py) ;
+  Int_t GetIndexInList() const { 
+    // returns the index of this in the list
+    return fIndexInList ; 
+  } 
+  virtual const Int_t GetNPrimaries() const {return 0 ;}
+  virtual const TParticle * GetPrimary(Int_t index=0) const  {return 0 ;} 
+  const Int_t GetType() const { 
+    // returns the type of the particle
+    return fType ; 
+  } 
+  
+  void SetPIDBit(UInt_t fSet) {
+    // Set PID bit number fSet
+    fType |= (1<<fSet) ; 
+  } 
+  
+  Bool_t TestPIDBit(UInt_t fTest) const {
+    // Check PID bit number fTest
+    if (fType & (1<<fTest) ) return  kTRUE ;   
+    else return kFALSE ;
+  }
+  
+  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;
+
+  TString Name() const ; 
   virtual void Paint(Option_t * option="");
-  void Print() ; 
-  void SetType(Int_t type) { fType = type ; } 
-
-private:
+  virtual void Print(Option_t * option="") const ; 
+  
+  void SetType(Int_t type) ;
+  
+  void SetIndexInList(Int_t val) { 
+    // sets the value of the index in the list 
+    fIndexInList = val ; 
+  }
+  //This has to disappear
+  enum EParticleType { kUNDEFINED=-1, 
+                      kNEUTRALEMFAST, kNEUTRALHAFAST,  kNEUTRALEMSLOW, kNEUTRALHASLOW, 
+                      kCHARGEDEMFAST, kCHARGEDHAFAST,  kCHARGEDEMSLOW, kCHARGEDHASLOW } ; 
+  
+  typedef TClonesArray  FastRecParticlesList ; 
+  
+ protected:
 
-  Int_t fType ;   // identified particle type
+  Int_t fIndexInList ; // the index of this RecParticle in the list stored in TreeR (to be set by analysis)
+  Int_t fType ;        // particle type obtained by "virtual" reconstruction
+ private:
 
-  ClassDef(AliPHOSFastRecParticle,1)  // Reconstructed Particle, version 1
+  ClassDef(AliPHOSFastRecParticle,2)  // Reconstructed Particle produced by the fast simulation 
 
 };