Belle II Software development
AxialTrackCreatorHitHough Class Referenceabstract

Generates axial tracks from hit using the special leaf processing inspired by the legendre algorithm. More...

#include <AxialTrackCreatorHitHough.h>

Inheritance diagram for AxialTrackCreatorHitHough:
Findlet< const TrackingUtilities::CDCWireHit *const, TrackingUtilities::CDCTrack > 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

std::string getDescription () final
 Short description of the findlet.
 
void exposeParameters (ModuleParamList *moduleParamList, const std::string &prefix) final
 Expose the parameters to a module.
 
void initialize () final
 Initialize the findlet before event processing.
 
void apply (const std::vector< const TrackingUtilities::CDCWireHit * > &axialWireHits, std::vector< TrackingUtilities::CDCTrack > &tracks) final
 Generates the tracks from the given segments into the output argument.
 
void terminate () final
 Cleanup the findlet after event processing.
 
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.
 

Static Public Member Functions

static std::vector< float > getDefaultCurvBounds (std::array< float, 2 > curvSpan, int granularityLevel)
 Get a series of parameters to be set for each pass over the rough hough space.
 

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 = TrackingUtilities::Findlet<const TrackingUtilities::CDCWireHit* const, TrackingUtilities::CDCTrack>
 Type of the base class.
 
using SimpleRLTaggedWireHitPhi0CurvHough
 Type of the hough space tree search.
 

Private Attributes

const double m_curlCurv = 0.018
 Curvature below which particles from IP do not leave the CDC.
 
int m_param_granularityLevel = 12
 Parameter: Level of divisions in the hough space.
 
int m_param_sectorLevelSkip = 2
 Parameter: Number of levels to be skipped in the hough space on the first level to form sectors.
 
std::vector< float > m_param_curvBounds {{ -0.02, 0.14}}
 Parameter: hough bounds.
 
int m_param_discretePhi0Width = 19
 Parameter: Width of the phi0 bins at the highest level of the hough space.
 
int m_param_discretePhi0Overlap = 5
 Parameter: Overlap of the phi0 bins at the highest level of the hough space.
 
int m_param_discreteCurvWidth = 1
 Parameter: Width of the curvature bins at the highest level of the hough space.
 
int m_param_discreteCurvOverlap = -1
 Parameter: Overlap of the curvature bins at the highest level of the hough space.
 
std::vector< TrackingUtilities::ParameterVariantMap > m_param_relaxationSchedule
 Parameter: Relaxation schedule for the leaf processor in the hough tree.
 
std::unique_ptr< SimpleRLTaggedWireHitPhi0CurvHoughm_houghTree
 The hough space tree search.
 
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.
 

Static Private Attributes

static const int c_phi0Divisions = 2
 Fixed parameter: Number of divisions in the phi0 direction.
 
static const int c_curvDivisions = 2
 Fixed parameter: Number of divisions in the curv direction.
 

Detailed Description

Generates axial tracks from hit using the special leaf processing inspired by the legendre algorithm.

Definition at line 35 of file AxialTrackCreatorHitHough.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.

◆ SimpleRLTaggedWireHitPhi0CurvHough

Initial value:
SimpleRLTaggedWireHitHoughTree<InPhi0CurvBox, c_phi0Divisions, c_curvDivisions>

Type of the hough space tree search.

Definition at line 101 of file AxialTrackCreatorHitHough.h.

◆ Super

Type of the base class.

Definition at line 40 of file AxialTrackCreatorHitHough.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.

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< const TrackingUtilities::CDCWireHit * > & axialWireHits,
std::vector< TrackingUtilities::CDCTrack > & tracks )
final

Generates the tracks from the given segments into the output argument.

Definition at line 150 of file AxialTrackCreatorHitHough.cc.

152{
153 // Reset the mask flag and select only the untaken hits
154 std::vector<const CDCWireHit*> unusedAxialWireHits;
155 for (const CDCWireHit* wireHit : axialWireHits) {
156 (*wireHit)->setMaskedFlag(false);
157 if ((*wireHit)->hasTakenFlag()) continue;
158 unusedAxialWireHits.push_back(wireHit);
159 }
160
161 // Setup the level processor and obtain its parameter list to be set.
162 using Node = typename SimpleRLTaggedWireHitPhi0CurvHough::Node;
164 AxialLegendreLeafProcessor<Node> leafProcessor(maxTreeLevel);
165 leafProcessor.setAxialWireHits(axialWireHits);
166 ModuleParamList moduleParamList;
167 const std::string prefix = "";
168 leafProcessor.exposeParameters(&moduleParamList, prefix);
169
170 // Find tracks with increasingly relaxed conditions in the hough grid
171 m_houghTree->seed(std::move(unusedAxialWireHits));
172 for (const ParameterVariantMap& passParameters : m_param_relaxationSchedule) {
173 AssignParameterVisitor::update(&moduleParamList, passParameters);
174 leafProcessor.beginWalk();
175 m_houghTree->findUsing(leafProcessor);
176 }
177 m_houghTree->fell();
178
179 // Write out tracks as return value
180 const std::vector<CDCTrack>& foundTracks = leafProcessor.getTracks();
181 tracks.insert(tracks.end(), foundTracks.begin(), foundTracks.end());
182}
std::unique_ptr< SimpleRLTaggedWireHitPhi0CurvHough > m_houghTree
The hough space tree search.
int m_param_sectorLevelSkip
Parameter: Number of levels to be skipped in the hough space on the first level to form sectors.
std::vector< TrackingUtilities::ParameterVariantMap > m_param_relaxationSchedule
Parameter: Relaxation schedule for the leaf processor in the hough tree.
int m_param_granularityLevel
Parameter: Level of divisions in the hough space.
static void update(ModuleParamList *moduleParamList, const std::map< std::string, boost::variant< T... > > &valuesByName)
Transfer all the parameters from the map boost:variant values to the module parameter list.

◆ beginEvent()

void beginEvent ( )
overridevirtualinherited

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

Reimplemented from ProcessingSignalListener.

Reimplemented in DATCONFPGAFindlet, SpacePointTagger< AResult, ACluster >, SpacePointTagger< Belle2::CKFToPXDResult, Belle2::PXDCluster >, SpacePointTagger< Belle2::CKFToSVDResult, Belle2::SVDCluster >, MCSymmetric< BaseAxialSegmentPairFilter >, MCSymmetric< BaseAxialSegmentPairFilter >, MCSymmetric< BaseFacetFilter >, MCSymmetric< BaseFacetFilter >, MCSymmetric< BaseFacetRelationFilter >, MCSymmetric< BaseFacetRelationFilter >, MCSymmetric< BaseSegmentPairFilter >, MCSymmetric< BaseSegmentPairFilter >, MCSymmetric< BaseSegmentPairRelationFilter >, MCSymmetric< BaseSegmentPairRelationFilter >, MCSymmetric< BaseSegmentRelationFilter >, MCSymmetric< BaseSegmentRelationFilter >, MCSymmetric< BaseSegmentTripleFilter >, MCSymmetric< BaseSegmentTripleFilter >, MCSymmetric< BaseSegmentTripleRelationFilter >, MCSymmetric< BaseSegmentTripleRelationFilter >, MCSymmetric< BaseTrackRelationFilter >, MCSymmetric< BaseTrackRelationFilter >, MonopoleStereoHitFinder, MonopoleStereoHitFinderQuadratic, SegmentCreatorMCTruth, SegmentFinderFacetAutomaton, SegmentTrackCombiner, SegmentTrackTruthVarSet, StereoHitFinder, StereoHitTruthVarSet, TrackFinderAutomaton, TrackFinderSegmentPairAutomaton, TrackFinderSegmentTripleAutomaton, TruthAxialSegmentPairVarSet, TruthSegmentVarSet, TruthTrackVarSet, WireHitMCMultiLoopBlocker, FindletStoreArrayInput< TWrappedFindlet >, SharingHitsMatcher< ACollectorItem, ACollectionItem >, SharingHitsMatcher< Belle2::TrackingUtilities::CDCTrack, Belle2::TrackingUtilities::CDCSegment2D >, StoreVectorSwapper< IOType, a_alwaysWrite >, StoreVectorSwapper< Belle2::TrackingUtilities::CDCFacet >, StoreVectorSwapper< Belle2::TrackingUtilities::CDCSegment2D >, StoreVectorSwapper< Belle2::TrackingUtilities::CDCSegmentPair >, StoreVectorSwapper< Belle2::TrackingUtilities::CDCSegmentTriple >, StoreVectorSwapper< Belle2::TrackingUtilities::CDCTrack >, StoreVectorSwapper< Belle2::TrackingUtilities::CDCWireHit, true >, RecoTrackStorer, ROIFinder, and SVDHoughTracking.

Definition at line 31 of file CompositeProcessingSignalListener.cc.

32{
35 psl->beginEvent();
36 }
37}
virtual void beginEvent()
Receive signal for the start of a new event.
ProcessingSignalListener()
Allow default construction.

◆ beginRun()

void beginRun ( )
overridevirtualinherited

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

Reimplemented from ProcessingSignalListener.

Reimplemented in DATCONSVDClusterizer, LayerPXDRelationFilter< AFilter, APrefilter >, LayerPXDRelationFilter< TrackingUtilities::ChooseableFilter< PXDPairFilterFactory > >, LayerPXDRelationFilter< TrackingUtilities::ChooseableFilter< PXDPairFilterFactory > >, LayerSVDRelationFilter< AFilter, APrefilter >, LayerSVDRelationFilter< TrackingUtilities::ChooseableFilter< SVDPairFilterFactory > >, LayerSVDRelationFilter< TrackingUtilities::ChooseableFilter< SVDPairFilterFactory > >, SectorMapBasedSVDPairFilter, SimplePXDStateFilter, SimpleSVDStateFilter, CutsFromDBWireHitFilter, WireHitCreator, MVA< Filter< AVarSet::Object > >, MVA< Filter< typename AVarSet::Object > >, MVA< Filter< typename AVarSet::Object > >, FourHitFilter, LayerRelationFilter< AFilter >, LayerRelationFilter< TrackingUtilities::ChooseableFilter< RelationFilterFactory > >, LayerRelationFilter< TrackingUtilities::ChooseableFilter< RelationFilterFactory > >, QualityIndicatorFilter, RecoTrackStorer, ROIFinder, SpacePointLoaderAndPreparer, ThreeHitFilter, TrackCandidateResultRefiner, TwoHitVirtualIPFilter, and TwoHitVirtualIPQIFilter.

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 )
finalvirtual

Expose the parameters to a module.

Reimplemented from CompositeProcessingSignalListener.

Definition at line 63 of file AxialTrackCreatorHitHough.cc.

65{
66 // Parameters for the hough space
67 moduleParamList->addParameter(prefixed(prefix, "granularityLevel"),
69 "Level of divisions in the hough space.",
71
72 moduleParamList->addParameter(prefixed(prefix, "sectorLevelSkip"),
74 "Number of levels to be skipped in the hough "
75 "space on the first level to form sectors",
77
78 moduleParamList->addParameter(prefixed(prefix, "curvBounds"),
80 "Curvature bounds of the hough space. Either 2 or all discrete bounds",
82
83 moduleParamList->addParameter(prefixed(prefix, "discretePhi0Width"),
85 "Width of the phi0 bins at the lowest level of the hough space.",
87
88 moduleParamList->addParameter(prefixed(prefix, "discretePhi0Overlap"),
90 "Overlap of the phi0 bins at the lowest level of the hough space.",
92
93 moduleParamList->addParameter(prefixed(prefix, "discreteCurvWidth"),
95 "Width of the curvature bins at the lowest level of the hough space.",
97
98 moduleParamList->addParameter(prefixed(prefix, "discreteCurvOverlap"),
100 "Overlap of the curvature bins at the lowest level of the hough space.",
102
103 // Relaxation schedule
104 moduleParamList->addParameter(prefixed(prefix, "relaxationSchedule"),
106 "Relaxation schedule for the leaf processor in the hough tree. "
107 "For content of the individual parameter maps consider the parameters of the "
108 "AxialLegendreLeafProcessor",
110
111}
int m_param_discretePhi0Width
Parameter: Width of the phi0 bins at the highest level of the hough space.
std::vector< float > m_param_curvBounds
Parameter: hough bounds.
int m_param_discreteCurvOverlap
Parameter: Overlap of the curvature bins at the highest level of the hough space.
int m_param_discreteCurvWidth
Parameter: Width of the curvature bins at the highest level of the hough space.
int m_param_discretePhi0Overlap
Parameter: Overlap of the phi0 bins at the highest level of the hough space.
void addParameter(const std::string &name, T &paramVariable, const std::string &description, const T &defaultValue)
Adds a new parameter to the module list.

◆ getDefaultCurvBounds()

std::vector< float > getDefaultCurvBounds ( std::array< float, 2 > curvSpan,
int granularityLevel )
static

Get a series of parameters to be set for each pass over the rough hough space.

Definition at line 191 of file AxialTrackCreatorHitHough.cc.

192{
193 using BinSpan = std::array<float, 2>;
194 using BinSpans = std::vector<BinSpan>;
195 std::vector<BinSpans> binSpansByLevel(granularityLevel + 1);
196 binSpansByLevel[0].push_back(BinSpan({curvSpan[0], curvSpan[1]}));
197
198 for (int level = 1; level <= granularityLevel; ++level) {
199 for (const BinSpan& binSpan : binSpansByLevel[level - 1]) {
200 const float subBinWidth = std::fabs(binSpan[1] - binSpan[0]) / 2;
201 const float middle = binSpan[0] + (binSpan[1] - binSpan[0]) / 2.0;
202
203 // Expanding bins somewhat to have a overlap
204 // Assuming granularity level = 12
205 // For level 6 to 7 only expand 1 / 4, for higher levels expand 1 / 8.
206 // Never expand for curvatures lower than 0.005
207 // (copied from the Legendre method. Works well, but some experimentation
208 // needs to be made to know why)
209 const float extension = [&]() {
210 if ((level + 7 <= granularityLevel)
211 // or (std::fabs(middle) <= 0.007)
212 or (std::fabs(middle) <= 0.005)) {
213 return 0.0;
214 } else if (level + 5 < granularityLevel) {
215 return subBinWidth / 4.0;
216 } else {
217 return subBinWidth / 8.0;
218 }
219 }();
220
221 const float lower1 = binSpan[0] - extension;
222 const float upper1 = middle + extension;
223
224 const float lower2 = middle - extension;
225 const float upper2 = binSpan[1] + extension;
226
227 binSpansByLevel[level].push_back({lower1, upper1});
228 binSpansByLevel[level].push_back({lower2, upper2});
229 }
230 }
231
232 // Return highest level as prepared bin bounds.
233 std::vector<float> result;
234
235 for (BinSpan& binSpan : binSpansByLevel[granularityLevel]) {
236 result.push_back(binSpan[0]);
237 result.push_back(binSpan[1]);
238 }
239 return result;
240}

◆ getDescription()

std::string getDescription ( )
finalvirtual

Short description of the findlet.

Reimplemented from Findlet< const TrackingUtilities::CDCWireHit *const, TrackingUtilities::CDCTrack >.

Definition at line 58 of file AxialTrackCreatorHitHough.cc.

59{
60 return "Generates axial tracks from hits using several increasingly relaxed hough space search over phi0 and curvature.";
61}

◆ getNProcessingSignalListener()

int getNProcessingSignalListener ( )
protectedinherited

Get the number of currently registered listeners.

Definition at line 60 of file CompositeProcessingSignalListener.cc.

61{
63}

◆ initialize()

void initialize ( )
finalvirtual

Initialize the findlet before event processing.

Reimplemented from ProcessingSignalListener.

Definition at line 113 of file AxialTrackCreatorHitHough.cc.

114{
116
117 // Construct the hough space
118 const long nPhi0Bins = std::pow(c_phi0Divisions, m_param_granularityLevel);
119 const Phi0BinsSpec phi0BinsSpec(nPhi0Bins,
122
123 if (m_param_curvBounds.size() == 2) {
124 // If parameters are unchanged use the legendre default binning
125 if (m_param_discreteCurvOverlap == -1) {
127 std::array<float, 2> curvSpan({m_param_curvBounds[0], m_param_curvBounds[1]});
129 } else {
130 std::array<double, 2> curvBounds{{m_param_curvBounds.front(), m_param_curvBounds.back()}};
131 const long nCurvBins = std::pow(c_curvDivisions, m_param_granularityLevel);
132 const CurvBinsSpec curvBinsSpec(curvBounds.front(),
133 curvBounds.back(),
134 nCurvBins,
137 m_param_curvBounds = curvBinsSpec.constructArray();
138 }
139 }
140
141 // Construct hough tree
143 m_houghTree = std::make_unique<SimpleRLTaggedWireHitPhi0CurvHough>(maxTreeLevel, m_curlCurv);
144 m_houghTree->setSectorLevelSkip(m_param_sectorLevelSkip);
145 m_houghTree->assignArray<DiscretePhi0>(phi0BinsSpec.constructArray(), phi0BinsSpec.getNOverlap());
147 m_houghTree->initialize();
148}
const double m_curlCurv
Curvature below which particles from IP do not leave the CDC.
static const int c_curvDivisions
Fixed parameter: Number of divisions in the curv direction.
static std::vector< float > getDefaultCurvBounds(std::array< float, 2 > curvSpan, int granularityLevel)
Get a series of parameters to be set for each pass over the rough hough space.
static const int c_phi0Divisions
Fixed parameter: Number of divisions in the phi0 direction.
DiscreteCurv::Array constructArray() const
Construct the array of discrete curve positions.
Definition CurvRep.h:40
DiscretePhi0::Array constructArray() const
Construct the array of discrete phi0 positions.
Definition Phi0Rep.cc:24
int getNOverlap() const
Getter for the overlap in discrete number of positions.
Definition Phi0Rep.h:47

◆ terminate()

void terminate ( )
finalvirtual

Cleanup the findlet after event processing.

Reimplemented from ProcessingSignalListener.

Definition at line 184 of file AxialTrackCreatorHitHough.cc.

Member Data Documentation

◆ c_curvDivisions

const int c_curvDivisions = 2
staticprivate

Fixed parameter: Number of divisions in the curv direction.

Definition at line 97 of file AxialTrackCreatorHitHough.h.

◆ c_phi0Divisions

const int c_phi0Divisions = 2
staticprivate

Fixed parameter: Number of divisions in the phi0 direction.

Definition at line 94 of file AxialTrackCreatorHitHough.h.

◆ m_curlCurv

const double m_curlCurv = 0.018
private

Curvature below which particles from IP do not leave the CDC.

Definition at line 65 of file AxialTrackCreatorHitHough.h.

◆ m_houghTree

std::unique_ptr<SimpleRLTaggedWireHitPhi0CurvHough> m_houghTree
private

The hough space tree search.

Definition at line 105 of file AxialTrackCreatorHitHough.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_curvBounds

std::vector<float> m_param_curvBounds {{ -0.02, 0.14}}
private

Parameter: hough bounds.

Definition at line 76 of file AxialTrackCreatorHitHough.h.

76{{ -0.02, 0.14}};

◆ m_param_discreteCurvOverlap

int m_param_discreteCurvOverlap = -1
private

Parameter: Overlap of the curvature bins at the highest level of the hough space.

Definition at line 88 of file AxialTrackCreatorHitHough.h.

◆ m_param_discreteCurvWidth

int m_param_discreteCurvWidth = 1
private

Parameter: Width of the curvature bins at the highest level of the hough space.

Definition at line 85 of file AxialTrackCreatorHitHough.h.

◆ m_param_discretePhi0Overlap

int m_param_discretePhi0Overlap = 5
private

Parameter: Overlap of the phi0 bins at the highest level of the hough space.

Definition at line 82 of file AxialTrackCreatorHitHough.h.

◆ m_param_discretePhi0Width

int m_param_discretePhi0Width = 19
private

Parameter: Width of the phi0 bins at the highest level of the hough space.

Definition at line 79 of file AxialTrackCreatorHitHough.h.

◆ m_param_granularityLevel

int m_param_granularityLevel = 12
private

Parameter: Level of divisions in the hough space.

Definition at line 70 of file AxialTrackCreatorHitHough.h.

◆ m_param_relaxationSchedule

std::vector<TrackingUtilities::ParameterVariantMap> m_param_relaxationSchedule
private

Parameter: Relaxation schedule for the leaf processor in the hough tree.

Definition at line 91 of file AxialTrackCreatorHitHough.h.

◆ m_param_sectorLevelSkip

int m_param_sectorLevelSkip = 2
private

Parameter: Number of levels to be skipped in the hough space on the first level to form sectors.

Definition at line 73 of file AxialTrackCreatorHitHough.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 = 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: