10#include <svd/dataobjects/SVDCluster.h>
14#include <tracking/spacePointCreation/SpacePoint.h>
15#include <tracking/trackFindingVXD/analyzingTools/algorithms/AnalyzingAlgorithmBase.h>
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); }
58 template <
class ClusterType>
60 std::vector<const ClusterType*>& secondTC)
62 auto compareClusters = [](
const ClusterType * a,
const ClusterType * b) ->
bool {
63 return (a->getSensorID() == b->getSensorID()
64 and a->isUCluster() == b->isUCluster()
65 and a->getPosition() == b->getPosition()); };
67 std::vector<const ClusterType*> uniqueClusters;
68 for (
const auto* firstCluster : firstTC) {
69 for (
const auto* secondCluster : secondTC) {
70 if (compareClusters(firstCluster, secondCluster)) { uniqueClusters.push_back(firstCluster);
break; }
73 return uniqueClusters;
82 template <
class DataType,
class TCInfoType,
class VectorType>
90 DataType
calcData(
const TCInfoType& aTC)
override
103 template <
class DataType,
class TCInfoType,
class VectorType>
124 template <
class DataType,
class TCInfoType,
class VectorType>
132 virtual DataType
calcData(
const TCInfoType& aTC)
override
141 for (
const SVDCluster* aCluster : lostuClusters) {
142 lostEdep.push_back(
double(aCluster->getCharge()));
151 template <
class DataType,
class TCInfoType,
class VectorType>
159 virtual DataType
calcData(
const TCInfoType& aTC)
override
168 for (
const SVDCluster* aCluster : lostvClusters) {
169 lostEdep.push_back(
double(aCluster->getCharge()));
182 template <
class DataType,
class TCInfoType,
class VectorType>
195 return uClusters.size();
202 template <
class DataType,
class TCInfoType,
class VectorType>
215 return vClusters.size();
222 template <
class DataType,
class TCInfoType,
class VectorType>
230 virtual DataType
calcData(
const TCInfoType& aTC)
override
236 for (
const SVDCluster* aCluster : uClusters) {
237 totalEDep.push_back(
double(aCluster->getCharge()));
246 template <
class DataType,
class TCInfoType,
class VectorType>
254 virtual DataType
calcData(
const TCInfoType& aTC)
override
260 for (
const SVDCluster* aCluster : vClusters) {
261 totalEDep.push_back(
double(aCluster->getCharge()));
Small class for classifying types of analyzing algorithms.
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 const TcPair chooseCorrectPairOfTCs(const TCInfoType &aTC) const
makes sure that TcPair.refTC and .testTC are correctly set - throws exception if there are problems
AnalyzingAlgorithmLostUClusters()
constructor
DataType calcData(const TCInfoType &aTC) override
returns how many u-type-clusters the testTC lost compared to the refTC
virtual DataType calcData(const TCInfoType &aTC) override
returns the energy deposit of u-type-clusters the testTC lost compared to the refTC
AnalyzingAlgorithmLostUEDep()
constructor
AnalyzingAlgorithmLostVClusters()
constructor
DataType calcData(const TCInfoType &aTC) override
returns how many v-type-clusters the testTC lost compared to the refTC
virtual DataType calcData(const TCInfoType &aTC) override
returns the energy deposit of v-type-clusters the testTC lost compared to the refTC
AnalyzingAlgorithmLostVEDep()
constructor
AnalyzingAlgorithmTotalUClusters()
constructor
DataType calcData(const TCInfoType &aTC) override
returns how many 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
AnalyzingAlgorithmTotalVClusters()
constructor
DataType calcData(const TCInfoType &aTC) override
returns how many 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.
INFO This file contains all the algorithms retrieving infos from Clusters.
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)
non-memberfunction Comparison for equality two clusters
Abstract base class for different kinds of events.