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