///////////////////////////////////////////////////////////////////////////////
#include "AliTRDpadPlane.h"
-#include "AliTRDgeometryFull.h"
+#include "AliTRDgeometry.h"
ClassImp(AliTRDpadPlane)
fPadCol = 0;
fTiltingAngle = 0.0;
+ fTiltingTan = 0.0;
}
//_____________________________________________________________________________
-AliTRDpadPlane::AliTRDpadPlane(Int_t p, Int_t c):TObject()
+AliTRDpadPlane::AliTRDpadPlane(Int_t p, Int_t c):TObject(),fPadRow(0),fPadCol(0)
{
//
// Constructor that initializes a given pad plane type
//
- fGeo = new AliTRDgeometryFull();
+ fGeo = new AliTRDgeometry();
fPla = p;
fCha = c;
- //fRowSpacing = 0.025;
- //fColSpacing = 0.025;
-
fRowSpacing = 0.0;
fColSpacing = 0.0;
// L0C0 type
fNrows = 12;
fLength = 108.0;
- fWidth = 94.4;
+ fWidth = 92.2;
fLengthOPad = 8.0;
fWidthOPad = 0.515;
fLengthIPad = 9.0;
// L0C1 type
fNrows = 16;
fLength = 122.0;
- fWidth = 94.4;
+ fWidth = 92.2;
fLengthOPad = 7.5;
fWidthOPad = 0.515;
fLengthIPad = 7.5;
break;
};
+ //
+ // Store tilting angle as tangens
+ //
+ fTiltingTan = TMath::Tan(TMath::Pi()/180.0 * fTiltingAngle);
+
//
// The positions of the borders of the pads
//
// Row direction
//
- if (fPadRow) delete [] fPadRow;
fPadRow = new Double_t[fNrows];
Double_t row = fGeo->GetChamberLength(p,0)
+ fGeo->GetChamberLength(p,1)
+ fGeo->GetChamberLength(p,2) / 2.
+ - fGeo->RpadW()
- fLengthRim;
for (Int_t ic = 0; ic < c; ic++) {
row -= fGeo->GetChamberLength(p,ic);
for (Int_t ir = 0; ir < fNrows; ir++) {
fPadRow[ir] = row;
row -= fRowSpacing;
- if (ir == 1) {
+ if (ir == 0) {
row -= fLengthOPad;
}
else {
//
// Column direction
//
- if (fPadCol) delete [] fPadCol;
fPadCol = new Double_t[fNcols];
Double_t col = fGeo->GetChamberWidth(p) / 2.
+ + fGeo->CroWid()
- fWidthRim;
for (Int_t ic = 0; ic < fNcols; ic++) {
fPadCol[ic] = col;
col -= fColSpacing;
- if (ic == 1) {
+ if (ic == 0) {
col -= fWidthOPad;
}
else {
((AliTRDpadPlane &) p).fNcols = fNcols;
((AliTRDpadPlane &) p).fTiltingAngle = fTiltingAngle;
+ ((AliTRDpadPlane &) p).fTiltingTan = fTiltingTan;
if (((AliTRDpadPlane &) p).fPadRow) delete [] ((AliTRDpadPlane &) p).fPadRow;
((AliTRDpadPlane &) p).fPadRow = new Double_t[fNrows];
}
//_____________________________________________________________________________
-Int_t AliTRDpadPlane::GetPadRowNumber(const Double_t z)
+Int_t AliTRDpadPlane::GetPadRowNumber(Double_t z) const
{
//
// Finds the pad row number for a given global z-position
Int_t nbelow = 0;
Int_t middle = 0;
- if ((z > fPadRow[0]) ||
- (z < fPadRow[0] - fLength + 2.0*fLengthRim)) {
+ if ((z > GetRow0()) || (z < GetRowEnd())) {
+
row = -1;
+
}
else {
+
nabove = fNrows+1;
nbelow = 0;
while (nabove - nbelow > 1) {
else nbelow = middle;
}
row = nbelow - 1;
+
}
return row;
}
//_____________________________________________________________________________
-Int_t AliTRDpadPlane::GetPadColNumber(const Double_t rphi)
+Int_t AliTRDpadPlane::GetPadColNumber(Double_t rphi
+ , Double_t /*rowOffset*/) const
{
//
// Finds the pad column number for a given global rphi-position
//
- Int_t col = 0;
- Int_t nabove = 0;
- Int_t nbelow = 0;
- Int_t middle = 0;
+ Int_t col = 0;
+ Int_t nabove = 0;
+ Int_t nbelow = 0;
+ Int_t middle = 0;
+ Double_t rphiShift = 0;
+
+ // MI change don't apply tilting angle here - better to do it directly on hit level
+ // Take the tilting angle into account by shifting the hit position
+ // into the opposite direction
+ //
+
+
+ rphiShift = rphi ;
+
+ if ((rphiShift > GetCol0()) || (rphiShift < GetColEnd())) {
- if ((rphi > fPadCol[0]) ||
- (rphi < fPadCol[0] - fWidth + 2.0*fWidthRim)) {
col = -1;
+
}
else {
+
nabove = fNcols+1;
nbelow = 0;
while (nabove - nbelow > 1) {
middle = (nabove + nbelow) / 2;
- if (rphi == fPadCol[middle-1]) col = middle;
- if (rphi > fPadCol[middle-1]) nabove = middle;
- else nbelow = middle;
+ if (rphiShift == fPadCol[middle-1]) col = middle;
+ if (rphiShift > fPadCol[middle-1]) nabove = middle;
+ else nbelow = middle;
}
col = nbelow - 1;
- }
-
- return col;
-}
-
-//_____________________________________________________________________________
-Double_t AliTRDpadPlane::GetPadRowOffset(const Int_t row, const Double_t z)
-{
- //
- // Calculates the distance to the pad border in row direction
- //
-
- if ((row < 0) || (row >= fNrows)) {
- return -1.0;
}
- else {
- return fPadRow[row] - z;
- }
-
-}
-
-//_____________________________________________________________________________
-Double_t AliTRDpadPlane::GetPadColOffset(const Int_t col, const Double_t rphi)
-{
- //
- // Calculates the distance to the pad border in column direction
- //
- if ((col < 0) || (col >= fNcols)) {
- return -1.0;
- }
- else {
- return fPadCol[col] - rphi;
- }
+ return col;
}