]> git.uio.no Git - u/mrichter/AliRoot.git/blob - ITS/AliITSdigit.h
Checking in the seeds of new cluster fitting code.
[u/mrichter/AliRoot.git] / ITS / AliITSdigit.h
1 #ifndef ALIITSDIGIT_H
2 #define ALIITSDIGIT_H
3 /* Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
4  * See cxx source for full Copyright notice     */
5 /* $Id$ */
6 ////////////////////////////////////////////////
7 //  Digits classes for all ITS detectors      //
8 ////////////////////////////////////////////////
9 #include <Riostream.h>
10 #include <Riostream.h>
11 #include <TObject.h>
12 #include <TObjArray.h>
13
14 //______________________________________________________________________
15 class AliITSdigit: public TObject  {
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() { }
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
27     virtual Int_t *GetTracks() {return 0;}
28     // returns pointer to array of hits numbers for this module (as given by
29     // AliITSmodule).
30     virtual Int_t *GetHits() {return 0;}
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.
53 ostream &operator<<(ostream &os,AliITSdigit &source);
54 istream &operator>>(istream &os,AliITSdigit &source);
55 //______________________________________________________________________
56 class AliITSdigitSPD: public AliITSdigit {
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*/}
64     // returns the array size used to store Tracks and Hits
65     static Int_t GetNTracks() {return fkSspd;}
66     // returns pointer to the array of tracks which make this digit
67     virtual Int_t *GetTracks() {return &fTracks[0];}
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[fkSspd] into fTracks
75     virtual void SetTracks(const Int_t *trks){
76         for(Int_t i=0;i<fkSspd;i++) fTracks[i]=trks[i];}
77     //copy the array hits[fkSspd] into fHits
78     virtual void SetHits(const Int_t *hits){
79         for(Int_t i=0;i<fkSspd;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
87  private:
88     static const Int_t fkSspd = 10; // size of fTracks and fHits arrays
89     
90  public:  
91     // debugging  -- goes to the dictionary
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
95
96     ClassDef(AliITSdigitSPD,2)   // Simulated digit object for SPD
97
98 };
99 // Input and output functions for standard C++ input/output.
100 ostream &operator<<(ostream &os,AliITSdigitSPD &source);
101 istream &operator>>(istream &os,AliITSdigitSPD &source);
102
103 //______________________________________________________________________
104 class AliITSdigitSDD: public AliITSdigit {
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*/}
114     // returns the array size used to store Tracks and Hits
115     static Int_t GetNTracks() {return fkSsdd;}
116     // returns pointer to the array of tracks which make this digit
117     virtual Int_t *GetTracks() {return &fTracks[0];}
118     // returns the pointer to the array of hits which made this digit
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[fkSsdd] into fTracks
125     virtual void SetTracks(const Int_t *trks){
126         for(Int_t i=0;i<fkSsdd;i++) fTracks[i]=trks[i];}
127     //copy the array hits[fkSsdd] into fHits
128     virtual void SetHits(const Int_t *hits){
129         for(Int_t i=0;i<fkSsdd;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
137  private:
138     static const Int_t fkSsdd = 10; // size of fTracks and fHits arrays
139     
140  public:
141     // debugging  -- goes to the dictionary
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
147
148     ClassDef(AliITSdigitSDD,2)   // Simulated digit object for SDD
149
150 };
151 // Input and output functions for standard C++ input/output.
152 ostream &operator<<(ostream &os,AliITSdigitSDD &source);
153 istream &operator>>(istream &os,AliITSdigitSDD &source);
154 //______________________________________________________________________
155 class AliITSTransientDigit : public AliITSdigitSDD {
156
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.
183 ostream &operator<<(ostream &os,AliITSTransientDigit &source);
184 istream &operator>>(istream &os,AliITSTransientDigit &source);
185 //______________________________________________________________________
186 class AliITSdigitSSD: public AliITSdigit {
187
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 */}
195     // returns the array size used to store Tracks and Hits
196     static Int_t GetNTracks() {return fkSssd;}
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
202     virtual Int_t *GetTracks() {return &fTracks[0];}
203     // returns the pointer to the array of hits which made this digit
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[fkSssd] into fTracks
210     virtual void SetTracks(const Int_t *trks){
211         for(Int_t i=0;i<fkSssd;i++) fTracks[i]=trks[i];}
212     //copy the array hits[fkSssd] into fHits
213     virtual void SetHits(const Int_t *hits){
214         for(Int_t i=0;i<fkSssd;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
222  private:
223     static const Int_t fkSssd = 10; // size of fTracks and fHits arrays
224     
225  public:
226     // debugging  -- goes to the dictionary
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
230     
231     ClassDef(AliITSdigitSSD,2)   // Simulated digit object for SSD
232
233 };
234 // Input and output functions for standard C++ input/output.
235 ostream &operator<<(ostream &os,AliITSdigitSSD &source);
236 istream &operator>>(istream &os,AliITSdigitSSD &source);
237
238 #endif