12 #include <svd/dataobjects/SVDCluster.h>
16 #include <tracking/spacePointCreation/SpacePoint.h>
17 #include <tracking/trackFindingVXD/analyzingTools/algorithms/AnalyzingAlgorithmBase.h>
29 namespace AnalyzingAlgorithmHelper {
41 template <
class TrackCandType>
42 std::vector<const Belle2::SVDCluster*>
getSVDClusters(
const TrackCandType* aTC,
bool wantUCluster)
44 std::vector<const Belle2::SVDCluster*> clusters;
46 auto relatedClusters = aHit->getRelationsTo<
SVDCluster>(
"ALL");
48 if (aCluster.isUCluster() == wantUCluster) { clusters.push_back(&aCluster); }
60 template <
class ClusterType>
61 std::vector<const ClusterType*>
getUniqueClusters(std::vector<const ClusterType*>& firstTC,
62 std::vector<const ClusterType*>& secondTC)
64 auto compareClusters = [](
const ClusterType * a,
const ClusterType * b) ->
bool {
65 return (a->getSensorID() == b->getSensorID()
66 and a->isUCluster() == b->isUCluster()
67 and a->getPosition() == b->getPosition()); };
69 std::vector<const ClusterType*> uniqueClusters;
70 for (
const auto* firstCluster : firstTC) {
71 for (
const auto* secondCluster : secondTC) {
72 if (compareClusters(firstCluster, secondCluster)) { uniqueClusters.push_back(firstCluster);
break; }
75 return uniqueClusters;
84 template <
class DataType,
class TCInfoType,
class VectorType>
85 class AnalyzingAlgorithmLostUClusters :
public AnalyzingAlgorithmBase<DataType, TCInfoType, VectorType> {
92 DataType
calcData(
const TCInfoType& aTC)
override
105 template <
class DataType,
class TCInfoType,
class VectorType>
110 (AlgoritmType::AnalyzingAlgorithmLostVClusters) {}
113 DataType
calcData(
const TCInfoType& aTC)
override
126 template <
class DataType,
class TCInfoType,
class VectorType>
134 virtual DataType
calcData(
const TCInfoType& aTC)
143 for (
const SVDCluster* aCluster : lostuClusters) {
144 lostEdep.push_back(
double(aCluster->getCharge()));
153 template <
class DataType,
class TCInfoType,
class VectorType>
154 class AnalyzingAlgorithmLostVEDep :
public AnalyzingAlgorithmBase<DataType, TCInfoType, VectorType> {
161 virtual DataType
calcData(
const TCInfoType& aTC)
170 for (
const SVDCluster* aCluster : lostvClusters) {
171 lostEdep.push_back(
double(aCluster->getCharge()));
184 template <
class DataType,
class TCInfoType,
class VectorType>
185 class AnalyzingAlgorithmTotalUClusters :
public AnalyzingAlgorithmBase<DataType, TCInfoType, VectorType> {
192 DataType
calcData(
const TCInfoType& aTC)
override
197 return uClusters.size();
204 template <
class DataType,
class TCInfoType,
class VectorType>
209 (AlgoritmType::AnalyzingAlgorithmTotalVClusters) {}
212 DataType
calcData(
const TCInfoType& aTC)
override
217 return vClusters.size();
224 template <
class DataType,
class TCInfoType,
class VectorType>
229 (AlgoritmType::AnalyzingAlgorithmTotalUEDep) {}
232 virtual DataType
calcData(
const TCInfoType& aTC)
238 for (
const SVDCluster* aCluster : uClusters) {
239 totalEDep.push_back(
double(aCluster->getCharge()));
248 template <
class DataType,
class TCInfoType,
class VectorType>
249 class AnalyzingAlgorithmTotalVEDep :
public AnalyzingAlgorithmBase<DataType, TCInfoType, VectorType> {
253 (AlgoritmType::AnalyzingAlgorithmTotalVEDep) {}
256 virtual DataType
calcData(
const TCInfoType& aTC)
262 for (
const SVDCluster* aCluster : vClusters) {
263 totalEDep.push_back(
double(aCluster->getCharge()));