11#include <tracking/roiFinding/ROIToUnitTranslator.h>
12#include <vxd/geometry/GeoCache.h>
13#include <vxd/geometry/SensorInfoBase.h>
14#include <tracking/dataobjects/ROIid.h>
22 template<
class aIntercept>
24 : m_sigmaSystU(theROIinfo->sigmaSystU)
25 , m_sigmaSystV(theROIinfo->sigmaSystV)
26 , m_numSigmaTotU(theROIinfo->numSigmaTotU)
27 , m_numSigmaTotV(theROIinfo->numSigmaTotV)
28 , m_maxWidthU(theROIinfo->maxWidthU)
29 , m_maxWidthV(theROIinfo->maxWidthV)
32 template<
class aIntercept>
34 double numSigmaTotU,
double numSigmaTotV,
35 double maxWidthU,
double maxWidthV)
36 : m_sigmaSystU(sigmaSystU)
37 , m_sigmaSystV(sigmaSystV)
38 , m_numSigmaTotU(numSigmaTotU)
39 , m_numSigmaTotV(numSigmaTotV)
40 , m_maxWidthU(maxWidthU)
41 , m_maxWidthV(maxWidthV)
44 template<
class aIntercept>
48 const VXD::GeoCache& aGeometry = VXD::GeoCache::getInstance();
50 for (
int i = 0; i < listOfIntercepts->
getEntries(); i++) {
52 B2DEBUG(21,
" --->> a NEW INTERCEPT!");
57 double widthTotU = std::min(m_maxWidthU,
58 sqrt((*listOfIntercepts)[i]->getSigmaU() * (*listOfIntercepts)[i]->getSigmaU() + m_sigmaSystU * m_sigmaSystU) * m_numSigmaTotU);
59 double widthTotV = std::min(m_maxWidthV,
60 sqrt((*listOfIntercepts)[i]->getSigmaV() * (*listOfIntercepts)[i]->getSigmaV() + m_sigmaSystV * m_sigmaSystV) * m_numSigmaTotV);
62 double minU = (*listOfIntercepts)[i]->getCoorU() - widthTotU / 2 ;
63 double maxU = (*listOfIntercepts)[i]->getCoorU() + widthTotU / 2 ;
64 const int nUnitsU = aSensorInfo.
getUCells() - 1;
66 double minV = (*listOfIntercepts)[i]->getCoorV() - widthTotV / 2;
67 double maxV = (*listOfIntercepts)[i]->getCoorV() + widthTotV / 2;
68 const int nUnitsV = aSensorInfo.
getVCells() - 1;
70 const int firstPixelID = 0;
72 double bottomLeft_uID = aSensorInfo.
getUCellID(minU, minV,
false);
73 double bottomLeft_vID = aSensorInfo.
getVCellID(minV,
false);
74 double topRight_uID = aSensorInfo.
getUCellID(maxU, maxV,
false);
75 double topRight_vID = aSensorInfo.
getVCellID(maxV,
false);
77 B2DEBUG(21,
" LAYER = " <<
VxdID((*listOfIntercepts)[i]->getSensorID()).getLayerNumber()
78 <<
" LADDER = " <<
VxdID((*listOfIntercepts)[i]->getSensorID()).getLadderNumber()
79 <<
" SENSOR = " <<
VxdID((*listOfIntercepts)[i]->getSensorID()).getSensorNumber()
82 B2DEBUG(21,
" number of units (pixel or strip) (U,V) = (" << nUnitsU <<
"," << nUnitsV <<
")");
84 B2DEBUG(21,
" widthU = " << maxU - minU
87 <<
" lengthU = " << aSensorInfo.
getUSize((*listOfIntercepts)[i]->getCoorV())
90 B2DEBUG(21,
" widthV = " << maxV - minV
93 <<
" lengthV = " << aSensorInfo.
getVSize());
95 B2DEBUG(21,
" bottom left unit (pixel or strip) (U,V) = (" << bottomLeft_uID <<
"," << bottomLeft_vID <<
")");
96 B2DEBUG(21,
" top right unit (pixel or strip) (U,V) = (" << topRight_uID <<
"," << topRight_vID <<
")");
101 if (bottomLeft_uID > nUnitsU || topRight_uID < firstPixelID || bottomLeft_vID > nUnitsV || topRight_vID < firstPixelID) {
102 B2DEBUG(21,
" OOOPS: this unit (pixel or strip) does NOT belong to the sensor");
113 tmpROIid.
setSensorID((*listOfIntercepts)[i]->getSensorID()) ;
Translator for ROI-geometry-information into a list of pixels or strips.
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.
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
ROIToUnitTranslator(const ROIinfo *theROIinfo)
Constructor.
Abstract base class for different kinds of events.
ROIinfo contains the parameters that can be changed by the user in the python script.