Belle II Software development
ROICalculator Class Referenceabstract

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

#include <ROICalculator.h>

Inheritance diagram for ROICalculator:
Findlet< const std::pair< VxdID, long >, const std::pair< VxdID, long > > CompositeProcessingSignalListener ProcessingSignalListener

Public Types

using IOTypes
 Types that should be served to apply on invocation.
 
using IOTypes
 Types that should be served to apply on invocation.
 
using IOVectors
 Vector types that should be served to apply on invocation.
 
using IOVectors
 Vector types that should be served to apply on invocation.
 

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.
 
virtual std::string getDescription ()
 Brief description of the purpose of the concrete findlet.
 
virtual std::string getDescription ()
 Brief description of the purpose of the concrete 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
 Short hand for ToRangeImpl.
 
using ToVector
 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
 Flag to keep track whether initialization happened before.
 
bool m_terminated
 Flag to keep track whether termination happened 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 Typedef Documentation

◆ IOTypes [1/2]

using IOTypes
inherited

Types that should be served to apply on invocation.

Definition at line 30 of file Findlet.h.

◆ IOTypes [2/2]

using IOTypes
inherited

Types that should be served to apply on invocation.

Definition at line 30 of file Findlet.h.

◆ IOVectors [1/2]

using IOVectors
inherited

Vector types that should be served to apply on invocation.

Definition at line 53 of file Findlet.h.

◆ IOVectors [2/2]

using IOVectors
inherited

Vector types that should be served to apply on invocation.

Definition at line 53 of file Findlet.h.

◆ Super

using Super = TrackFindingCDC::Findlet<const std::pair<VxdID, long>, const std::pair<VxdID, long>>
private

Parent class.

Definition at line 30 of file ROICalculator.h.

◆ ToVector [1/2]

using ToVector
protectedinherited

Short hand for ToRangeImpl.

Definition at line 49 of file Findlet.h.

◆ ToVector [2/2]

using ToVector
protectedinherited

Short hand for ToRangeImpl.

Definition at line 49 of file Findlet.h.

Constructor & Destructor Documentation

◆ ROICalculator()

Find intercepts in the 2D Hough space.

Definition at line 21 of file ROICalculator.cc.

21 : Super()
22{
23}
TrackFindingCDC::Findlet< const std::pair< VxdID, long >, const std::pair< VxdID, long > > Super
Parent class.

Member Function Documentation

◆ addProcessingSignalListener()

void addProcessingSignalListener ( ProcessingSignalListener * psl)
protectedinherited

Register a processing signal listener to be notified.

Definition at line 53 of file CompositeProcessingSignalListener.cc.

56{
58}
Interface for a minimal algorithm part that wants to expose some parameters to a module.
Definition Findlet.h:26

◆ 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::getInstance().getSensorInfo(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}
short m_param_uROIsizeL2
ROI size in u direction on L2.
short m_param_uROIsizeL1
ROI size in u direction on L1.
short m_param_vROIsizeL2
ROI size in v direction on L2.
short m_param_vROIsizeL1
ROI size in v direction on L1.
StoreArray< ROIid > m_storeDATCONROIs
PXDIntercept StoreArray.
static const double nm
[nanometers]
Definition Unit.h:72
const SensorInfoBase & getSensorInfo(Belle2::VxdID id) const
Return a reference to the SensorInfo of a given SensorID.
Definition GeoCache.cc:67
static GeoCache & getInstance()
Return a reference to the singleton instance.
Definition GeoCache.cc:214
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.
baseType getLayerNumber() const
Get the layer id.
Definition VxdID.h:96

◆ beginEvent()

void beginEvent ( )
overrideinherited

Receive and dispatch signal for the start of a new event.

Definition at line 36 of file CompositeProcessingSignalListener.cc.

32{
35 psl->beginEvent();
36 }
37}
void beginEvent() override
Receive and dispatch signal for the start of a new event.
virtual void beginEvent()
Receive signal for the start of a new event.

◆ beginRun()

void beginRun ( )
overrideinherited

Receive and dispatch signal for the beginning of a new run.

Definition at line 33 of file CompositeProcessingSignalListener.cc.

24{
27 psl->beginRun();
28 }
29}
void beginRun() override
Receive and dispatch signal for the beginning of a new run.
virtual void beginRun()
Receive signal for the beginning of a new run.

◆ endRun()

void endRun ( )
overrideinherited

Receive and dispatch signal for the end of the run.

Definition at line 39 of file CompositeProcessingSignalListener.cc.

40{
42 psl->endRun();
43 }
45}
void endRun() override
Receive and dispatch signal for the end of the run.
virtual void endRun()
Receive signal for the end of the run.

◆ exposeParameters()

void exposeParameters ( ModuleParamList * moduleParamList,
const std::string & prefix )
overridevirtual

Expose the parameters of the sub findlets.

Reimplemented from CompositeProcessingSignalListener.

Definition at line 25 of file ROICalculator.cc.

26{
27 Super::exposeParameters(moduleParamList, prefix);
28
29 moduleParamList->addParameter(TrackFindingCDC::prefixed(prefix, "ROIsStoreArrayName"), m_param_ROIsStoreArrayName,
30 "Name of the ROIs StoreArray?", m_param_ROIsStoreArrayName);
31
32 moduleParamList->addParameter(TrackFindingCDC::prefixed(prefix, "uROIsizeL1"), m_param_uROIsizeL1,
33 "u direction ROI size on L1. Data type: short", m_param_uROIsizeL1);
34
35 moduleParamList->addParameter(TrackFindingCDC::prefixed(prefix, "uROIsizeL2"), m_param_uROIsizeL2,
36 "u direction ROI size on L2. Data type: short", m_param_uROIsizeL2);
37
38 moduleParamList->addParameter(TrackFindingCDC::prefixed(prefix, "vROIsizeL1"), m_param_vROIsizeL1,
39 "v direction ROI size on L1. Data type: short", m_param_vROIsizeL1);
40
41 moduleParamList->addParameter(TrackFindingCDC::prefixed(prefix, "vROIsizeL2"), m_param_vROIsizeL2,
42 "v direction ROI size on L2. Data type: short", m_param_vROIsizeL2);
43
44}
std::string m_param_ROIsStoreArrayName
name of the PXDIntercept StoreArray
void addParameter(const std::string &name, T &paramVariable, const std::string &description, const T &defaultValue)
Adds a new parameter to the module list.

◆ getDescription() [1/2]

virtual std::string getDescription ( )
inlinevirtualinherited

Brief description of the purpose of the concrete findlet.

Definition at line 60 of file Findlet.h.

61 {
62 return "(no description)";
63 }

◆ getDescription() [2/2]

virtual std::string getDescription ( )
inlinevirtualinherited

Brief description of the purpose of the concrete findlet.

Definition at line 60 of file Findlet.h.

61 {
62 return "(no description)";
63 }

◆ getNProcessingSignalListener()

int getNProcessingSignalListener ( )
protectedinherited

Get the number of currently registered listeners.

Definition at line 56 of file CompositeProcessingSignalListener.cc.

61{
63}

◆ initialize()

void initialize ( )
overridevirtual

◆ terminate()

void terminate ( )
overrideinherited

Receive and dispatch Signal for termination of the event processing.

Definition at line 42 of file CompositeProcessingSignalListener.cc.

48{
50 psl->terminate();
51 }
53}
void terminate() override
Receive and dispatch Signal for termination of the event processing.
virtual void terminate()
Receive Signal for termination of the event processing.

Member Data Documentation

◆ m_initialized

bool m_initialized
privateinherited

Flag to keep track whether initialization happened before.

Definition at line 52 of file ProcessingSignalListener.h.

◆ m_initializedAs

std::string m_initializedAs
privateinherited

Name of the type during initialisation.

Definition at line 58 of file ProcessingSignalListener.h.

◆ m_param_ROIsStoreArrayName

std::string m_param_ROIsStoreArrayName = "DATCONFPGAROIs"
private

name of the PXDIntercept StoreArray

Definition at line 49 of file ROICalculator.h.

◆ m_param_uROIsizeL1

short m_param_uROIsizeL1 = 40
private

ROI size in u direction on L1.

Definition at line 54 of file ROICalculator.h.

◆ m_param_uROIsizeL2

short m_param_uROIsizeL2 = 40
private

ROI size in u direction on L2.

Definition at line 56 of file ROICalculator.h.

◆ m_param_vROIsizeL1

short m_param_vROIsizeL1 = 40
private

ROI size in v direction on L1.

Definition at line 58 of file ROICalculator.h.

◆ m_param_vROIsizeL2

short m_param_vROIsizeL2 = 40
private

ROI size in v direction on L2.

Definition at line 60 of file ROICalculator.h.

◆ m_storeDATCONROIs

StoreArray<ROIid> m_storeDATCONROIs
private

PXDIntercept StoreArray.

Definition at line 51 of file ROICalculator.h.

◆ m_subordinaryProcessingSignalListeners

std::vector<ProcessingSignalListener*> m_subordinaryProcessingSignalListeners
privateinherited

References to subordinary signal processing listener contained in this findlet.

Definition at line 60 of file CompositeProcessingSignalListener.h.

◆ m_terminated

bool m_terminated
privateinherited

Flag to keep track whether termination happened before.

Definition at line 55 of file ProcessingSignalListener.h.


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