3 /* Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
4 * See cxx source for full Copyright notice */
8 ////////////////////////////////////////////////
9 // Digits classes for all ITS detectors //
10 ////////////////////////////////////////////////
11 #include <Riostream.h>
12 #include <Riostream.h>
19 //______________________________________________________________________
20 class AliITSdigit: public TObject {
23 AliITSdigit() {//default constructor. zero all values.
24 fSignal=fCoord1=fCoord2=0;}
25 //Standard Constructor. Fills class from array digits
26 AliITSdigit(const Int_t *digits);
28 virtual ~AliITSdigit() { }
29 // returns the array size used to store Tracks and Hits
30 // virtual Int_t GetNTracks() {return 0;}
31 //returns pointer to array of tracks numbers
32 virtual Int_t *GetTracks() {return 0;}
33 // returns pointer to array of hits numbers for this module (as given by
35 virtual Int_t *GetHits() {return 0;}
36 // returns track number kept in the array element i of fTracks
37 virtual Int_t GetTrack(Int_t) const {return 0;}
38 // returns hit number kept in the array element i of fHits
39 virtual Int_t GetHit(Int_t) const {return 0;}
40 virtual Int_t GetCoord1() const {return fCoord1;} // returns fCoord1
41 virtual Int_t GetCoord2() const {return fCoord2;} // returns fCoord2
42 virtual Int_t GetSignal() const {return fSignal;} // returns fSignal
43 virtual void SetCoord1(Int_t i){fCoord1 = i;} // Sets fCoord1 value
44 virtual void SetCoord2(Int_t i){fCoord2 = i;} // Sets fCoord12value
45 virtual void SetSignal(Int_t i){fSignal = i;} // Sets fSignal value
46 void Print(ostream *os); // Class ascii print function
47 void Read(istream *os); // Class ascii read function
50 Int_t fCoord1; // Cell number on Z axis (SPD+SDD), flag for side type (SSD)
51 Int_t fCoord2; // Cell number on X axis (SPD+SDD), strip number (SSD)
52 Int_t fSignal; // Signal in ADC counts
54 ClassDef(AliITSdigit,1) // Real data digit object for set:ITS
57 // Input and output functions for standard C++ input/output.
58 ostream &operator<<(ostream &os,AliITSdigit &source);
59 istream &operator>>(istream &os,AliITSdigit &source);
60 //______________________________________________________________________
61 class AliITSdigitSPD: public AliITSdigit {
64 AliITSdigitSPD(); //default creator
65 AliITSdigitSPD(const Int_t *digits);//standard creator digits only
66 //standard creator with digits, tracks, and hits
67 AliITSdigitSPD(const Int_t *digits,const Int_t *tracks,const Int_t *hits);
68 virtual ~AliITSdigitSPD(){/*destructor*/}
69 // returns the array size used to store Tracks and Hits
70 static Int_t GetNTracks() {return fkSspd;}
71 // returns the signal in electrons
72 Int_t GetSignalSPD() {return fSignalSPD;}
73 // returns pointer to the array of tracks which make this digit
74 virtual Int_t *GetTracks() {return &fTracks[0];}
75 //returns the pointer to the array of hits which made this digit
76 virtual Int_t *GetHits() {return &fHits[0];}
77 // returns track number kept in the array element i of fTracks
78 virtual Int_t GetTrack(Int_t i) const {return fTracks[i];}
79 // returns hit number kept in the array element i of fHits
80 virtual Int_t GetHit(Int_t i) const {return fHits[i];}
81 // returns TArrayI of unduplicated track numbers (summed over hits).
82 virtual Int_t GetListOfTracks(TArrayI &t);
83 //copy the array trks[fkSspd] into fTracks
84 virtual void SetTracks(const Int_t *trks){
85 for(Int_t i=0;i<fkSspd;i++) fTracks[i]=trks[i];}
86 // set signal in electrons
87 void SetSignalSPD(Int_t sig) {fSignalSPD = sig;}
88 //copy the array hits[fkSspd] into fHits
89 virtual void SetHits(const Int_t *hits){
90 for(Int_t i=0;i<fkSspd;i++) fHits[i]=hits[i];}
91 //set array element i of fTracks to trk.
92 virtual void SetTrack(Int_t i,Int_t trk){fTracks[i]=trk;}
93 //set array element i of fHits to hit.
94 virtual void SetHit(Int_t i,Int_t hit){fHits[i]=hit;}
95 void Print(ostream *os); // Class ascii print function
96 void Read(istream *os); // Class ascii read function
99 static const Int_t fkSspd = 10; // size of fTracks and fHits arrays
101 // debugging -- goes to the dictionary
102 Int_t fTracks[fkSspd]; //[fkSspd] tracks making this digit
103 Int_t fHits[fkSspd]; //[fkSspd] hits associated to the tracks
104 Int_t fSignalSPD; // Signal in electrons
106 ClassDef(AliITSdigitSPD,2) // Simulated digit object for SPD
109 // Input and output functions for standard C++ input/output.
110 ostream &operator<<(ostream &os,AliITSdigitSPD &source);
111 istream &operator>>(istream &os,AliITSdigitSPD &source);
113 //______________________________________________________________________
114 class AliITSdigitSDD: public AliITSdigit {
117 AliITSdigitSDD(); //default creator
118 //standard creator with digits and "phys"
119 AliITSdigitSDD(Float_t phys,const Int_t *digits);
120 //standard creator with digits, tracls, hits, "phys", and charge
121 AliITSdigitSDD( Float_t phys,const Int_t *digits,const Int_t *tracks,
122 const Int_t *hits,const Float_t *charges);
123 virtual ~AliITSdigitSDD(){/* destructor*/}
124 // returns the array size used to store Tracks and Hits
125 static Int_t GetNTracks() {return fkSsdd;}
126 // returns pointer to the array of tracks which make this digit
127 virtual Int_t *GetTracks() {return &fTracks[0];}
128 // returns the pointer to the array of hits which made this digit
129 virtual Int_t *GetHits() {return &fHits[0];}
130 // returns track number kept in the array element i of fTracks
131 virtual Int_t GetTrack(Int_t i) const {return fTracks[i];}
132 // returns hit number kept in the array element i of fHits
133 virtual Int_t GetHit(Int_t i) const {return fHits[i];}
134 // Return charge deposited by this track/hit
135 virtual Float_t GetCharge(Int_t i){return fTcharges[i];}
136 // returns TArrayI of unduplicated track numbers (summed over hits).
137 virtual Int_t GetListOfTracks(TArrayI &t,TArrayF &c);
138 //copy the array trks[fkSsdd] into fTracks
139 virtual void SetTracks(const Int_t *trks){
140 for(Int_t i=0;i<fkSsdd;i++) fTracks[i]=trks[i];}
141 //copy the array hits[fkSsdd] into fHits
142 virtual void SetHits(const Int_t *hits){
143 for(Int_t i=0;i<fkSsdd;i++) fHits[i]=hits[i];}
144 //set array element i of fTracks to trk.
145 virtual void SetTrack(Int_t i,Int_t trk){fTracks[i]=trk;}
146 //set array element i of fHits to hit.
147 virtual void SetHit(Int_t i,Int_t hit){fHits[i]=hit;}
148 void Print(ostream *os); // Class ascii print function
149 void Read(istream *os); // Class ascii read function
152 static const Int_t fkSsdd = 10; // size of fTracks and fHits arrays
154 // debugging -- goes to the dictionary
155 Int_t fTracks[fkSsdd]; //[fkSsdd] tracks making this digit
156 Int_t fHits[fkSsdd]; //[fkSsdd] hits associated to the tracks
157 // 3 hits temporarily - it will be only 1
158 Float_t fTcharges[fkSsdd]; //[fkSsdd] charge per track making this digit
159 Float_t fPhysics; // signal particles contribution to signal
161 ClassDef(AliITSdigitSDD,2) // Simulated digit object for SDD
164 // Input and output functions for standard C++ input/output.
165 ostream &operator<<(ostream &os,AliITSdigitSDD &source);
166 istream &operator>>(istream &os,AliITSdigitSDD &source);
167 //______________________________________________________________________
168 class AliITSTransientDigit : public AliITSdigitSDD {
171 AliITSTransientDigit() {/*default constructor*/fTrackList=0;}
172 // Standard constructor with digits and "phys"
173 AliITSTransientDigit(Float_t phys,const Int_t *digits);
174 virtual ~AliITSTransientDigit(){/*destructor delets TObjArray fTracklist */
177 AliITSTransientDigit(const AliITSTransientDigit &source);
178 //assignment operator
179 AliITSTransientDigit& operator=(const AliITSTransientDigit &source);
180 // returns pointer to the TObjArray of tracks and associated charges
181 TObjArray *TrackList() const {return fTrackList;}
182 //returns element i of fTrackList
183 TObject *TrackItem(Int_t i) const {return fTrackList->At(i);}
184 //put TObject into fTrackList at location i
185 void PutTrackItem(TObject *obj,Int_t i){fTrackList->AddAt(obj,i);}
186 void Print(ostream *os); // Class ascii print function
187 void Read(istream *os); // Class ascii read function
190 TObjArray *fTrackList; // track list
192 ClassDef(AliITSTransientDigit,1) // Transient digit for set: ITS
195 // Input and output functions for standard C++ input/output.
196 ostream &operator<<(ostream &os,AliITSTransientDigit &source);
197 istream &operator>>(istream &os,AliITSTransientDigit &source);
198 //______________________________________________________________________
199 class AliITSdigitSSD: public AliITSdigit {
202 AliITSdigitSSD(); //default constructor
203 //Standard constructor with digits
204 AliITSdigitSSD(const Int_t *digits);
205 //Standard constructor with digits, tracks, and hits
206 AliITSdigitSSD(const Int_t *digits,const Int_t *tracks,const Int_t *hits);
207 virtual ~AliITSdigitSSD(){/* destructor */}
208 // returns the array size used to store Tracks and Hits
209 static Int_t GetNTracks() {return fkSssd;}
210 Int_t GetSignal() const {/* returns signal*/return fSignal;}
211 Int_t GetStripNumber() const {/* returns strip number*/return fCoord2;}
212 //returns 1 when side P and 0 when side N
213 Int_t IsSideP() const {return fCoord1;}
214 // returns pointer to the array of tracks which make this digit
215 virtual Int_t *GetTracks() {return &fTracks[0];}
216 // returns the pointer to the array of hits which made this digit
217 virtual Int_t *GetHits() {return &fHits[0];}
218 // returns track number kept in the array element i of fTracks
219 virtual Int_t GetTrack(Int_t i) const {return fTracks[i];}
220 // returns hit number kept in the array element i of fHits
221 virtual Int_t GetHit(Int_t i) const {return fHits[i];}
222 // returns TArrayI of unduplicated track numbers (summed over hits).
223 virtual Int_t GetListOfTracks(TArrayI &t);
224 //copy the array trks[fkSssd] into fTracks
225 virtual void SetTracks(const Int_t *trks){
226 for(Int_t i=0;i<fkSssd;i++) fTracks[i]=trks[i];}
227 //copy the array hits[fkSssd] into fHits
228 virtual void SetHits(const Int_t *hits){
229 for(Int_t i=0;i<fkSssd;i++) fHits[i]=hits[i];}
230 //set array element i of fTracks to trk.
231 virtual void SetTrack(Int_t i,Int_t trk){fTracks[i]=trk;}
232 //set array element i of fHits to hit.
233 virtual void SetHit(Int_t i,Int_t hit){fHits[i]=hit;}
234 void Print(ostream *os); // Class ascii print function
235 void Read(istream *os); // Class ascii read function
238 static const Int_t fkSssd = 10; // size of fTracks and fHits arrays
240 // debugging -- goes to the dictionary
241 Int_t fTracks[fkSssd]; //[fkSssd] tracks making this digit
242 Int_t fHits[fkSssd]; //[fkSssd] hits associated to the tracks
243 // 3 hits temporarily - it will be only 1
245 ClassDef(AliITSdigitSSD,2) // Simulated digit object for SSD
248 // Input and output functions for standard C++ input/output.
249 ostream &operator<<(ostream &os,AliITSdigitSSD &source);
250 istream &operator>>(istream &os,AliITSdigitSSD &source);