Belle II Software  release-08-01-10
CKFRelationCreator.icc.h
1 /**************************************************************************
2  * basf2 (Belle II Analysis Software Framework) *
3  * Author: The Belle II Collaboration *
4  * *
5  * See git log for contributors and copyright holders. *
6  * This file is licensed under LGPL-3.0, see LICENSE.md. *
7  **************************************************************************/
8 #pragma once
9 
10 #include <tracking/ckf/general/findlets/CKFRelationCreator.dcl.h>
11 #include <tracking/trackFindingCDC/utilities/StringManipulation.h>
12 
13 #include <tracking/trackFindingCDC/filters/base/RelationFilterUtil.h>
14 #include <tracking/trackFindingCDC/utilities/Algorithms.h>
15 
16 namespace Belle2 {
21  template<class AState, class ASeedRelationFilter, class AHitRelationFilter>
23 
24  template<class AState, class ASeedRelationFilter, class AHitRelationFilter>
26  {
29  }
30 
31  template<class AState, class ASeedRelationFilter, class AHitRelationFilter>
33  const std::string& prefix)
34  {
35  m_seedFilter.exposeParameters(moduleParamList, TrackFindingCDC::prefixed("seed", prefix));
36  m_hitFilter.exposeParameters(moduleParamList, TrackFindingCDC::prefixed("hit", prefix));
37  }
38 
39  template<class AState, class ASeedRelationFilter, class AHitRelationFilter>
41  std::vector<AState>& states,
42  std::vector<TrackFindingCDC::WeightedRelation<AState>>& relations)
43  {
44  const std::vector<AState*> seedStatePointers = TrackFindingCDC::as_pointers<AState>(seedStates);
45  const std::vector<AState*> statePointers = TrackFindingCDC::as_pointers<AState>(states);
46 
47  // Just some arbitrary number...
48  relations.reserve(10000);
49 
50  // relations += seed states -> states
51  TrackFindingCDC::RelationFilterUtil::appendUsing(m_seedFilter, seedStatePointers, statePointers, relations, 1000000);
52 
53  // relations += states -> states
54  TrackFindingCDC::RelationFilterUtil::appendUsing(m_hitFilter, statePointers, statePointers, relations, 1000000);
55  }
57 }
ASeedRelationFilter m_seedFilter
Subfindlet for the relation checking between seed and hits.
AHitRelationFilter m_hitFilter
Subfindlet for the relation checking between hits and hits.
The Module parameter list class.
void addProcessingSignalListener(ProcessingSignalListener *psl)
Register a processing signal listener to be notified.
Type for two related objects with a weight.
CKFRelationCreator()
Construct this findlet and add the subfindlet as listener.
~CKFRelationCreator()
Default destructor.
void exposeParameters(ModuleParamList *moduleParamList, const std::string &prefix) final
Expose the parameters of the subfindlet.
void apply(std::vector< AState > &seedStates, std::vector< AState > &states, std::vector< TrackFindingCDC::WeightedRelation< AState >> &relations) override
Apply both filters for creating state-hit and hit-hit relations.
Abstract base class for different kinds of events.
static void appendUsing(ARelationFilter &relationFilter, const std::vector< AObject * > &froms, const std::vector< AObject * > &tos, std::vector< WeightedRelation< AObject >> &weightedRelations, unsigned int maximumNumberOfRelations=std::numeric_limits< unsigned int >::max())
Appends relations between elements in the given AItems using the ARelationFilter.