Belle II Software development
DATCONSVDClusterLoaderAndPreparer Class Referenceabstract

Findlet for loading SVDClusters that were created by the DATCONSVDClusterizer findlet and prepare them for usage in the FastInterceptFinder2D by calculating the conformal transformed x,y coordinates and the creating pairs of coordinates for finding track candidates in r-phi and r-z. More...

#include <DATCONSVDClusterLoaderAndPreparer.h>

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

Public Types

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

Public Member Functions

 DATCONSVDClusterLoaderAndPreparer ()
 Load clusters and prepare them for intercept finding.
 
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< SVDCluster > &uClusters, const std::vector< SVDCluster > &vClusters, std::vector< std::pair< VxdID, std::pair< long, long > > > &uHits, std::vector< std::pair< VxdID, std::pair< long, long > > > &vHits) override
 Load the SVDClusters and create two vectors containing the hits prepared for intercept finding This function takes uClusters and vClusters as distinct vectors which where created by the DATCONSVDClusterizer 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 = 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 SVDCluster, const SVDCluster, std::pair< VxdID, std::pair< long, long > >, std::pair< VxdID, std::pair< long, long > > >
 Parent class.
 

Private Attributes

uint m_param_maxClustersPerLayer = 200
 Cut value for aborting tracking if more than this number of clusters is found on one layer.
 
std::array< uint, 8 > m_nClusterPerLayer = {0}
 array containing the number of clusters per layer. If this exceeds a cut value, tracking is aborted
 
const std::array< int, 4 > m_const_SVDRadii = {38990, 80000, 104000, 135150}
 Radii of the SVD layers, in µm.
 
const std::array< int, 4 > m_const_RPhiShiftsOfLayers = { -4680, -10780, -11036, -19076}
 shift in r-phi to create windmill structure, in µm
 
const std::array< double, 4 > m_const_InitialAngle = {(342.195 - 360.) / 180. * M_PI, 8. / 180. * M_PI, -8. / 180. * M_PI, -4. / 180. * M_PI}
 phi-value of the first ladder in each layer, i.e. sensors X.1.Y, in rad
 
const std::array< double, 4 > m_const_AngleStep = {2. * M_PI / 7., M_PI / 5., M_PI / 6., M_PI / 8.}
 angle difference between two consecutive ladders, in rad
 
const std::array< double, 4 > m_const_CosSlantedAngles = {1, cos(0.207694180987), cos(0.279252680319), cos(0.368264472171)}
 cosine values of the slanted sensors
 
const std::array< int, 2 > m_const_ZShiftL3 = {92350, -32650}
 shift along z of the L3 senosrs, in µn
 
const std::array< int, 3 > m_const_ZShiftL4 = {149042, 24760, -100240}
 shift along z of the L4 senosrs, in µn
 
const std::array< int, 4 > m_const_ZShiftL5 = {233754, 110560, -14440, -139440}
 shift along z of the L5 senosrs, in µn
 
const std::array< int, 5 > m_const_ZShiftL6 = {303471, 182060, 57060, -67940, -192940}
 shift along z of the L6 senosrs, in µn
 
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 happened before.
 
bool m_terminated = false
 Flag to keep track whether termination happened before.
 
std::string m_initializedAs
 Name of the type during initialisation.
 

Detailed Description

Findlet for loading SVDClusters that were created by the DATCONSVDClusterizer findlet and prepare them for usage in the FastInterceptFinder2D by calculating the conformal transformed x,y coordinates and the creating pairs of coordinates for finding track candidates in r-phi and r-z.

Definition at line 30 of file DATCONSVDClusterLoaderAndPreparer.h.

Member Typedef Documentation

◆ IOTypes

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

Types that should be served to apply on invocation.

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 invocation.

Definition at line 53 of file Findlet.h.

◆ Super

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

Parent class.

Definition at line 34 of file DATCONSVDClusterLoaderAndPreparer.h.

◆ ToVector

using ToVector = typename ToVectorImpl<T>::Type
protectedinherited

Short hand for ToRangeImpl.

Definition at line 49 of file Findlet.h.

Constructor & Destructor Documentation

◆ DATCONSVDClusterLoaderAndPreparer()

Load clusters and prepare them for intercept finding.

Definition at line 18 of file DATCONSVDClusterLoaderAndPreparer.cc.

18 : Super()
19{
20}
TrackFindingCDC::Findlet< const SVDCluster, const SVDCluster, std::pair< VxdID, std::pair< long, long > >, std::pair< VxdID, std::pair< long, long > > > Super
Parent class.

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< SVDCluster > &  uClusters,
const std::vector< SVDCluster > &  vClusters,
std::vector< std::pair< VxdID, std::pair< long, long > > > &  uHits,
std::vector< std::pair< VxdID, std::pair< long, long > > > &  vHits 
)
override

Load the SVDClusters and create two vectors containing the hits prepared for intercept finding This function takes uClusters and vClusters as distinct vectors which where created by the DATCONSVDClusterizer findlet.

Definition at line 35 of file DATCONSVDClusterLoaderAndPreparer.cc.

38{
39 if (uClusters.size() == 0 or vClusters.size() == 0) {
40 return;
41 }
42
43 m_nClusterPerLayer.fill(0);
44
45 for (auto& cluster : uClusters) {
46 const VxdID& sensorID = cluster.getSensorID();
47 const uint& layerNumber = sensorID.getLayerNumber();
48 const uint& ladderNumber = sensorID.getLadderNumber();
49 const long localPosition = convertFloatToInt(cluster.getPosition(), 4); // convert the cluster position from cm to µm
50
51 m_nClusterPerLayer.at(layerNumber - 3)++;
52 const double rotangle = m_const_InitialAngle[layerNumber - 3] + (ladderNumber - 1) * m_const_AngleStep[layerNumber - 3];
53 const double cosRotAngle = cos(rotangle);
54 const double sinRotAngle = sin(rotangle);
55 const int sensorRadius = m_const_SVDRadii[layerNumber - 3];
56 const int ytmp = localPosition + m_const_RPhiShiftsOfLayers[layerNumber - 3];
57
58 // perform 2D rotation
59 const long x = round(sensorRadius * cosRotAngle - ytmp * sinRotAngle); // x is in µm
60 const long y = round(sensorRadius * sinRotAngle + ytmp * cosRotAngle); // y is in µm
61 const long radiusSquared = x * x + y * y; // therefore radius is in µm as well, like all other length values
62 // x or y divided by r^2 can create values very close to 0. To cope for this and still
63 // have non-zero numbers after conversion and rounding, the conversion to int is made with 10^10
64 std::pair<long, long> pos2D = std::make_pair(convertFloatToInt(2. * (double)x / (double)radiusSquared, 10),
65 convertFloatToInt(2. * (double)y / (double)radiusSquared, 10));
66 B2DEBUG(29, "x, y: " << x << " " << y << " Hough-values: " << pos2D.first << " " << pos2D.second);
67 uHits.emplace_back(std::make_pair(sensorID, pos2D));
68 }
69
70 /* First convert to absolute hits and save into a map */
71 for (auto& cluster : vClusters) {
72 const VxdID& sensorID = cluster.getSensorID();
73 const uint& layerNumber = sensorID.getLayerNumber();
74 const uint& sensorNumber = sensorID.getSensorNumber();
75 const long localPosition = convertFloatToInt(cluster.getPosition(), 4); // convert the cluster position from cm to µm
76
77 m_nClusterPerLayer.at(4 + layerNumber - 3)++;
78 const int radius = m_const_SVDRadii[layerNumber - 3];
79 int z = 0;
80 if (layerNumber == 3) {
81 z = localPosition + m_const_ZShiftL3[sensorNumber - 1];
82 } else {
83 switch (layerNumber) {
84 case 4:
85 if (sensorNumber == 1) {
86 z = localPosition * m_const_CosSlantedAngles[layerNumber - 3] + m_const_ZShiftL4[sensorNumber - 1];
87 } else {
88 z = localPosition + m_const_ZShiftL4[sensorNumber - 1];
89 }
90 break;
91 case 5:
92 if (sensorNumber == 1) {
93 z = localPosition * m_const_CosSlantedAngles[layerNumber - 3] + m_const_ZShiftL5[sensorNumber - 1];
94 } else {
95 z = localPosition + m_const_ZShiftL5[sensorNumber - 1];
96 }
97 break;
98 case 6:
99 if (sensorNumber == 1) {
100 z = localPosition * m_const_CosSlantedAngles[layerNumber - 3] + m_const_ZShiftL6[sensorNumber - 1];
101 } else {
102 z = localPosition + m_const_ZShiftL6[sensorNumber - 1];
103 }
104 break;
105 }
106 }
107 vHits.emplace_back(std::make_pair(sensorID, std::make_pair(z, radius)));
108 }
109
110 const uint* maxOfClustersPerLayer = std::max_element(m_nClusterPerLayer.begin(), m_nClusterPerLayer.end());
111 if (*maxOfClustersPerLayer > m_param_maxClustersPerLayer) {
112 B2WARNING("High occupancy in SVD, aborting FPGA-DATCON...");
113 uHits.clear();
114 vHits.clear();
115 }
116
117}
const std::array< int, 3 > m_const_ZShiftL4
shift along z of the L4 senosrs, in µn
uint m_param_maxClustersPerLayer
Cut value for aborting tracking if more than this number of clusters is found on one layer.
std::array< uint, 8 > m_nClusterPerLayer
array containing the number of clusters per layer. If this exceeds a cut value, tracking is aborted
const std::array< int, 2 > m_const_ZShiftL3
shift along z of the L3 senosrs, in µn
const std::array< double, 4 > m_const_AngleStep
angle difference between two consecutive ladders, in rad
const std::array< int, 4 > m_const_RPhiShiftsOfLayers
shift in r-phi to create windmill structure, in µm
const std::array< double, 4 > m_const_InitialAngle
phi-value of the first ladder in each layer, i.e. sensors X.1.Y, in rad
const std::array< double, 4 > m_const_CosSlantedAngles
cosine values of the slanted sensors
const std::array< int, 4 > m_const_ZShiftL5
shift along z of the L5 senosrs, in µn
const std::array< int, 5 > m_const_ZShiftL6
shift along z of the L6 senosrs, in µn
const std::array< int, 4 > m_const_SVDRadii
Radii of the SVD layers, in µm.
Class to uniquely identify a any structure of the PXD and SVD.
Definition: VxdID.h:33
baseType getSensorNumber() const
Get the sensor id.
Definition: VxdID.h:100
baseType getLadderNumber() const
Get the ladder id.
Definition: VxdID.h:98
baseType getLayerNumber() const
Get the layer id.
Definition: VxdID.h:96
long convertFloatToInt(double value, int power)
Convert float or double to long int for more similarity to the FPGA implementation.
Definition: DATCONHelpers.h:21

◆ 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 SVDCluster, const SVDCluster, std::pair< VxdID, std::pair< long, long > >, std::pair< VxdID, std::pair< long, long > > >.

Definition at line 22 of file DATCONSVDClusterLoaderAndPreparer.cc.

23{
24 Super::exposeParameters(moduleParamList, prefix);
25
26 moduleParamList->addParameter(TrackFindingCDC::prefixed(prefix, "maxClustersPerLayer"), m_param_maxClustersPerLayer,
27 "Maximum number of clusters on one layer before aborting tracking.", m_param_maxClustersPerLayer);
28}
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 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 60 of file CompositeProcessingSignalListener.cc.

61{
63}

◆ initialize()

void initialize ( )
overridevirtual

Create the store arrays.

Reimplemented from ProcessingSignalListener.

Definition at line 30 of file DATCONSVDClusterLoaderAndPreparer.cc.

31{
33}
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_const_AngleStep

const std::array<double, 4> m_const_AngleStep = {2. * M_PI / 7., M_PI / 5., M_PI / 6., M_PI / 8.}
private

angle difference between two consecutive ladders, in rad

Definition at line 69 of file DATCONSVDClusterLoaderAndPreparer.h.

◆ m_const_CosSlantedAngles

const std::array<double, 4> m_const_CosSlantedAngles = {1, cos(0.207694180987), cos(0.279252680319), cos(0.368264472171)}
private

cosine values of the slanted sensors

Definition at line 71 of file DATCONSVDClusterLoaderAndPreparer.h.

◆ m_const_InitialAngle

const std::array<double, 4> m_const_InitialAngle = {(342.195 - 360.) / 180. * M_PI, 8. / 180. * M_PI, -8. / 180. * M_PI, -4. / 180. * M_PI}
private

phi-value of the first ladder in each layer, i.e. sensors X.1.Y, in rad

Definition at line 67 of file DATCONSVDClusterLoaderAndPreparer.h.

◆ m_const_RPhiShiftsOfLayers

const std::array<int, 4> m_const_RPhiShiftsOfLayers = { -4680, -10780, -11036, -19076}
private

shift in r-phi to create windmill structure, in µm

Definition at line 65 of file DATCONSVDClusterLoaderAndPreparer.h.

◆ m_const_SVDRadii

const std::array<int, 4> m_const_SVDRadii = {38990, 80000, 104000, 135150}
private

Radii of the SVD layers, in µm.

Definition at line 63 of file DATCONSVDClusterLoaderAndPreparer.h.

◆ m_const_ZShiftL3

const std::array<int, 2> m_const_ZShiftL3 = {92350, -32650}
private

shift along z of the L3 senosrs, in µn

Definition at line 74 of file DATCONSVDClusterLoaderAndPreparer.h.

◆ m_const_ZShiftL4

const std::array<int, 3> m_const_ZShiftL4 = {149042, 24760, -100240}
private

shift along z of the L4 senosrs, in µn

Definition at line 76 of file DATCONSVDClusterLoaderAndPreparer.h.

◆ m_const_ZShiftL5

const std::array<int, 4> m_const_ZShiftL5 = {233754, 110560, -14440, -139440}
private

shift along z of the L5 senosrs, in µn

Definition at line 78 of file DATCONSVDClusterLoaderAndPreparer.h.

◆ m_const_ZShiftL6

const std::array<int, 5> m_const_ZShiftL6 = {303471, 182060, 57060, -67940, -192940}
private

shift along z of the L6 senosrs, in µn

Definition at line 80 of file DATCONSVDClusterLoaderAndPreparer.h.

◆ m_initialized

bool m_initialized = false
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_nClusterPerLayer

std::array<uint, 8> m_nClusterPerLayer = {0}
private

array containing the number of clusters per layer. If this exceeds a cut value, tracking is aborted

Definition at line 59 of file DATCONSVDClusterLoaderAndPreparer.h.

◆ m_param_maxClustersPerLayer

uint m_param_maxClustersPerLayer = 200
private

Cut value for aborting tracking if more than this number of clusters is found on one layer.

Definition at line 56 of file DATCONSVDClusterLoaderAndPreparer.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 happened before.

Definition at line 55 of file ProcessingSignalListener.h.


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