 |
Belle II Software
release-05-02-19
|
12 #include <tracking/trackFindingCDC/varsets/BaseVarSet.h>
14 #include <tracking/trackFindingCDC/utilities/Named.h>
15 #include <tracking/trackFindingCDC/utilities/MayBePtr.h>
26 namespace TrackFindingCDC {
28 template <
class AObject>
29 class UnionVarSet :
public BaseVarSet<AObject> {
33 using Super = BaseVarSet<AObject>;
45 for (std::unique_ptr<ContainedVarSet>& varSet :
m_varSets)
62 for (std::unique_ptr<ContainedVarSet>& varSet :
m_varSets)
64 result &= varSet->extract(obj);
73 std::vector<Named<Float_t*>>
getNamedVariables(
const std::string& prefix)
override
75 std::vector<Named<Float_t*> > result;
76 for (std::unique_ptr<ContainedVarSet>& varSet :
m_varSets) {
77 std::vector<Named<Float_t*> > extend = varSet->getNamedVariables(prefix);
78 result.insert(result.end(), extend.begin(), extend.end());
87 MayBePtr<Float_t>
find(
const std::string& varName)
override
89 for (std::unique_ptr<ContainedVarSet>& varSet :
m_varSets) {
90 MayBePtr<Float_t> found = varSet->find(varName);
91 if (found)
return found;
97 void push_back(std::unique_ptr<ContainedVarSet> varSet)
118 std::vector<std::unique_ptr<ContainedVarSet>>
m_varSets;
virtual bool extract(const Object *obj __attribute__((unused)))
Main method that extracts the variable values from the complex object.
void clear()
Remove all contained variable sets.
void push_back(std::unique_ptr< ContainedVarSet > varSet)
Add a variable set to the contained variable sets.
size_t size() const
Return the number of currently contained variable sets.
void addProcessingSignalListener(ProcessingSignalListener *psl)
Register a processing signal listener to be notified.
void initialize() override
Receive and dispatch signal before the start of the event processing.
std::vector< Named< Float_t * > > getNamedVariables()
Getter for the named references to the individual variables.
bool extract(const Object *obj) final
Main method that extracts the variable values from the complex object.
Abstract base class for different kinds of events.
void initialize() final
Initialize all contained variable set before event processing.
AObject Object
Object type from which variables shall be extracted.
std::vector< std::unique_ptr< ContainedVarSet > > m_varSets
Collection of contained variables sets.
MayBePtr< Float_t > find(const std::string &varName) override
Pointer to the variable with the given name.
AObject Object
Object type from which variables shall be extracted.
BaseVarSet< AObject > Super
Type of the super class.