Belle II Software  release-08-01-10
UnionVarSet< AObject > Class Template Reference

Class that accomodates many variable sets and presents them as on set of variables. More...

#include <UnionVarSet.h>

Inheritance diagram for UnionVarSet< AObject >:
Collaboration diagram for UnionVarSet< AObject >:

Public Types

using Object = AObject
 Object type from which variables shall be extracted.
 
using ContainedVarSet = BaseVarSet< Object >
 Type of the contained variable sets.
 

Public Member Functions

void initialize () final
 Initialize all contained variable set before event processing.
 
bool extract (const Object *obj) final
 Main method that extracts the variable values from the complex object. More...
 
std::vector< Named< Float_t * > > getNamedVariables (const std::string &prefix) override
 Getter for the named references to the individual variables Base implementaton returns empty vector.
 
MayBePtr< Float_t > find (const std::string &varName) override
 Pointer to the variable with the given name. More...
 
void push_back (std::unique_ptr< ContainedVarSet > varSet)
 Add a variable set to the contained variable sets.
 
void clear ()
 Remove all contained variable sets.
 
size_t size () const
 Return the number of currently contained variable sets.
 
bool extract (const Object &obj)
 Method for extraction from an object instead of a pointer.
 
std::vector< Named< Float_t * > > getNamedVariables ()
 Getter for the named references to the individual variables.
 
std::map< std::string, Float_t > getNamedValues (const std::string &prefix) const
 Getter for a map of names to float values. More...
 
std::map< std::string, Float_t > getNamedValues () const
 Getter for a map of names to float values.
 
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 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 = BaseVarSet< AObject >
 Type of the super class.
 

Private Attributes

std::vector< std::unique_ptr< ContainedVarSet > > m_varSets
 Collection of contained variables sets.
 
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 AObject>
class Belle2::TrackFindingCDC::UnionVarSet< AObject >

Class that accomodates many variable sets and presents them as on set of variables.

Definition at line 27 of file UnionVarSet.h.

Member Function Documentation

◆ extract()

bool extract ( const Object obj)
inlinefinalvirtual

Main method that extracts the variable values from the complex object.

Returns
Indication whether the extraction could be completed successfully.

Reimplemented from BaseVarSet< AObject >.

Definition at line 58 of file UnionVarSet.h.

58  {
59  bool result = true;
60  for (std::unique_ptr<ContainedVarSet>& varSet : m_varSets)
61  {
62  result &= varSet->extract(obj);
63  }
64  return result;
65  }
std::vector< std::unique_ptr< ContainedVarSet > > m_varSets
Collection of contained variables sets.
Definition: UnionVarSet.h:116

◆ find()

MayBePtr<Float_t> find ( const std::string &  varName)
inlineoverridevirtual

Pointer to the variable with the given name.

Returns nullptr if not found.

Reimplemented from BaseVarSet< AObject >.

Definition at line 85 of file UnionVarSet.h.

◆ getNamedValues()

std::map<std::string, Float_t> getNamedValues ( const std::string &  prefix) const
inlineinherited

Getter for a map of names to float values.

Parameters
prefixName prefix to apply to all variable names.

Definition at line 83 of file BaseVarSet.h.


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