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