]> git.uio.no Git - u/mrichter/AliRoot.git/commitdiff
Fast simulation ready to be tested
authorschutz <schutz@f7af4fe6-9843-0410-8265-dc069ae4e863>
Thu, 2 Mar 2000 14:37:06 +0000 (14:37 +0000)
committerschutz <schutz@f7af4fe6-9843-0410-8265-dc069ae4e863>
Thu, 2 Mar 2000 14:37:06 +0000 (14:37 +0000)
PHOS/AliPHOSFastRecParticle.h
PHOS/AliPHOSvFast.cxx
PHOS/AliPHOSvFast.h

index 113f39fe35be5304246db8afa8fe4830a839c247..e4e026ef978b0aab555209cc4f75af7a21bd1c1e 100644 (file)
 
 // --- AliRoot header files ---
 
 
 // --- AliRoot header files ---
 
-#include "AliPHOSRecParticle.h" 
+//#include "AliPHOSRecParticle.h" 
 
 typedef TClonesArray  FastRecParticlesList ; 
 
 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 {
 
 
 class AliPHOSFastRecParticle : public TParticle {
@@ -44,7 +53,7 @@ public:
   void Print() ; 
   void SetType(Int_t type) { fType = type ; } 
 
   void Print() ; 
   void SetType(Int_t type) { fType = type ; } 
 
-private:
+protected:
 
   Int_t fType ;   // identified particle type
 
 
   Int_t fType ;   // identified particle type
 
index aa8d558902d4089bacf7755b3d909d728f6a21ef..88f98edbb6c374fb5c84359c6a7e8846ce99eea9 100644 (file)
@@ -88,8 +88,8 @@ AliPHOSvFast::~AliPHOSvFast()
 //____________________________________________________________________________
 void AliPHOSvFast::AddRecParticle(const AliPHOSFastRecParticle & rp)
 {  
 //____________________________________________________________________________
 void AliPHOSvFast::AddRecParticle(const AliPHOSFastRecParticle & rp)
 {  
-   new( (*fFastRecParticles)[fNRecParticles] ) AliPHOSFastRecParticle(rp) ;
-   fNRecParticles++ ; 
+  new( (*fFastRecParticles)[fNRecParticles] ) AliPHOSFastRecParticle(rp) ;
+  fNRecParticles++ ; 
 }
 
 //____________________________________________________________________________
 }
 
 //____________________________________________________________________________
@@ -220,8 +220,7 @@ void AliPHOSvFast::MakeBranch(Option_t* opt)
 {  
   //
   // Create a new branch in the current Root Tree
 {  
   //
   // Create a new branch in the current Root Tree
-  // The branch of fHits is automatically split
-  //
   AliDetector::MakeBranch(opt) ;
   
   char branchname[10];
   AliDetector::MakeBranch(opt) ;
   
   char branchname[10];
@@ -298,7 +297,7 @@ Int_t AliPHOSvFast::MakeType(AliPHOSFastRecParticle & rp )
   Int_t charge = (Int_t)rp.GetPDG()->Charge() ;
   Int_t test ; 
   Float_t ran ; 
   Int_t charge = (Int_t)rp.GetPDG()->Charge() ;
   Int_t test ; 
   Float_t ran ; 
-  if ( charge == 0 && ( TMath::Abs(rp.GetPdgCode()) != 11 ) ) 
+  if ( charge != 0 && ( TMath::Abs(rp.GetPdgCode()) != 11 ) ) 
     test = - 1 ;
   else
     test = rp.GetPdgCode() ; 
     test = - 1 ;
   else
     test = rp.GetPdgCode() ; 
@@ -342,7 +341,7 @@ Int_t AliPHOSvFast::MakeType(AliPHOSFastRecParticle & rp )
       rv = kCHARGEDHADRON ; 
     break; 
 
       rv = kCHARGEDHADRON ; 
     break; 
 
-  case -11:   // it's a electron
+  case -11:   // it's a positon
     ran = fRan.Rndm() ; 
     if ( ran <= 0.9996 )
       rv = kELECTRON ; 
     ran = fRan.Rndm() ; 
     if ( ran <= 0.9996 )
       rv = kELECTRON ; 
@@ -364,6 +363,20 @@ Int_t AliPHOSvFast::MakeType(AliPHOSFastRecParticle & rp )
   return rv ;
 }
 
   return rv ;
 }
 
+//___________________________________________________________________________
+void AliPHOSvFast::ResetPoints()
+{
+  ResetFastRecParticles() ; 
+}
+
+//___________________________________________________________________________
+void AliPHOSvFast::ResetFastRecParticles()
+{
+  if (fFastRecParticles) 
+    fFastRecParticles->Clear() ;
+  fNRecParticles = 0 ; 
+}
+
 //___________________________________________________________________________
 void AliPHOSvFast::SetBigBox(Int_t index, Float_t value)
 {
 //___________________________________________________________________________
 void AliPHOSvFast::SetBigBox(Int_t index, Float_t value)
 {
index 6c02ad78313be0d3bb974e90509a987e7f87c068..a61c391d847f49553303987427c8cf0e499f3ae1 100644 (file)
@@ -45,6 +45,8 @@ public:
   void MakeRecParticle(const Int_t modid, const TVector3 pos, AliPHOSFastRecParticle & rp) ;  // makes a reconstructes particle from primary
   Int_t   MakeType(AliPHOSFastRecParticle & rp) ;                    // gets the detected type of particle
   FastRecParticlesList * FastRecParticles() { return fFastRecParticles ; } // gets TClonesArray of reconstructed particles
   void MakeRecParticle(const Int_t modid, const TVector3 pos, AliPHOSFastRecParticle & rp) ;  // makes a reconstructes particle from primary
   Int_t   MakeType(AliPHOSFastRecParticle & rp) ;                    // gets the detected type of particle
   FastRecParticlesList * FastRecParticles() { return fFastRecParticles ; } // gets TClonesArray of reconstructed particles
+  virtual void ResetPoints() ; 
+  void         ResetFastRecParticles() ; 
   void         SetBigBox(Int_t index, Float_t value) ;                             
   Double_t     SigmaE(Double_t energy) ;    // calulates the energy resolution at a given Energy                           
   Double_t     SigmaP(Double_t energy, Int_t inc) ; // calulates the position resolution at a given Energy at a given incidence                           
   void         SetBigBox(Int_t index, Float_t value) ;                             
   Double_t     SigmaE(Double_t energy) ;    // calulates the energy resolution at a given Energy                           
   Double_t     SigmaP(Double_t energy, Int_t inc) ; // calulates the position resolution at a given Energy at a given incidence