1 /**************************************************************************
2 * Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
4 * Author: The ALICE Off-line Project. *
5 * Contributors are mentioned in the code where appropriate. *
7 * Permission to use, copy, modify and distribute this software and its *
8 * documentation strictly for non-commercial purposes is hereby granted *
9 * without fee, provided that the above copyright notice appears in all *
10 * copies and that both the copyright notice and this permission notice *
11 * appear in the supporting documentation. The authors make no claims *
12 * about the suitability of this software for any purpose. It is *
13 * provided "as is" without express or implied warranty. *
14 **************************************************************************/
15 //////////////////////////////////////////////////////////////////////////////
16 // This is the base class for ITS detector signal simulations. Data members //
17 // include are a pointer to the detectors specific response and segmentation//
18 // classes. See the detector specific implementations for the propper code. //
19 //////////////////////////////////////////////////////////////////////////////
20 #include "TClonesArray.h"
22 #include "AliITSsimulation.h"
23 #include "AliITSpList.h"
25 ClassImp(AliITSsimulation)
27 //______________________________________________________________________
28 AliITSsimulation::AliITSsimulation(): TObject(),
35 // Default constructor
41 // a default constructed AliITSsimulation class
43 //______________________________________________________________________
44 AliITSsimulation::AliITSsimulation(AliITSsegmentation *seg,
45 AliITSresponse *res): TObject(),
52 // Default constructor
54 // AliITSsegmentation *seg Segmentation class to be used
55 // AliITSresponse *res Response class to be used.
59 // a default constructed AliITSsimulation class
61 //__________________________________________________________________________
62 AliITSsimulation::~AliITSsimulation(){
71 fSegmentation = 0; // local copies of pointer, do not delete
72 fResponse = 0; // local copies of pointer, do not delete
75 //__________________________________________________________________________
76 AliITSsimulation::AliITSsimulation(const AliITSsimulation &s) : TObject(s){
79 // const AliITSsimulation &s simulation class to copy from
83 // a standard constructed AliITSsimulation class with values the same
90 //_________________________________________________________________________
91 AliITSsimulation& AliITSsimulation::operator=(const AliITSsimulation &s){
92 // Assignment operator
94 // const AliITSsimulation &s simulation class to copy from
98 // a standard constructed AliITSsimulation class with values the same
101 if(&s == this) return *this;
102 this->fResponse = s.fResponse;
103 this->fSegmentation = s.fSegmentation;
104 this->fModule = s.fModule;
105 this->fEvent = s.fEvent;
106 this->fpList = s.fpList;
109 //______________________________________________________________________
110 Bool_t AliITSsimulation::AddSDigitsToModule(TClonesArray *pItemA,Int_t mask ){
111 // Add Summable digits to module maps.
113 // TClonesArray *pItemA Array of AliITSpListItems (SDigits).
114 // Int_t mask Track number off set value (see
115 // AliITSpList::AddItemTo).
119 // kTRUE if there is a signal >0 else kFALSE
120 Int_t nItems = pItemA->GetEntries();
123 // cout << "Adding "<< nItems <<" SDigits to module " << fModule << endl;
124 for( Int_t i=0; i<nItems; i++ ) {
125 AliITSpListItem * pItem = (AliITSpListItem *)(pItemA->At( i ));
126 if( pItem->GetModule() != fModule ) {
127 Error( "AddSDigitsToModule","Error reading, SDigits module %d "
128 "!= current module %d: exit",
129 pItem->GetModule(), fModule );
132 if(pItem->GetSignal()>0.0 ) sig = kTRUE;
133 fpList->AddItemTo( mask, pItem );