]> git.uio.no Git - u/mrichter/AliRoot.git/blame - TRD/AliTRDpadPlane.h
Fix Coverity
[u/mrichter/AliRoot.git] / TRD / AliTRDpadPlane.h
CommitLineData
e0d47c25 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
f162af62 6/* $Id$ */
e0d47c25 7
023b669c 8////////////////////////////////////////////////////////////////////////////
9// //
10// TRD pad plane class //
11// //
12// Contains the information on ideal pad positions, pad dimensions, //
13// tilting angle, etc. //
14// It also provides methods to identify the current pad number from //
15// local tracking coordinates. //
16// //
17////////////////////////////////////////////////////////////////////////////
e0d47c25 18
19#include <TObject.h>
20
e0d47c25 21//_____________________________________________________________________________
22class AliTRDpadPlane : public TObject {
23
24 public:
25
26 AliTRDpadPlane();
053767a4 27 AliTRDpadPlane(Int_t layer, Int_t stack);
e0d47c25 28 AliTRDpadPlane(const AliTRDpadPlane &p);
29 virtual ~AliTRDpadPlane();
30 AliTRDpadPlane &operator=(const AliTRDpadPlane &p);
31 virtual void Copy(TObject &p) const;
32
053767a4 33 void SetLayer(Int_t l) { fLayer = l; };
34 void SetStack(Int_t s) { fStack = s; };
f162af62 35 void SetRowSpacing(Double_t s) { fRowSpacing = s; };
36 void SetColSpacing(Double_t s) { fColSpacing = s; };
37 void SetLengthRim(Double_t l) { fLengthRim = l; };
38 void SetWidthRim(Double_t w) { fWidthRim = w; };
39 void SetNcols(Int_t n) { fNcols = n;
40 if (fPadCol) delete[] fPadCol;
41 fPadCol = new Double_t[fNcols]; };
42 void SetNrows(Int_t n) { fNrows = n;
43 if (fPadRow) delete[] fPadRow;
44 fPadRow = new Double_t[fNrows]; };
45 void SetPadCol(Int_t ic, Double_t c) { if (ic < fNcols) fPadCol[ic] = c; };
46 void SetPadRow(Int_t ir, Double_t r) { if (ir < fNrows) fPadRow[ir] = r; };
58897a75 47 void SetLength(Double_t l) { fLength = l; };
48 void SetWidth(Double_t w) { fWidth = w; };
49 void SetLengthOPad(Double_t l) { fLengthOPad = l; };
50 void SetWidthOPad(Double_t w) { fWidthOPad = w; };
51 void SetLengthIPad(Double_t l) { fLengthIPad = l; };
52 void SetWidthIPad(Double_t w) { fWidthIPad = w; };
53 void SetPadRowSMOffset(Double_t o) { fPadRowSMOffset = o; };
54 void SetAnodeWireOffset(Float_t o) { fAnodeWireOffset = o; };
f18d4f83 55 void SetTiltingAngle(Double_t t);
f162af62 56
98ce8151 57 Int_t GetPadRowNumber(Double_t z) const;
4329977a 58 Int_t GetPadRowNumberROC(Double_t z) const;
59 Int_t GetPadColNumber(Double_t rphi) const;
60
6d17a2b7 61 Double_t GetTiltOffset(Double_t rowOffset) const
62 { return fTiltingTan * (rowOffset - 0.5*fLengthIPad); };
4329977a 63
98ce8151 64 Double_t GetPadRowOffset(Int_t row, Double_t z) const
4329977a 65 { if ((row < 0) || (row >= fNrows))
66 return -1.0;
023b669c 67 else
4329977a 68 return fPadRow[row] + fPadRowSMOffset - z; };
69 Double_t GetPadRowOffsetROC(Int_t row, Double_t z) const
a5cadd36 70 { if ((row < 0) || (row >= fNrows))
71 return -1.0;
72 else
73 return fPadRow[row] - z; };
74
98ce8151 75 Double_t GetPadColOffset(Int_t col, Double_t rphi) const
a5cadd36 76 { if ((col < 0) || (col >= fNcols))
77 return -1.0;
78 else
023b669c 79 return rphi - fPadCol[col]; };
a5cadd36 80
58897a75 81 Double_t GetTiltingAngle() const { return fTiltingAngle; };
a5cadd36 82
58897a75 83 Int_t GetNrows() const { return fNrows; };
84 Int_t GetNcols() const { return fNcols; };
a5cadd36 85
4329977a 86 Double_t GetRow0() const { return fPadRow[0] + fPadRowSMOffset; };
58897a75 87 Double_t GetRow0ROC() const { return fPadRow[0]; };
88 Double_t GetCol0() const { return fPadCol[0]; };
a5cadd36 89
4329977a 90 Double_t GetRowEnd() const { return fPadRow[fNrows-1] - fLengthOPad + fPadRowSMOffset; };
91 Double_t GetRowEndROC() const { return fPadRow[fNrows-1] - fLengthOPad; };
023b669c 92 Double_t GetColEnd() const { return fPadCol[fNcols-1] + fWidthOPad; };
a5cadd36 93
4329977a 94 Double_t GetRowPos(Int_t row) const { return fPadRow[row] + fPadRowSMOffset; };
58897a75 95 Double_t GetRowPosROC(Int_t row) const { return fPadRow[row]; };
96 Double_t GetColPos(Int_t col) const { return fPadCol[col]; };
e0d47c25 97
3becff3c 98 Double_t GetRowSize(Int_t row) const { if ((row == 0) || (row == fNrows-1))
a5cadd36 99 return fLengthOPad;
100 else
101 return fLengthIPad; };
3becff3c 102 Double_t GetColSize(Int_t col) const { if ((col == 0) || (col == fNcols-1))
a5cadd36 103 return fWidthOPad;
104 else
58897a75 105 return fWidthIPad; };
f162af62 106
58897a75 107 Double_t GetLengthRim() const { return fLengthRim; };
108 Double_t GetWidthRim() const { return fWidthRim; };
a5cadd36 109
58897a75 110 Double_t GetRowSpacing() const { return fRowSpacing; };
111 Double_t GetColSpacing() const { return fColSpacing; };
e0d47c25 112
58897a75 113 Double_t GetLengthOPad() const { return fLengthOPad; };
114 Double_t GetLengthIPad() const { return fLengthIPad; };
f162af62 115
58897a75 116 Double_t GetWidthOPad() const { return fWidthOPad; };
117 Double_t GetWidthIPad() const { return fWidthIPad; };
118
119 Double_t GetAnodeWireOffset() const { return fAnodeWireOffset; };
f162af62 120
121 protected:
e0d47c25 122
053767a4 123 Int_t fLayer; // Layer number
124 Int_t fStack; // Stack number
e0d47c25 125
126 Double_t fLength; // Length of pad plane in z-direction (row)
127 Double_t fWidth; // Width of pad plane in rphi-direction (col)
128
129 Double_t fLengthRim; // Length of the rim in z-direction (row)
130 Double_t fWidthRim; // Width of the rim in rphi-direction (col)
131
132 Double_t fLengthOPad; // Length of an outer pad in z-direction (row)
133 Double_t fWidthOPad; // Width of an outer pad in rphi-direction (col)
134
135 Double_t fLengthIPad; // Length of an inner pad in z-direction (row)
136 Double_t fWidthIPad; // Width of an inner pad in rphi-direction (col)
137
138 Double_t fRowSpacing; // Spacing between the pad rows
139 Double_t fColSpacing; // Spacing between the pad columns
140
141 Int_t fNrows; // Number of rows
142 Int_t fNcols; // Number of columns
143
144 Double_t fTiltingAngle; // Pad tilting angle
4ffb371b 145 Double_t fTiltingTan; // Tangens of pad tilting angle
e0d47c25 146
f162af62 147 Double_t *fPadRow; // Pad border positions in row direction
148 Double_t *fPadCol; // Pad border positions in column direction
e0d47c25 149
4329977a 150 Double_t fPadRowSMOffset; // To be added to translate local ROC system to local SM system
151
58897a75 152 Double_t fAnodeWireOffset; // Distance of first anode wire from pad edge
153
154 ClassDef(AliTRDpadPlane,6) // TRD ROC pad plane
e0d47c25 155
156};
157
158#endif