]> git.uio.no Git - u/mrichter/AliRoot.git/blobdiff - PHOS/AliPHOSFastRecParticle.h
Moved from AliTransbit to AliL3Transbit.
[u/mrichter/AliRoot.git] / PHOS / AliPHOSFastRecParticle.h
index 9ddbdaf24f12f9db3a7151d879e7d714f43c6e66..9c270cef3e8a4b40f54d6d20ca479944c6240c4c 100644 (file)
 
 // --- AliRoot header files ---
 
-typedef TClonesArray  FastRecParticlesList ; 
-
-const static Int_t kUNDEFINED     = -1; 
-const static Int_t kGAMMA         = 0 ; 
-const static Int_t kELECTRON      = 1 ;
-const static Int_t kNEUTRAL       = 2 ;  
-const static Int_t kCHARGED       = 3 ;  
-const static Int_t kCHARGEDHADRON = 4 ;  
-const static Int_t kNEUTRALHADRON = 5 ;  
-const static Int_t kNEUTRALEM     = 6 ;  
-const static Int_t kGAMMAHADRON   = 7 ; 
-
-
 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 GetIndexInList() const { return fIndexInList ; } 
-  virtual Int_t * GetPrimaries(Int_t & number) ;
-  Int_t GetType() { return fType ; } 
+  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)
+    {
+      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 ;
+  }
+  
+  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 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 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() ; 
   virtual void Paint(Option_t * option="");
-  void Print() ; 
-  void SetPrimary(Int_t index) { fPrimary = index ; }
-  void SetType(Int_t type) { fType = type ; } 
-  void SetIndexInList(Int_t val) { fIndexInList = val ; } 
-
-protected:
+  virtual void Print(const char * opt) ; 
+  
+  void SetType(Int_t type) { 
+    // sets the particle type 
+    fType = 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 fIndexInList ; // the index of this RecParticle in the list stored in TreeR (to be set by analysis)
-  Int_t fPrimary ;     // (unique) primary particle index 
   Int_t fType ;        // particle type obtained by "virtual" reconstruction
+ private:
+
 
-  ClassDef(AliPHOSFastRecParticle,1)  // Reconstructed Particle produced by the fast simulation 
+  ClassDef(AliPHOSFastRecParticle,2)  // Reconstructed Particle produced by the fast simulation 
 
 };