1 #ifndef TP_PIXELINDICES_H 2 #define TP_PIXELINDICES_H 37 const bool TP_CHECK_LIMITS =
true;
48 if (TP_CHECK_LIMITS) {
49 if (theChipsInX < 1 || theChipsInX >
maxROCsInX)
52 if (theChipsInY < 1 || theChipsInY >
maxROCsInY)
80 inline static int convertDcolToCol(
const int dcol,
const int pix,
int& colROC,
int& rowROC) {
81 if (TP_CHECK_LIMITS) {
82 if (dcol < 0 || dcol >=
DColsPerROC || pix < 2 || pix > 161) {
83 std::cout <<
"PixelIndices: wrong dcol or pix " << dcol <<
" " << pix << std::endl;
91 int colEvenOdd = pix % 2;
93 colROC = dcol * 2 + colEvenOdd;
94 rowROC =
abs(
int(pix / 2) - 80);
96 if (TP_CHECK_LIMITS) {
98 std::cout <<
"PixelIndices: wrong col or row " << colROC <<
" " << rowROC <<
" " << dcol <<
" " << pix
115 if (TP_CHECK_LIMITS) {
117 std::cout <<
"PixelIndices: wrong index " << colROC <<
" " << rowROC << std::endl;
123 if (rocId >= 0 && rocId < 8) {
127 }
else if (rocId >= 8 && rocId < 16) {
132 std::cout <<
"PixelIndices: wrong ROC ID " << rocId << std::endl;
135 if (TP_CHECK_LIMITS) {
137 std::cout <<
"PixelIndices: wrong index " <<
col <<
" " << row << std::endl;
150 if (TP_CHECK_LIMITS) {
152 std::cout <<
"PixelIndices: wrong index 3 " << std::endl;
163 if (TP_CHECK_LIMITS && (rocId < 0 || rocId >= 16)) {
164 std::cout <<
"PixelIndices: wrong roc index " << rocId << std::endl;
172 colROC = 51 - colROC;
173 rowROC = 79 - rowROC;
176 if (TP_CHECK_LIMITS) {
178 std::cout <<
"PixelIndices: wrong index " << colROC <<
" " << rowROC << std::endl;
189 inline static int rocIndex(
const int chipX,
const int chipY) {
191 if (TP_CHECK_LIMITS) {
192 if (chipX < 0 || chipX >= 2 || chipY < 0 || chipY >= 8) {
193 std::cout <<
"PixelChipIndices: wrong index " << chipX <<
" " << chipY << std::endl;
202 if (TP_CHECK_LIMITS) {
204 std::cout <<
"PixelIndices: Error in ROC index " << rocId << std::endl;
214 int dColumnId = (colROC) / 2;
215 if (TP_CHECK_LIMITS) {
216 if (dColumnId < 0 || dColumnId >= 26) {
217 std::cout <<
"PixelIndices: wrong dcol index " << dColumnId <<
" " << colROC << std::endl;
227 int dcolInMod = dcol + chipIndex * 26;
234 return (rowROC << 6) | colROC;
237 int rowROC = (
chan >> 6) & 0x7F;
238 int colROC =
chan & 0x3F;
239 return std::pair<int, int>(rowROC, colROC);
static std::pair< int, int > channelToPixelROC(const int chan)
int numberOfROCsInY(void)
static int DColumn(const int colROC)
static int rocIndex(const int chipX, const int chipY)
int transformToROC(const int col, const int row, int &rocId, int &colROC, int &rowROC) const
PixelIndices(const int colsInDet, const int rowsInDet)
int numberOfROCsInX(void)
static int pixelToChannelROC(const int rowROC, const int colROC)
static int convertDcolToCol(const int dcol, const int pix, int &colROC, int &rowROC)
Abs< T >::type abs(const T &t)
constexpr int defaultDetSizeInX
int transformToModule(const int colROC, const int rowROC, const int rocId, int &col, int &row) const
constexpr int defaultDetSizeInY
chan
lumi = TPaveText(lowX+0.38, lowY+0.061, lowX+0.45, lowY+0.161, "NDC") lumi.SetBorderSize( 0 ) lumi...
constexpr int DColsPerROC
static int DColumnInModule(const int dcol, const int chipIndex)