Belle II Software  release-08-00-10
MatcherInterface< ACollectorItem, ACollectionItem > Class Template Referenceabstract

Base class for a findlet, which outputs a list of weighted relations between elements in a list of CollectorItems and a list of CollectionItems. More...

#include <MatcherInterface.h>

Inheritance diagram for MatcherInterface< ACollectorItem, ACollectionItem >:
Collaboration diagram for MatcherInterface< ACollectorItem, ACollectionItem >:

Public Types

using WeightedRelationItem = WeightedRelation< ACollectorItem, const ACollectionItem >
 Shortcut class name for a weighted relation between a collector item and a collection item.
 
using IOTypes = std::tuple< AIOTypes... >
 Types that should be served to apply on invokation.
 
using IOVectors = std::tuple< std::vector< AIOTypes >... >
 Vector types that should be served to apply on invokation.
 

Public Member Functions

void apply (std::vector< ACollectorItem > &collectorItems, const std::vector< ACollectionItem > &collectionItems, std::vector< WeightedRelationItem > &weightedRelations) override
 Main function: create weighted relations between collectors and collection items using the implemented functionality overriden in a derived class.
 
virtual std::string getDescription ()
 Brief description of the purpose of the concret findlet.
 
virtual void exposeParameters (ModuleParamList *moduleParamList, const std::string &prefix)
 Forward prefixed parameters of this findlet to the module parameter list.
 
virtual void apply (ToVector< AIOTypes > &... ioVectors)=0
 Main function executing the algorithm.
 
void initialize () override
 Receive and dispatch signal before the start of the event processing.
 
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

virtual void match (ACollectorItem &collectorItem, const std::vector< ACollectionItem > &collectionItems, std::vector< WeightedRelationItem > &relationsForCollector)
 Override this function to implement your own matching algorithm between one collector and many collection items. More...
 
virtual Weight match (ACollectorItem &collectorItem, const ACollectionItem &collectionItem)
 Override this function to implement your own matching algorithm between one collector and one collection items. More...
 
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 = ProcessingSignalListener
 Type of the base class.
 

Private Attributes

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 happend before.
 
bool m_terminated = false
 Flag to keep track whether termination happend before.
 
std::string m_initializedAs
 Name of the type during initialisation.
 

Detailed Description

template<class ACollectorItem, class ACollectionItem>
class Belle2::TrackFindingCDC::MatcherInterface< ACollectorItem, ACollectionItem >

Base class for a findlet, which outputs a list of weighted relations between elements in a list of CollectorItems and a list of CollectionItems.

Which item pairs are related and with which weight (if at all), can be defined by overriding one of the match()-functions in a derived class.

Most likely, the full stack is used as follows:

  • match two lists of elements (Collectors and Collections) resulting in a list of weighted relations among those
  • select only some relations using a certain criteria (this is where the difference between Collector and Collections comes into place)
  • add the found relations by absorbing the collection items into the collector items.

Please note that the CollectionItems are therefore const whereas the CollectorItems are not. All the passed WeightedRelations lists must be sorted.

Most of the provided selectors are built to match many collection items to one collector item.

Definition at line 40 of file MatcherInterface.h.

Member Function Documentation

◆ match() [1/2]

virtual Weight match ( ACollectorItem &  collectorItem,
const ACollectionItem &  collectionItem 
)
inlineprotectedvirtual

Override this function to implement your own matching algorithm between one collector and one collection items.

If you override this function, you just have to return a weight - the rest of the logic is handled by the MatcherInterface class.

Definition at line 82 of file MatcherInterface.h.

84  {
85  return NAN;
86  }

◆ match() [2/2]

virtual void match ( ACollectorItem &  collectorItem,
const std::vector< ACollectionItem > &  collectionItems,
std::vector< WeightedRelationItem > &  relationsForCollector 
)
inlineprotectedvirtual

Override this function to implement your own matching algorithm between one collector and many collection items.

A reason to override this instead of the other match function could be, if you want to apply some sort of caching for each collector item.

Reimplemented in SharingHitsMatcher< ACollectorItem, ACollectionItem >.

Definition at line 68 of file MatcherInterface.h.


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