added new files to build system
[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$ */
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
22 //_____________________________________________________________________________
23 class AliTRDpadPlane : public TObject {
24
25  public:
26
27   AliTRDpadPlane();
28   AliTRDpadPlane(Int_t plane, Int_t chamber);
29   AliTRDpadPlane(const AliTRDpadPlane &p);
30   virtual           ~AliTRDpadPlane();
31   AliTRDpadPlane    &operator=(const AliTRDpadPlane &p);
32   virtual void       Copy(TObject &p) const;
33
34   void     SetPlane(Int_t p)                   { fPla            = p; };
35   void     SetChamber(Int_t c)                 { fCha            = c; };
36   void     SetRowSpacing(Double_t s)           { fRowSpacing     = s; };
37   void     SetColSpacing(Double_t s)           { fColSpacing     = s; };
38   void     SetLengthRim(Double_t l)            { fLengthRim      = l; };
39   void     SetWidthRim(Double_t w)             { fWidthRim       = w; };
40   void     SetNcols(Int_t n)                   { fNcols          = n;
41                                                  if (fPadCol) delete[] fPadCol;
42                                                  fPadCol         = new Double_t[fNcols]; };
43   void     SetNrows(Int_t n)                   { fNrows          = n;
44                                                  if (fPadRow) delete[] fPadRow;
45                                                  fPadRow         = new Double_t[fNrows]; };
46   void     SetPadCol(Int_t ic, Double_t c)     { if (ic < fNcols) fPadCol[ic] = c;       };
47   void     SetPadRow(Int_t ir, Double_t r)     { if (ir < fNrows) fPadRow[ir] = r;       };
48   void     SetLength(Double_t l)               { fLength         = l; };
49   void     SetWidth(Double_t w)                { fWidth          = w; };
50   void     SetLengthOPad(Double_t l)           { fLengthOPad     = l; };
51   void     SetWidthOPad(Double_t w)            { fWidthOPad      = w; };
52   void     SetLengthIPad(Double_t l)           { fLengthIPad     = l; };
53   void     SetWidthIPad(Double_t w)            { fWidthIPad      = w; };
54   void     SetPadRowSMOffset(Double_t o)       { fPadRowSMOffset = o; };
55   void     SetTiltingAngle(Double_t t);
56
57   Int_t    GetPadRowNumber(Double_t z) const;
58   Int_t    GetPadRowNumberROC(Double_t z) const;
59   Int_t    GetPadColNumber(Double_t rphi) const;
60
61   Double_t GetTiltOffset(Double_t rowOffset) const 
62                                              { return fTiltingTan * (rowOffset - 0.5*fLengthIPad); };
63
64   Double_t GetPadRowOffset(Int_t row, Double_t z) const
65                                              { if ((row < 0) || (row >= fNrows))
66                                                  return -1.0;
67                                                else 
68                                                  return fPadRow[row] + fPadRowSMOffset - z;        };
69   Double_t GetPadRowOffsetROC(Int_t row, Double_t z) const
70                                              { if ((row < 0) || (row >= fNrows))
71                                                  return -1.0;
72                                                else 
73                                                  return fPadRow[row] - z;    };
74
75   Double_t GetPadColOffset(Int_t col, Double_t rphi) const
76                                              { if ((col < 0) || (col >= fNcols))
77                                                  return -1.0;
78                                                else
79                                                  return fPadCol[col] - rphi; };
80
81   Double_t GetTiltingAngle() const           { return fTiltingAngle; };
82
83   Int_t    GetNrows() const                  { return fNrows;        };
84   Int_t    GetNcols() const                  { return fNcols;        };
85
86   Double_t GetRow0() const                   { return fPadRow[0] + fPadRowSMOffset;    };
87   Double_t GetRow0ROC() const                { return fPadRow[0];    };
88   Double_t GetCol0() const                   { return fPadCol[0];    };
89
90   Double_t GetRowEnd() const                 { return fPadRow[fNrows-1] - fLengthOPad + fPadRowSMOffset; };
91   Double_t GetRowEndROC() const              { return fPadRow[fNrows-1] - fLengthOPad; };
92   Double_t GetColEnd() const                 { return fPadCol[fNcols-1] - fWidthOPad;  };
93
94   Double_t GetRowPos(Int_t row) const        { return fPadRow[row] + fPadRowSMOffset;  };
95   Double_t GetRowPosROC(Int_t row) const     { return fPadRow[row];  };
96   Double_t GetColPos(Int_t col) const        { return fPadCol[col];  };
97   
98   Double_t GetRowSize(Int_t row) const       { if ((row == 0) || (row == fNrows-1))
99                                                  return fLengthOPad;
100                                                else
101                                                  return fLengthIPad; };
102   Double_t GetColSize(Int_t col) const       { if ((col == 0) || (col == fNcols-1))
103                                                  return fWidthOPad;
104                                                else
105                                                   return fWidthIPad; };
106
107   Double_t GetLengthRim() const              { return fLengthRim;    };
108   Double_t GetWidthRim() const               { return fWidthRim;     };
109
110   Double_t GetRowSpacing() const             { return fRowSpacing;   };
111   Double_t GetColSpacing() const             { return fColSpacing;   };
112
113   Double_t GetLengthOPad() const             { return fLengthOPad;   };
114   Double_t GetLengthIPad() const             { return fLengthIPad;   };
115
116   Double_t GetWidthOPad() const              { return fWidthOPad;    };
117   Double_t GetWidthIPad() const              { return fWidthIPad;    };
118
119  protected:
120
121   Int_t     fPla;             //  Plane number
122   Int_t     fCha;             //  Chamber number
123
124   Double_t  fLength;          //  Length of pad plane in z-direction (row)
125   Double_t  fWidth;           //  Width of pad plane in rphi-direction (col)
126
127   Double_t  fLengthRim;       //  Length of the rim in z-direction (row)
128   Double_t  fWidthRim;        //  Width of the rim in rphi-direction (col)
129
130   Double_t  fLengthOPad;      //  Length of an outer pad in z-direction (row)
131   Double_t  fWidthOPad;       //  Width of an outer pad in rphi-direction (col)
132
133   Double_t  fLengthIPad;      //  Length of an inner pad in z-direction (row)
134   Double_t  fWidthIPad;       //  Width of an inner pad in rphi-direction (col)
135
136   Double_t  fRowSpacing;      //  Spacing between the pad rows
137   Double_t  fColSpacing;      //  Spacing between the pad columns
138
139   Int_t     fNrows;           //  Number of rows
140   Int_t     fNcols;           //  Number of columns
141
142   Double_t  fTiltingAngle;    //  Pad tilting angle  
143   Double_t  fTiltingTan;      //  Tangens of pad tilting angle
144
145   Double_t *fPadRow;          //  Pad border positions in row direction
146   Double_t *fPadCol;          //  Pad border positions in column direction
147
148   Double_t  fPadRowSMOffset;  //  To be added to translate local ROC system to local SM system
149
150   ClassDef(AliTRDpadPlane,4)  //  TRD ROC pad plane
151
152 };
153
154 #endif