10 #ifndef ALIHLTTPCCAGRID_H
11 #define ALIHLTTPCCAGRID_H
13 #include "AliHLTTPCCADef.h"
14 #include "AliHLTTPCCAMath.h"
27 void Create1(
float y,
float z,
float sy,
float sz );
28 void Create(
float yMin,
float yMax,
float zMin,
float zMax,
float sy,
float sz );
30 int GetBin(
float Y,
float Z )
const;
34 ushort_v
GetBinBounded(
const sfloat_v &Y,
const sfloat_v &Z )
const;
35 void GetBinBounded(
const sfloat_v &Y,
const sfloat_v &Z, ushort_v *bY, ushort_v *bZ )
const;
38 static void GetBinBounded(
const AliHLTTPCCAGrid *array,
const ushort_v &indexes,
const sfloat_v &Y,
const sfloat_v &Z, ushort_v *bY, ushort_v *bZ );
39 static ushort_v Ny(
const AliHLTTPCCAGrid *array,
const ushort_v &indexes ) {
return ushort_v( array, &AliHLTTPCCAGrid::fNy, indexes ); }
41 void GetBinBounds(
int iBin,
float &Ymin,
float &Ymax,
float &Zmin,
float &Zmax)
const;
43 unsigned int N()
const {
return fN; }
44 unsigned short Ny()
const {
return fNy; }
45 unsigned short Nz()
const {
return fNz; }
72 const sfloat_v fZMinOverStep( array, &AliHLTTPCCAGrid::fZMinOverStep, indexes );
73 const sfloat_v fStepZInv( array, &AliHLTTPCCAGrid::fStepZInv, indexes );
74 const ushort_v fNz( array, &AliHLTTPCCAGrid::fNz, indexes );
75 short_v zBin = ( Z * fStepZInv - fZMinOverStep ).staticCast<short_v>();
76 ushort_v zBin2 = CAMath::Max( short_v( Vc::Zero ), CAMath::Min( short_v( fNz - 1 ), zBin ) ).staticCast<ushort_v>();
78 const sfloat_v fYMinOverStep( array, &AliHLTTPCCAGrid::fYMinOverStep, indexes );
79 const sfloat_v fStepYInv( array, &AliHLTTPCCAGrid::fStepYInv, indexes );
80 const ushort_v fNy( array, &AliHLTTPCCAGrid::fNy, indexes );
81 short_v yBin = ( Y * fStepYInv - fYMinOverStep ).staticCast<short_v>();
82 ushort_v yBin2 = CAMath::Max( short_v( Vc::Zero ), CAMath::Min( short_v( fNy - 1 ), yBin ) ).staticCast<ushort_v>();
83 return zBin2 * fNy + yBin2;
100 const sfloat_v fYMinOverStep( array, &AliHLTTPCCAGrid::fYMinOverStep, indexes );
101 const sfloat_v fStepYInv( array, &AliHLTTPCCAGrid::fStepYInv, indexes );
102 const ushort_v fNy( array, &AliHLTTPCCAGrid::fNy, indexes );
103 const short_v fNy2 = fNy.staticCast<short_v>();
104 const short_v &yBin = ( Y * fStepYInv - fYMinOverStep ).staticCast<short_v>();
105 *bY = CAMath::Max( short_v( Vc::Zero ), CAMath::Min( fNy2 - 1, yBin ) ).staticCast<ushort_v>();
107 const sfloat_v fZMinOverStep( array, &AliHLTTPCCAGrid::fZMinOverStep, indexes );
108 const sfloat_v fStepZInv( array, &AliHLTTPCCAGrid::fStepZInv, indexes );
109 const ushort_v fNz( array, &AliHLTTPCCAGrid::fNz, indexes );
110 const short_v fNz2 = fNz.staticCast<short_v>();
111 const short_v &zBin = ( Z * fStepZInv - fZMinOverStep ).staticCast<short_v>();
112 *bZ = CAMath::Max( short_v( Vc::Zero ), CAMath::Min( fNz2 - 1, zBin ) ).staticCast<ushort_v>();
121 return zBin * fNy + yBin;
143 const short_v &yBin = ( Y * fStepYInv - fYMinOverStep ).staticCast<short_v>();
144 const short_v &zBin = ( Z * fStepZInv - fZMinOverStep ).staticCast<short_v>();
146 *bY = CAMath::Max( short_v( Vc::Zero ), CAMath::Min( short_v( fNy - 1 ), yBin ) ).staticCast<ushort_v>();
147 *bZ = CAMath::Max( short_v( Vc::Zero ), CAMath::Min( short_v( fNz - 1 ), zBin ) ).staticCast<ushort_v>();
ushort_v GetBinBounded(const sfloat_v &Y, const sfloat_v &Z) const