]> git.uio.no Git - u/mrichter/AliRoot.git/blame - ITS/AliITSsimulation.cxx
Incrementing ClassDefs (Y.Schutz)
[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 //
17// include are a pointer to the detectors specific response and segmentation//
18// classes. See the detector specific implementations for the propper code. //
19//////////////////////////////////////////////////////////////////////////////
b361c75d 20#include "TClonesArray.h"
21
b0f5e3fc 22#include "AliITSsimulation.h"
b361c75d 23#include "AliITSpList.h"
b0f5e3fc 24
d4a64099 25ClassImp(AliITSsimulation)
b0f5e3fc 26
aacedc3e 27//______________________________________________________________________
28AliITSsimulation::AliITSsimulation(): TObject(),
29fResponse(0),
30fSegmentation(0),
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//______________________________________________________________________
44AliITSsimulation::AliITSsimulation(AliITSsegmentation *seg,
45 AliITSresponse *res): TObject(),
46fResponse(res),
47fSegmentation(seg),
48fpList(0),
49fModule(0),
50fEvent(0),
51fDebug(0){
52 // Default constructor
53 // Inputs:
54 // AliITSsegmentation *seg Segmentation class to be used
55 // AliITSresponse *res Response class to be used.
56 // Outputs:
57 // none.
58 // Return:
59 // a default constructed AliITSsimulation class
b361c75d 60}
61//__________________________________________________________________________
62AliITSsimulation::~AliITSsimulation(){
63 // destructor
aacedc3e 64 // Inputs:
65 // none.
66 // Outputs:
67 // none.
68 // Return:
69 // none.
70
b361c75d 71 fSegmentation = 0; // local copies of pointer, do not delete
72 fResponse = 0; // local copies of pointer, do not delete
73 delete fpList;
b0f5e3fc 74}
b0f5e3fc 75//__________________________________________________________________________
ac8cbb66 76AliITSsimulation::AliITSsimulation(const AliITSsimulation &s) : TObject(s){
aacedc3e 77 // Copy Constructor
78 // Inputs:
79 // const AliITSsimulation &s simulation class to copy from
80 // Outputs:
81 // none.
82 // Return:
83 // a standard constructed AliITSsimulation class with values the same
84 // as that of s.
b361c75d 85
ac8cbb66 86 *this = s;
b361c75d 87 return;
b0f5e3fc 88}
89
90//_________________________________________________________________________
ac8cbb66 91AliITSsimulation& AliITSsimulation::operator=(const AliITSsimulation &s){
b361c75d 92 // Assignment operator
aacedc3e 93 // Inputs:
94 // const AliITSsimulation &s simulation class to copy from
95 // Outputs:
96 // none.
97 // Return:
98 // a standard constructed AliITSsimulation class with values the same
99 // as that of s.
b361c75d 100
ac8cbb66 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;
b361c75d 107 return *this;
108}
109//______________________________________________________________________
d4a64099 110Bool_t AliITSsimulation::AddSDigitsToModule(TClonesArray *pItemA,Int_t mask ){
b361c75d 111 // Add Summable digits to module maps.
aacedc3e 112 // Inputs:
113 // TClonesArray *pItemA Array of AliITSpListItems (SDigits).
114 // Int_t mask Track number off set value (see
115 // AliITSpList::AddItemTo).
116 // Outputs:
117 // none.
118 // Return:
119 // kTRUE if there is a signal >0 else kFALSE
b361c75d 120 Int_t nItems = pItemA->GetEntries();
d4a64099 121 Bool_t sig = kFALSE;
b361c75d 122
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 "
aacedc3e 128 "!= current module %d: exit",
129 pItem->GetModule(), fModule );
d4a64099 130 return sig;
b361c75d 131 } // end if
aacedc3e 132 if(pItem->GetSignal()>0.0 ) sig = kTRUE;
b361c75d 133 fpList->AddItemTo( mask, pItem );
134 } // end for i
d4a64099 135 return sig;
b0f5e3fc 136}