AliRoot Core  edcc906 (edcc906)
AliComplexCluster.h
Go to the documentation of this file.
1 #ifndef ALICOMPLEXCLUSTER_H
2 #define ALICOMPLEXCLUSTER_H
3 /* Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
4  * See cxx source for full Copyright notice */
5 
9 
10 #include "TObject.h"
11 #include "TMath.h"
12 #include "AliTPCclusterMI.h"
13 #include "limits.h"
14 
16  inline Int_t Clamp(Int_t val, Int_t min, Int_t max)
17  {
18  // limit to range, inspire by boost clamp
19  return (val<min)?min:(val>max)?max:val;
20  }
21 }
22 
23 
24 class AliComplexCluster : public TObject {
25 public:
26 
28  virtual ~AliComplexCluster() {;}
29  Bool_t IsSortable() const;
30  Int_t Compare(const TObject *o) const;
31  // the following getters are needed by HLT
32  // please dont remove... C. Loizides
33  Int_t GetTrack(Int_t i)const {return fTracks[i];} //labels of overlapped tracks
34  Float_t GetX()const {return fX;}
35  Float_t GetY()const {return fY;}
36  Float_t GetQ()const {return fQ;}
37  Float_t GetSigmaX2()const {return fSigmaX2;}
38  Float_t GetSigmaY2()const {return fSigmaY2;}
39  Float_t GetSigmaXY()const {return fSigmaXY;}
40  Float_t GetArea()const {return fArea;}
41  Float_t GetMax()const {return fMax;}
42 private:
43  Int_t fTracks[3];
44  Float_t fX ;
45  Float_t fY ;
46  Float_t fQ ;
47  Float_t fSigmaX2;
48  Float_t fSigmaY2;
49  Float_t fSigmaXY;
50  Float_t fArea;
51  Float_t fMax;
52 
54  ClassDef(AliComplexCluster, 1);
56 
57  // Cluster manager
58 };
59 
60 //RS: this is old, non-economical and virtualized class, for bwd compatibility only
62  public:
63 
65  fTX(0),
66  fTZ(0),
67  fTY(0),
68  fTAngleZ(0),
69  fTAngleY(0),
70  fSigmaZ(0),
71  fSigmaY(0),
72  fErrZ(0),
73  fErrY(0),
74  fIsShared(0){}
75  virtual ~AliTPCTrackerPoint(){}
76  AliTPCTrackerPoint &operator=(const AliTPCTrackerPoint& o);
77  Float_t GetX() const {return (fTX*0.01);}
78  Float_t GetZ() const {return (fTZ*0.01);}
79  Float_t GetY() const {return (fTY*0.01);}
80  Float_t GetAngleZ() const {return (Float_t(fTAngleZ)*0.02);}
81  Float_t GetAngleY() const {return (Float_t(fTAngleY)*0.02);}
82  //
83  void SetX(Float_t x) { fTX = Short_t(AliComplexClusterHelper::Clamp(TMath::Nint(x*100.), SHRT_MIN, SHRT_MAX));}
84  void SetY(Float_t y) { fTY = Short_t(AliComplexClusterHelper::Clamp(TMath::Nint(y*100.), SHRT_MIN, SHRT_MAX));}
85  void SetZ(Float_t z) { fTZ = Short_t(AliComplexClusterHelper::Clamp(TMath::Nint(z*100.), SHRT_MIN, SHRT_MAX));}
86  void SetAngleZ(Float_t anglez) {fTAngleZ = Char_t(AliComplexClusterHelper::Clamp(TMath::Nint(anglez*50.),SCHAR_MIN,SCHAR_MAX));}
87  void SetAngleY(Float_t angley) {fTAngleY = Char_t(AliComplexClusterHelper::Clamp(TMath::Nint(angley*50.),SCHAR_MIN,SCHAR_MAX));}
88  Float_t GetSigmaZ() const {return (fSigmaZ*0.02);}
89  Float_t GetSigmaY() const {return (fSigmaY*0.02);}
90  Float_t GetErrZ() const {return (fErrZ*0.005);}
91  Float_t GetErrY() const {return (fErrY*0.005);}
92  void SetErrZ(Float_t errz) {fErrZ = UChar_t(AliComplexClusterHelper::Clamp(TMath::Nint(errz*200.),0,UCHAR_MAX));}
93  void SetErrY(Float_t erry) {fErrY = UChar_t(AliComplexClusterHelper::Clamp(TMath::Nint(erry*200.),0,UCHAR_MAX));}
94 
95  void SetSigmaZ(Float_t sigmaz) {fSigmaZ = UChar_t(AliComplexClusterHelper::Clamp(TMath::Nint(sigmaz*50.),0,UCHAR_MAX));}
96  void SetSigmaY(Float_t sigmay) {fSigmaY = UChar_t(AliComplexClusterHelper::Clamp(TMath::Nint(sigmay*50.),0,UCHAR_MAX));}
97 
98  Char_t IsShared() const {return fIsShared;}
99  void SetShared(Char_t s) {fIsShared=s;}
100  //
101  private:
102  Short_t fTX;
103  Short_t fTZ;
104  Short_t fTY;
105  Char_t fTAngleZ;
106  Char_t fTAngleY;
107  UShort_t fSigmaZ;
108  UShort_t fSigmaY;
109  UShort_t fErrZ;
110  UShort_t fErrY;
111  Char_t fIsShared;
112 
114  ClassDef(AliTPCTrackerPoint, 2);
116 };
117 
118 //RS: this is new, more economic class for TrackerPoints, avoiding vtable pointer per point
120  //
121  public:
122  class Point {
123  public:
124  Point():fTX(0),fTZ(0),fTY(0),fTAngleZ(0),fTAngleY(0),fSigmaZ(0),fSigmaY(0),fErrZ(0),fErrY(0) {}
125  ~Point(){}
126  Point &operator=(const Point& o) {
127  if(this!=&o) {
128  fTX = o.fTX;
129  fTY = o.fTY;
130  fTZ = o.fTZ;
131  fTAngleZ = o.fTAngleZ;
132  fTAngleY = o.fTAngleY;
133  fSigmaZ = o.fSigmaZ;
134  fSigmaY = o.fSigmaY;
135  fErrZ = o.fErrZ;
136  fErrY = o.fErrY;
137  }
138  return *this;
139  }
140  //
142  SetX(o.GetX());
143  SetY(o.GetY());
144  SetZ(o.GetZ());
145  SetAngleZ(o.GetAngleZ());
146  SetAngleY(o.GetAngleY());
147  SetSigmaZ(o.GetSigmaZ());
148  SetSigmaY(o.GetSigmaY());
149  //
150  SetErrZ(o.GetErrZ());
151  SetErrY(o.GetErrY());
152  //
153  return *this;
154  }
155  Float_t GetX() const {return (fTX*0.01);}
156  Float_t GetZ() const {return (fTZ*0.01);}
157  Float_t GetY() const {return (fTY*0.01);}
158  Float_t GetAngleZ() const {return (Float_t(fTAngleZ)*0.02);}
159  Float_t GetAngleY() const {return (Float_t(fTAngleY)*0.02);}
160  //
161  void SetX(Float_t x) { fTX = Short_t(AliComplexClusterHelper::Clamp(TMath::Nint(x*100.), SHRT_MIN, SHRT_MAX));}
162  void SetY(Float_t y) { fTY = Short_t(AliComplexClusterHelper::Clamp(TMath::Nint(y*100.), SHRT_MIN, SHRT_MAX));}
163  void SetZ(Float_t z) { fTZ = Short_t(AliComplexClusterHelper::Clamp(TMath::Nint(z*100.), SHRT_MIN, SHRT_MAX));}
164  void SetAngleZ(Float_t anglez) {fTAngleZ = Char_t(AliComplexClusterHelper::Clamp(TMath::Nint(anglez*50.),SCHAR_MIN,SCHAR_MAX));}
165  void SetAngleY(Float_t angley) {fTAngleY = Char_t(AliComplexClusterHelper::Clamp(TMath::Nint(angley*50.),SCHAR_MIN,SCHAR_MAX));}
166  //
167  Float_t GetSigmaZ() const {return (fSigmaZ*0.02);}
168  Float_t GetSigmaY() const {return (fSigmaY*0.02);}
169  Float_t GetErrYSys2TotSq() const {return fErrY*15./UCHAR_MAX;}
170  Float_t GetErrZSys2TotSq() const {return fErrZ*15./UCHAR_MAX;}
171  //
172  // this is only for back-compatibility with old version, fetched via Point &operator=(const AliTPCTrackerPoint& o)
173  Float_t GetErrZ() const {return (fErrZ*0.005);}
174  Float_t GetErrY() const {return (fErrY*0.005);}
175  void SetErrZ(Float_t errz) {fErrZ = UChar_t(AliComplexClusterHelper::Clamp(TMath::Nint(errz*200.),0,UCHAR_MAX));}
176  void SetErrY(Float_t erry) {fErrY = UChar_t(AliComplexClusterHelper::Clamp(TMath::Nint(erry*200.),0,UCHAR_MAX));}
177  //
178  void SetErrZSys2TotSq(Float_t r) {fErrZ = UChar_t(AliComplexClusterHelper::Clamp(TMath::Nint(r*UCHAR_MAX/15.),0,UCHAR_MAX));}
179  void SetErrYSys2TotSq(Float_t r) {fErrY = UChar_t(AliComplexClusterHelper::Clamp(TMath::Nint(r*UCHAR_MAX/15.),0,UCHAR_MAX));}
180  void SetSigmaZ(Float_t sigmaz) {fSigmaZ = UChar_t(AliComplexClusterHelper::Clamp(TMath::Nint(sigmaz*50.),0,UCHAR_MAX));}
181  void SetSigmaY(Float_t sigmay) {fSigmaY = UChar_t(AliComplexClusterHelper::Clamp(TMath::Nint(sigmay*50.),0,UCHAR_MAX));}
182 
183  //
184  private:
185  Short_t fTX;
186  Short_t fTZ;
187  Short_t fTY;
188  Char_t fTAngleZ;
189  Char_t fTAngleY;
190  UChar_t fSigmaZ;
191  UChar_t fSigmaY;
192  UChar_t fErrZ;
193  UChar_t fErrY;
194  };
195 
196  public:
199  AliTPCTrackerPoints &operator=(const AliTPCTrackerPoints& o);
201  void Clear();
202  //
203  void SetShared(int i) {fShared[i/8] |= 0x1<<(i%8);}
204  Bool_t IsShared(int i) const {return fShared[i/8] & 0x1<<(i%8);}
205  const Point* GetPoint(int i) const {return &fPoints[i];}
206  void SetPoint(int i, const AliTPCTrackerPoint* o);
207  //
208  protected:
209  //
210  UChar_t fShared[20]; // shared map
211  Point fPoints[159]; // array of compact non-virtualized points
212  //
213  ClassDef(AliTPCTrackerPoints, 1);
214 };
215 
217  public:
219  fCZ(0),
220  fCY(0),
221  fSigmaZ(0),
222  fSigmaY(0),
223  fQ(0),
224  fMax(0),
225  fCType(0){}
227  Float_t GetZ() const {return (fCZ*0.01);}
228  Float_t GetY() const {return (fCY*0.01);}
229  Float_t GetSigmaZ() const {return (fSigmaZ*0.02);}
230  Float_t GetSigmaY() const {return (fSigmaY*0.02);}
231  Int_t GetType() const {return fCType;}
232  Int_t GetMax() const {return fMax;}
233  Float_t GetQ() const {return fQ;}
234 
235  //
236  void SetY(Float_t y){ fCY = Short_t(AliComplexClusterHelper::Clamp(TMath::Nint(y*100.), SHRT_MIN, SHRT_MAX));}
237  void SetZ(Float_t z){ fCZ = Short_t(AliComplexClusterHelper::Clamp(TMath::Nint(z*100.), SHRT_MIN, SHRT_MAX));}
238  void SetSigmaZ(Float_t sigmaz) {fSigmaZ = UChar_t(AliComplexClusterHelper::Clamp(TMath::Nint(sigmaz*50.),0,UCHAR_MAX));}
239  void SetSigmaY(Float_t sigmay) {fSigmaY = UChar_t(AliComplexClusterHelper::Clamp(TMath::Nint(sigmay*50.),0,UCHAR_MAX));}
240 
241  void SetQ(Float_t q) {fQ = UShort_t(q);}
242  void SetMax(Float_t max) {fMax = UShort_t(max);}
243  void SetType(Char_t type) {fCType = type;}
244  private:
245  Short_t fCZ;
246  Short_t fCY;
247  UChar_t fSigmaZ;
248  UChar_t fSigmaY;
249  UShort_t fQ;
250  UShort_t fMax;
251  Char_t fCType;
252 
254  ClassDef(AliTPCClusterPoint, 1);
256 };
257 
258 
259 class AliTPCExactPoint : public TObject{
260  public:
261  AliTPCExactPoint():TObject(),
262  fEZ(0.),
263  fEY(0.),
264  fEX(0.),
265  fEAngleZ(0.),
266  fEAngleY(0.),
267  fEAmp(0.),
268  fEPrim(0.),
269  fTrackID(0),
270  fRow(0),
271  fSec(0){}
272  private:
273  Float_t fEZ;
274  Float_t fEY;
275  Float_t fEX;
276  Float_t fEAngleZ;
277  Float_t fEAngleY;
278  Float_t fEAmp;
279  Float_t fEPrim;
280  Int_t fTrackID;
281  Int_t fRow;
282  Int_t fSec;
283 
285  ClassDef(AliTPCExactPoint, 1);
287 };
288 
289 
290 class AliTPCTrackPoint: public TObject{
291  public:
292  AliTPCTrackPoint():TObject(),
293  fTPoint(),
294  fCPoint(){}
295 
296  // AliTPCClusterPoint & GetCPoint(){return fCPoint;}
297  AliTPCTrackerPoint & GetTPoint(){return fTPoint;}
298  AliTPCclusterMI & GetCPoint(){return fCPoint;}
299  private:
300  // AliTPCClusterPoint fCPoint;
301  //Char_t fIsShared;
304 
306  ClassDef(AliTPCTrackPoint, 1);
308 };
309 
311  public:
313  fGX(0.),
314  fGY(0.),
315  fGZ(0.),
316  fDY(0.),
317  fDZ(0.),
318  fDYU(0.),
319  fDYD(0),
320  fDZU(0.),
321  fDZD(0.),
322  fDDY(0),
323  fDDZ(0.),
324  fID(0),
325  fLab(0){}
326  private:
327  Float_t fGX;
328  Float_t fGY;
329  Float_t fGZ;
330  //
331  Float_t fDY;
332  Float_t fDZ;
333  //
334  Float_t fDYU;
335  Float_t fDYD;
336  //
337  Float_t fDZU;
338  Float_t fDZD;
339  //
340  Float_t fDDY;
341  Float_t fDDZ;
342  //
343  Int_t fID;
344  Int_t fLab;
345 
347  ClassDef(AliTPCTrackPoint2, 1);
349 };
350 
351 #endif //ALICOMPLEXCLUSTER_H
void SetAngleZ(Float_t anglez)
Float_t fDDZ
derivation in y,z up-down
Int_t fID
id of the corresponding track
Float_t fDY
distortion of the clusters from the global helix (3 point interpolation)
Char_t fIsShared
indicate sharing of the point between several tracks
void SetType(Char_t type)
Float_t GetSigmaZ() const
Float_t fDDY
derivation in y,z up-down
UShort_t fErrZ
z error estimate - in mm - 50 mum precision
Char_t IsShared() const
UShort_t fSigmaZ
shape Z - normalised shape - normaliziation 1 - precision 2 percent
UChar_t fSigmaY
shape Y - normalised shape - normaliziation 1 - precision 2 percent
void SetAngleY(Float_t angley)
Float_t GetSigmaX2() const
Int_t GetType() const
Float_t fEY
current "exact" position according simulation
UChar_t fSigmaZ
shape Z - normalised shape - normaliziation 1 - precision 2 percent
Float_t fGY
global poition of the point
Int_t fLab
MC label of the track.
Float_t GetQ() const
Point & operator=(const AliTPCTrackerPoint &o)
void SetSigmaY(Float_t sigmay)
Float_t GetY() const
Float_t fDZ
distortion of the clusters from the global helix (3 point interpolation)
void SetErrY(Float_t erry)
void SetZ(Float_t z)
AliTPCTrackerPoint fTPoint
track point
void SetX(Float_t x)
Float_t fMax
amplitude at maximum
Float_t GetSigmaXY() const
void SetSigmaY(Float_t sigmay)
Float_t fEAmp
total charge deposited in row
void SetMax(Float_t max)
void SetSigmaZ(Float_t sigmaz)
Int_t fTrackID
id of the track
Int_t Compare(const T &ds1, const T &ds2)
Int_t GetTrack(Int_t i) const
Short_t fTY
current prolongation in Y in cm - 10 mum prec.
UShort_t fMax
charge at maximum
void SetSigmaY(Float_t sigmay)
void SetAngleZ(Float_t anglez)
Float_t GetMax() const
Float_t fSigmaY2
Sigma Z square of cluster.
Float_t fY
Z of cluster.
Float_t fGZ
global poition of the point
Short_t fCY
current cluster position Y in cm - 100 mum precision
void SetErrZ(Float_t errz)
Float_t GetX() const
Float_t fEAngleZ
angle Z
Float_t GetY() const
Float_t fEZ
current "exact" position according simulation
Float_t GetSigmaZ() const
void Clear()
Add comment.
UChar_t fErrY
y error estimate - in mm - 50 mum precision or ratio of sysErr/totErr^2 in Y (prec 15...
Implementation of the TPC cluser.
Float_t GetSigmaY() const
Short_t fTZ
current prolongation in Z in cm - 10 mum prec.
Float_t fSigmaXY
XY moment.
void SetY(Float_t y)
Float_t GetArea() const
Float_t GetErrZSys2TotSq() const
void SetZ(Float_t z)
Float_t GetErrZ() const
Short_t fTX
x position of the cluster in cm - 10 mum prec
void SetSigmaZ(Float_t sigmaz)
Int_t Clamp(Int_t val, Int_t min, Int_t max)
Float_t GetSigmaY() const
Float_t fDYU
derivation in y up
Float_t fX
Y of cluster.
Float_t GetSigmaY2() const
UChar_t fErrZ
z error estimate - in mm - 50 mum precision or ratio of sysErr/totErr^2 in Z (prec 15...
const Point * GetPoint(int i) const
Float_t fDZU
derivation in y up
UShort_t fQ
total charge in cluster
Float_t fQ
Q of cluster (in ADC counts)
Point & operator=(const Point &o)
void SetAngleY(Float_t angley)
AliTPCclusterMI fCPoint
cluster point
UShort_t fErrY
y error estimate - in mm - 50 mum precision
Short_t fCZ
current cluster position Z in cm - 100 mum precision
Float_t fArea
area of cluster
AliTPCTrackerPoint & GetTPoint()
Float_t GetZ() const
Char_t fCType
type of the cluster
Float_t GetAngleY() const
Float_t fDZD
distortion of y down
UChar_t fSigmaZ
shape Z - normalised shape - normaliziation 1 - precision 2 percent
void SetShared(Char_t s)
Float_t fEAngleY
angle Y
Float_t GetAngleZ() const
virtual ~AliTPCTrackerPoint()
Short_t fTX
x position of the cluster in cm - 10 mum prec
Short_t fTY
current prolongation in Y in cm - 10 mum prec.
Int_t GetMax() const
Float_t GetY() const
Float_t GetErrY() const
Float_t fGX
global poition of the point
Float_t fEX
x poistion of the cluster
virtual ~AliComplexCluster()
Float_t GetErrYSys2TotSq() const
Float_t fSigmaX2
Sigma Y square of cluster.
Bool_t IsShared(int i) const
Float_t GetX() const
Float_t fDYD
distortion of y down
UShort_t fSigmaY
shape Y - normalised shape - normaliziation 1 - precision 2 percent
UChar_t fSigmaY
shape Y - normalised shape - normaliziation 1 - precision 2 percent
Float_t fEPrim
primary charge deposited in row
Float_t GetQ() const
Short_t fTZ
current prolongation in Z in cm - 10 mum prec.
AliTPCclusterMI & GetCPoint()
Float_t GetZ() const
void SetSigmaZ(Float_t sigmaz)
void SetQ(Float_t q)
void SetY(Float_t y)