12 #include <tracking/pxdDataReductionClasses/ROIPixelTranslator.h>
13 #include <framework/logging/Logger.h>
14 #include <vxd/geometry/GeoCache.h>
15 #include <vxd/geometry/SensorInfoBase.h>
20 ROIPixelTranslator::ROIPixelTranslator(
double user_sigmaSystU,
double user_sigmaSystV,
double user_numSigmaTotU,
21 double user_numSigmaTotV,
double user_maxWidthU,
double user_maxWidthV)
22 : m_sigmaSystU(user_sigmaSystU)
23 , m_sigmaSystV(user_sigmaSystV)
24 , m_numSigmaTotU(user_numSigmaTotU)
25 , m_numSigmaTotV(user_numSigmaTotV)
26 , m_maxWidthU(user_maxWidthU)
27 , m_maxWidthV(user_maxWidthV)
32 : m_sigmaSystU(theROIinfo->sigmaSystU)
33 , m_sigmaSystV(theROIinfo->sigmaSystV)
34 , m_numSigmaTotU(theROIinfo->numSigmaTotU)
35 , m_numSigmaTotV(theROIinfo->numSigmaTotV)
36 , m_maxWidthU(theROIinfo->maxWidthU)
37 , m_maxWidthV(theROIinfo->maxWidthV)
52 for (
int i = 0; i < listOfIntercepts->
getEntries(); i++) {
54 B2DEBUG(10,
" --->> a NEW INTERCEPT!");
64 double minU = (*listOfIntercepts)[i]->getCoorU() - widthTotU / 2 ;
65 double maxU = (*listOfIntercepts)[i]->getCoorU() + widthTotU / 2 ;
66 const int nPixelsU = aSensorInfo.
getUCells() - 1;
68 double minV = (*listOfIntercepts)[i]->getCoorV() - widthTotV / 2;
69 double maxV = (*listOfIntercepts)[i]->getCoorV() + widthTotV / 2;
70 const int nPixelsV = aSensorInfo.
getVCells() - 1;
72 const int firstPixelID = 0;
74 double bottomLeft_uID = aSensorInfo.
getUCellID(minU, minV,
false);
75 double bottomLeft_vID = aSensorInfo.
getVCellID(minV,
false);
76 double topRight_uID = aSensorInfo.
getUCellID(maxU, maxV,
false);
77 double topRight_vID = aSensorInfo.
getVCellID(maxV,
false);
79 B2DEBUG(10,
" LAYER = " <<
VxdID((*listOfIntercepts)[i]->getSensorID()).getLayerNumber()
80 <<
" LADDER = " <<
VxdID((*listOfIntercepts)[i]->getSensorID()).getLadderNumber()
81 <<
" SENSOR = " <<
VxdID((*listOfIntercepts)[i]->getSensorID()).getSensorNumber()
84 B2DEBUG(10,
" nPixels (U,V) = (" << nPixelsU <<
"," << nPixelsV <<
")");
86 B2DEBUG(10,
" widthU = " << maxU - minU
89 <<
" lengthU = " << aSensorInfo.
getUSize((*listOfIntercepts)[i]->getCoorV())
92 B2DEBUG(10,
" widthV = " << maxV - minV
95 <<
" lengthV = " << aSensorInfo.
getVSize());
97 B2DEBUG(10,
" bottom left pixel (U,V) = (" << bottomLeft_uID <<
"," << bottomLeft_vID <<
")");
98 B2DEBUG(10,
" top right pixel (U,V) = (" << topRight_uID <<
"," << topRight_vID <<
")");
103 if (bottomLeft_uID > nPixelsU || topRight_uID < firstPixelID || bottomLeft_vID > nPixelsV || topRight_vID < firstPixelID) {
104 B2DEBUG(5,
" OOOPS: this pixel does NOT belong to the sensor");
111 tmpROIid.setMinUid(aSensorInfo.
getUCellID(minU, minV,
true));
112 tmpROIid.setMinVid(aSensorInfo.
getVCellID(minV,
true));
113 tmpROIid.setMaxUid(aSensorInfo.
getUCellID(maxU, maxV,
true));
114 tmpROIid.setMaxVid(aSensorInfo.
getVCellID(maxV,
true));
115 tmpROIid.setSensorID((*listOfIntercepts)[i]->getSensorID()) ;