15#ifndef ALICEO2_ITSSMFT_ALPIDESIMRESPONSE_H
16#define ALICEO2_ITSSMFT_ALPIDESIMRESPONSE_H
36 static int constexpr NPix = 5;
46 for (
int iRow =
NPix; iRow--;) {
47 int rw = flipRow ?
NPix - 1 - iRow : iRow;
48 for (
int iCol =
NPix; iCol--;) {
49 int bDest = rw *
NPix + (flipCol ?
NPix - 1 - iCol : iCol);
57 float getValue(
int iRow,
int iCol,
bool flipRow,
bool flipCol)
const
59 int bin = (flipRow ?
NPix - 1 - iRow : iRow) *
NPix + (flipCol ?
NPix - 1 - iCol : iCol);
67 void print(
bool flipRow =
false,
bool flipCol =
false)
const;
70 std::array<float, MatSize>
data;
89 int getColBin(
float pos)
const;
90 int getRowBin(
float pos)
const;
91 int getDepthBin(
float pos)
const;
92 std::string composeDataName(
int colBin,
int rowBin);
103 float mDptShift = 0.f;
104 float mStepInvCol = 0;
105 float mStepInvRow = 0;
106 float mStepInvDpt = 0;
107 std::vector<AlpideRespSimMat> mData;
109 std::string mDataPath;
110 std::string mGridColName =
"grid_list_x.txt";
111 std::string mGridRowName =
"grid_list_y.txt";
112 std::string mColRowDataFmt =
"data_pixels_%.2f_%.2f.txt";
118 void initData(
int tableNumber, std::string dataPath,
const bool quiet =
true);
122 const AlpideRespSimMat*
getResponse(
float vRow,
float vCol,
float vDepth,
bool& flipRow,
bool& flipCol,
float rowMax,
float colMax)
const;
132 float getStepCol()
const {
return mStepInvCol ? 1. / mStepInvCol : 0.f; }
133 float getStepRow()
const {
return mStepInvRow ? 1. / mStepInvRow : 0.f; }
134 float getStepDepth()
const {
return mStepInvDpt ? 1. / mStepInvDpt : 0.f; }
149inline int AlpideSimResponse::getColBin(
float pos)
const
152 int i =
pos * mStepInvCol + 0.5f;
153 return i < mNBinCol ?
i : mMaxBinCol;
157inline int AlpideSimResponse::getRowBin(
float pos)
const
160 int i =
pos * mStepInvRow + 0.5f;
161 return i < mNBinRow ?
i : mMaxBinRow;
165inline int AlpideSimResponse::getDepthBin(
float pos)
const
169 int i = (mDptMax -
pos) * mStepInvDpt;
170 return i < 0 ? 0 :
i;
Definition of the SegmentationAlpide class.
static int constexpr getNPix()
number of pixels in the quadrant
void adopt(const AlpideRespSimMat &src, bool flipRow=false, bool flipCol=false)
static int constexpr NPix
float getValue(int iRow, int iCol, bool flipRow, bool flipCol) const
~AlpideRespSimMat()=default
float getValue(int iRow, int iCol) const
probability to find an electron in pixel ix,iy,iz
AlpideRespSimMat()=default
std::array< float, MatSize > * getArray()
pointer on underlying array
static int constexpr MatSize
side of quadrant (pixels) with non-0 response
const std::string & getDataPath() const
ClassDefNV(AlpideSimResponse, 1)
float getStepDepth() const
AlpideSimResponse()=default
format to read the data for given Col,Row
const std::string & getColRowDataFmt() const
float getDepthMax() const
void setDataPath(const std::string pth)
const std::string & getGridColName() const
bool getResponse(float vRow, float vCol, float cDepth, AlpideRespSimMat &dest) const
void setGridRowName(const std::string nm)
float getDepthMin() const
const std::string & getGridRowName() const
float getDepthShift() const
void initData(int tableNumber, std::string dataPath, const bool quiet=true)
~AlpideSimResponse()=default
void setGridColName(const std::string nm)
static int constexpr getNPix()
void setColRowDataFmt(const std::string nm)
static constexpr float PitchCol
static constexpr float PitchRow
a couple of static helper functions to create timestamp values for CCDB queries or override obsolete ...