Belle II Software development
CosmicsTrackMergerFindlet Class Referenceabstract

Links tracks based on a filter criterion. It is based on the TrackLinker in the TF_CDC package. More...

#include <CosmicsTrackMergerFindlet.h>

Inheritance diagram for CosmicsTrackMergerFindlet:
Findlet<> 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

 CosmicsTrackMergerFindlet ()
 Constructor adding the filter as a subordinary processing signal listener.
 
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
 Init the store arrays.
 
void apply () final
 Main algorithm.
 
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<>
 Type of the base class.
 

Private Attributes

TrackFindingCDC::WeightedRelationCreator< const CellularRecoTrack, PhiRecoTrackRelationFilterm_trackRelationCreator
 Creator of the track relations for linking.
 
TrackFindingCDC::MultipassCellularPathFinder< const CellularRecoTrackm_cellularPathFinder
 Instance of the cellular automaton path finder.
 
std::vector< TrackFindingCDC::WeightedRelation< const CellularRecoTrack > > m_trackRelations
 Memory for the relations between tracks to be followed on linking.
 
std::vector< TrackFindingCDC::Path< const CellularRecoTrack > > m_trackPaths
 Memory for the track paths generated from the graph.
 
std::vector< CellularRecoTrackm_inputTrackVector
 Storage for the input tracks.
 
StoreArray< RecoTrackm_outputTracks
 StoreArray for the output tracks.
 
StoreArray< RecoTrackm_inputTracks
 StoreArray for the input tracks.
 
std::string m_param_inputRecoTracks = "UnmergedRecoTracks"
 Parameter for the input reco tracks.
 
std::string m_param_outputRecoTracks = "RecoTracks"
 Parameter for the output reco tracks.
 
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

Links tracks based on a filter criterion. It is based on the TrackLinker in the TF_CDC package.

Definition at line 29 of file CosmicsTrackMergerFindlet.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<>
private

Type of the base class.

Definition at line 32 of file CosmicsTrackMergerFindlet.h.

◆ ToVector

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

Short hand for ToRangeImpl.

Definition at line 49 of file Findlet.h.

Constructor & Destructor Documentation

◆ CosmicsTrackMergerFindlet()

Constructor adding the filter as a subordinary processing signal listener.

Definition at line 16 of file CosmicsTrackMergerFindlet.cc.

17{
19}
TrackFindingCDC::WeightedRelationCreator< const CellularRecoTrack, PhiRecoTrackRelationFilter > m_trackRelationCreator
Creator of the track relations for linking.
void addProcessingSignalListener(ProcessingSignalListener *psl)
Register a processing signal listener to be notified.

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 ( )
final

Main algorithm.

Definition at line 47 of file CosmicsTrackMergerFindlet.cc.

48{
49 m_inputTrackVector.clear();
50
51 // Read the tracks from the Store Array
52 for (const RecoTrack& recoTrack : m_inputTracks) {
53 m_inputTrackVector.emplace_back(&recoTrack);
54 }
55
56 std::sort(m_inputTrackVector.begin(), m_inputTrackVector.end());
57
58 // Obtain the tracks as pointers
59 std::vector<const CellularRecoTrack*> trackPtrs = as_pointers<const CellularRecoTrack>(m_inputTrackVector);
60
61 // Create linking relations
62 m_trackRelations.clear();
64
65 // Find linking paths
66 m_trackPaths.clear();
68
69 // Write out the tracks to the data store
70 // TODO: other possibility would be to use relations for this!
71 // One would need to extend the RelatedTrackCombiner for this
72 for (const std::vector<const CellularRecoTrack*>& trackPath : m_trackPaths) {
73 // We use the first track to give us the momentum seed etc.
74 const RecoTrack* firstTrack = *(trackPath.front());
75 RecoTrack* newRecoTrack = firstTrack->copyToStoreArray(m_outputTracks);
76
77 unsigned int numberOfAddedHits = 0;
78 for (const CellularRecoTrack* cellularRecoTrack : trackPath) {
79 numberOfAddedHits += newRecoTrack->addHitsFromRecoTrack(*cellularRecoTrack, numberOfAddedHits);
80 }
81 }
82}
StoreArray< RecoTrack > m_outputTracks
StoreArray for the output tracks.
std::vector< TrackFindingCDC::Path< const CellularRecoTrack > > m_trackPaths
Memory for the track paths generated from the graph.
TrackFindingCDC::MultipassCellularPathFinder< const CellularRecoTrack > m_cellularPathFinder
Instance of the cellular automaton path finder.
StoreArray< RecoTrack > m_inputTracks
StoreArray for the input tracks.
std::vector< CellularRecoTrack > m_inputTrackVector
Storage for the input tracks.
std::vector< TrackFindingCDC::WeightedRelation< const CellularRecoTrack > > m_trackRelations
Memory for the relations between tracks to be followed on linking.
This is the Reconstruction Event-Data Model Track.
Definition: RecoTrack.h:79
size_t addHitsFromRecoTrack(const RecoTrack *recoTrack, unsigned int sortingParameterOffset=0, bool reversed=false, std::optional< double > optionalMinimalWeight=std::nullopt)
Add all hits from another RecoTrack to this RecoTrack.
Definition: RecoTrack.cc:240
RecoTrack * copyToStoreArray(StoreArray< RecoTrack > &storeArray) const
Append a new RecoTrack to the given store array and copy its general properties, but not the hits the...
Definition: RecoTrack.cc:529
Mixin class to attach an automaton cell to an object or pointer.

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

Expose the parameters to a module.

Reimplemented from Findlet<>.

Definition at line 26 of file CosmicsTrackMergerFindlet.cc.

27{
28 m_trackRelationCreator.exposeParameters(moduleParamList, prefix);
29 m_cellularPathFinder.exposeParameters(moduleParamList, prefix);
30
31 moduleParamList->addParameter("inputRecoTracks", m_param_inputRecoTracks,
32 "Store Array name of the input reco tracks.", m_param_inputRecoTracks);
33 moduleParamList->addParameter("outputRecoTracks", m_param_outputRecoTracks,
34 "Store Array name of the output reco tracks.", m_param_outputRecoTracks);
35}
std::string m_param_outputRecoTracks
Parameter for the output reco tracks.
std::string m_param_inputRecoTracks
Parameter for the input reco tracks.
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<>.

Definition at line 21 of file CosmicsTrackMergerFindlet.cc.

22{
23 return "Links tracks by extraction of track paths in a cellular automaton.";
24}

◆ 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

Init the store arrays.

Reimplemented from ProcessingSignalListener.

Definition at line 37 of file CosmicsTrackMergerFindlet.cc.

38{
40
43
45}
@ c_ErrorIfAlreadyRegistered
If the object/array was already registered, produce an error (aborting initialisation).
Definition: DataStore.h:72
static void registerRequiredRelations(StoreArray< RecoTrack > &recoTracks, std::string const &pxdHitsStoreArrayName="", std::string const &svdHitsStoreArrayName="", std::string const &cdcHitsStoreArrayName="", std::string const &bklmHitsStoreArrayName="", std::string const &eklmHitsStoreArrayName="", std::string const &recoHitInformationStoreArrayName="")
Convenience method which registers all relations required to fully use a RecoTrack.
Definition: RecoTrack.cc:53
bool isRequired(const std::string &name="")
Ensure this array/object has been registered previously.
bool registerInDataStore(DataStore::EStoreFlags storeFlags=DataStore::c_WriteOut)
Register the object/array in the DataStore.
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_cellularPathFinder

Instance of the cellular automaton path finder.

Definition at line 55 of file CosmicsTrackMergerFindlet.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_inputTracks

StoreArray<RecoTrack> m_inputTracks
private

StoreArray for the input tracks.

Definition at line 70 of file CosmicsTrackMergerFindlet.h.

◆ m_inputTrackVector

std::vector<CellularRecoTrack> m_inputTrackVector
private

Storage for the input tracks.

Definition at line 64 of file CosmicsTrackMergerFindlet.h.

◆ m_outputTracks

StoreArray<RecoTrack> m_outputTracks
private

StoreArray for the output tracks.

Definition at line 67 of file CosmicsTrackMergerFindlet.h.

◆ m_param_inputRecoTracks

std::string m_param_inputRecoTracks = "UnmergedRecoTracks"
private

Parameter for the input reco tracks.

Definition at line 74 of file CosmicsTrackMergerFindlet.h.

◆ m_param_outputRecoTracks

std::string m_param_outputRecoTracks = "RecoTracks"
private

Parameter for the output reco tracks.

Definition at line 77 of file CosmicsTrackMergerFindlet.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.

◆ m_trackPaths

std::vector<TrackFindingCDC::Path<const CellularRecoTrack> > m_trackPaths
private

Memory for the track paths generated from the graph.

Definition at line 61 of file CosmicsTrackMergerFindlet.h.

◆ m_trackRelationCreator

Creator of the track relations for linking.

Definition at line 52 of file CosmicsTrackMergerFindlet.h.

◆ m_trackRelations

std::vector<TrackFindingCDC::WeightedRelation<const CellularRecoTrack> > m_trackRelations
private

Memory for the relations between tracks to be followed on linking.

Definition at line 58 of file CosmicsTrackMergerFindlet.h.


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