]> git.uio.no Git - u/mrichter/AliRoot.git/blob - ITS/AliITSsegmentation.h
Anode numbering adapted to hardware channel numbering + Code cleanup of segmentation...
[u/mrichter/AliRoot.git] / ITS / AliITSsegmentation.h
1 #ifndef ALIITSSEGMENTATION_H
2 #define ALIITSSEGMENTATION_H
3
4 #include <TObject.h>
5 #include "AliLog.h"
6 #include "AliITSgeom.h"
7
8 class TF1;
9 //----------------------------------------------
10 //
11 // ITS  segmentation virtual base class
12 //
13 class AliITSsegmentation :
14 public TObject {
15  public:
16   AliITSsegmentation();
17   AliITSsegmentation(AliITSgeom *geom);
18   AliITSsegmentation(const AliITSsegmentation& source);
19   virtual ~AliITSsegmentation();
20   AliITSsegmentation& operator=(const AliITSsegmentation &source);
21     // Set Detector Segmentation Parameters
22     //
23     // Detector size  
24     virtual void    SetDetSize(Float_t p1,Float_t p2,Float_t p3) 
25                     {fDx=p1; fDz=p2; fDy=p3;}
26     // Cell size   
27     virtual void    SetPadSize(Float_t,Float_t) {MayNotUse("SetPadSize");}
28     // Maximum number of cells along the two coordinates  
29     virtual void    SetNPads(Int_t,Int_t) = 0;
30     // Returns the maximum number of cells (digits) posible
31     virtual Int_t   GetNPads() const = 0;
32     // Set layer
33     virtual void SetLayer(Int_t) {MayNotUse("SetLayer");}
34     // Transform from real to cell coordinates
35     virtual void    GetPadIxz(Float_t,Float_t,Int_t &,Int_t &) const = 0;
36     // Transform from cell to real coordinates
37     virtual void    GetPadCxz(Int_t,Int_t,Float_t &,Float_t &) const = 0;
38
39     // Transform from real global to local coordinates
40     void GetLocal(Int_t module,Float_t *g ,Float_t *l) const {
41       if(!fGeom) {
42         AliFatal("Pointer to ITS geometry class (AliITSgeom) is null\n");
43         return;
44       }
45       fGeom->GtoL(module,g,l);      
46     }
47     // Transform from real local to global coordinates
48     void GetGlobal(Int_t module,Float_t *l ,Float_t *g) const {
49       if(!fGeom) {
50         AliFatal("Pointer to ITS geometry class (AliITSgeom) is null\n");
51       }
52       fGeom->LtoG(module,l,g);
53     }
54     // Local transformation of real local coordinates -
55     virtual void    GetPadTxz(Float_t &,Float_t &) const = 0;
56     // Transformation from Geant cm detector center local coordinates
57     // to detector segmentation/cell coordiantes starting from (0,0).
58     virtual Bool_t LocalToDet(Float_t,Float_t,Int_t &,Int_t &) const = 0;
59     // Transformation from detector segmentation/cell coordiantes starting
60     // from (0,0) to Geant cm detector center local coordinates.
61     virtual void    DetToLocal(Int_t,Int_t,Float_t &,Float_t &) const = 0;
62     // Initialisation
63     virtual void Init() = 0;
64     //
65     // Get member data
66     //
67     // Detector type geometry
68     virtual AliITSgeom* Geometry() const {return fGeom;}
69     // Detector length
70     virtual Float_t Dx() const {return fDx;}
71     // Detector width
72     virtual Float_t Dz() const {return fDz;}
73     // Detector thickness
74     virtual Float_t Dy() const {return fDy;}
75     // Cell size in x
76     virtual Float_t Dpx(Int_t) const = 0;
77     // Cell size in z 
78     virtual Float_t Dpz(Int_t) const = 0;
79     // Maximum number of Cells in x
80     virtual Int_t    Npx() const = 0;
81     // Maximum number of Cells in z
82     virtual Int_t    Npz() const = 0;
83     // Layer
84     virtual Int_t GetLayer() const {MayNotUse("GetLayer"); return 0;}
85     // Set hit position
86     //    virtual void     SetHit(Float_t, Float_t) {}
87     // angles
88     virtual void Angles(Float_t& /* p */, Float_t& /* n */) const
89                                           {MayNotUse("Angles");}
90
91     //
92     // Get next neighbours 
93     virtual void Neighbours(Int_t,Int_t,Int_t*,Int_t[10],Int_t[10]) const
94                      {MayNotUse("Neighbours");}
95
96     // Function for systematic corrections
97     // Set the correction function
98     virtual void SetCorrFunc(TF1* fc) {fCorr = fc;}
99     // Get the correction Function
100     virtual TF1* CorrFunc() {return fCorr;}
101     // Print Default parameters
102     virtual void PrintDefaultParameters() const = 0;
103
104  protected:
105
106     virtual void Copy(TObject &obj) const;
107
108     Float_t fDx;    //SPD: Full width of the detector (x axis)- microns
109                     //SDD: Drift distance of the 1/2detector (x axis)-microns
110                     //SSD: Full length of the detector (x axis)- microns
111     Float_t fDz;    //SPD: Full length of the detector (z axis)- microns
112                     //SDD: Length of half-detector (z axis) - microns
113                     //SSD: Full width of the detector (z axis)- microns
114     Float_t fDy;    //SPD:  Full thickness of the detector (y axis) -um 
115                     //SDD: Full thickness of the detector (y axis) - microns
116                     //SSD: Full thickness of the detector (y axis) -um 
117     AliITSgeom *fGeom;  //! pointer to the geometry class
118     TF1*       fCorr;   // correction function
119
120     ClassDef(AliITSsegmentation,2) //Segmentation virtual base class 
121 };
122 #endif