10 #include <tracking/pxdDataReductionClasses/ROIPixelTranslator.h>
11 #include <framework/logging/Logger.h>
12 #include <vxd/geometry/GeoCache.h>
13 #include <vxd/geometry/SensorInfoBase.h>
18 double user_numSigmaTotV,
double user_maxWidthU,
double user_maxWidthV)
19 : m_sigmaSystU(user_sigmaSystU)
20 , m_sigmaSystV(user_sigmaSystV)
21 , m_numSigmaTotU(user_numSigmaTotU)
22 , m_numSigmaTotV(user_numSigmaTotV)
23 , m_maxWidthU(user_maxWidthU)
24 , m_maxWidthV(user_maxWidthV)
29 : m_sigmaSystU(theROIinfo->sigmaSystU)
30 , m_sigmaSystV(theROIinfo->sigmaSystV)
31 , m_numSigmaTotU(theROIinfo->numSigmaTotU)
32 , m_numSigmaTotV(theROIinfo->numSigmaTotV)
33 , m_maxWidthU(theROIinfo->maxWidthU)
34 , m_maxWidthV(theROIinfo->maxWidthV)
49 for (
int i = 0; i < listOfIntercepts->
getEntries(); i++) {
51 B2DEBUG(21,
" --->> a NEW INTERCEPT!");
61 double minU = (*listOfIntercepts)[i]->getCoorU() - widthTotU / 2 ;
62 double maxU = (*listOfIntercepts)[i]->getCoorU() + widthTotU / 2 ;
63 const int nPixelsU = aSensorInfo.
getUCells() - 1;
65 double minV = (*listOfIntercepts)[i]->getCoorV() - widthTotV / 2;
66 double maxV = (*listOfIntercepts)[i]->getCoorV() + widthTotV / 2;
67 const int nPixelsV = aSensorInfo.
getVCells() - 1;
69 const int firstPixelID = 0;
71 double bottomLeft_uID = aSensorInfo.
getUCellID(minU, minV,
false);
72 double bottomLeft_vID = aSensorInfo.
getVCellID(minV,
false);
73 double topRight_uID = aSensorInfo.
getUCellID(maxU, maxV,
false);
74 double topRight_vID = aSensorInfo.
getVCellID(maxV,
false);
76 B2DEBUG(21,
" LAYER = " <<
VxdID((*listOfIntercepts)[i]->getSensorID()).getLayerNumber()
77 <<
" LADDER = " <<
VxdID((*listOfIntercepts)[i]->getSensorID()).getLadderNumber()
78 <<
" SENSOR = " <<
VxdID((*listOfIntercepts)[i]->getSensorID()).getSensorNumber()
81 B2DEBUG(21,
" nPixels (U,V) = (" << nPixelsU <<
"," << nPixelsV <<
")");
83 B2DEBUG(21,
" widthU = " << maxU - minU
86 <<
" lengthU = " << aSensorInfo.
getUSize((*listOfIntercepts)[i]->getCoorV())
89 B2DEBUG(21,
" widthV = " << maxV - minV
92 <<
" lengthV = " << aSensorInfo.
getVSize());
94 B2DEBUG(21,
" bottom left pixel (U,V) = (" << bottomLeft_uID <<
"," << bottomLeft_vID <<
")");
95 B2DEBUG(21,
" top right pixel (U,V) = (" << topRight_uID <<
"," << topRight_vID <<
")");
100 if (bottomLeft_uID > nPixelsU || topRight_uID < firstPixelID || bottomLeft_vID > nPixelsV || topRight_vID < firstPixelID) {
101 B2DEBUG(20,
" OOOPS: this pixel does NOT belong to the sensor");
112 tmpROIid.
setSensorID((*listOfIntercepts)[i]->getSensorID()) ;
double m_maxWidthV
ROI maximum width allowed in the V direction.
void fillRoiIDList(StoreArray< PXDIntercept > *listOfIntercepts, StoreArray< ROIid > *ROIidList)
Append the ROIid to the list listToBeFilled.
double m_maxWidthU
ROI maximum width allowed in the U direction.
double m_sigmaSystV
systematic error along the V coordinate
double m_numSigmaTotV
number of standard deviations to be taken to define a ROI along V
double m_sigmaSystU
systematic error along the U coordinate
double m_numSigmaTotU
number of standard deviations to be taken to define a ROI along U
~ROIPixelTranslator()
Destructor.
ROIPixelTranslator(const ROIinfo *theROIinfo)
Constructor.
ROIid stores the U and V ids and the sensor id of the Region Of Interest.
void setMaxUid(double user_maxUid)
set the maximum U id of the ROI
void setMinUid(double user_minUid)
set the minimum U id of the ROI
void setMaxVid(double user_maxVid)
set the maximum V id of the ROI
void setSensorID(VxdID::baseType user_sensorID)
set the sensor ID of the ROI
void setMinVid(double user_minVid)
set the minimum V id of the ROI
void addRelationTo(const RelationsInterface< BASE > *object, float weight=1.0, const std::string &namedRelation="") const
Add a relation from this object to another object (with caching).
Accessor to arrays stored in the data store.
T * appendNew()
Construct a new T object at the end of the array.
int getEntries() const
Get the number of objects in the array.
Class to faciliate easy access to sensor information of the VXD like coordinate transformations or pi...
const SensorInfoBase & getSensorInfo(Belle2::VxdID id) const
Return a referecne to the SensorInfo of a given SensorID.
static GeoCache & getInstance()
Return a reference to the singleton instance.
Base class to provide Sensor Information for PXD and SVD.
double getVSize() const
Return the length of the sensor.
int getVCells() const
Return number of pixel/strips in v direction.
int getUCells() const
Return number of pixel/strips in u direction.
double getUSize(double v=0) const
Return the width of the sensor.
int getVCellID(double v, bool clamp=false) const
Return the corresponding pixel/strip ID of a given v coordinate.
int getUCellID(double u, double v=0, bool clamp=false) const
Return the corresponding pixel/strip ID of a given u coordinate.
Class to uniquely identify a any structure of the PXD and SVD.
double sqrt(double a)
sqrt for double
Abstract base class for different kinds of events.
ROIinfo contains the parameters that can be changed by the user in the python script.