Belle II Software development
AnalyzingAlgorithmBase< DataType, TCInfoType, VectorType > Class Template Reference

Base class for storing an algorithm determining the data one wants to have. More...

#include <AnalyzingAlgorithmBase.h>

Inheritance diagram for AnalyzingAlgorithmBase< DataType, TCInfoType, VectorType >:
AnalyzingAlgorithmLostUClusters< DataType, TCInfoType, VectorType > AnalyzingAlgorithmLostUEDep< DataType, TCInfoType, VectorType > AnalyzingAlgorithmLostVClusters< DataType, TCInfoType, VectorType > AnalyzingAlgorithmLostVEDep< DataType, TCInfoType, VectorType > AnalyzingAlgorithmResidualP< DataType, TCInfoType, VectorType > AnalyzingAlgorithmResidualPAngle< DataType, TCInfoType, VectorType > AnalyzingAlgorithmResidualPPhi< DataType, TCInfoType, VectorType > AnalyzingAlgorithmResidualPT< DataType, TCInfoType, VectorType > AnalyzingAlgorithmResidualPTAngle< DataType, TCInfoType, VectorType > AnalyzingAlgorithmResidualPTheta< DataType, TCInfoType, VectorType > AnalyzingAlgorithmResidualPX< DataType, TCInfoType, VectorType > AnalyzingAlgorithmResidualPY< DataType, TCInfoType, VectorType > AnalyzingAlgorithmResidualPZ< DataType, TCInfoType, VectorType > AnalyzingAlgorithmResidualPosition< DataType, TCInfoType, VectorType > AnalyzingAlgorithmResidualPositionXY< DataType, TCInfoType, VectorType > AnalyzingAlgorithmTotalUClusters< DataType, TCInfoType, VectorType > AnalyzingAlgorithmTotalUEDep< DataType, TCInfoType, VectorType > AnalyzingAlgorithmTotalVClusters< DataType, TCInfoType, VectorType > AnalyzingAlgorithmTotalVEDep< DataType, TCInfoType, VectorType > AnalyzingAlgorithmValueDistSeed2IP< DataType, TCInfoType, VectorType > AnalyzingAlgorithmValueDistSeed2IPXY< DataType, TCInfoType, VectorType > AnalyzingAlgorithmValueDistSeed2IPZ< DataType, TCInfoType, VectorType > AnalyzingAlgorithmValueP< DataType, TCInfoType, VectorType > AnalyzingAlgorithmValuePPhi< DataType, TCInfoType, VectorType > AnalyzingAlgorithmValuePT< DataType, TCInfoType, VectorType > AnalyzingAlgorithmValuePTheta< DataType, TCInfoType, VectorType > AnalyzingAlgorithmValuePX< DataType, TCInfoType, VectorType > AnalyzingAlgorithmValuePY< DataType, TCInfoType, VectorType > AnalyzingAlgorithmValuePZ< DataType, TCInfoType, VectorType > AnalyzingAlgorithmValueQI< DataType, TCInfoType, VectorType >

Classes

struct  TcPair
 minimal struct for keeping track which tc is which More...
 

Public Member Functions

 BELLE2_DEFINE_EXCEPTION (No_refTC_Attached, "To given testTC no refTC was attached, could not provide valid data for algorithm - no value returned!")
 this exception is thrown if m_storeRefTCDataForTestTC is true and no refTC could be found
 
 AnalyzingAlgorithmBase ()
 constructor
 
virtual ~AnalyzingAlgorithmBase ()
 virtual destructor - derived classes need to write their own destructors if any other data members are added.
 
bool operator== (const AnalyzingAlgorithmBase &b) const
 operator for comparison.
 
AlgoritmType::Type getID () const
 returns unique ID
 
std::string getIDName () const
 returns unique ID as a string
 
virtual DataType calcData (const TCInfoType &)
 virtual class to calculate data.
 

Static Public Member Functions

static VectorType & getOrigin ()
 returns current value for the origin
 
static void setOrigin (VectorType newOrigin)
 set origin for all inherited classes
 
static bool willRefTCdataBeUsed4TestTCs ()
 returns current choice for behavior of algorithms in terms of storing reference or testData for successfully matched TCs
 
static void setWillRefTCdataBeUsed4TestTCs (bool newBehavior)
 set behavior of algorithms in terms of storing reference or testData for successfully matched TCs
 

Protected Member Functions

 AnalyzingAlgorithmBase (const AlgoritmType::Type &newID)
 constructor used for inheriting classes
 
 AnalyzingAlgorithmBase (const std::string &newID)
 constructor used for inheriting classes
 
 AnalyzingAlgorithmBase (const AnalyzingAlgorithmBase &algo)=delete
 copy constructor should not be used so delete it
 
AnalyzingAlgorithmBaseoperator= (const AnalyzingAlgorithmBase &algo)=delete
 also assignment constructor should not be used
 
virtual const TCInfoType & chooseCorrectTC (const TCInfoType &aTC) const
 virtual class to determine the correct TC to be used for algorithm calculation.
 
virtual const TcPair chooseCorrectPairOfTCs (const TCInfoType &aTC) const
 makes sure that TcPair.refTC and .testTC are correctly set - throws exception if there are problems
 

Protected Attributes

AlgoritmType::Type m_iD
 carries unique ID
 

Static Protected Attributes

static VectorType s_origin
 stores the origin used for some calculations, can be set here
 
static bool m_storeRefTCDataForTestTC
 if true, for testTC the values of attached refTC will be stored instead of own values.
 

Detailed Description

template<class DataType, class TCInfoType, class VectorType>
class Belle2::AnalyzingAlgorithmBase< DataType, TCInfoType, VectorType >

Base class for storing an algorithm determining the data one wants to have.

Definition at line 31 of file AnalyzingAlgorithmBase.h.

Constructor & Destructor Documentation

◆ AnalyzingAlgorithmBase() [1/3]

template<class DataType, class TCInfoType, class VectorType>
AnalyzingAlgorithmBase ( const AlgoritmType::Type & newID)
inlineexplicitprotected

constructor used for inheriting classes

Definition at line 68 of file AnalyzingAlgorithmBase.h.

68: m_iD(newID) {}

◆ AnalyzingAlgorithmBase() [2/3]

template<class DataType, class TCInfoType, class VectorType>
AnalyzingAlgorithmBase ( const std::string & newID)
inlineexplicitprotected

constructor used for inheriting classes

Definition at line 71 of file AnalyzingAlgorithmBase.h.

71: m_iD(AlgoritmType::getTypeEnum(newID)) {}

◆ AnalyzingAlgorithmBase() [3/3]

template<class DataType, class TCInfoType, class VectorType>
AnalyzingAlgorithmBase ( )
inline

constructor

Definition at line 119 of file AnalyzingAlgorithmBase.h.

119: m_iD(AlgoritmType::AnalyzingAlgorithmBase) {}

◆ ~AnalyzingAlgorithmBase()

template<class DataType, class TCInfoType, class VectorType>
virtual ~AnalyzingAlgorithmBase ( )
inlinevirtual

virtual destructor - derived classes need to write their own destructors if any other data members are added.

Definition at line 123 of file AnalyzingAlgorithmBase.h.

123{}

Member Function Documentation

◆ calcData()

template<class DataType, class TCInfoType, class VectorType>
virtual DataType calcData ( const TCInfoType & )
inlinevirtual

virtual class to calculate data.

takes two TCInfos

Reimplemented in AnalyzingAlgorithmLostUClusters< DataType, TCInfoType, VectorType >, AnalyzingAlgorithmLostUEDep< DataType, TCInfoType, VectorType >, AnalyzingAlgorithmLostVClusters< DataType, TCInfoType, VectorType >, AnalyzingAlgorithmLostVEDep< DataType, TCInfoType, VectorType >, AnalyzingAlgorithmResidualP< DataType, TCInfoType, VectorType >, AnalyzingAlgorithmResidualPAngle< DataType, TCInfoType, VectorType >, AnalyzingAlgorithmResidualPosition< DataType, TCInfoType, VectorType >, AnalyzingAlgorithmResidualPositionXY< DataType, TCInfoType, VectorType >, AnalyzingAlgorithmResidualPPhi< DataType, TCInfoType, VectorType >, AnalyzingAlgorithmResidualPT< DataType, TCInfoType, VectorType >, AnalyzingAlgorithmResidualPTAngle< DataType, TCInfoType, VectorType >, AnalyzingAlgorithmResidualPTheta< DataType, TCInfoType, VectorType >, AnalyzingAlgorithmResidualPX< DataType, TCInfoType, VectorType >, AnalyzingAlgorithmResidualPY< DataType, TCInfoType, VectorType >, AnalyzingAlgorithmResidualPZ< DataType, TCInfoType, VectorType >, AnalyzingAlgorithmTotalUClusters< DataType, TCInfoType, VectorType >, AnalyzingAlgorithmTotalUEDep< DataType, TCInfoType, VectorType >, AnalyzingAlgorithmTotalVClusters< DataType, TCInfoType, VectorType >, AnalyzingAlgorithmTotalVEDep< DataType, TCInfoType, VectorType >, AnalyzingAlgorithmValueDistSeed2IP< DataType, TCInfoType, VectorType >, AnalyzingAlgorithmValueDistSeed2IPXY< DataType, TCInfoType, VectorType >, AnalyzingAlgorithmValueDistSeed2IPZ< DataType, TCInfoType, VectorType >, AnalyzingAlgorithmValueP< DataType, TCInfoType, VectorType >, AnalyzingAlgorithmValuePPhi< DataType, TCInfoType, VectorType >, AnalyzingAlgorithmValuePT< DataType, TCInfoType, VectorType >, AnalyzingAlgorithmValuePTheta< DataType, TCInfoType, VectorType >, AnalyzingAlgorithmValuePX< DataType, TCInfoType, VectorType >, AnalyzingAlgorithmValuePY< DataType, TCInfoType, VectorType >, AnalyzingAlgorithmValuePZ< DataType, TCInfoType, VectorType >, and AnalyzingAlgorithmValueQI< DataType, TCInfoType, VectorType >.

Definition at line 153 of file AnalyzingAlgorithmBase.h.

154 {
155 B2ERROR(" AnalyzingAlgorithmBase::calcData: if you can see this, the code tried to return the actual baseClass instead of the inherited ones - this is unintended behavior!");
156 return DataType();
157 }

◆ chooseCorrectPairOfTCs()

template<class DataType, class TCInfoType, class VectorType>
virtual const TcPair chooseCorrectPairOfTCs ( const TCInfoType & aTC) const
inlineprotectedvirtual

makes sure that TcPair.refTC and .testTC are correctly set - throws exception if there are problems

Definition at line 100 of file AnalyzingAlgorithmBase.h.

101 {
102 // capture bad case, where second TC is missing:
103 if (aTC.m_assignedTC == nullptr) { throw AnalyzingAlgorithmBase::No_refTC_Attached(); }
104
105 if (aTC.m_tcType == TCType::Reference or aTC.m_tcType == TCType::Lost) {
106 return TcPair(aTC, *aTC.m_assignedTC);
107 }
108 return TcPair(*aTC.m_assignedTC, aTC);
109 }

◆ chooseCorrectTC()

template<class DataType, class TCInfoType, class VectorType>
virtual const TCInfoType & chooseCorrectTC ( const TCInfoType & aTC) const
inlineprotectedvirtual

virtual class to determine the correct TC to be used for algorithm calculation.

  • throws exception if there are problems. More explanations @ m_storeRefTCDataForTestTC.

Definition at line 84 of file AnalyzingAlgorithmBase.h.

85 {
86 // capture cases of aTC == referenceTC first:
87 if (TCType::isReference(aTC.m_tcType)) { return aTC; }
88
89 // is no reference TC and own data usage is allowed:
90 if (m_storeRefTCDataForTestTC == false) { return aTC; }
91
92 // handle cases when attached reference TC has to be used instead of own data:
93 if (aTC.m_assignedTC != nullptr) { return *aTC.m_assignedTC; }
94
95 throw AnalyzingAlgorithmBase::No_refTC_Attached();
96 }

◆ getID()

template<class DataType, class TCInfoType, class VectorType>
AlgoritmType::Type getID ( ) const
inline

returns unique ID

Definition at line 131 of file AnalyzingAlgorithmBase.h.

131{ return m_iD; }

◆ getIDName()

template<class DataType, class TCInfoType, class VectorType>
std::string getIDName ( ) const
inline

returns unique ID as a string

Definition at line 134 of file AnalyzingAlgorithmBase.h.

134{ return AlgoritmType::getTypeName(m_iD); }

◆ getOrigin()

template<class DataType, class TCInfoType, class VectorType>
static VectorType & getOrigin ( )
inlinestatic

returns current value for the origin

Definition at line 137 of file AnalyzingAlgorithmBase.h.

137{ return s_origin; }

◆ operator==()

template<class DataType, class TCInfoType, class VectorType>
bool operator== ( const AnalyzingAlgorithmBase< DataType, TCInfoType, VectorType > & b) const
inline

operator for comparison.

Definition at line 127 of file AnalyzingAlgorithmBase.h.

127{ return m_iD == b.getID(); }

◆ setOrigin()

template<class DataType, class TCInfoType, class VectorType>
static void setOrigin ( VectorType newOrigin)
inlinestatic

set origin for all inherited classes

Definition at line 141 of file AnalyzingAlgorithmBase.h.

141{ s_origin = newOrigin; }

◆ setWillRefTCdataBeUsed4TestTCs()

template<class DataType, class TCInfoType, class VectorType>
static void setWillRefTCdataBeUsed4TestTCs ( bool newBehavior)
inlinestatic

set behavior of algorithms in terms of storing reference or testData for successfully matched TCs

Definition at line 149 of file AnalyzingAlgorithmBase.h.

149{ m_storeRefTCDataForTestTC = newBehavior; }

◆ willRefTCdataBeUsed4TestTCs()

template<class DataType, class TCInfoType, class VectorType>
static bool willRefTCdataBeUsed4TestTCs ( )
inlinestatic

returns current choice for behavior of algorithms in terms of storing reference or testData for successfully matched TCs

Definition at line 145 of file AnalyzingAlgorithmBase.h.

145{ return m_storeRefTCDataForTestTC; }

Member Data Documentation

◆ m_iD

template<class DataType, class TCInfoType, class VectorType>
AlgoritmType::Type m_iD
protected

carries unique ID

Definition at line 51 of file AnalyzingAlgorithmBase.h.

◆ m_storeRefTCDataForTestTC

template<class DataType, class TCInfoType, class VectorType>
bool m_storeRefTCDataForTestTC
staticprotected

if true, for testTC the values of attached refTC will be stored instead of own values.

  • why are there values of the mcTC stored? we want to know the real data, not the guesses of the reconstructed data. Deviations of reference values to guesses of the reconstructed data will be stored in resiudals anyway.

Definition at line 64 of file AnalyzingAlgorithmBase.h.

◆ s_origin

template<class DataType, class TCInfoType, class VectorType>
VectorType s_origin
staticprotected

stores the origin used for some calculations, can be set here

Definition at line 55 of file AnalyzingAlgorithmBase.h.


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