From f96d3dc77995e13c5776586e4ba7f671b152387c Mon Sep 17 00:00:00 2001 From: schutz Date: Thu, 2 Mar 2000 14:37:06 +0000 Subject: [PATCH] Fast simulation ready to be tested --- PHOS/AliPHOSFastRecParticle.h | 13 +++++++++++-- PHOS/AliPHOSvFast.cxx | 25 +++++++++++++++++++------ PHOS/AliPHOSvFast.h | 2 ++ 3 files changed, 32 insertions(+), 8 deletions(-) diff --git a/PHOS/AliPHOSFastRecParticle.h b/PHOS/AliPHOSFastRecParticle.h index 113f39fe35b..e4e026ef978 100644 --- a/PHOS/AliPHOSFastRecParticle.h +++ b/PHOS/AliPHOSFastRecParticle.h @@ -21,9 +21,18 @@ // --- AliRoot header files --- -#include "AliPHOSRecParticle.h" +//#include "AliPHOSRecParticle.h" 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 { @@ -44,7 +53,7 @@ public: void Print() ; void SetType(Int_t type) { fType = type ; } -private: +protected: Int_t fType ; // identified particle type diff --git a/PHOS/AliPHOSvFast.cxx b/PHOS/AliPHOSvFast.cxx index aa8d558902d..88f98edbb6c 100644 --- a/PHOS/AliPHOSvFast.cxx +++ b/PHOS/AliPHOSvFast.cxx @@ -88,8 +88,8 @@ AliPHOSvFast::~AliPHOSvFast() //____________________________________________________________________________ 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 - // The branch of fHits is automatically split - // + 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 ; - if ( charge == 0 && ( TMath::Abs(rp.GetPdgCode()) != 11 ) ) + if ( charge != 0 && ( TMath::Abs(rp.GetPdgCode()) != 11 ) ) test = - 1 ; else test = rp.GetPdgCode() ; @@ -342,7 +341,7 @@ Int_t AliPHOSvFast::MakeType(AliPHOSFastRecParticle & rp ) rv = kCHARGEDHADRON ; break; - case -11: // it's a electron + case -11: // it's a positon ran = fRan.Rndm() ; if ( ran <= 0.9996 ) rv = kELECTRON ; @@ -364,6 +363,20 @@ Int_t AliPHOSvFast::MakeType(AliPHOSFastRecParticle & rp ) return rv ; } +//___________________________________________________________________________ +void AliPHOSvFast::ResetPoints() +{ + ResetFastRecParticles() ; +} + +//___________________________________________________________________________ +void AliPHOSvFast::ResetFastRecParticles() +{ + if (fFastRecParticles) + fFastRecParticles->Clear() ; + fNRecParticles = 0 ; +} + //___________________________________________________________________________ void AliPHOSvFast::SetBigBox(Int_t index, Float_t value) { diff --git a/PHOS/AliPHOSvFast.h b/PHOS/AliPHOSvFast.h index 6c02ad78313..a61c391d847 100644 --- a/PHOS/AliPHOSvFast.h +++ b/PHOS/AliPHOSvFast.h @@ -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 + 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 -- 2.43.0