25 #include "AliHLTTPCCAGrid.h"
26 #include "AliHLTTPCCAMath.h"
30 void AliHLTTPCCAGrid::CreateEmpty()
43 void AliHLTTPCCAGrid::Create1(
float y,
float z,
float sy,
float sz )
52 fYMinOverStep = y * fStepYInv - 0.5f;
53 fZMinOverStep = z * fStepZInv - 0.5f;
56 void AliHLTTPCCAGrid::Create(
float yMin,
float yMax,
float zMin,
float zMax,
float sy,
float sz )
62 fYMinOverStep = yMin * fStepYInv;
63 fZMinOverStep = zMin * fStepZInv;
66 fNy =
static_cast<unsigned short>( yMax * fStepYInv - fYMinOverStep + 1.f );
67 fNz =
static_cast<unsigned short>( zMax * fStepZInv - fZMinOverStep + 1.f );
76 int AliHLTTPCCAGrid::GetBin(
float Y,
float Z )
const
79 const int yBin =
static_cast<int>( Y * fStepYInv - fYMinOverStep );
80 const int zBin =
static_cast<int>( Z * fStepZInv - fZMinOverStep );
83 assert( yBin < static_cast<int>( fNy ) );
84 assert( zBin < static_cast<int>( fNz ) );
85 const int bin = zBin * fNy + yBin;
89 void AliHLTTPCCAGrid::GetBinBounds(
int iBin,
float &Ymin,
float &Ymax,
float &Zmin,
float &Zmax)
const
91 int zBin = iBin / fNy;
92 int yBin = iBin % fNy;
93 Ymin = (fYMinOverStep + yBin)/fStepYInv;
94 Zmin = (fZMinOverStep + zBin)/fStepZInv;
95 Ymax = Ymin + 1. / fStepYInv;
96 Zmax = Zmin + 1. / fStepZInv;