X-Git-Url: http://git.uio.no/git/?a=blobdiff_plain;f=ITS%2FAliITSsimulation.cxx;h=838cbd0fd9201fda6fff3e30aba856b31c3b09f8;hb=b5cec7b2fdfc1e84506c02f1ddb746dc699766cc;hp=576abdbe290e4118b6d155b823c7dc3bb6285638;hpb=ac8cbb66a82ab5b8e2410c6ee7439fa6e2b037d5;p=u%2Fmrichter%2FAliRoot.git diff --git a/ITS/AliITSsimulation.cxx b/ITS/AliITSsimulation.cxx index 576abdbe290..838cbd0fd92 100644 --- a/ITS/AliITSsimulation.cxx +++ b/ITS/AliITSsimulation.cxx @@ -12,7 +12,12 @@ * about the suitability of this software for any purpose. It is * * provided "as is" without express or implied warranty. * **************************************************************************/ - +////////////////////////////////////////////////////////////////////////////// +// This is the base class for ITS detector signal simulations. Data members // +// include are a pointer to the AliITSDetTypeSim clas in order to access // +// segmentation and response objects // +// classes. See the detector specific implementations for the propper code. // +////////////////////////////////////////////////////////////////////////////// #include "TClonesArray.h" #include "AliITSsimulation.h" @@ -20,36 +25,81 @@ ClassImp(AliITSsimulation) -AliITSsimulation::AliITSsimulation(){ - // constructor - fSegmentation = 0; - fResponse = 0; - fpList = 0; - fModule = 0; - fEvent = 0; +//______________________________________________________________________ +AliITSsimulation::AliITSsimulation(): TObject(), +fDetType(0), +fpList(0), +fModule(0), +fEvent(0), +fDebug(0){ + // Default constructor + // Inputs: + // none. + // Outputs: + // none. + // Return: + // a default constructed AliITSsimulation class +} +//______________________________________________________________________ +AliITSsimulation::AliITSsimulation(AliITSDetTypeSim *dettyp): TObject(), +fDetType(dettyp), +fpList(0), +fModule(0), +fEvent(0), +fDebug(0){ + // Default constructor + // Inputs: + // AliITSDetTypeSim * : object used to access segmentation and response + // Outputs: + // none. + // Return: + // a default constructed AliITSsimulation class } //__________________________________________________________________________ AliITSsimulation::~AliITSsimulation(){ // destructor - fSegmentation = 0; // local copies of pointer, do not delete - fResponse = 0; // local copies of pointer, do not delete - delete fpList; -} + // Inputs: + // none. + // Outputs: + // none. + // Return: + // none. + + if(fpList){ + delete fpList; + fpList = 0; + } + } //__________________________________________________________________________ -AliITSsimulation::AliITSsimulation(const AliITSsimulation &s) : TObject(s){ - // Copy Constructor +AliITSsimulation::AliITSsimulation(const AliITSsimulation &s) : TObject(s), +fDetType(s.fDetType), +fpList(s.fpList), +fModule(s.fModule), +fEvent(s.fEvent), +fDebug(s.fDebug){ + // Copy Constructor + // Inputs: + // const AliITSsimulation &s simulation class to copy from + // Outputs: + // none. + // Return: + // a standard constructed AliITSsimulation class with values the same + // as that of s. - *this = s; - return; } //_________________________________________________________________________ AliITSsimulation& AliITSsimulation::operator=(const AliITSsimulation &s){ // Assignment operator + // Inputs: + // const AliITSsimulation &s simulation class to copy from + // Outputs: + // none. + // Return: + // a standard constructed AliITSsimulation class with values the same + // as that of s. if(&s == this) return *this; - this->fResponse = s.fResponse; - this->fSegmentation = s.fSegmentation; this->fModule = s.fModule; this->fEvent = s.fEvent; this->fpList = s.fpList; @@ -58,6 +108,14 @@ AliITSsimulation& AliITSsimulation::operator=(const AliITSsimulation &s){ //______________________________________________________________________ Bool_t AliITSsimulation::AddSDigitsToModule(TClonesArray *pItemA,Int_t mask ){ // Add Summable digits to module maps. + // Inputs: + // TClonesArray *pItemA Array of AliITSpListItems (SDigits). + // Int_t mask Track number off set value (see + // AliITSpList::AddItemTo). + // Outputs: + // none. + // Return: + // kTRUE if there is a signal >0 else kFALSE Int_t nItems = pItemA->GetEntries(); Bool_t sig = kFALSE; @@ -66,11 +124,11 @@ Bool_t AliITSsimulation::AddSDigitsToModule(TClonesArray *pItemA,Int_t mask ){ AliITSpListItem * pItem = (AliITSpListItem *)(pItemA->At( i )); if( pItem->GetModule() != fModule ) { Error( "AddSDigitsToModule","Error reading, SDigits module %d " - "!= current module %d: exit", - pItem->GetModule(), fModule ); + "!= current module %d: exit", + pItem->GetModule(), fModule ); return sig; } // end if - if(pItem->GetSignal()>0.0 ) sig = kTRUE; + if(pItem->GetSignal()>0.0 ) sig = kTRUE; fpList->AddItemTo( mask, pItem ); } // end for i return sig;