]> git.uio.no Git - u/mrichter/AliRoot.git/blob - ITS/AliITSsegmentationSPD.h
fWSN->Eval(0.001) to avoid fpe.
[u/mrichter/AliRoot.git] / ITS / AliITSsegmentationSPD.h
1 #ifndef ALIITSSEGMENTATIONSPD_H
2 #define ALIITSSEGMENTATIONSPD_H
3
4 #include "AliITSsegmentation.h"
5
6 #include <TF1.h>
7
8 class AliITSgeom;
9
10 // segmentation and response for SPD 
11
12 class AliITSsegmentationSPD :
13 public AliITSsegmentation {
14  public:
15
16     AliITSsegmentationSPD();
17     AliITSsegmentationSPD(AliITSgeom *gm);
18     AliITSsegmentationSPD(AliITSsegmentationSPD &source);
19     virtual ~AliITSsegmentationSPD(){}
20     AliITSsegmentationSPD& operator=(AliITSsegmentationSPD &source);
21
22     // Set Detector Segmentation Parameters
23     //
24     // Detector size along x,z,y coordinates  
25     virtual void    SetDetSize(Float_t Dx, Float_t Dz, Float_t Dy);
26
27     // Maximum number of pixels along the two coordinates  
28     virtual void    SetNPads(Int_t p1, Int_t p2);
29     // Returns the maximum number of cells (digits) posible
30     virtual Int_t   GetNPads(){return fNpx*fNpz;}
31     // Set Pixel Size Array in x and z, microns.
32     virtual void    SetBinSize(Float_t *x,Float_t *z);
33
34     // Transform from real to pixel coordinates
35     virtual void    GetPadIxz(Float_t x,Float_t z,Int_t &ix,Int_t &iz);
36     // Transform from pixel to real coordinates
37     virtual void    GetPadCxz(Int_t ix,Int_t iz,Float_t &x,Float_t &z);
38     // Transform from real global to local coordinates
39     //virtual void    GetLocal(Int_t module,Float_t *g ,Float_t *l) {}
40     // Transform from real local to global coordinates
41     //virtual void    GetGlobal(Int_t module,Float_t *l ,Float_t *g) {}
42     // Local transformation of real local coordinates -
43     virtual void    GetPadTxz(Float_t &x ,Float_t &z);
44     // Transformation from Geant cm detector center local coordinates
45     // to detector segmentation/cell coordiantes starting from (0,0).
46     virtual void    LocalToDet(Float_t x,Float_t z,Int_t &ix,Int_t &iz);
47     // Transformation from detector segmentation/cell coordiantes starting
48     // from (0,0) to Geant cm detector center local coordinates.
49     virtual void    DetToLocal(Int_t ix,Int_t iz,Float_t &x,Float_t &z);
50     // Returns the Cell upper and lower boundries in x and y. cell indexes
51     // starting from (0,0) and return Geant cm detector centered local
52     // coordinates, consistant with DetToLocal and LocalToDet functions above.
53     virtual void CellBoundries(Int_t ix,Int_t iz,Double_t &xl,Double_t &xu,
54                                Double_t &zl,Double_t &zu);
55     //
56     // Initialisation
57     virtual void Init();
58     virtual void Init300();
59     //
60     // Get member data
61     //
62     // Detector Type geometry
63     virtual AliITSgeom* Geometry() {return fGeom;}
64     // Detector length
65     virtual Float_t Dx() {return fDx;}
66     // Detector width
67     virtual Float_t Dz() {return fDz;}
68     // Detector thickness
69     virtual Float_t Dy() {return fDy;}
70     // Pixel size in x
71     virtual Float_t Dpx(Int_t ix);
72     // Pixel size in z 
73     virtual Float_t Dpz(Int_t iz);
74
75     // Maximum number of Pixels in x
76     virtual Int_t    Npx() {return fNpx;}
77     // Maximum number of Pixels in z
78     virtual Int_t    Npz(){return fNpz;}
79     //
80     // Get next neighbours
81     virtual void Neighbours
82        (Int_t iX,Int_t iZ,Int_t* Nlist,Int_t Xlist[10],Int_t Zlist[10]);
83
84  private:
85     Float_t ColFromZ300(Float_t z);
86     Float_t ZFromCol300(Int_t col);
87     Float_t ZpitchFromCol300(Int_t col);
88     Float_t ColFromZ(Float_t z);
89     Float_t ZFromCol(Int_t col);
90     Float_t ZpitchFromCol(Int_t col);
91     
92   protected:
93
94     Int_t   fNpx;           // Number of pixels in x
95     Int_t   fNpz;           // Number of pixels in z
96     Float_t fDx;            // Full width of the detector (x axis)- microns
97     Float_t fDz;            // Full length of the detector (z axis)- microns
98     Float_t fDy;            // Full thickness of the detector (y axis) -um 
99     Float_t fCellSizeX[256];// Size for each pixel in x -microns
100     Float_t fCellSizeZ[280];// Size for each pixel in z -microns
101     TF1*    fCorr;          // correction function
102     AliITSgeom *fGeom;      //! local pointer to AliITSgeom.
103
104   ClassDef(AliITSsegmentationSPD,1) //Segmentation class for SPD 
105
106 };
107
108 #endif