15 #include <framework/datastore/StoreArray.h>
17 #include <mdst/dataobjects/MCParticle.h>
18 #include <svd/dataobjects/SVDTrueHit.h>
20 #include <vxd/dataobjects/VxdID.h>
22 #include <tracking/dataobjects/DATCONSVDSpacePoint.h>
24 #include <unordered_map>
36 struct ClustersOnSensor {
41 inline void addCluster(
const SVDCluster* entry)
43 vxdID = entry->getSensorID();
44 if (entry->isUCluster() ==
true) {
clustersU.push_back(entry);
return; }
74 for (
unsigned int i = 0; i < uint(DATCONSVDClusters.
getEntries()); ++i) {
75 const SVDCluster* currentCluster = DATCONSVDClusters[i];
76 std::vector<const SVDCluster*> currentClusterCombi = { currentCluster };
93 std::vector< std::vector<const SVDCluster*> >& foundCombinations)
96 for (
const SVDCluster* uCluster : aSensor.
clustersU) {
99 for (
const SVDCluster* vCluster : aSensor.
clustersV) {
103 foundCombinations.push_back({uCluster, vCluster});
117 StoreArray<DATCONSVDSpacePoint>& spacePoints)
120 std::unordered_map<VxdID::baseType, Belle2::ClustersOnSensor> activatedSensors;
123 std::vector<std::vector<const SVDCluster*> > foundCombinations;
127 for (
unsigned int i = 0; i < uint(DATCONSVDClusters.getEntries()); ++i) {
128 SVDCluster* currentCluster = DATCONSVDClusters[i];
130 activatedSensors[currentCluster->
getSensorID().
getID()].addCluster(currentCluster);
133 for (
auto& aSensor : activatedSensors) {
138 for (
auto& clusterCombi : foundCombinations) {
139 DATCONSVDSpacePoint* newSP = spacePoints.appendNew(clusterCombi);
140 for (
auto* cluster : clusterCombi) {
141 newSP->addRelationTo(cluster, cluster->isUCluster() ? 1. : -1.);
143 RelationVector<MCParticle> relatedMC = cluster->getRelationsTo<MCParticle>();
144 RelationVector<SVDTrueHit> relatedSVDTrue = cluster->getRelationsTo<SVDTrueHit>();
147 if (relatedMC.size() > 0) {
148 for (
unsigned int relmcindex = 0; relmcindex < relatedMC.size(); relmcindex++) {
149 newSP->addRelationTo(relatedMC[relmcindex], relatedMC.weight(relmcindex));
152 if (relatedSVDTrue.size() > 0) {
153 for (
unsigned int reltruehitindex = 0; reltruehitindex < relatedSVDTrue.size(); reltruehitindex++) {
154 newSP->addRelationTo(relatedSVDTrue[reltruehitindex], relatedSVDTrue.weight(reltruehitindex));