10#include <svd/dataobjects/SVDCluster.h>
14#include <tracking/spacePointCreation/SpacePoint.h>
15#include <tracking/trackFindingVXD/analyzingTools/algorithms/AnalyzingAlgorithmBase.h>
27 namespace AnalyzingAlgorithmHelper {
39 template <
class TrackCandType>
40 std::vector<const Belle2::SVDCluster*>
getSVDClusters(
const TrackCandType* aTC,
bool wantUCluster)
42 std::vector<const Belle2::SVDCluster*> clusters;
44 auto relatedClusters = aHit->getRelationsTo<
SVDCluster>(
"ALL");
46 if (aCluster.isUCluster() == wantUCluster) { clusters.push_back(&aCluster); }
59 template <
class ClusterType>
61 std::vector<const ClusterType*>& secondTC)
63 auto compareClusters = [](
const ClusterType * a,
const ClusterType * b) ->
bool {
64 return (a->getSensorID() == b->getSensorID()
65 and a->isUCluster() == b->isUCluster()
66 and a->getPosition() == b->getPosition()); };
68 std::vector<const ClusterType*> uniqueClusters;
69 for (
const auto* firstCluster : firstTC) {
70 for (
const auto* secondCluster : secondTC) {
71 if (compareClusters(firstCluster, secondCluster)) { uniqueClusters.push_back(firstCluster);
break; }
74 return uniqueClusters;
83 template <
class DataType,
class TCInfoType,
class VectorType>
91 DataType
calcData(
const TCInfoType& aTC)
override
104 template <
class DataType,
class TCInfoType,
class VectorType>
125 template <
class DataType,
class TCInfoType,
class VectorType>
133 virtual DataType
calcData(
const TCInfoType& aTC)
override
142 for (
const SVDCluster* aCluster : lostuClusters) {
143 lostEdep.push_back(
double(aCluster->getCharge()));
152 template <
class DataType,
class TCInfoType,
class VectorType>
160 virtual DataType
calcData(
const TCInfoType& aTC)
override
169 for (
const SVDCluster* aCluster : lostvClusters) {
170 lostEdep.push_back(
double(aCluster->getCharge()));
183 template <
class DataType,
class TCInfoType,
class VectorType>
196 return uClusters.size();
203 template <
class DataType,
class TCInfoType,
class VectorType>
216 return vClusters.size();
223 template <
class DataType,
class TCInfoType,
class VectorType>
231 virtual DataType
calcData(
const TCInfoType& aTC)
override
237 for (
const SVDCluster* aCluster : uClusters) {
238 totalEDep.push_back(
double(aCluster->getCharge()));
247 template <
class DataType,
class TCInfoType,
class VectorType>
255 virtual DataType
calcData(
const TCInfoType& aTC)
override
261 for (
const SVDCluster* aCluster : vClusters) {
262 totalEDep.push_back(
double(aCluster->getCharge()));
Small class for classifying types of analyzing algorithms.
Base class for storing an algorithm determining the data one wants to have.
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
Class for storing an algorithm to find out how many u-type-clusters the testTC lost compared to the r...
AnalyzingAlgorithmLostUClusters()
constructor
DataType calcData(const TCInfoType &aTC) override
returns how many u-type-clusters the testTC lost compared to the refTC
Class for storing an algorithm to find out the energy deposit of u-type-clusters the testTC lost comp...
virtual DataType calcData(const TCInfoType &aTC) override
returns the energy deposit of u-type-clusters the testTC lost compared to the refTC
AnalyzingAlgorithmLostUEDep()
constructor
Class for storing an algorithm to find out how many v-type-clusters the testTC lost compared to the r...
AnalyzingAlgorithmLostVClusters()
constructor
DataType calcData(const TCInfoType &aTC) override
returns how many v-type-clusters the testTC lost compared to the refTC
Class for storing an algorithm to find out the energy deposit of v-type-clusters the testTC lost comp...
virtual DataType calcData(const TCInfoType &aTC) override
returns the energy deposit of v-type-clusters the testTC lost compared to the refTC
AnalyzingAlgorithmLostVEDep()
constructor
Class for storing an algorithm to find out how many u-type-clusters the given TC had.
AnalyzingAlgorithmTotalUClusters()
constructor
DataType calcData(const TCInfoType &aTC) override
returns how many u-type-clusters the given TC had
Class for storing an algorithm to find out the energy deposit of u-type-clusters the given TC had.
virtual DataType calcData(const TCInfoType &aTC) override
returns the energy deposit of u-type-clusters the given TC had
AnalyzingAlgorithmTotalUEDep()
constructor
Class for storing an algorithm to find out how many v-type-clusters the given TC had.
AnalyzingAlgorithmTotalVClusters()
constructor
DataType calcData(const TCInfoType &aTC) override
returns how many v-type-clusters the given TC had
Class for storing an algorithm to find out the energy deposit of v-type-clusters the given TC had.
AnalyzingAlgorithmTotalVEDep()
constructor
virtual DataType calcData(const TCInfoType &aTC) override
returns the energy deposit of v-type-clusters the given TC had
The SVD Cluster class This class stores all information about reconstructed SVD clusters.
SpacePoint typically is build from 1 PXDCluster or 1-2 SVDClusters.
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
Abstract base class for different kinds of events.