 |
Belle II Software
release-05-02-19
|
13 #include <framework/logging/Logger.h>
14 #include <framework/core/FrameworkExceptions.h>
17 #include<tracking/trackFindingVXD/analyzingTools/TCType.h>
18 #include<tracking/trackFindingVXD/analyzingTools/AlgoritmType.h>
32 template <
class DataType,
class TCInfoType,
class VectorType>
33 class AnalyzingAlgorithmBase {
42 TcPair(
const TCInfoType& aRefTC,
const TCInfoType& aTestTC) :
refTC(&aRefTC),
testTC(&aTestTC) {}
95 if (aTC.assignedTC != NULL) {
return *aTC.assignedTC; }
97 throw AnalyzingAlgorithmBase::No_refTC_Attached();
105 if (aTC.assignedTC == NULL) {
throw AnalyzingAlgorithmBase::No_refTC_Attached(); }
107 if (aTC.tcType == TCType::Reference or aTC.tcType == TCType::Lost) {
108 return TcPair(aTC, *aTC.assignedTC);
117 "To given testTC no refTC was attached, could not provide valid data for algorithm - no value returned!");
157 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!");
164 template<
class DataType,
class TCInfoType,
class VectorType>
169 template<
class DataType,
class TCInfoType,
class VectorType>
174 template <
class DataType,
class TCInfoType,
class VectorType>
175 inline bool operator == (
const AnalyzingAlgorithmBase<DataType, TCInfoType, VectorType>& a,
const std::string& b)
176 {
return (a.getIDName() == b); }
180 template <
class DataType,
class TCInfoType,
class VectorType>
181 inline bool operator == (
const std::string& a,
const AnalyzingAlgorithmBase<DataType, TCInfoType, VectorType>& b)
182 {
return (a == b.getIDName()); }
186 template <
class DataType,
class TCInfoType,
class VectorType>
188 {
return (a.getID() == b); }
192 template <
class DataType,
class TCInfoType,
class VectorType>
194 {
return (a == b.getID()); }
bool operator==(const AnalyzingAlgorithmBase &b) const
operator for comparison.
AnalyzingAlgorithmBase()
constructor
bool operator==(const DecayNode &node1, const DecayNode &node2)
Compare two Decay Nodes: They are equal if All daughter decay nodes are equal or one of the daughter ...
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
AlgoritmType::Type m_iD
carries unique ID
minimal struct for keeping track which tc is which
const TCInfoType * refTC
here the reference TC will be stored
static bool willRefTCdataBeUsed4TestTCs()
returns current choice for behavior of algorithms in terms of storing reference or testData for succe...
static bool isReference(TCType::Type aType)
returns true if given TCType is a reference-Type, false if not
static std::string getTypeName(AlgoritmType::Type type)
for given AlgoritmType the corresponding string-name will be returned.
AlgoritmType::Type getID() const
returns unique ID
static VectorType s_origin
stores the origin used for some calculations, can be set here
std::string getIDName() const
returns unique ID as a string
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 exeption if there are problems
Abstract base class for different kinds of events.
virtual DataType calcData(const TCInfoType &)
virtual class to calculate data.
AnalyzingAlgorithmBase & operator=(const AnalyzingAlgorithmBase &algo)=delete
also assignement constructor should not be used
TcPair()
standard constructor sets NULL-ptrs.
const TCInfoType * testTC
here the TC to be tested will be stored
static bool m_storeRefTCDataForTestTC
if true, for testTC the values of attached refTC will be stored instead of own values.
static void setOrigin(VectorType newOrigin)
set origin for all inherited classes
Base class for storing an algorithm determining the data one wants to have.
Small class for classifying types of analyzing algorithms.
static void setWillRefTCdataBeUsed4TestTCs(bool newBehavior)
set behavior of algorithms in terms of storing reference or testData for successfully matched TCs
static VectorType & getOrigin()
returns current value for the origin
Type
allows classifying Analyzing algorithms
virtual ~AnalyzingAlgorithmBase()
virtual destructor - derived classes need to write their own destructors if any other data members ar...