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

Class for storing an algorithm to find out the energy deposit of v-type-clusters the testTC lost compared to the refTC. More...

#include <AnalyzingAlgorithmClusterBased.h>

Inheritance diagram for AnalyzingAlgorithmLostVEDep< DataType, TCInfoType, VectorType >:
AnalyzingAlgorithmBase< DataType, TCInfoType, VectorType >

Public Member Functions

 AnalyzingAlgorithmLostVEDep ()
 constructor
 
virtual DataType calcData (const TCInfoType &aTC) override
 returns the energy deposit of v-type-clusters the testTC lost compared to the refTC
 
 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
 
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
 

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

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
 

Protected Attributes

AlgoritmType::Type m_iD
 carries unique ID
 

Static Protected Attributes

static VectorType s_origin = VectorType(0, 0, 0)
 stores the origin used for some calculations, can be set here
 
static bool m_storeRefTCDataForTestTC = false
 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::AnalyzingAlgorithmLostVEDep< DataType, TCInfoType, VectorType >

Class for storing an algorithm to find out the energy deposit of v-type-clusters the testTC lost compared to the refTC.

Definition at line 153 of file AnalyzingAlgorithmClusterBased.h.

Constructor & Destructor Documentation

◆ AnalyzingAlgorithmLostVEDep()

constructor

Definition at line 156 of file AnalyzingAlgorithmClusterBased.h.

156 : AnalyzingAlgorithmBase<DataType, TCInfoType, VectorType>
157 (AlgoritmType::AnalyzingAlgorithmLostVEDep) {}

Member Function Documentation

◆ calcData()

virtual DataType calcData ( const TCInfoType &  aTC)
inlineoverridevirtual

returns the energy deposit of v-type-clusters the testTC lost compared to the refTC

Reimplemented from AnalyzingAlgorithmBase< DataType, TCInfoType, VectorType >.

Definition at line 160 of file AnalyzingAlgorithmClusterBased.h.

161 {
162 DataType lostEdep;
164 std::vector<const SVDCluster*> vClustersRef = AnalyzingAlgorithmHelper::getSVDClusters(tcs.refTC->tC, false);
165 std::vector<const SVDCluster*> vClustersTest = AnalyzingAlgorithmHelper::getSVDClusters(tcs.testTC->tC, false);
166
167 std::vector<const SVDCluster*> lostvClusters = AnalyzingAlgorithmHelper::getUniqueClusters(vClustersRef, vClustersTest);
168
169 for (const SVDCluster* aCluster : lostvClusters) {
170 lostEdep.push_back(double(aCluster->getCharge()));
171 }
172 return lostEdep;
173 }
virtual const TcPair chooseCorrectPairOfTCs(const TCInfoType &aTC) const
makes sure that TcPair.refTC and .testTC are correctly set - throws exeption if there are problems
std::vector< const ClusterType * > getUniqueClusters(std::vector< const ClusterType * > &firstTC, std::vector< const ClusterType * > &secondTC)
helper function to retrieve the number of unique Clusters of first tc given, compared with second tc
std::vector< const Belle2::SVDCluster * > getSVDClusters(const TrackCandType *aTC, bool wantUCluster)
helper function to retrieve SVDClusters from a given TC

◆ chooseCorrectPairOfTCs()

virtual const TcPair chooseCorrectPairOfTCs ( const TCInfoType &  aTC) const
inlineprotectedvirtualinherited

makes sure that TcPair.refTC and .testTC are correctly set - throws exeption 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.assignedTC == nullptr) { throw AnalyzingAlgorithmBase::No_refTC_Attached(); }
104
105 if (aTC.tcType == TCType::Reference or aTC.tcType == TCType::Lost) {
106 return TcPair(aTC, *aTC.assignedTC);
107 }
108 return TcPair(*aTC.assignedTC, aTC);
109 }

◆ chooseCorrectTC()

virtual const TCInfoType & chooseCorrectTC ( const TCInfoType &  aTC) const
inlineprotectedvirtualinherited

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

  • throws exeption 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.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.assignedTC != nullptr) { return *aTC.assignedTC; }
94
95 throw AnalyzingAlgorithmBase::No_refTC_Attached();
96 }
static bool isReference(TCType::Type aType)
returns true if given TCType is a reference-Type, false if not
Definition: TCType.h:86
static bool m_storeRefTCDataForTestTC
if true, for testTC the values of attached refTC will be stored instead of own values.

◆ getID()

AlgoritmType::Type getID ( ) const
inlineinherited

returns unique ID

Definition at line 131 of file AnalyzingAlgorithmBase.h.

131{ return m_iD; }
AlgoritmType::Type m_iD
carries unique ID

◆ getIDName()

std::string getIDName ( ) const
inlineinherited

returns unique ID as a string

Definition at line 134 of file AnalyzingAlgorithmBase.h.

static std::string getTypeName(AlgoritmType::Type type)
for given AlgoritmType the corresponding string-name will be returned.
Definition: AlgoritmType.h:86

◆ getOrigin()

static VectorType & getOrigin ( )
inlinestaticinherited

returns current value for the origin

Definition at line 137 of file AnalyzingAlgorithmBase.h.

137{ return s_origin; }
static VectorType s_origin
stores the origin used for some calculations, can be set here

◆ operator==()

bool operator== ( const AnalyzingAlgorithmBase< DataType, TCInfoType, VectorType > &  b) const
inlineinherited

operator for comparison.

Definition at line 127 of file AnalyzingAlgorithmBase.h.

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

◆ setOrigin()

static void setOrigin ( VectorType  newOrigin)
inlinestaticinherited

set origin for all inherited classes

Definition at line 141 of file AnalyzingAlgorithmBase.h.

141{ s_origin = newOrigin; }

◆ setWillRefTCdataBeUsed4TestTCs()

static void setWillRefTCdataBeUsed4TestTCs ( bool  newBehavior)
inlinestaticinherited

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()

static bool willRefTCdataBeUsed4TestTCs ( )
inlinestaticinherited

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.

Member Data Documentation

◆ m_iD

AlgoritmType::Type m_iD
protectedinherited

carries unique ID

Definition at line 51 of file AnalyzingAlgorithmBase.h.


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