]> git.uio.no Git - u/mrichter/AliRoot.git/blob - ITS/AliITSRecPoint.h
Additional protection (Alberto)
[u/mrichter/AliRoot.git] / ITS / AliITSRecPoint.h
1 #ifndef ALIITSRECPOINT_H
2 #define ALIITSRECPOINT_H 
3 /* Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
4  * See cxx source for full Copyright notice                               */
5
6 /*
7   $Id$
8 */
9
10 ///////////////////////////////////////////////////////////////////////////////
11 //  Reconstructed space point class for set:ITS   
12 //  Reconstructed points are expressed simultaneously in two different 
13 //  reference frames, both differing from the global system.
14 //  The first is referred to the sensor (see AliITSsegmentation for the
15 //  definition) and each point is represented by two coordinates: fXloc and
16 //  fZloc. This system in the code is referred to as "local"
17 //  The second is used for tracking (V2, SA and MI versions) and the X axis 
18 //  represents the radial coordinate (this system is, in the bending plane, 
19 //  a rotated system w.r.t. the global reference system). 
20 //  Each reaconstructed point is represented by two coordinates: fY and fZ, 
21 //  inherited from AliCluster. This system in the code is referred to as 
22 //  "trackingV2".
23 ///////////////////////////////////////////////////////////////////////////////
24
25 #include <AliCluster.h>
26 #include <Riostream.h>
27 #include <AliLog.h>
28 #include <AliITSgeom.h>
29
30
31 class AliITSRecPoint : public AliCluster {
32  public:
33   AliITSRecPoint();
34   AliITSRecPoint(AliITSgeom* geom);
35   AliITSRecPoint(Int_t *lab,Float_t *hit, Int_t *info);
36   AliITSRecPoint(Int_t module,AliITSgeom* geom,Int_t *lab,
37                  Float_t *hit, Int_t *info);
38   AliITSRecPoint(const AliITSRecPoint& pt);
39   AliITSRecPoint& operator=(const AliITSRecPoint &source);
40   
41   virtual ~AliITSRecPoint() {}; // distructor
42   Bool_t IsSortable() const {return kTRUE;} // allows for sorting
43   Int_t  *GetTracks(){return fTracks;}// Returns pointer to track array
44   Int_t   GetNTracks() const {return 3;} // returns track array size
45   Float_t GetDetLocalX() const {return fXloc;} // gets fX
46   Float_t GetDetLocalZ() const {return fZloc;} // gets fZ
47   Float_t GetdEdX() const {return fdEdX;} // gets fdEdX
48   Float_t GetSigmaDetLocX2() const {return fSigmaY2;} // gets fSigmaX2
49   void SetdEdX(Float_t dedx){fdEdX=dedx;} // sets fdEdX
50   void SetSigmaDetLocX2(Float_t sx2){fSigmaY2=sx2;} // sets fSigmaX2
51   Int_t Compare(const TObject *) const {return 0;} //to be defined
52   void Print(ostream *os); 
53   // Reads in the content of this class in the format of Print
54   void Read(istream *is);
55   virtual void Print(Option_t *option="") const {TObject::Print(option);}
56   virtual Int_t Read(const char *name) {return TObject::Read(name);}
57   
58   void SetITSgeom(AliITSgeom* geom) {fGeom=geom;}
59
60   virtual void SetY(Float_t  y ){fY=y;
61     AliError("For consistency, Use method SetYZ. Data members are only partially set\n");}
62   virtual void SetZ(Float_t  z ){fZ=z;
63     AliError("For consistency, Use method SetYZ. Data members are only partially set\n");}
64   void SetYZ(Int_t module, Float_t y, Float_t z){
65     fY=y;fZ=z;
66     if(fGeom)fGeom->TrackingV2ToDetL(module,y,z,fXloc,fZloc);
67     else AliError("Geometry not set. \n");
68   }
69   void SetXZ(Int_t module, Float_t x, Float_t z){
70     fXloc=x;fZloc=z;
71     if(fGeom)fGeom->DetLToTrackingV2(module,x,z,fY,fZ);
72     else AliError("Geometry not set. Nothing done!!!!!\n");
73   }
74   void Use(Int_t = 0) {fQ=-fQ;}
75   void UnUse() {fQ=TMath::Abs(fQ);}
76   void SetQ(Float_t q) {fQ=q;}
77   void SetDetectorIndex(Int_t i) { fIndex=i; }
78   void SetLayer(Int_t layer) {fLayer=layer;}
79   void SetNz(Int_t nz) {fNz =nz;}
80   void SetNy(Int_t ny){fNy=ny;}
81   void SetChargeRatio(Float_t ratio) { fChargeRatio = ratio;}
82   void SetPhiR(Float_t y) { fChargeRatio=y; }
83   void SetType(Int_t type){ fType=type;}
84   void SetDeltaProbability(Float_t prob){fDeltaProb = prob;}
85   
86   Int_t IsUsed() const {return (fQ<0)?1:0;}
87   Float_t GetQ() const {return TMath::Abs(fQ);}
88   Int_t GetDetectorIndex() const { return 0x3FF&fIndex; }
89   Int_t GetLayer() const {return fLayer;}
90   Int_t GetNz() const {return fNz;}
91   Int_t GetNy() const {return fNy;}
92   Float_t GetChargeRatio() const {return fChargeRatio;}
93   Float_t GetPhiR() const {return fChargeRatio;}
94   Int_t GetPindex() const { return 0xFFF00000&fIndex; }  //SSD clusters only
95   Int_t GetNindex() const { return 0xFFC00&fIndex; }  //SSD clusters only
96   Int_t GetType() const {return fType;}  // type of the cluster
97   Float_t GetDeltaProbability() const{return fDeltaProb;} //probability to belong to the delta ray
98   
99   // The following two methods deal with the misaligned x position
100   // of a cluster in the tracking coordidate system 
101   virtual Float_t GetX() const {return fX;}
102   virtual void SetX(Float_t x) {fX=x;}
103
104  protected:
105   Float_t   fX;        // X coordinate in the misaligned tracking system 
106
107   Float_t   fXloc ;        //X of cluster (local coordinates)
108   Float_t   fZloc ;        //Z of cluster (local coordinates)
109   Float_t   fdEdX;      //dE/dX inside this cluster
110
111   Int_t    fIndex;    // detector index
112   Float_t  fQ ;       // Q of cluster (in ADC counts)
113   Char_t   fLayer;    // layer number
114   Short_t  fNz;       //number of digits in Z direction
115   Short_t  fNy;       //number of digits in y direction 
116   Float_t  fChargeRatio; //charge ratio
117   Int_t    fType;         //quality factor of the cluster
118   Float_t  fDeltaProb;    // probability to be deleta electron
119     
120   AliITSgeom* fGeom;     //!pointer to ITS geometry
121
122   ClassDef(AliITSRecPoint,2)  // AliITSRecPoint class
123 };
124 // Input and output function for standard C++ input/output.
125 ostream& operator<<(ostream &os,AliITSRecPoint &source);
126 istream& operator>>(istream &is,AliITSRecPoint &source);
127 #endif