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 = 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.
 
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 Typedef Documentation

◆ IOTypes

using IOTypes = std::tuple<AIOTypes...>
inherited

Types that should be served to apply on invokation.

Definition at line 30 of file Findlet.h.

◆ IOVectors

using IOVectors = std::tuple< std::vector<AIOTypes>... >
inherited

Vector types that should be served to apply on invokation.

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

using ToVector = typename ToVectorImpl<T>::Type
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.
Definition: ROICalculator.h:30

Member Function Documentation

◆ addProcessingSignalListener()

void addProcessingSignalListener ( ProcessingSignalListener psl)
protectedinherited

Register a processing signal listener to be notified.

Definition at line 55 of file CompositeProcessingSignalListener.cc.

56{
58}
std::vector< ProcessingSignalListener * > m_subordinaryProcessingSignalListeners
References to subordinary signal processing listener contained in this findlet.

◆ 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}
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
const SensorInfoBase & getSensorInfo(Belle2::VxdID id) const
Return a referecne 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.
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

◆ beginEvent()

void beginEvent ( )
overridevirtualinherited

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

Reimplemented from ProcessingSignalListener.

Reimplemented in SpacePointTagger< Belle2::CKFToPXDResult, Belle2::PXDCluster >, SpacePointTagger< Belle2::CKFToSVDResult, Belle2::SVDCluster >, BaseEventTimeExtractor< RecoTrack * >, BaseEventTimeExtractor< TrackFindingCDC::CDCWireHit & >, SharingHitsMatcher< Belle2::TrackFindingCDC::CDCTrack, Belle2::TrackFindingCDC::CDCSegment2D >, MCSymmetric< BaseAxialSegmentPairFilter >, MCSymmetric< BaseFacetFilter >, MCSymmetric< BaseFacetRelationFilter >, MCSymmetric< BaseSegmentPairFilter >, MCSymmetric< BaseSegmentPairRelationFilter >, MCSymmetric< BaseSegmentRelationFilter >, MCSymmetric< BaseSegmentTripleFilter >, MCSymmetric< BaseSegmentTripleRelationFilter >, MCSymmetric< BaseTrackRelationFilter >, StoreVectorSwapper< Belle2::TrackFindingCDC::CDCFacet >, StoreVectorSwapper< Belle2::TrackFindingCDC::CDCWireHit, true >, StoreVectorSwapper< Belle2::TrackFindingCDC::CDCSegment2D >, StoreVectorSwapper< Belle2::TrackFindingCDC::CDCTrack >, StoreVectorSwapper< Belle2::TrackFindingCDC::CDCSegmentPair >, StoreVectorSwapper< Belle2::TrackFindingCDC::CDCSegmentTriple >, RecoTrackStorer, ROIFinder, and SVDHoughTracking.

Definition at line 31 of file CompositeProcessingSignalListener.cc.

32{
35 psl->beginEvent();
36 }
37}
Interface for an algorithm part that needs to receive the module processing signals.
virtual void beginEvent()
Receive signal for the start of a new event.

◆ beginRun()

void beginRun ( )
overridevirtualinherited

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

Reimplemented from ProcessingSignalListener.

Reimplemented in LayerRelationFilter< AFilter >, FourHitFilter, QualityIndicatorFilter, ThreeHitFilter, TwoHitVirtualIPFilter, TwoHitVirtualIPQIFilter, RecoTrackStorer, ROIFinder, SpacePointLoaderAndPreparer, and TrackCandidateResultRefiner.

Definition at line 23 of file CompositeProcessingSignalListener.cc.

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

◆ endRun()

void endRun ( )
overridevirtualinherited

Receive and dispatch signal for the end of the run.

Reimplemented from ProcessingSignalListener.

Definition at line 39 of file CompositeProcessingSignalListener.cc.

40{
42 psl->endRun();
43 }
45}
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 Findlet< const std::pair< VxdID, long >, const std::pair< VxdID, long > >.

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
Definition: ROICalculator.h:49
virtual void exposeParameters(ModuleParamList *moduleParamList, const std::string &prefix)
Forward prefixed parameters of this findlet to the module parameter list.
Definition: Findlet.h:69
void addParameter(const std::string &name, T &paramVariable, const std::string &description, const T &defaultValue)
Adds a new parameter to the module list.

◆ getDescription()

virtual std::string getDescription ( )
inlinevirtualinherited

Brief description of the purpose of the concret 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 60 of file CompositeProcessingSignalListener.cc.

61{
63}

◆ initialize()

void initialize ( )
overridevirtual

Create the store arrays.

Reimplemented from ProcessingSignalListener.

Definition at line 46 of file ROICalculator.cc.

47{
49
51}
void initialize() override
Receive and dispatch signal before the start of the event processing.

◆ terminate()

void terminate ( )
overridevirtualinherited

Receive and dispatch Signal for termination of the event processing.

Reimplemented from ProcessingSignalListener.

Reimplemented in StereoHitTrackQuadTreeMatcher< Belle2::TrackFindingCDC::HyperHough >, StereoHitTrackQuadTreeMatcher< Belle2::TrackFindingCDC::QuadraticLegendre >, and StereoHitTrackQuadTreeMatcher< Belle2::TrackFindingCDC::Z0TanLambdaLegendre >.

Definition at line 47 of file CompositeProcessingSignalListener.cc.

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

Member Data Documentation

◆ m_initialized

bool m_initialized = false
privateinherited

Flag to keep track whether initialization happend 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 52 of file CompositeProcessingSignalListener.h.

◆ m_terminated

bool m_terminated = false
privateinherited

Flag to keep track whether termination happend before.

Definition at line 55 of file ProcessingSignalListener.h.


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