Belle II Software development
StoreArrayLoader< IOType > Class Template Referenceabstract

Helper findlet to allow combined findlets to import data from the DataStore. More...

#include <StoreArrayLoader.h>

Inheritance diagram for StoreArrayLoader< IOType >:
Findlet< IOType * > CompositeProcessingSignalListener ProcessingSignalListener

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

 StoreArrayLoader (const std::string &storeArrayName="", const std::string &classMnemomicName="", const std::string &classMnemomicDescription="")
 Constructor taking the default name of the store vector which is the source for the import.
 
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 apply (std::vector< IOType * > &output) final
 Loads the items from the DataStore.
 
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 = Findlet< IOType * >
 Type of the base class.
 

Private Attributes

std::string m_param_storeArrayName
 Name of the store vector to be used.
 
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< 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 IOType>
class Belle2::TrackFindingCDC::StoreArrayLoader< IOType >

Helper findlet to allow combined findlets to import data from the DataStore.

This findlet can be used to retrieve data from a store array. Please note that this module returns pointers.

Definition at line 32 of file StoreArrayLoader.h.

Member Typedef Documentation

◆ IOTypes

using IOTypes = std::tuple<AIOTypes...>
inherited

Types that should be served to apply on invokation.

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 invokation.

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 StoreArrayLoader.h.

◆ ToVector

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

Short hand for ToRangeImpl.

Definition at line 49 of file Findlet.h.

Constructor & Destructor Documentation

◆ StoreArrayLoader()

StoreArrayLoader ( const std::string &  storeArrayName = "",
const std::string &  classMnemomicName = "",
const std::string &  classMnemomicDescription = "" 
)
inline

Constructor taking the default name of the store vector which is the source for the import.

Definition at line 39 of file StoreArrayLoader.h.

42 : m_param_storeArrayName(storeArrayName),
43 m_classMnemomicName(classMnemomicName),
44 m_classMnemomicDescription(classMnemomicDescription)
45 {
47 if (m_classMnemomicName != "") {
49 } else {
50 // Just a little bit of ADL, taken from StoreArraySwapper
52 }
53 }
54
55 if (m_classMnemomicName == "") {
56 // Just a little bit of ADL, takem from StoreArraySwapper
57 m_classMnemomicName = getClassMnemomicParameterName(static_cast<IOType*>(nullptr));
58 }
59 }
std::string m_param_storeArrayName
Name of the store vector to be used.
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 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 * > &  output)
inlinefinal

Loads the items from the DataStore.

Definition at line 88 of file StoreArrayLoader.h.

88 {
89 // Swap items to the DataStore
90 StoreArray<IOType> storeArray(m_param_storeArrayName);
91
92 output.reserve(output.size() + storeArray.getEntries());
93
94 for (auto& item : storeArray)
95 {
96 // cppcheck-suppress useStlAlgorithm
97 output.push_back(&item);
98 }
99 }

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

Expose the parameters to a module.

Reimplemented from Findlet< IOType * >.

Definition at line 62 of file StoreArrayLoader.h.

63 {
64 std::string classMnemomicCapitalName = m_classMnemomicName;
65 classMnemomicCapitalName[0] = ::toupper(classMnemomicCapitalName.at(0));
66
67 moduleParamList->addParameter(prefixed(prefix, classMnemomicCapitalName + "sStoreArrayName"),
69 "Name of the StoreArray of the " + m_classMnemomicDescription,
70 std::string(m_param_storeArrayName));
71 }

◆ getDescription()

std::string getDescription ( )
inlineoverridevirtual

Short description of the findlet.

Reimplemented from Findlet< IOType * >.

Definition at line 74 of file StoreArrayLoader.h.

75 {
76 return "Swaps an interal vector of " + m_classMnemomicDescription + "s to the DataStore";
77 }

◆ 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 80 of file StoreArrayLoader.h.

81 {
83 StoreArray<IOType> storeArray(m_param_storeArrayName);
84 storeArray.isRequired();
85 }
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_classMnemomicDescription

std::string m_classMnemomicDescription
private

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

Definition at line 109 of file StoreArrayLoader.h.

◆ m_classMnemomicName

std::string m_classMnemomicName
private

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

Definition at line 106 of file StoreArrayLoader.h.

◆ m_initialized

bool m_initialized = false
privateinherited

Flag to keep track whether initialization happend 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_storeArrayName

std::string m_param_storeArrayName
private

Name of the store vector to be used.

Definition at line 103 of file StoreArrayLoader.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 happend before.

Definition at line 55 of file ProcessingSignalListener.h.


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