8#include <tracking/datcon/findlets/ROICalculator.h>
9#include <framework/core/ModuleParamList.h>
10#include <framework/core/ModuleParamList.templateDetails.h>
11#include <tracking/trackFindingCDC/utilities/StringManipulation.h>
12#include <framework/gearbox/Unit.h>
13#include <tracking/dataobjects/ROIid.h>
14#include <pxd/geometry/SensorInfo.h>
15#include <vxd/dataobjects/VxdID.h>
16#include <vxd/geometry/GeoCache.h>
19using namespace TrackFindingCDC;
54 const std::vector<std::pair<VxdID, long>>& vExtrapolations)
57 const unsigned short uCells = 250, vCells = 768;
61 for (
auto& uExtrapolatedHit : uExtrapolations) {
62 const VxdID& uHitSensorID = uExtrapolatedHit.first;
64 for (
auto& vExtrapolatedHit : vExtrapolations) {
65 const VxdID& vHitSensorID = vExtrapolatedHit.first;
67 if (uHitSensorID != vHitSensorID) {
75 double uCoordinateInCM = uExtrapolatedHit.second *
Unit::nm;
76 double vCoordinateInCM = vExtrapolatedHit.second *
Unit::nm;
79 const short uCell = currentSensor->
getUCellID(uCoordinateInCM);
80 const short vCell = currentSensor->
getVCellID(vCoordinateInCM);
85 B2DEBUG(29,
"sensorID: " << uHitSensorID <<
", localUCoordinate: " << uCoordinateInCM <<
", localVCoordinate: " << vCoordinateInCM
86 <<
", localUCell: " << uCell <<
", localVCell: " << vCell <<
", uROIsize : " << uROIsize <<
", vROIsize: " << vROIsize);
89 short uCellDownLeft = uCell - uROIsize / 2;
90 if (uCellDownLeft < 0) uCellDownLeft = 0;
91 short vCellDownLeft = vCell - vROIsize / 2;
92 if (vCellDownLeft < 0) vCellDownLeft = 0;
95 short uCellUpRight = uCell + uROIsize / 2;
96 if (uCellUpRight >= uCells) uCellUpRight = uCells - 1;
97 short vCellUpRight = vCell + vROIsize / 2;
98 if (vCellUpRight >= vCells) vCellUpRight = vCells - 1;
100 m_storeDATCONROIs.appendNew(
ROIid(uCellDownLeft, uCellUpRight, vCellDownLeft, vCellUpRight, uHitSensorID));
The Module parameter list class.
Specific implementation of SensorInfo for PXD Sensors which provides additional pixel specific inform...
void initialize() override
Create the store arrays.
short m_param_uROIsizeL2
ROI size in u direction on L2.
short m_param_uROIsizeL1
ROI size in u direction on L1.
void apply(const std::vector< std::pair< VxdID, long > > &uExtrapolations, const std::vector< std::pair< VxdID, long > > &vExtrapolations) override
Load in the prepared hits and create tracks for extrapolation to PXD.
short m_param_vROIsizeL2
ROI size in v direction on L2.
ROICalculator()
Find intercepts in the 2D Hough space.
short m_param_vROIsizeL1
ROI size in v direction on L1.
StoreArray< ROIid > m_storeDATCONROIs
PXDIntercept StoreArray.
void exposeParameters(ModuleParamList *moduleParamList, const std::string &prefix) override
Expose the parameters of the sub findlets.
std::string m_param_ROIsStoreArrayName
name of the PXDIntercept StoreArray
ROIid stores the U and V ids and the sensor id of the Region Of Interest.
void initialize() override
Receive and dispatch signal before the start of the event processing.
virtual void exposeParameters(ModuleParamList *moduleParamList, const std::string &prefix)
Forward prefixed parameters of this findlet to the module parameter list.
static const double nm
[nanometers]
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.
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.
baseType getLayerNumber() const
Get the layer id.
void addParameter(const std::string &name, T ¶mVariable, const std::string &description, const T &defaultValue)
Adds a new parameter to the module list.
Abstract base class for different kinds of events.