Belle II Software development
StoreVectorSwapper< IOType, a_alwaysWrite > Class Template Referenceabstract

Refines the clustering of wire hits from clusters to clusters. More...

#include <StoreVectorSwapper.h>

Inheritance diagram for StoreVectorSwapper< IOType, a_alwaysWrite >:
Findlet< IOType > 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

 StoreVectorSwapper (const std::string &storeVectorName, const std::string &classMnemomicName="", const std::string &classMnemomicDescription="")
 Constructor taking the default name of the store vector which is the target of the swap.
 
void exposeParameters (ModuleParamList *moduleParamList, const std::string &prefix) override
 Expose the parameters to a module.
 
std::string getDescription () override
 Short description of the findlet.
 
void initialize () override
 Receive signal before the start of the event processing.
 
void beginEvent () override
 Receive signal for the start of a new event.
 
void apply (std::vector< IOType > &input) final
 Swaps the items to the DataStore or to the backup storage location.
 
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 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 = Findlet< IOType >
 Type of the base class.
 

Private Attributes

std::string m_param_storeVectorName
 Name of the store vector to be used.
 
bool m_param_writeStoreVector = a_alwaysWrite
 Switch if the store vector should be filled.
 
std::string m_classMnemomicName
 Short name for the type of objects to be written out.
 
std::string m_classMnemomicDescription
 Short description for the type of objects to be written out.
 
std::vector< IOType > m_backup
 Backup storage if the vector should not be written to the DataStore.
 
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

template<class IOType, bool a_alwaysWrite = false>
class Belle2::TrackFindingCDC::StoreVectorSwapper< IOType, a_alwaysWrite >

Refines the clustering of wire hits from clusters to clusters.

Helper findlet to allow combined findlets to export more data to the DataStore. This is mainly to temporarily maintain the former behaviour of some finder parts that used to expose more of their internals.

Definition at line 30 of file StoreVectorSwapper.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 = Findlet<IOType>
private

Type of the base class.

Definition at line 35 of file StoreVectorSwapper.h.

◆ ToVector

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

Short hand for ToRangeImpl.

Definition at line 49 of file Findlet.h.

Constructor & Destructor Documentation

◆ StoreVectorSwapper()

StoreVectorSwapper ( const std::string &  storeVectorName,
const std::string &  classMnemomicName = "",
const std::string &  classMnemomicDescription = "" 
)
inlineexplicit

Constructor taking the default name of the store vector which is the target of the swap.

Definition at line 39 of file StoreVectorSwapper.h.

42 : m_param_storeVectorName(storeVectorName),
43 m_classMnemomicName(classMnemomicName),
44 m_classMnemomicDescription(classMnemomicDescription)
45 {
47 if (m_classMnemomicName != "") {
49 } else {
50 // Just a little bit of ADL
52 }
53 }
54
55 if (m_classMnemomicName == "") {
56 // Just a little bit of ADL
57 m_classMnemomicName = getClassMnemomicParameterName(static_cast<IOType*>(nullptr));
58 }
59 }
std::string m_classMnemomicDescription
Short description for the type of objects to be written out.
std::string m_classMnemomicName
Short name for the type of objects to be written out.
std::string m_param_storeVectorName
Name of the store vector to be used.
std::string getClassMnemomicParameterDescription(const RecoTrack *dispatchTag)
Returns a short description for class RecoTrack to be used in descriptions of parameters.
std::string getClassMnemomicParameterName(const RecoTrack *dispatchTag)
Returns a short name for class RecoTrack to be used in names of parameters.

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 ( std::vector< IOType > &  input)
inlinefinal

Swaps the items to the DataStore or to the backup storage location.

Definition at line 116 of file StoreVectorSwapper.h.

117 {
118 // Swap items to the DataStore
120 StoreWrappedObjPtr< std::vector<IOType> > storeVector(m_param_storeVectorName);
121 std::vector<IOType>& sink = *storeVector;
122 sink.swap(input);
123 } else {
124 m_backup.swap(input);
125 }
126 }
std::vector< IOType > m_backup
Backup storage if the vector should not be written to the DataStore.
bool m_param_writeStoreVector
Switch if the store vector should be filled.

◆ beginEvent()

void beginEvent ( )
inlineoverridevirtual

Receive signal for the start of a new event.

Attain super cluster vector on the DataStore if needed.

Reimplemented from ProcessingSignalListener.

Definition at line 101 of file StoreVectorSwapper.h.

102 {
104
107 StoreWrappedObjPtr< std::vector<IOType> > storeVector(m_param_storeVectorName);
108 if (not storeVector.isValid()) {
109 storeVector.construct();
110 }
111 }
112 m_backup.clear();
113 }
void beginEvent() override
Receive and dispatch 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}
Interface for an algorithm part that needs to receive the module processing signals.
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 
)
inlineoverridevirtual

Expose the parameters to a module.

Reimplemented from Findlet< IOType >.

Definition at line 62 of file StoreVectorSwapper.h.

63 {
64 std::string classMnemomicCapitalName = m_classMnemomicName;
65 classMnemomicCapitalName[0] = ::toupper(classMnemomicCapitalName.at(0));
66
67 if (not a_alwaysWrite) {
68 moduleParamList->addParameter(prefixed(prefix, "Write" + classMnemomicCapitalName + "s"),
70 "Switch if " + m_classMnemomicDescription +
71 "s shall be written to the DataStore",
73 }
74
75 moduleParamList->addParameter(prefixed(prefix, classMnemomicCapitalName + "sStoreObjName"),
77 "Name of the output StoreObjPtr of the " + m_classMnemomicDescription +
78 "s generated within this module.",
79 std::string(m_param_storeVectorName));
80 //FIXME: Small parameter names
81 }

◆ getDescription()

std::string getDescription ( )
inlineoverridevirtual

Short description of the findlet.

Reimplemented from Findlet< IOType >.

Definition at line 84 of file StoreVectorSwapper.h.

85 {
86 return "Swaps an internal vector of " + m_classMnemomicDescription + "s to the DataStore";
87 }

◆ getNProcessingSignalListener()

int getNProcessingSignalListener ( )
protectedinherited

Get the number of currently registered listeners.

Definition at line 60 of file CompositeProcessingSignalListener.cc.

61{
63}

◆ initialize()

void initialize ( )
inlineoverridevirtual

Receive signal before the start of the event processing.

Reimplemented from ProcessingSignalListener.

Definition at line 91 of file StoreVectorSwapper.h.

92 {
95 StoreWrappedObjPtr< std::vector<IOType> > storeVector(m_param_storeVectorName);
97 }
98 }
@ c_DontWriteOut
Object/array should be NOT saved by output modules.
Definition: DataStore.h:71
@ c_ErrorIfAlreadyRegistered
If the object/array was already registered, produce an error (aborting initialisation).
Definition: DataStore.h:72
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_backup

std::vector<IOType> m_backup
private

Backup storage if the vector should not be written to the DataStore.

Definition at line 142 of file StoreVectorSwapper.h.

◆ m_classMnemomicDescription

std::string m_classMnemomicDescription
private

Short description for the type of objects to be written out.

Definition at line 139 of file StoreVectorSwapper.h.

◆ m_classMnemomicName

std::string m_classMnemomicName
private

Short name for the type of objects to be written out.

Definition at line 136 of file StoreVectorSwapper.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_param_storeVectorName

std::string m_param_storeVectorName
private

Name of the store vector to be used.

Definition at line 130 of file StoreVectorSwapper.h.

◆ m_param_writeStoreVector

bool m_param_writeStoreVector = a_alwaysWrite
private

Switch if the store vector should be filled.

Definition at line 133 of file StoreVectorSwapper.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.


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