* 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; i<nItems; i++ ) {
+ AliITSpListItem * pItem = (AliITSpListItem *)(pItemA->At( 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
}
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
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