11#include <framework/logging/Logger.h>
12#include <framework/core/FrameworkExceptions.h>
15#include<tracking/trackFindingVXD/analyzingTools/TCType.h>
16#include<tracking/trackFindingVXD/analyzingTools/AlgoritmType.h>
30 template <
class DataType,
class TCInfoType,
class VectorType>
40 TcPair(
const TCInfoType& aRefTC,
const TCInfoType& aTestTC) :
refTC(&aRefTC),
testTC(&aTestTC) {}
93 if (aTC.assignedTC !=
nullptr) {
return *aTC.assignedTC; }
95 throw AnalyzingAlgorithmBase::No_refTC_Attached();
103 if (aTC.assignedTC ==
nullptr) {
throw AnalyzingAlgorithmBase::No_refTC_Attached(); }
105 if (aTC.tcType == TCType::Reference or aTC.tcType == TCType::Lost) {
106 return TcPair(aTC, *aTC.assignedTC);
108 return TcPair(*aTC.assignedTC, aTC);
115 "To given testTC no refTC was attached, could not provide valid data for algorithm - no value returned!");
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!");
162 template<
class DataType,
class TCInfoType,
class VectorType>
167 template<
class DataType,
class TCInfoType,
class VectorType>
172 template <
class DataType,
class TCInfoType,
class VectorType>
174 {
return (a.getIDName() == b); }
178 template <
class DataType,
class TCInfoType,
class VectorType>
180 {
return (a == b.getIDName()); }
184 template <
class DataType,
class TCInfoType,
class VectorType>
186 {
return (a.getID() == b); }
190 template <
class DataType,
class TCInfoType,
class VectorType>
192 {
return (a == b.getID()); }
Small class for classifying types of analyzing algorithms.
Type
allows classifying Analyzing algorithms
static std::string getTypeName(AlgoritmType::Type type)
for given AlgoritmType the corresponding string-name will be returned.
Base class for storing an algorithm determining the data one wants to have.
AnalyzingAlgorithmBase & operator=(const AnalyzingAlgorithmBase &algo)=delete
also assignment constructor should not be used
virtual DataType calcData(const TCInfoType &)
virtual class to calculate data.
static bool willRefTCdataBeUsed4TestTCs()
returns current choice for behavior of algorithms in terms of storing reference or testData for succe...
static void setWillRefTCdataBeUsed4TestTCs(bool newBehavior)
set behavior of algorithms in terms of storing reference or testData for successfully matched TCs
AlgoritmType::Type m_iD
carries unique ID
AlgoritmType::Type getID() const
returns unique ID
AnalyzingAlgorithmBase(const AnalyzingAlgorithmBase &algo)=delete
copy constructor should not be used so delete it
bool operator==(const AnalyzingAlgorithmBase &b) const
operator for comparison.
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(const std::string &newID)
constructor used for inheriting classes
AnalyzingAlgorithmBase(const AlgoritmType::Type &newID)
constructor used for inheriting classes
virtual const TCInfoType & chooseCorrectTC(const TCInfoType &aTC) const
virtual class to determine the correct TC to be used for algorithm calculation.
virtual ~AnalyzingAlgorithmBase()
virtual destructor - derived classes need to write their own destructors if any other data members ar...
virtual const TcPair chooseCorrectPairOfTCs(const TCInfoType &aTC) const
makes sure that TcPair.refTC and .testTC are correctly set - throws exception if there are problems
static VectorType & getOrigin()
returns current value for the origin
AnalyzingAlgorithmBase()
constructor
std::string getIDName() const
returns unique ID as a string
static void setOrigin(VectorType newOrigin)
set origin for all inherited classes
static bool isReference(TCType::Type aType)
returns true if given TCType is a reference-Type, false if not
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 ...
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.
Abstract base class for different kinds of events.
minimal struct for keeping track which tc is which
TcPair(const TCInfoType &aRefTC, const TCInfoType &aTestTC)
constructor sets valid values
const TCInfoType * testTC
here the TC to be tested will be stored
const TCInfoType * refTC
here the reference TC will be stored
TcPair()
standard constructor sets nullptr-ptrs.