Belle II Software development
SelectSubsetBase Class Referenceabstract

Type-independent implementation details of SelectSubset. More...

#include <SelectSubset.h>

Inheritance diagram for SelectSubsetBase:
SelectSubset< Particle > SelectSubset< Belle2::SpacePointTrackCand > SelectSubset< Belle2::CDCDedxTrack > SelectSubset< Belle2::ECLShower > SelectSubset< Belle2::ECLCalDigit > SelectSubset< Belle2::PXDCluster > SelectSubset< Belle2::PXDRawHit > SelectSubset< Belle2::PXDDigit > SelectSubset< Belle2::Track > SelectSubset< Belle2::RecoHitInformation > SelectSubset< Belle2::SVDCluster > SelectSubset< Belle2::SVDShaperDigit > SelectSubset< Belle2::ECLCluster > SelectSubset< Belle2::KLMCluster > SelectSubset< Belle2::V0 > SelectSubset< StoredClass >

Public Member Functions

std::vector< std::string > getInheritFromArrays () const
 Get list of arrays we inherit relations from.
 
std::vector< std::string > getInheritToArrays () const
 Get list of arrays we inherit relations to.
 
bool getInheritToSelf () const
 Do we inherit relations from original set to itself?
 
virtual StoreAccessorBasegetSet ()=0
 Get accessor for original set.
 
virtual StoreAccessorBasegetSubSet ()=0
 Get accessor for reduced set.
 
void swapSetsAndDestroyOriginal ()
 Swap set and subset (+relations), and keep only the reduced set.
 

Protected Attributes

std::vector< std::string > m_inheritFromArrays
 array names we inherit relations from.
 
std::vector< std::string > m_inheritToArrays
 array names we inherit relations to.
 
bool m_inheritToSelf = false
 If true, relations from set objects to set objects are copied.
 
bool m_reduceExistingSet = false
 If true, non-selected candidates are removed from m_set, m_subset only exists temporarily.
 

Detailed Description

Type-independent implementation details of SelectSubset.

Definition at line 29 of file SelectSubset.h.

Constructor & Destructor Documentation

◆ SelectSubsetBase()

SelectSubsetBase ( )
inlineprotected

Definition at line 50 of file SelectSubset.h.

50{ }

◆ ~SelectSubsetBase()

virtual ~SelectSubsetBase ( )
inlineprotectedvirtual

Definition at line 51 of file SelectSubset.h.

51{ }

Member Function Documentation

◆ getInheritFromArrays()

std::vector< std::string > getInheritFromArrays ( ) const
inline

Get list of arrays we inherit relations from.

Definition at line 32 of file SelectSubset.h.

32{ return m_inheritFromArrays; }
std::vector< std::string > m_inheritFromArrays
array names we inherit relations from.
Definition: SelectSubset.h:54

◆ getInheritToArrays()

std::vector< std::string > getInheritToArrays ( ) const
inline

Get list of arrays we inherit relations to.

Definition at line 34 of file SelectSubset.h.

34{ return m_inheritToArrays; }
std::vector< std::string > m_inheritToArrays
array names we inherit relations to.
Definition: SelectSubset.h:56

◆ getInheritToSelf()

bool getInheritToSelf ( ) const
inline

Do we inherit relations from original set to itself?

Definition at line 36 of file SelectSubset.h.

36{ return m_inheritToSelf; }
bool m_inheritToSelf
If true, relations from set objects to set objects are copied.
Definition: SelectSubset.h:58

◆ getSet()

◆ getSubSet()

◆ swapSetsAndDestroyOriginal()

void swapSetsAndDestroyOriginal ( )

Swap set and subset (+relations), and keep only the reduced set.

Subset and associated relations will be empty afterwards.

Definition at line 14 of file SelectSubset.cc.

15{
18
19 //replace set with subset
20 DataStore::Instance().replaceData(*subset, *set);
21
22 //swap relations
23 for (const std::string& fromArray : m_inheritFromArrays) {
24 RelationArray setRel(DataStore::relationName(fromArray, set->getName()));
25 RelationArray subsetRel(DataStore::relationName(fromArray, subset->getName()));
26 DataStore::Instance().replaceData(subsetRel, setRel);
27 }
28 for (const std::string& toArray : m_inheritToArrays) {
29 RelationArray setRel(DataStore::relationName(set->getName(), toArray));
30 RelationArray subsetRel(DataStore::relationName(subset->getName(), toArray));
31 DataStore::Instance().replaceData(subsetRel, setRel);
32 }
33}
static DataStore & Instance()
Instance of singleton Store.
Definition: DataStore.cc:54
static std::string relationName(const std::string &fromName, const std::string &toName, std::string const &namedRelation="")
Return storage name for a relation between two arrays of the given names.
Definition: DataStore.h:180
void replaceData(const StoreAccessorBase &from, const StoreAccessorBase &to)
For two StoreAccessors of same type, move all data in 'from' into 'to', discarding previous contents ...
Definition: DataStore.cc:343
Low-level class to create/modify relations between StoreArrays.
Definition: RelationArray.h:62
virtual StoreAccessorBase * getSubSet()=0
Get accessor for reduced set.
virtual StoreAccessorBase * getSet()=0
Get accessor for original set.
Base class for StoreObjPtr and StoreArray for easier common treatment.
const std::string & getName() const
Return name under which the object is saved in the DataStore.
std::bitset< max - min+1 > subset(std::bitset< nbits > set)
extract a subset of bitstring, like substring.
Definition: Cosim.h:120

Member Data Documentation

◆ m_inheritFromArrays

std::vector<std::string> m_inheritFromArrays
protected

array names we inherit relations from.

Definition at line 54 of file SelectSubset.h.

◆ m_inheritToArrays

std::vector<std::string> m_inheritToArrays
protected

array names we inherit relations to.

Definition at line 56 of file SelectSubset.h.

◆ m_inheritToSelf

bool m_inheritToSelf = false
protected

If true, relations from set objects to set objects are copied.

(if both objects are selected!).

Definition at line 58 of file SelectSubset.h.

◆ m_reduceExistingSet

bool m_reduceExistingSet = false
protected

If true, non-selected candidates are removed from m_set, m_subset only exists temporarily.

Definition at line 60 of file SelectSubset.h.


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