]> git.uio.no Git - u/mrichter/AliRoot.git/blob - TRD/AliTRDpadPlane.h
hopefully the last refinements for correct type conversion in calibration
[u/mrichter/AliRoot.git] / TRD / AliTRDpadPlane.h
1 #ifndef ALITRDPADPLANE_H
2 #define ALITRDPADPLANE_H
3 /* Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
4  * See cxx source for full Copyright notice                               */
5
6 /* $Id: AliTRDpadPlane.h,v */
7
8 //////////////////////////////////////////////////
9 //                                              //
10 //  TRD pad plane class                         //
11 //                                              //
12 //  Contains the information on pad postions,   //
13 //  pad dimensions, tilting angle, etc.         //
14 //  It also provides methods to identify the    //
15 //  current pad number from global coordinates. //
16 //                                              //
17 //////////////////////////////////////////////////
18
19 #include <TObject.h>
20
21 class AliTRDgeometry;
22
23 //_____________________________________________________________________________
24 class AliTRDpadPlane : public TObject {
25
26  public:
27
28   AliTRDpadPlane();
29   AliTRDpadPlane(Int_t p, Int_t c);
30   AliTRDpadPlane(const AliTRDpadPlane &p);
31   virtual           ~AliTRDpadPlane();
32   AliTRDpadPlane    &operator=(const AliTRDpadPlane &p);
33   virtual void       Copy(TObject &p) const;
34
35   Int_t    GetPadRowNumber(Double_t z) const;
36   Int_t    GetPadRowNumberROC(Double_t z) const;
37   Int_t    GetPadColNumber(Double_t rphi) const;
38
39   Double_t GetTiltOffset(Double_t rowOffset) const 
40                                              { return fTiltingTan * (rowOffset - 0.5*fLengthIPad); };
41
42   Double_t GetPadRowOffset(Int_t row, Double_t z) const
43                                              { if ((row < 0) || (row >= fNrows))
44                                                  return -1.0;
45                                                else 
46                                                  return fPadRow[row] + fPadRowSMOffset - z;        };
47   Double_t GetPadRowOffsetROC(Int_t row, Double_t z) const
48                                              { if ((row < 0) || (row >= fNrows))
49                                                  return -1.0;
50                                                else 
51                                                  return fPadRow[row] - z;    };
52
53   Double_t GetPadColOffset(Int_t col, Double_t rphi) const
54                                              { if ((col < 0) || (col >= fNcols))
55                                                  return -1.0;
56                                                else
57                                                  return fPadCol[col] - rphi; };
58
59   Double_t GetTiltingAngle() const           { return fTiltingAngle; };
60
61   Int_t    GetNrows() const                  { return fNrows;        };
62   Int_t    GetNcols() const                  { return fNcols;        };
63
64   Double_t GetRow0() const                   { return fPadRow[0] + fPadRowSMOffset;    };
65   Double_t GetRow0ROC() const                { return fPadRow[0];    };
66   Double_t GetCol0() const                   { return fPadCol[0];    };
67
68   Double_t GetRowEnd() const                 { return fPadRow[fNrows-1] - fLengthOPad + fPadRowSMOffset; };
69   Double_t GetRowEndROC() const              { return fPadRow[fNrows-1] - fLengthOPad; };
70   Double_t GetColEnd() const                 { return fPadCol[fNcols-1] - fWidthOPad;  };
71
72   Double_t GetRowPos(Int_t row) const        { return fPadRow[row] + fPadRowSMOffset;  };
73   Double_t GetRowPosROC(Int_t row) const     { return fPadRow[row];  };
74   Double_t GetColPos(Int_t col) const        { return fPadCol[col];  };
75   
76   Double_t GetRowSize(Int_t row) const       { if ((row == 0) || (row == fNrows-1))
77                                                  return fLengthOPad;
78                                                else
79                                                  return fLengthIPad; };
80   Double_t GetColSize(Int_t col) const       { if ((col == 0) || (col == fNcols-1))
81                                                  return fWidthOPad;
82                                                else
83                                                   return fWidthIPad; };
84   Double_t GetLengthRim() const              { return fLengthRim;    };
85
86  protected:
87
88   AliTRDgeometry *fGeo;       //! TRD geometry       
89
90   Int_t     fPla;             //  Plane number
91   Int_t     fCha;             //  Chamber number
92
93   Double_t  fLength;          //  Length of pad plane in z-direction (row)
94   Double_t  fWidth;           //  Width of pad plane in rphi-direction (col)
95
96   Double_t  fLengthRim;       //  Length of the rim in z-direction (row)
97   Double_t  fWidthRim;        //  Width of the rim in rphi-direction (col)
98
99   Double_t  fLengthOPad;      //  Length of an outer pad in z-direction (row)
100   Double_t  fWidthOPad;       //  Width of an outer pad in rphi-direction (col)
101
102   Double_t  fLengthIPad;      //  Length of an inner pad in z-direction (row)
103   Double_t  fWidthIPad;       //  Width of an inner pad in rphi-direction (col)
104
105   Double_t  fRowSpacing;      //  Spacing between the pad rows
106   Double_t  fColSpacing;      //  Spacing between the pad columns
107
108   Int_t     fNrows;           //  Number of rows
109   Int_t     fNcols;           //  Number of columns
110
111   Double_t  fTiltingAngle;    //  Pad tilting angle  
112   Double_t  fTiltingTan;      //  Tangens of pad tilting angle
113
114   Double_t *fPadRow;          //! Pad border positions in row direction
115   Double_t *fPadCol;          //! Pad border positions in column direction
116
117   Double_t  fPadRowSMOffset;  //  To be added to translate local ROC system to local SM system
118
119   ClassDef(AliTRDpadPlane,3)  //  TRD ROC pad plane
120
121 };
122
123 #endif