Belle II Software  release-08-01-10
ROICalculator Class Referenceabstract

Findlet to calculate ROI on the PXD sensors based on input hits. More...

#include <ROICalculator.h>

Inheritance diagram for ROICalculator:
Collaboration diagram for ROICalculator:

Public Types

using IOTypes = std::tuple< AIOTypes... >
 Types that should be served to apply on invokation.
 
using IOVectors = std::tuple< std::vector< AIOTypes >... >
 Vector types that should be served to apply on invokation.
 

Public Member Functions

 ROICalculator ()
 Find intercepts in the 2D Hough space.
 
void exposeParameters (ModuleParamList *moduleParamList, const std::string &prefix) override
 Expose the parameters of the sub findlets.
 
void initialize () override
 Create the store arrays.
 
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. More...
 
virtual std::string getDescription ()
 Brief description of the purpose of the concret findlet.
 
virtual void apply (ToVector< AIOTypes > &... ioVectors)=0
 Main function executing the algorithm.
 
void beginRun () override
 Receive and dispatch signal for the beginning of a new run.
 
void beginEvent () override
 Receive and dispatch signal for the start of a new event.
 
void endRun () override
 Receive and dispatch signal for the end of the run.
 
void terminate () override
 Receive and dispatch Signal for termination of the event processing.
 

Protected Types

using ToVector = typename ToVectorImpl< T >::Type
 Short hand for ToRangeImpl.
 

Protected Member Functions

void addProcessingSignalListener (ProcessingSignalListener *psl)
 Register a processing signal listener to be notified.
 
int getNProcessingSignalListener ()
 Get the number of currently registered listeners.
 

Private Types

using Super = TrackFindingCDC::Findlet< const std::pair< VxdID, long >, const std::pair< VxdID, long > >
 Parent class.
 

Private Attributes

std::string m_param_ROIsStoreArrayName = "DATCONFPGAROIs"
 name of the PXDIntercept StoreArray
 
StoreArray< ROIidm_storeDATCONROIs
 PXDIntercept StoreArray.
 
short m_param_uROIsizeL1 = 40
 ROI size in u direction on L1.
 
short m_param_uROIsizeL2 = 40
 ROI size in u direction on L2.
 
short m_param_vROIsizeL1 = 40
 ROI size in v direction on L1.
 
short m_param_vROIsizeL2 = 40
 ROI size in v direction on L2.
 
std::vector< ProcessingSignalListener * > m_subordinaryProcessingSignalListeners
 References to subordinary signal processing listener contained in this findlet.
 
bool m_initialized = false
 Flag to keep track whether initialization happend before.
 
bool m_terminated = false
 Flag to keep track whether termination happend before.
 
std::string m_initializedAs
 Name of the type during initialisation.
 

Detailed Description

Findlet to calculate ROI on the PXD sensors based on input hits.

Definition at line 28 of file ROICalculator.h.

Member Function Documentation

◆ apply()

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.

Reminder: 250 px in u-direction = r-phi, in total 768 (512+256) px in v-direction = z

Lower left corner

Upper right corner

Definition at line 53 of file ROICalculator.cc.

55 {
57  const unsigned short uCells = 250, vCells = 768;
58 
59  const PXD::SensorInfo* currentSensor;
60 
61  for (auto& uExtrapolatedHit : uExtrapolations) {
62  const VxdID& uHitSensorID = uExtrapolatedHit.first;
63 
64  for (auto& vExtrapolatedHit : vExtrapolations) {
65  const VxdID& vHitSensorID = vExtrapolatedHit.first;
66 
67  if (uHitSensorID != vHitSensorID) {
68  continue;
69  }
70 
71  // Convert back from nm to cm.
72  // Before the all values were upscaled with "convertFloatToInt" as the FPGA only works with integers.
73  // This conversion from nm to cm is hardcoded, if the powers of 10 are changed in the other modules, this conversion
74  // would not necessarily be right anymore, so maybe there is a better way of doing this - I didn't find any.
75  double uCoordinateInCM = uExtrapolatedHit.second * Unit::nm;
76  double vCoordinateInCM = vExtrapolatedHit.second * Unit::nm;
77 
78  currentSensor = dynamic_cast<const PXD::SensorInfo*>(&VXD::GeoCache::get(uHitSensorID));
79  const short uCell = currentSensor->getUCellID(uCoordinateInCM);
80  const short vCell = currentSensor->getVCellID(vCoordinateInCM);
81 
82  const unsigned short& uROIsize = (uHitSensorID.getLayerNumber() == 1 ? m_param_uROIsizeL1 : m_param_uROIsizeL2);
83  const unsigned short& vROIsize = (uHitSensorID.getLayerNumber() == 1 ? m_param_vROIsizeL1 : m_param_vROIsizeL2);
84 
85  B2DEBUG(29, "sensorID: " << uHitSensorID << ", localUCoordinate: " << uCoordinateInCM << ", localVCoordinate: " << vCoordinateInCM
86  << ", localUCell: " << uCell << ", localVCell: " << vCell << ", uROIsize : " << uROIsize << ", vROIsize: " << vROIsize);
87 
89  short uCellDownLeft = uCell - uROIsize / 2;
90  if (uCellDownLeft < 0) uCellDownLeft = 0;
91  short vCellDownLeft = vCell - vROIsize / 2;
92  if (vCellDownLeft < 0) vCellDownLeft = 0;
93 
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;
99 
100  m_storeDATCONROIs.appendNew(ROIid(uCellDownLeft, uCellUpRight, vCellDownLeft, vCellUpRight, uHitSensorID));
101  }
102  }
103 }
Specific implementation of SensorInfo for PXD Sensors which provides additional pixel specific inform...
Definition: SensorInfo.h:23
short m_param_uROIsizeL2
ROI size in u direction on L2.
Definition: ROICalculator.h:56
short m_param_uROIsizeL1
ROI size in u direction on L1.
Definition: ROICalculator.h:54
short m_param_vROIsizeL2
ROI size in v direction on L2.
Definition: ROICalculator.h:60
short m_param_vROIsizeL1
ROI size in v direction on L1.
Definition: ROICalculator.h:58
StoreArray< ROIid > m_storeDATCONROIs
PXDIntercept StoreArray.
Definition: ROICalculator.h:51
ROIid stores the U and V ids and the sensor id of the Region Of Interest.
Definition: ROIid.h:25
static const double nm
[nanometers]
Definition: Unit.h:72
static const SensorInfoBase & get(Belle2::VxdID id)
Return a reference to the SensorInfo of a given SensorID.
Definition: GeoCache.h:139
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.
Definition: VxdID.h:33
baseType getLayerNumber() const
Get the layer id.
Definition: VxdID.h:96

The documentation for this class was generated from the following files: