commented define _ClusterTopology_ - to be used only for the special productions
[u/mrichter/AliRoot.git] / ITS / AliITSsimulation.cxx
CommitLineData
b0f5e3fc 1/**************************************************************************
2 * Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
3 * *
4 * Author: The ALICE Off-line Project. *
5 * Contributors are mentioned in the code where appropriate. *
6 * *
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 **************************************************************************/
7d62fb64 15//////////////////////////////////////////////////////////////////////////////
16// This is the base class for ITS detector signal simulations. Data members //
8ba39da9 17// include are a pointer to the AliITSDetTypeSim clas in order to access //
18// segmentation and response objects //
7d62fb64 19// classes. See the detector specific implementations for the propper code. //
20//////////////////////////////////////////////////////////////////////////////
b361c75d 21#include "TClonesArray.h"
22
b0f5e3fc 23#include "AliITSsimulation.h"
b361c75d 24#include "AliITSpList.h"
b0f5e3fc 25
d4a64099 26ClassImp(AliITSsimulation)
b0f5e3fc 27
aacedc3e 28//______________________________________________________________________
29AliITSsimulation::AliITSsimulation(): TObject(),
7537d03c 30fDetType(0),
aacedc3e 31fpList(0),
32fModule(0),
33fEvent(0),
34fDebug(0){
35 // Default constructor
36 // Inputs:
37 // none.
38 // Outputs:
39 // none.
40 // Return:
41 // a default constructed AliITSsimulation class
42}
43//______________________________________________________________________
8ba39da9 44AliITSsimulation::AliITSsimulation(AliITSDetTypeSim *dettyp): TObject(),
7537d03c 45fDetType(dettyp),
aacedc3e 46fpList(0),
47fModule(0),
48fEvent(0),
49fDebug(0){
50 // Default constructor
51 // Inputs:
8ba39da9 52 // AliITSDetTypeSim * : object used to access segmentation and response
aacedc3e 53 // Outputs:
54 // none.
55 // Return:
56 // a default constructed AliITSsimulation class
b361c75d 57}
58//__________________________________________________________________________
59AliITSsimulation::~AliITSsimulation(){
60 // destructor
aacedc3e 61 // Inputs:
62 // none.
63 // Outputs:
64 // none.
65 // Return:
66 // none.
67
8ba39da9 68 if(fpList){
69 delete fpList;
70 fpList = 0;
71 }
fcf95fc7 72 }
b0f5e3fc 73//__________________________________________________________________________
7537d03c 74AliITSsimulation::AliITSsimulation(const AliITSsimulation &s) : TObject(s),
75fDetType(s.fDetType),
76fpList(s.fpList),
77fModule(s.fModule),
78fEvent(s.fEvent),
79fDebug(s.fDebug){
aacedc3e 80 // Copy Constructor
81 // Inputs:
82 // const AliITSsimulation &s simulation class to copy from
83 // Outputs:
84 // none.
85 // Return:
86 // a standard constructed AliITSsimulation class with values the same
87 // as that of s.
b361c75d 88
b0f5e3fc 89}
90
91//_________________________________________________________________________
ac8cbb66 92AliITSsimulation& AliITSsimulation::operator=(const AliITSsimulation &s){
b361c75d 93 // Assignment operator
aacedc3e 94 // Inputs:
95 // const AliITSsimulation &s simulation class to copy from
96 // Outputs:
97 // none.
98 // Return:
99 // a standard constructed AliITSsimulation class with values the same
100 // as that of s.
b361c75d 101
ac8cbb66 102 if(&s == this) return *this;
ac8cbb66 103 this->fModule = s.fModule;
104 this->fEvent = s.fEvent;
105 this->fpList = s.fpList;
b361c75d 106 return *this;
107}
108//______________________________________________________________________
d4a64099 109Bool_t AliITSsimulation::AddSDigitsToModule(TClonesArray *pItemA,Int_t mask ){
b361c75d 110 // Add Summable digits to module maps.
aacedc3e 111 // Inputs:
112 // TClonesArray *pItemA Array of AliITSpListItems (SDigits).
113 // Int_t mask Track number off set value (see
114 // AliITSpList::AddItemTo).
115 // Outputs:
116 // none.
117 // Return:
118 // kTRUE if there is a signal >0 else kFALSE
b361c75d 119 Int_t nItems = pItemA->GetEntries();
d4a64099 120 Bool_t sig = kFALSE;
b361c75d 121
122 // cout << "Adding "<< nItems <<" SDigits to module " << fModule << endl;
123 for( Int_t i=0; i<nItems; i++ ) {
124 AliITSpListItem * pItem = (AliITSpListItem *)(pItemA->At( i ));
125 if( pItem->GetModule() != fModule ) {
126 Error( "AddSDigitsToModule","Error reading, SDigits module %d "
aacedc3e 127 "!= current module %d: exit",
128 pItem->GetModule(), fModule );
d4a64099 129 return sig;
b361c75d 130 } // end if
aacedc3e 131 if(pItem->GetSignal()>0.0 ) sig = kTRUE;
b361c75d 132 fpList->AddItemTo( mask, pItem );
133 } // end for i
d4a64099 134 return sig;
b0f5e3fc 135}