1 #ifndef ALIITSPLISTSSDITEM_H
2 #define ALIITSPLISTSSDITEM_H
3 /* Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
4 * See cxx source for full Copyright notice */
10 class AliITSpListItem: public TObject {
12 // Default Constructor
14 // Standard Signal Constructor
15 AliITSpListItem(Int_t track,Int_t hit,Int_t module,Int_t index,
17 // Standard Noise Constructor
18 AliITSpListItem(Int_t module,Int_t index,Double_t signal);
20 virtual ~AliITSpListItem();
22 AliITSpListItem(AliITSpListItem &source);
24 virtual AliITSpListItem& operator=(const AliITSpListItem &source);
25 // Returns the signal value in the list of signals
26 virtual Double_t GetSignal(Int_t i){
27 return ( (i>=0&&i<fkSize-1) ? fSignal[i] : 0.0);}
28 virtual Double_t GetSignal(){
30 // Returns the Sum/Total signal
31 virtual Double_t GetSumSignal() const {return fTsignal+fNoise;}
33 virtual Double_t GetNoise() const {return fNoise;}
34 // Returns the number of stored singals.
35 virtual Int_t GetNsignals() const {return fkSize;}
36 // Addes track number and signal to this existing list.
37 virtual void AddSignal(Int_t track,Int_t hit,Int_t module,
38 Int_t index,Double_t signal);
39 // Addes noise to this existing list.
40 virtual void AddNoise(Int_t module,Int_t index,Double_t noise);
41 // Returns track number.
42 virtual Int_t GetTrack(Int_t i){
43 return ((i>=0&&i<fkSize-1) ? fTrack[i] : 0);}
44 // Returns hit number.
45 virtual Int_t GetHit(Int_t i){
46 return ((i>=0&&i<fkSize-1) ? fHits[i] : 0);}
47 // Returns module number.
48 virtual Int_t GetModule(){
50 // Returns index number.
51 virtual Int_t GetIndex(){
53 // Adds the contents of pl to this with track number off set given by
55 virtual void AddTo(Int_t fileIndex,AliITSpListItem *pl);
56 // Shift an index number to occupy the upper four bits.
57 virtual Int_t ShiftIndex(Int_t in,Int_t trk);
58 // Standard ascii class print function
59 void Print(ostream *os);
60 // Standard ascii class read function
61 void Read(istream *is);
64 static const Int_t fkSize = 10; // Array sizes
65 Int_t fmodule; // module number
66 Int_t findex; // Strip/row,col number linearlized.
67 Int_t fTrack[fkSize]; //[fkSize] track Number
68 Int_t fHits[fkSize]; //[fkSize] hit number
69 Double_t fSignal[fkSize]; //[fkSize] Signals
70 Double_t fTsignal; // Total signal (no noise)
71 Double_t fNoise; // Total noise, coupling, ...
73 ClassDef(AliITSpListItem,2) // Item list of signals and track numbers
75 // Input and output functions for standard C++ input/output.
76 ostream & operator<<(ostream &os,AliITSpListItem &source);
77 istream & operator>>(istream &is,AliITSpListItem &source);
82 #ifndef ALIITSPLISTSSD_H
83 #define ALIITSPLISTSSD_H
84 /* Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
85 * See cxx source for full Copyright notice */
87 #include "AliITSMap.h"
90 class AliITSpListItem;
92 class AliITSpList: public AliITSMap {
94 // returns the TObjArray index for a give set of map indecies.
95 Int_t GetIndex(Int_t i,Int_t j){
96 if(i<0||i>=fNi || j<0||j>=fNj) return -1;
101 // Default Constructor
103 // Standard Constructor
104 AliITSpList(Int_t imax,Int_t jmax);
106 virtual ~AliITSpList();
108 AliITSpList(AliITSpList &source);
110 virtual AliITSpList& operator=(const AliITSpList &source);
111 // Returns the max mape index values
112 void GetMaxMapIndex(Int_t &ni,Int_t &nj){ni=fNi;nj=fNj;return;}
113 // returns the max index value.
114 Int_t GetMaxIndex(){return fNi*fNj;}
115 // returns the max number of track/hit entries per cell.
116 Int_t GetNEnteries(){return 5;}
117 // for a give TObjArray index it returns the corresponding map index
118 void GetMapIndex(Int_t index,Int_t &i,Int_t &j){
119 i = index/fNj;j = index - fNj*i;
120 if(i<0||i>=fNi || j<0||j>=fNj){i=-1;j=-1; return;}
122 // Returns the signal+noise for a give map coordinate
123 Double_t GetSignal(Int_t i,Int_t j){
124 if(GetpListItem(i,j)==0) return 0.0;
125 return GetpListItem(i,j)->GetSumSignal();
127 // Returns the signal only for a give map coordinate
128 Double_t GetSignalOnly(Int_t i,Int_t j){
129 if(GetpListItem(i,j)==0) return 0.0;
130 return GetpListItem(i,j)->GetSignal();
132 // Returns the noise for a give map coordinate
133 Double_t GetNoise(Int_t i,Int_t j){
134 if(GetpListItem(i,j)==0) return 0.0;
135 return GetpListItem(i,j)->GetNoise();
137 // returns the track number which generated the signal at a given map
138 // coordinate. If there is no signal or only noise, then -2 is returned.
139 // k is the track rank number.
140 Double_t GetTSignal(Int_t i,Int_t j,Int_t k){
141 if(GetpListItem(i,j)==0) return 0.0;
142 return GetpListItem(i,j)->GetSignal(k);
144 // returns the track number which generated the signal at a given map
145 // coordinate. If there is no signal or only noise, then -2 is returned.
146 // k is the track rank number.
147 Int_t GetTrack(Int_t i,Int_t j,Int_t k){
148 if(GetpListItem(i,j)==0) return -2;
149 return GetpListItem(i,j)->GetTrack(k);
151 // returns the hit number which generated the signal at a given map
152 // coordinate. If there is no signal or only noise, then -2 is returned.
153 // k is the hit rank number.
154 Int_t GetHit(Int_t i,Int_t j,Int_t k){
155 if(GetpListItem(i,j)==0) return -2;
156 return GetpListItem(i,j)->GetHit(k);
158 // returns the number of Signal values
159 Int_t GetNSignals(Int_t i,Int_t j){
160 if(GetpListItem(i,j)==0) return 0;
161 return GetpListItem(i,j)->GetNsignals();
163 // Adds the contents of pl to the list with track number off set given by
165 virtual void AddItemTo(Int_t fileIndex, AliITSpListItem *pl);
166 // Adds a Signal value to the map. Creating and expanding arrays as needed.
167 void AddSignal(Int_t i,Int_t j,Int_t trk,Int_t ht,Int_t mod,Double_t sig);
168 // Adds a Noise value to the map. Creating and expanding arrays as needed.
169 void AddNoise(Int_t i,Int_t j,Int_t mod,Double_t noise);
170 // Delete all AliITSpListItems and zero the TObjArray
172 // Delete a particular AliITSpListItem in the TObjArray.
173 void DeleteHit(Int_t i,Int_t j);
174 // returns hit index in TObjArray
175 Int_t GetHitIndex(Int_t i,Int_t j){return GetIndex(i,j);}
176 // returns "hit" AliITSpListItem as a TObject.
177 TObject * GetHit(Int_t i,Int_t j){return (TObject*)GetpListItem(i,j);}
179 FlagType TestHit(Int_t i,Int_t j){if(GetpListItem(i,j)==0) return kEmpty;
180 else if(GetSignal(i,j)<=0) return kUnused; else return kUsed;}
181 // Returns the pointer to the TObjArray of pList Items
182 TObjArray * GetpListItems(){return fa;}
183 // returns the pList Item stored in the TObject array
184 AliITSpListItem* GetpListItem(Int_t i,Int_t j){
185 if(fa!=0)return (AliITSpListItem*) (fa->At(GetIndex(i,j)));
189 // Fill pList from digits. Not functional yet
191 // Sets threshold for significance. Not of relavance in this case.
192 void SetThreshold(Int_t i){;}
193 // Sets a single hit. Not of relavance in this case.
194 void SetHit(Int_t i,Int_t j,Int_t k){;}
195 // Flags a hit. Not of relavence in this case.
196 void FlagHit(Int_t i,Int_t j){;}
199 Int_t fNi,fNj; // The max index in i,j.
200 TObjArray *fa; // array of pList items
202 ClassDef(AliITSpList,1) // list of signals and track numbers
204 // Input and output functions for standard C++ input/output.
205 ostream & operator<<(ostream &os,AliITSpList &source);
206 istream & operator>>(istream &is,AliITSpList &source);