Belle II Software  release-08-01-10
CDCCKFPathMerger Class Referenceabstract

Merge similar paths. More...

#include <CDCCKFPathMerger.h>

Inheritance diagram for CDCCKFPathMerger:
Collaboration diagram for CDCCKFPathMerger:

Public Types

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< CDCCKFPath > &newPaths) override
 main method of the findlet, reads/returns merged paths More...
 
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

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 Member Functions

size_t lastThreeHitHash (const CDCCKFPath &path)
 helper function, returns has of the last 3 wire hits on the path
 

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

Merge similar paths.

Definition at line 22 of file CDCCKFPathMerger.h.

Member Function Documentation

◆ apply()

void apply ( std::vector< CDCCKFPath > &  newPaths)
inlineoverride

main method of the findlet, reads/returns merged paths

TODO: Merging does not work properly, as the tracks we compare must not have the same number of hits (and must not be at the same stage)

Definition at line 25 of file CDCCKFPathMerger.h.

26  {
28  std::unordered_map<size_t, CDCCKFPath> hashToPathList;
29  for (const CDCCKFPath& path : newPaths) {
30  const auto lastHitsHash = lastThreeHitHash(path);
31  if (hashToPathList.find(lastHitsHash) != hashToPathList.end()) {
32  if (hashToPathList[lastHitsHash].size() < path.size()) {
33  hashToPathList[lastHitsHash] = path;
34  }
35  } else {
36  hashToPathList[lastHitsHash] = path;
37  }
38  }
39 
40  newPaths.clear();
41  for (const auto& hashAndPathList : hashToPathList) {
42  const CDCCKFPath& path = hashAndPathList.second;
43  newPaths.push_back(path);
44  }
45  }
size_t lastThreeHitHash(const CDCCKFPath &path)
helper function, returns has of the last 3 wire hits on the path
std::vector< CDCCKFState > CDCCKFPath
Shortcut for the collection of CDC CKF-algorithm states.
Definition: CDCCKFPath.h:19

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