1 #ifndef CTPPS_PIXELINDICES_H 2 #define CTPPS_PIXELINDICES_H 87 if(CTPPS_CHECK_LIMITS) {
88 if(theChipsInX<1 || theChipsInX>maxROCsInX)
89 edm::LogError(
"RPix") <<
" CTPPSPixelIndices: Error in ROCsInX " 91 if(theChipsInY<1 || theChipsInY>maxROCsInY)
92 edm::LogError(
"RPix") <<
" CTPPSPixelIndices: Error in ROCsInY " 103 if(CTPPS_CHECK_LIMITS) {
104 if(theChipsInX<1 || theChipsInX>maxROCsInX)
105 edm::LogError(
"RPix") <<
" CTPPSPixelIndices: Error in ROCsInX " 107 if(theChipsInY<1 || theChipsInY>maxROCsInY)
108 edm::LogError(
"RPix") <<
" CTPPSPixelIndices: Error in ROCsInY " 124 edm::LogInfo(
"RPix") <<
" Rows in one chip " << ROCSizeInX <<
" and columns " 126 edm::LogInfo(
"RPix") <<
" Double columns per ROC " << DColsPerROC ;
137 int & colROC,
int & rowROC) {
139 if(CTPPS_CHECK_LIMITS) {
140 if(dcol<0||dcol>=DColsPerROC||pix<2||pix>161) {
141 edm::LogError(
"RPix")<<
"CTPPSPixelIndices: wrong dcol or pix "<<dcol<<
" "<<pix;
149 int colEvenOdd = pix%2;
151 colROC = dcol * 2 + colEvenOdd;
152 rowROC =
abs(
int(pix/2) - 80);
154 if(CTPPS_CHECK_LIMITS) {
155 if(colROC<0||colROC>=ROCSizeInY||rowROC<0||rowROC>=ROCSizeInX ) {
156 edm::LogError(
"RPix")<<
"CTPPSPixelIndices: wrong col or row "<<colROC<<
" "<<rowROC<<
" " 174 int &
col,
int & row )
const {
175 if(CTPPS_CHECK_LIMITS) {
176 if(colROC<0 || colROC>=ROCSizeInY || rowROC<0 ||rowROC>=ROCSizeInX) {
177 edm::LogError(
"RPix")<<
"CTPPSPixelIndices: wrong index "<<colROC<<
" "<<rowROC;
183 if(rocId>=0 && rocId<3) {
186 col = (rocId+1)*ROCSizeInY - colROC - 1 ;
187 }
else if(rocId>=3 && rocId<6) {
190 col = (5-rocId)*ROCSizeInY + colROC;
192 edm::LogError(
"RPix")<<
"CTPPSPixelIndices: wrong ROC ID "<<rocId;
195 if(CTPPS_CHECK_LIMITS) {
196 if(col<0 || col>=(ROCSizeInY*
theChipsInY) || row<0 ||
198 edm::LogError(
"RPix")<<
"CTPPSPixelIndices: wrong index "<<col<<
" "<<row;
212 int & rocId,
int & colROC,
int & rowROC )
const {
213 if(CTPPS_CHECK_LIMITS) {
214 if(col<0 || col>=(ROCSizeInY*
theChipsInY) || row<0 ||
222 int chipX = row / ROCSizeInX;
223 int chipY = col / ROCSizeInY;
227 if(CTPPS_CHECK_LIMITS && (rocId<0 || rocId>=6) ) {
228 edm::LogError(
"RPix")<<
"CTPPSPixelIndices: wrong roc index "<<rocId;
232 rowROC = (row%ROCSizeInX);
233 colROC = (col%ROCSizeInY);
236 colROC = 51 - colROC;
237 rowROC = 79 - rowROC;
240 if(CTPPS_CHECK_LIMITS) {
241 if(colROC<0||colROC>=ROCSizeInY||rowROC<0||rowROC>=ROCSizeInX) {
242 edm::LogError(
"RPix")<<
"CTPPSPixelIndices: wrong index "<<colROC<<
" "<<rowROC;
256 if(CTPPS_CHECK_LIMITS) {
257 if(col<0 || col>=(ROCSizeInY*
theChipsInY) || row<0 ||
265 int chipX = row / ROCSizeInX;
266 int chipY = col / ROCSizeInY;
270 if(CTPPS_CHECK_LIMITS && (rocId<0 || rocId>=6) ) {
271 edm::LogError(
"RPix")<<
"CTPPSPixelIndices: wrong roc index "<<rocId;
282 if(col == 0 || row == 0 || col == (defaultDetSizeInY-1) || row == (defaultDetSizeInX-1))
return true;
292 inline static int rocIndex(
const int chipX,
const int chipY) {
295 if(CTPPS_CHECK_LIMITS) {
296 if(chipX<0 || chipX>=2 ||chipY<0 || chipY>=3) {
297 edm::LogError(
"RPix")<<
"PixelChipIndices: wrong index "<<chipX<<
" "<<chipY;
301 if(chipX==0) rocId = 5 - chipY;
302 else if(chipX==1) rocId = chipY;
304 if(CTPPS_CHECK_LIMITS) {
305 if(rocId < 0 || rocId >= (maxROCsInX*maxROCsInY) ) {
306 edm::LogError(
"RPix") <<
"CTPPSPixelIndices: Error in ROC index " << rocId ;
317 int dColumnId = (colROC)/2;
318 if(CTPPS_CHECK_LIMITS) {
319 if(dColumnId<0 || dColumnId>=26) {
320 edm::LogError(
"RPix")<<
"CTPPSPixelIndices: wrong dcol index "<<dColumnId<<
" "<<colROC;
330 int dcolInMod = dcol + chipIndex * 26;
337 return (rowROC<<6) | colROC;
340 int rowROC = (chan >> 6) & 0x7F;
341 int colROC = chan & 0x3F;
342 return std::pair<int,int>(rowROC,colROC);
static std::pair< int, int > channelToPixelROC(const int chan)
static int convertDcolToCol(const int dcol, const int pix, int &colROC, int &rowROC)
int numberOfROCsInY(void)
int getDefaultRowDetSize() const
CTPPSPixelIndices(const int colsInDet, const int rowsInDet)
static int pixelToChannelROC(const int rowROC, const int colROC)
static int rocIndex(const int chipX, const int chipY)
int getDefaultColDetSize() const
int getROCId(const int col, const int row) const
Abs< T >::type abs(const T &t)
int transformToModule(const int colROC, const int rowROC, const int rocId, int &col, int &row) const
static int DColumnInModule(const int dcol, const int chipIndex)
chan
lumi = TPaveText(lowX+0.38, lowY+0.061, lowX+0.45, lowY+0.161, "NDC") lumi.SetBorderSize( 0 ) lumi...
int transformToROC(const int col, const int row, int &rocId, int &colROC, int &rowROC) const
bool isOnEdge(const int col, const int row) const
int numberOfROCsInX(void)
static int DColumn(const int colROC)