From b361c75de7f4727dce882e79d6667b336bee1be2 Mon Sep 17 00:00:00 2001 From: nilsen Date: Fri, 15 Mar 2002 17:30:12 +0000 Subject: [PATCH] Added data members fpList, fModule, fEvent. These are now needed by all simulation members for compliance with new SDigitization functions. Added here because they are common to all. Also added common function AddSDigitsToModule, and virtual functions InitSimulatinoModule, and FinishSDititizeModule. --- ITS/AliITSsimulation.cxx | 69 +++++++++++++++++++++++++++++----------- ITS/AliITSsimulation.h | 28 +++++++++++++--- 2 files changed, 74 insertions(+), 23 deletions(-) diff --git a/ITS/AliITSsimulation.cxx b/ITS/AliITSsimulation.cxx index 04c40244bb8..f22ca2b9a3c 100644 --- a/ITS/AliITSsimulation.cxx +++ b/ITS/AliITSsimulation.cxx @@ -13,32 +13,65 @@ * provided "as is" without express or implied warranty. * **************************************************************************/ +#include "TClonesArray.h" + #include "AliITSsimulation.h" +#include "AliITSpList.h" ClassImp(AliITSsimulation) -AliITSsimulation::AliITSsimulation() -{ - // constructor - fSegmentation=0; - fResponse=0; +AliITSsimulation::AliITSsimulation(){ + // constructor + fSegmentation = 0; + fResponse = 0; + fpList = 0; +} +//__________________________________________________________________________ +AliITSsimulation::~AliITSsimulation(){ + // destructor + fSegmentation = 0; // local copies of pointer, do not delete + fResponse = 0; // local copies of pointer, do not delete + delete fpList; } - //__________________________________________________________________________ AliITSsimulation::AliITSsimulation(const AliITSsimulation &source){ - // Copy Constructor - if(&source == this) return; - this->fResponse = source.fResponse; - this->fSegmentation = source.fSegmentation; - return; + // Copy Constructor + + if(&source == this) return; + this->fResponse = source.fResponse; + this->fSegmentation = source.fSegmentation; + this->fModule = source.fModule; + this->fEvent = source.fEvent; + this->fpList = source.fpList; + return; } //_________________________________________________________________________ -AliITSsimulation& - AliITSsimulation::operator=(const AliITSsimulation &source) { - // Assignment operator - if(&source == this) return *this; - this->fResponse = source.fResponse; - this->fSegmentation = source.fSegmentation; - return *this; +AliITSsimulation& AliITSsimulation::operator=(const AliITSsimulation &source){ + // Assignment operator + + if(&source == this) return *this; + this->fResponse = source.fResponse; + this->fSegmentation = source.fSegmentation; + this->fModule = source.fModule; + this->fEvent = source.fEvent; + this->fpList = source.fpList; + return *this; +} +//______________________________________________________________________ +void AliITSsimulation::AddSDigitsToModule(TClonesArray *pItemA,Int_t mask ){ + // Add Summable digits to module maps. + Int_t nItems = pItemA->GetEntries(); + + // cout << "Adding "<< nItems <<" SDigits to module " << fModule << endl; + for( Int_t i=0; iAt( i )); + if( pItem->GetModule() != fModule ) { + Error( "AddSDigitsToModule","Error reading, SDigits module %d " + "!= current module %d: exit", + pItem->GetModule(), fModule ); + return; + } // end if + fpList->AddItemTo( mask, pItem ); + } // end for i } diff --git a/ITS/AliITSsimulation.h b/ITS/AliITSsimulation.h index b45c6a89fd8..7c7f8ef7961 100644 --- a/ITS/AliITSsimulation.h +++ b/ITS/AliITSsimulation.h @@ -22,6 +22,8 @@ class AliITSresponse; class AliITSsegmentation; class AliITSmodule; class TRandom; +class AliITSpList; +class TClonesArray; // This is the base class for ITS detector signal simulations. Data members // include are a pointer to the detectors specific response and segmentation @@ -31,24 +33,40 @@ class AliITSsimulation : public TObject { public: AliITSsimulation(); // Default constructor - virtual ~AliITSsimulation() {}// destructor + virtual ~AliITSsimulation(); // destructor // copy constructor. See detector specific implementation. AliITSsimulation(const AliITSsimulation &source); // Assignment opporator. See detector specific implementation. virtual AliITSsimulation& operator=(const AliITSsimulation &source); + + // ***************** Hits -> SDigits ****************** // digitize module using the "slow" detector simulator creating // summable digits. virtual void SDigitiseModule(AliITSmodule *mod,Int_t module,Int_t event){;} + + // ***************** sum of SDigits -> Digits ********** + // Reset module arrays (maps), etc + virtual void InitSimulationModule( Int_t module, Int_t event ){;} + // add (sum) a new list of summable digits to module, + // add an offset (mask) to the track numbers + virtual void AddSDigitsToModule( TClonesArray *pItemArray, Int_t mask ); + // digitize module using the "slow" detector simulator from + // the sum of summable digits. + virtual void FinishSDigitiseModule(){;} + + // **************** Hits -> Digits ********************* // digitize module using the "slow" detector simulator creating digits. virtual void DigitiseModule(AliITSmodule *mod,Int_t module,Int_t event) {;} // digitizes module using the "fast" detector simulator. virtual void CreateFastRecPoints(AliITSmodule *mod,Int_t module, TRandom *rndm) {} -protected: - - AliITSresponse *fResponse; //! response - AliITSsegmentation *fSegmentation; //! segmentation + protected: + AliITSresponse *fResponse; //! response + AliITSsegmentation *fSegmentation; //! segmentation + AliITSpList *fpList; //! + Int_t fModule; //! + Int_t fEvent; //! ClassDef(AliITSsimulation,1) // Simulation base class -- 2.43.0