Belle II Software development
ToPXDExtrapolator Class Referenceabstract

Findlet to extrapolate found tracks to the PXD sensors and calculate intercepts. More...

#include <ToPXDExtrapolator.h>

Inheritance diagram for ToPXDExtrapolator:
Findlet< const std::pair< double, double >, const std::pair< double, double >, std::pair< VxdID, long >, std::pair< VxdID, 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

 ToPXDExtrapolator ()
 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< double, double > > &uTracks, const std::vector< std::pair< double, double > > &vTracks, std::vector< std::pair< VxdID, long > > &uExtrapolations, 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 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< double, double >, const std::pair< double, double >, std::pair< VxdID, long >, std::pair< VxdID, long > >
 Parent class.
 

Private Member Functions

void extrapolateUTrack (const double trackPhi, const double trackRadius, const uint layer, std::vector< std::pair< VxdID, long > > &uExtrapolations)
 extrapolate the u-track to the two PXD layers
 
void extrapolateVTrack (const long tanLambda, const uint layer, std::vector< std::pair< VxdID, long > > &vExtrapolations)
 extrapolate the v-track to the two PXD layers
 

Private Attributes

double m_param_phiCutL1 = M_PI / 3.
 Create ROIs in phi only if the absolute difference in phi between sensor and track is smaller than this value on L1.
 
double m_param_phiCutL2 = M_PI / 4.
 Create ROIs in phi only if the absolute difference in phi between sensor and track is smaller than this value on L2.
 
bool m_param_createPXDIntercepts = false
 Create PXDIntercepts?
 
std::string m_param_PXDInterceptStoreArrayName = "DATCONFPGAPXDIntercepts"
 name of the PXDIntercept StoreArray
 
StoreArray< PXDInterceptm_pxdIntercepts
 PXDIntercept StoreArray.
 
const long centerZShiftLayer1 [2] = {36825500, -8825500}
 shift of the sensor center along z for L1, in µm for use of mhp_z > (length/-2)+shiftZ && mhp_z < (length/2)+shiftZ
 
const long centerZShiftLayer2 [2] = {50145500, -12145500}
 shift of the sensor center along z for L2, in µm for use of mhp_z > (length/-2)+shiftZ && mhp_z < (length/2)+shiftZ
 
const long layerRadius [2] = {14285, 22121}
 radius of L1 and L2, in µm
 
const long sensorLength [2] = {44800000, 61440000}
 length of the modules flr L1 and L2, in µm
 
const long sensorMinY = -3600000
 minimum y coordinate for a ladder in the position of ladder 1 (perpendicular to the x-axis), in µm
 
const long sensorMaxY = 8900000
 maximum y coordinate for a ladder in the position of ladder 1 (perpendicular to the x-axis), in µm
 
const long shiftY = (sensorMaxY + sensorMinY) / 2
 shift of the sensor center in r-phi
 
const uint laddersPerLayer [2] = {8, 12}
 number of ladders per layer
 
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 to extrapolate found tracks to the PXD sensors and calculate intercepts.

Definition at line 29 of file ToPXDExtrapolator.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 std::pair<double, double>, const std::pair<double, double>, std::pair<VxdID, long>, std::pair<VxdID, long> >
private

Parent class.

Definition at line 32 of file ToPXDExtrapolator.h.

◆ ToVector

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

Short hand for ToRangeImpl.

Definition at line 49 of file Findlet.h.

Constructor & Destructor Documentation

◆ ToPXDExtrapolator()

Find intercepts in the 2D Hough space.

Definition at line 22 of file ToPXDExtrapolator.cc.

22 : Super()
23{
24}
TrackFindingCDC::Findlet< const std::pair< double, double >, const std::pair< double, double >, std::pair< VxdID, long >, 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 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< double, double > > &  uTracks,
const std::vector< std::pair< double, double > > &  vTracks,
std::vector< std::pair< VxdID, long > > &  uExtrapolations,
std::vector< std::pair< VxdID, long > > &  vExtrapolations 
)
override

Load in the prepared hits and create tracks for extrapolation to PXD.

Definition at line 56 of file ToPXDExtrapolator.cc.

59{
60 VxdID sensorID;
61
62 for (auto& uTrack : uTracks) {
63 const double trackPhi = uTrack.first;
64 const double trackRadius = uTrack.second;
65
66 extrapolateUTrack(trackPhi, trackRadius, 1, uExtrapolations);
67 extrapolateUTrack(trackPhi, trackRadius, 2, uExtrapolations);
68 }
69
70 for (auto& vTrack : vTracks) {
71 const double& trackLambda = -vTrack.first;
72 const long tanLambda = convertFloatToInt(tan(trackLambda), 3);
73
74 extrapolateVTrack(tanLambda, 1, vExtrapolations);
75 extrapolateVTrack(tanLambda, 2, vExtrapolations);
76 }
77
79 for (auto& uExtrapolatedHit : uExtrapolations) {
80 const VxdID& uHitSensorID = uExtrapolatedHit.first;
81
82 for (auto& vExtrapolatedHit : vExtrapolations) {
83 const VxdID& vHitSensorID = vExtrapolatedHit.first;
84
85 if (uHitSensorID != vHitSensorID) {
86 continue;
87 }
88
89 // convert back from nm to cm
90 double uCoordinateInCM = uExtrapolatedHit.second * Unit::nm;
91 double vCoordinateInCM = vExtrapolatedHit.second * Unit::nm;
92
93 PXDIntercept intercept;
94 intercept.setCoorU(uCoordinateInCM);
95 intercept.setCoorV(vCoordinateInCM);
96 intercept.setVxdID(uHitSensorID);
97 m_pxdIntercepts.appendNew(intercept);
98 }
99 }
100 }
101
102 B2DEBUG(29, "uExtrapolations.size: " << uExtrapolations.size() << " vExtrapolations.size: " << vExtrapolations.size());
103}
PXDIntercept stores the U,V coordinates and uncertainties of the intersection of a track with an PXD ...
Definition: PXDIntercept.h:22
StoreArray< PXDIntercept > m_pxdIntercepts
PXDIntercept StoreArray.
void extrapolateUTrack(const double trackPhi, const double trackRadius, const uint layer, std::vector< std::pair< VxdID, long > > &uExtrapolations)
extrapolate the u-track to the two PXD layers
void extrapolateVTrack(const long tanLambda, const uint layer, std::vector< std::pair< VxdID, long > > &vExtrapolations)
extrapolate the v-track to the two PXD layers
bool m_param_createPXDIntercepts
Create PXDIntercepts?
static const double nm
[nanometers]
Definition: Unit.h:72
void setVxdID(VxdID::baseType user_vxdID)
set the sensor ID
Definition: VXDIntercept.h:77
void setCoorU(double user_coorU)
set the U coordinate of the intercept
Definition: VXDIntercept.h:70
void setCoorV(double user_coorV)
set the V coordinate of the intercept
Definition: VXDIntercept.h:71
Class to uniquely identify a any structure of the PXD and SVD.
Definition: VxdID.h:33
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 std::pair< double, double >, const std::pair< double, double >, std::pair< VxdID, long >, std::pair< VxdID, long > >.

Definition at line 26 of file ToPXDExtrapolator.cc.

27{
28 Super::exposeParameters(moduleParamList, prefix);
29
30 moduleParamList->addParameter(TrackFindingCDC::prefixed(prefix, "extrapolationPhiCutL1"), m_param_phiCutL1,
31 "Only extrapolate to PXD sensors within this value away from the track phi value, L1.",
33
34 moduleParamList->addParameter(TrackFindingCDC::prefixed(prefix, "extrapolationPhiCutL2"), m_param_phiCutL2,
35 "Only extrapolate to PXD sensors within this value away from the track phi value, L2.",
37
38 moduleParamList->addParameter(TrackFindingCDC::prefixed(prefix, "createPXDIntercepts"), m_param_createPXDIntercepts,
39 "Store PXDIntercepts to StoreArray?", m_param_createPXDIntercepts);
40
41 moduleParamList->addParameter(TrackFindingCDC::prefixed(prefix, "storePXDInterceptsName"), m_param_PXDInterceptStoreArrayName,
42 "Name of the PXDIntercepts StoreArray?", m_param_PXDInterceptStoreArrayName);
43
44}
double m_param_phiCutL1
Create ROIs in phi only if the absolute difference in phi between sensor and track is smaller than th...
double m_param_phiCutL2
Create ROIs in phi only if the absolute difference in phi between sensor and track is smaller than th...
std::string m_param_PXDInterceptStoreArrayName
name of the PXDIntercept StoreArray
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.

◆ extrapolateUTrack()

void extrapolateUTrack ( const double  trackPhi,
const double  trackRadius,
const uint  layer,
std::vector< std::pair< VxdID, long > > &  uExtrapolations 
)
private

extrapolate the u-track to the two PXD layers

Parameters
trackPhiazimtutal angle of the track
trackRadiusradius of the track
layerPXD layer to extrapolate to
uExtrapolationsvector containing the extrapolated positions in u

Definition at line 105 of file ToPXDExtrapolator.cc.

107{
108 long sensorPerpRadius = layerRadius[layer - 1];
109 for (uint ladder = 1; ladder <= laddersPerLayer[layer - 1]; ladder++) {
110 double sensorPhi = M_PI / (laddersPerLayer[layer - 1] / 2) * (ladder - 1);
111 if (sensorPhi > M_PI) {
112 sensorPhi -= 2. * M_PI;
113 }
114
115 double angleDiff = trackPhi - sensorPhi;
116 if (angleDiff > M_PI) {
117 angleDiff -= 2. * M_PI;
118 }
119 if (angleDiff < -M_PI) {
120 angleDiff += 2. * M_PI;
121 }
122 if (fabs(angleDiff) >= (layer == 1 ? m_param_phiCutL1 : m_param_phiCutL2)) continue;
123
124 // additional factor of 10^3, as the sine and cosine values are also multiplied by 1000
125 long trackRadiusSquared = convertFloatToInt(trackRadius, 3) * convertFloatToInt(trackRadius, 3);
126 // additional factor of 10^3, as the sine and cosine values are also multiplied by 1000
127 long b = convertFloatToInt(sensorPerpRadius, 3) - trackRadius * convertFloatToInt(sin(angleDiff), 3);
128 double y = -trackRadius * convertFloatToInt(cos(angleDiff), 3) + sqrt(trackRadiusSquared - b * b);
129
130 if (y >= sensorMinY && y <= sensorMaxY) {
131 long localUPosition = y - shiftY;
132
133 // store extrapolated hit for first sensor in ladder
134 VxdID sensorID = VxdID(layer, ladder, 1);
135 uExtrapolations.emplace_back(sensorID, localUPosition);
136
137 // store extrapolated hit for second sensor in ladder
138 sensorID = VxdID(layer, ladder, 2);
139 uExtrapolations.emplace_back(sensorID, localUPosition);
140 }
141 }
142}
const long layerRadius[2]
radius of L1 and L2, in µm
const long sensorMinY
minimum y coordinate for a ladder in the position of ladder 1 (perpendicular to the x-axis),...
const long sensorMaxY
maximum y coordinate for a ladder in the position of ladder 1 (perpendicular to the x-axis),...
const long shiftY
shift of the sensor center in r-phi
const uint laddersPerLayer[2]
number of ladders per layer
double sqrt(double a)
sqrt for double
Definition: beamHelpers.h:28

◆ extrapolateVTrack()

void extrapolateVTrack ( const long  tanLambda,
const uint  layer,
std::vector< std::pair< VxdID, long > > &  vExtrapolations 
)
private

extrapolate the v-track to the two PXD layers

Parameters
tanLambdaazimtutal angle of the track
layerPXD layer to extrapolate to
vExtrapolationsvector containing the extrapolated positions in v

Definition at line 144 of file ToPXDExtrapolator.cc.

146{
147 for (uint sensor = 1; sensor <= 2; sensor++) {
148 const long& sensorPerpRadius = layerRadius[layer - 1];
149 const long& lengthOfSensor = sensorLength[layer - 1];
150 const long& shiftZ = (layer == 1 ? centerZShiftLayer1[sensor - 1] : centerZShiftLayer2[sensor - 1]);
151 // sensorPerpRadius is in µm, inverseTanTheta is multiplied by 1000, so this is basically nm
152 const long globalz = sensorPerpRadius * tanLambda;
153 // shift globalz into local coordinate system by subtracting the z-shift of this sensor
154 const long localVPosition = globalz - shiftZ;
155 if (localVPosition >= -lengthOfSensor / 2. && localVPosition <= lengthOfSensor / 2.) {
156
157 for (uint ladder = 1; ladder <= laddersPerLayer[layer - 1]; ladder++) {
158 VxdID sensorID = VxdID(layer, ladder, sensor);
159 vExtrapolations.emplace_back(sensorID, localVPosition);
160 }
161 }
162 }
163}
const long sensorLength[2]
length of the modules flr L1 and L2, in µm
const long centerZShiftLayer1[2]
shift of the sensor center along z for L1, in µm for use of mhp_z > (length/-2)+shiftZ && mhp_z < (le...
const long centerZShiftLayer2[2]
shift of the sensor center along z for L2, in µm for use of mhp_z > (length/-2)+shiftZ && mhp_z < (le...

◆ 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 46 of file ToPXDExtrapolator.cc.

47{
49
52 }
53
54}
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

◆ centerZShiftLayer1

const long centerZShiftLayer1[2] = {36825500, -8825500}
private

shift of the sensor center along z for L1, in µm for use of mhp_z > (length/-2)+shiftZ && mhp_z < (length/2)+shiftZ

Definition at line 80 of file ToPXDExtrapolator.h.

◆ centerZShiftLayer2

const long centerZShiftLayer2[2] = {50145500, -12145500}
private

shift of the sensor center along z for L2, in µm for use of mhp_z > (length/-2)+shiftZ && mhp_z < (length/2)+shiftZ

Definition at line 83 of file ToPXDExtrapolator.h.

◆ laddersPerLayer

const uint laddersPerLayer[2] = {8, 12}
private

number of ladders per layer

Definition at line 96 of file ToPXDExtrapolator.h.

◆ layerRadius

const long layerRadius[2] = {14285, 22121}
private

radius of L1 and L2, in µm

Definition at line 85 of file ToPXDExtrapolator.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_param_createPXDIntercepts

bool m_param_createPXDIntercepts = false
private

Create PXDIntercepts?

Definition at line 71 of file ToPXDExtrapolator.h.

◆ m_param_phiCutL1

double m_param_phiCutL1 = M_PI / 3.
private

Create ROIs in phi only if the absolute difference in phi between sensor and track is smaller than this value on L1.

Definition at line 66 of file ToPXDExtrapolator.h.

◆ m_param_phiCutL2

double m_param_phiCutL2 = M_PI / 4.
private

Create ROIs in phi only if the absolute difference in phi between sensor and track is smaller than this value on L2.

Definition at line 68 of file ToPXDExtrapolator.h.

◆ m_param_PXDInterceptStoreArrayName

std::string m_param_PXDInterceptStoreArrayName = "DATCONFPGAPXDIntercepts"
private

name of the PXDIntercept StoreArray

Definition at line 73 of file ToPXDExtrapolator.h.

◆ m_pxdIntercepts

StoreArray<PXDIntercept> m_pxdIntercepts
private

PXDIntercept StoreArray.

Definition at line 75 of file ToPXDExtrapolator.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.

◆ sensorLength

const long sensorLength[2] = {44800000, 61440000}
private

length of the modules flr L1 and L2, in µm

Definition at line 87 of file ToPXDExtrapolator.h.

◆ sensorMaxY

const long sensorMaxY = 8900000
private

maximum y coordinate for a ladder in the position of ladder 1 (perpendicular to the x-axis), in µm

Definition at line 91 of file ToPXDExtrapolator.h.

◆ sensorMinY

const long sensorMinY = -3600000
private

minimum y coordinate for a ladder in the position of ladder 1 (perpendicular to the x-axis), in µm

Definition at line 89 of file ToPXDExtrapolator.h.

◆ shiftY

const long shiftY = (sensorMaxY + sensorMinY) / 2
private

shift of the sensor center in r-phi

Definition at line 93 of file ToPXDExtrapolator.h.


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