Belle II Software development
AxialTrackCreatorHitLegendre Class Referenceabstract

Generates axial tracks from hit using special leaf postprocessing. More...

#include <AxialTrackCreatorHitLegendre.h>

Inheritance diagram for AxialTrackCreatorHitLegendre:
Findlet< const TrackingUtilities::CDCWireHit *const, TrackingUtilities::CDCTrack > CompositeProcessingSignalListener ProcessingSignalListener

Public Types

enum class  EPass {
  NonCurlers ,
  NonCurlersWithIncreasingThreshold ,
  FullRange ,
  Straight
}
 Pass keys for the different sets of predefined parameters for a pass if legendre search Note: Naming copied from original location. More...
 
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

 AxialTrackCreatorHitLegendre ()
 Constructor.
 
 AxialTrackCreatorHitLegendre (EPass pass)
 Constructor from a pass key.
 
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
 Initialisation before the event processing starts.
 
void apply (const std::vector< const TrackingUtilities::CDCWireHit * > &axialWireHits, std::vector< TrackingUtilities::CDCTrack > &tracks) final
 Execute one pass over a quad tree.
 
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 = TrackingUtilities::Findlet<const TrackingUtilities::CDCWireHit* const, TrackingUtilities::CDCTrack>
 Type of the base class.
 
using CandidateReceiver = AxialHitQuadTreeProcessor::CandidateReceiver
 lambda function used for postprocessing
 

Private Member Functions

std::unique_ptr< AxialHitQuadTreeProcessorconstructQTProcessor (EPass pass)
 Method to create QTProcessor that performs the search.
 
void executeRelaxation (const CandidateReceiver &candidateReceiver, AxialHitQuadTreeProcessor &qtProcessor)
 Performs quadtree search.
 

Private Attributes

EPass m_pass = EPass::NonCurlers
 The pass key for lookup of the parameters for this pass.
 
const double m_param_stepScale = 0.75
 Parameter to define multiplier for hits threshold for the next quadtree iteration.
 
int m_param_minNHits = 10
 Parameter to define minimal threshold of hit.
 
double m_param_precision = 0.00000001
 Parameter to define precision of quadtree search in case of straight pass.
 
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

Generates axial tracks from hit using special leaf postprocessing.

Implements Legendre transformation of the drift time circles. This is a module, performing tracking in the CDC. It is based on the paper "Implementation of the Legendre Transform for track segment reconstruction in drift tube chambers" by T. Alexopoulus, et al. NIM A592 456-462 (2008).

Definition at line 35 of file AxialTrackCreatorHitLegendre.h.

Member Typedef Documentation

◆ CandidateReceiver

lambda function used for postprocessing

Definition at line 86 of file AxialTrackCreatorHitLegendre.h.

◆ 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

Type of the base class.

Definition at line 40 of file AxialTrackCreatorHitLegendre.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 Enumeration Documentation

◆ EPass

enum class EPass
strong

Pass keys for the different sets of predefined parameters for a pass if legendre search Note: Naming copied from original location.

Does not actually match with the associated parameters.

Enumerator
NonCurlers 

Pass corresponds to High-pt track finding and more deeper quadtree.

NonCurlersWithIncreasingThreshold 

Pass corresponds to High-pt track finding and more rough quadtree.

FullRange 

Pass corresponds to full pt range and even more rough quadtree (non-ip tracks, tracks with energy losses etc)

Straight 

Pass corresponds to very High-pt track and very rough quadtree (monopole tracks, including those with low hit count)

Definition at line 48 of file AxialTrackCreatorHitLegendre.h.

48 {
50 NonCurlers,
52 NonCurlersWithIncreasingThreshold,
55 FullRange,
58 Straight
59 };

Constructor & Destructor Documentation

◆ AxialTrackCreatorHitLegendre()

Constructor from a pass key.

Definition at line 70 of file AxialTrackCreatorHitLegendre.cc.

71 : m_pass(pass)
72{
73}
EPass m_pass
The pass key for lookup of the parameters for this pass.

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

Execute one pass over a quad tree.

Definition at line 100 of file AxialTrackCreatorHitLegendre.cc.

102{
103 // Prepare vector of unused hits to provide to the qt processor
104 // Also reset the mask flag and select only the untaken hits
105 std::vector<const TrackingUtilities::CDCWireHit*> unusedAxialWireHits;
106 for (const TrackingUtilities::CDCWireHit* wireHit : axialWireHits) {
107 (*wireHit)->setMaskedFlag(false);
108 if ((*wireHit)->hasTakenFlag()) continue;
109 unusedAxialWireHits.push_back(wireHit);
110 }
111
112 // Create quadtree processor
113 std::unique_ptr<AxialHitQuadTreeProcessor> qtProcessor = constructQTProcessor(m_pass);
114 qtProcessor->seed(unusedAxialWireHits);
115// qtProcessor->drawHits(unusedAxialWireHits, 9);
116
117 // Create object which contains interface between quadtree processor and track processor (module)
118 std::unique_ptr<BaseCandidateReceiver> receiver;
119 if (not(m_pass == EPass::Straight)) {
120 receiver = std::make_unique<OffOriginExtension>(unusedAxialWireHits);
121 } else {
122 receiver = std::make_unique<BaseCandidateReceiver>(unusedAxialWireHits);
123 }
124
125 // Start candidate finding
126 this->executeRelaxation(std::ref(*receiver), *qtProcessor);
127
128 const std::vector<CDCTrack>& newTracks = receiver->getTracks();
129 tracks.insert(tracks.end(), newTracks.begin(), newTracks.end());
130}
void executeRelaxation(const CandidateReceiver &candidateReceiver, AxialHitQuadTreeProcessor &qtProcessor)
Performs quadtree search.
std::unique_ptr< AxialHitQuadTreeProcessor > constructQTProcessor(EPass pass)
Method to create QTProcessor that performs the search.

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

◆ constructQTProcessor()

std::unique_ptr< AxialHitQuadTreeProcessor > constructQTProcessor ( EPass pass)
private

Method to create QTProcessor that performs the search.

Definition at line 24 of file AxialTrackCreatorHitLegendre.cc.

25{
27 using PrecisionFunction = PrecisionUtil::PrecisionFunction;
28 const int maxTheta = std::pow(2, PrecisionUtil::getLookupGridLevel());
29
30 if (pass == EPass::NonCurlers) {
31 int maxLevel = 12;
32 int seedLevel = 4;
33 XYSpans xySpans({{0, maxTheta}, { -0.02, 0.14}});
34 PrecisionFunction precisionFunction = &PrecisionUtil::getOriginCurvPrecision;
35
36 return std::make_unique<AxialHitQuadTreeProcessor>(maxLevel, seedLevel, xySpans, precisionFunction);
37
38 } else if (pass == EPass::NonCurlersWithIncreasingThreshold) {
39 int maxLevel = 10;
40 int seedLevel = 4;
41 XYSpans xySpans({{0, maxTheta}, { -0.02, 0.14}});
42 PrecisionFunction precisionFunction = &PrecisionUtil::getNonOriginCurvPrecision;
43
44 return std::make_unique<AxialHitQuadTreeProcessor>(maxLevel, seedLevel, xySpans, precisionFunction);
45
46 } else if (pass == EPass::FullRange) {
47 int maxLevel = 10;
48 int seedLevel = 1;
49 XYSpans xySpans({{0, maxTheta}, {0.00, 0.30}});
50 PrecisionFunction precisionFunction = &PrecisionUtil::getNonOriginCurvPrecision;
51
52 return std::make_unique<AxialHitQuadTreeProcessor>(maxLevel, seedLevel, xySpans, precisionFunction);
53
54 } else if (pass == EPass::Straight) {
55 int maxLevel = 10;
56 int seedLevel = 4;
57 XYSpans xySpans({{0, maxTheta}, { -0.02, 0.02}});
58// PrecisionFunction precisionFunction = &PrecisionUtil::getBasicCurvPrecision; //That is 0.3 / pow(2, 16)
59 PrecisionFunction precisionFunction = [this](double curv __attribute__((unused))) {return m_param_precision ;};
60
61 return std::make_unique<AxialHitQuadTreeProcessor>(maxLevel, seedLevel, xySpans, precisionFunction);
62
63 }
64 B2FATAL("Invalid pass");
65}
double m_param_precision
Parameter to define precision of quadtree search in case of straight pass.
static double getOriginCurvPrecision(double curv)
Function which estimates desired curvature resolution of quadtree node in the given pt region paramet...
static double getNonOriginCurvPrecision(double curv)
Function which estimates desired curvature resolution of quadtree node in the given pt region paramet...
static constexpr int getLookupGridLevel()
Returns desired deepness of the trigonometrical lookup table. Used as template parameter for the Trig...
std::function< double(double)> PrecisionFunction
Function type which is used for resolution calculations (resolution=f(curvature)) Takes a curvature v...

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

◆ executeRelaxation()

void executeRelaxation ( const CandidateReceiver & candidateReceiver,
AxialHitQuadTreeProcessor & qtProcessor )
private

Performs quadtree search.

Parameters
candidateReceiverlambda interface process found leaves in the legendre search
qtProcessorreference to the AxialHitQuadTreeProcessor instance

Definition at line 132 of file AxialTrackCreatorHitLegendre.cc.

134{
135 // radius of the CDC
136 const double rCDC = 113.;
137
138 // Curvature for high pt particles that leave the CDC
139 const double curlCurv = 2. / rCDC;
140
141 // find leavers
142 qtProcessor.fill(candidateReceiver, 50, curlCurv);
143
144 // find curlers with diameter higher than half of radius of CDC
145 qtProcessor.fill(candidateReceiver, 70, 2 * curlCurv);
146
147 // Start relaxation loop
148 int minNHits = m_pass == EPass::FullRange ? 30 : 50;
149 double maxCurv = m_pass == EPass::FullRange ? 0.15 : 0.07;
150 do {
151 qtProcessor.fill(candidateReceiver, minNHits, maxCurv);
152
153 minNHits = minNHits * m_param_stepScale;
154
155 if (m_pass != EPass::NonCurlers) {
156 maxCurv *= 2.;
157 if (maxCurv > 0.15) maxCurv = 0.15;
158 }
159
160 } while (minNHits >= m_param_minNHits);
161}
const double m_param_stepScale
Parameter to define multiplier for hits threshold for the next quadtree iteration.
int m_param_minNHits
Parameter to define minimal threshold of hit.
void fill(const CandidateReceiver &candidateReceiver, int nHitsThreshold)
Start filling the already created tree.

◆ exposeParameters()

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

Expose the parameters to a module.

Reimplemented from CompositeProcessingSignalListener.

Definition at line 80 of file AxialTrackCreatorHitLegendre.cc.

82{
83 moduleParamList->addParameter(prefixed(prefix, "minNHits"),
85 "Parameter to define minimal threshold of number of hits.",
87 if (m_pass == EPass::Straight) {
88 moduleParamList->addParameter(prefixed(prefix, "precision"),
90 "Parameter to define precision of quadtree search.",
92 }
93}
void addParameter(const std::string &name, T &paramVariable, const std::string &description, const T &defaultValue)
Adds a new parameter to the module list.

◆ getDescription()

std::string getDescription ( )
finalvirtual

Short description of the findlet.

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

Definition at line 75 of file AxialTrackCreatorHitLegendre.cc.

76{
77 return "Generates axial tracks from hits using several increasingly relaxed legendre space search over phi0 and curvature.";
78}

◆ 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

Initialisation before the event processing starts.

Reimplemented from ProcessingSignalListener.

Definition at line 95 of file AxialTrackCreatorHitLegendre.cc.

◆ terminate()

Member Data Documentation

◆ 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_minNHits

int m_param_minNHits = 10
private

Parameter to define minimal threshold of hit.

Definition at line 103 of file AxialTrackCreatorHitLegendre.h.

◆ m_param_precision

double m_param_precision = 0.00000001
private

Parameter to define precision of quadtree search in case of straight pass.

Definition at line 106 of file AxialTrackCreatorHitLegendre.h.

◆ m_param_stepScale

const double m_param_stepScale = 0.75
private

Parameter to define multiplier for hits threshold for the next quadtree iteration.

Definition at line 100 of file AxialTrackCreatorHitLegendre.h.

◆ m_pass

EPass m_pass = EPass::NonCurlers
private

The pass key for lookup of the parameters for this pass.

Definition at line 97 of file AxialTrackCreatorHitLegendre.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: