diff --git a/JugFast/src/components/ClusterMerger.cpp b/JugFast/src/components/ClusterMerger.cpp index c4e05daf1cc1bb24cef1cbaf58ca07d60d5ec9c1..48b74f4d7de2cae9bfb2860ea3336faba283307c 100644 --- a/JugFast/src/components/ClusterMerger.cpp +++ b/JugFast/src/components/ClusterMerger.cpp @@ -21,6 +21,8 @@ using namespace Gaudi::Units; +using Vector3f = decltype(eicd::ClusterData::position); + namespace Jug::Fast { /** Simple algorithm to merge clusters orinating from the same particle together, @@ -81,9 +83,9 @@ public: if (msgLevel(MSG::DEBUG)) { debug() << "Step 1/1: Merging clusters where needed" << endmsg; } - for (const auto& [mcID, clusters] : clusterMap) { + for (const auto& [mcp, clusters] : clusterMap) { if (msgLevel(MSG::DEBUG)) { - debug() << " --> Processing " << clusters.size() << " clusters for mcID " << mcID << endmsg; + debug() << " --> Processing " << clusters.size() << " clusters for mc.id " << mcp.id() << endmsg; } if (clusters.size() == 1) { const auto& clus = clusters[0]; @@ -94,9 +96,9 @@ public: auto new_clus = clus.clone(); merged.push_back(new_clus); auto ca = assoc2.create(); - ca.setSimID(mcID); ca.setWeight(1.0); ca.setRec(new_clus); + ca.setSim(mcp); } else { auto new_clus = merged.create(); // calculate aggregate info @@ -104,7 +106,7 @@ public: float energyError = 0; float time = 0; int nhits = 0; - eicd::Vector3f position; + Vector3f position; for (const auto& clus : clusters) { if (msgLevel(MSG::DEBUG)) { debug() << " --> Adding cluster with energy: " << clus.getEnergy() << endmsg; @@ -128,9 +130,9 @@ public: debug() << " --> Merged cluster with energy: " << new_clus.getEnergy() << endmsg; } auto ca = assoc2.create(); - ca.setSimID(mcID); ca.setWeight(1.0); ca.setRec(new_clus); + ca.setSim(mcp); } } @@ -140,42 +142,42 @@ public: } // get a map of MCParticle index--> std::vector for clusters that belong together - std::map> indexedClusterLists( + std::map> indexedClusterLists( const eicd::ClusterCollection& clusters, const eicd::MCRecoClusterParticleAssociationCollection& associations ) const { - std::map> matched = {}; + std::map> matched = {}; // loop over clusters for (const auto& cluster : clusters) { - int mcID = -1; + edm4hep::MCParticle mcp; // find associated particle for (const auto& assoc : associations) { if (assoc.getRec() == cluster) { - mcID = assoc.getSimID(); + mcp = assoc.getSim(); break; } } if (msgLevel(MSG::VERBOSE)) { - verbose() << " --> Found cluster with mcID " << mcID << " and energy " + verbose() << " --> Found cluster with mc.id " << mcp.id() << " and energy " << cluster.getEnergy() << endmsg; } - if (mcID < 0) { + if (mcp.id() < 10000) { if (msgLevel(MSG::VERBOSE)) { verbose() << " --> WARNING: no valid MC truth link found, skipping cluster..." << endmsg; } continue; } - if (!matched.count(mcID)) { - matched[mcID] = {}; + if (!matched.count(mcp)) { + matched[mcp] = {}; } - matched[mcID].push_back(cluster); + matched[mcp].push_back(cluster); } return matched; } diff --git a/JugFast/src/components/MatchClusters.cpp b/JugFast/src/components/MatchClusters.cpp index 273c99634b3e751eb8e5617d4de9cb9a4559f230..ab5bca2b53b1a4064e8b372f3131ac93ffbf6ed7 100644 --- a/JugFast/src/components/MatchClusters.cpp +++ b/JugFast/src/components/MatchClusters.cpp @@ -2,7 +2,7 @@ // Copyright (C) 2022 Sylvester Joosten // Takes a list of particles (presumed to be from tracking), and all available clusters. -// 1. Match clusters to their tracks using the mcID field +// 1. Match clusters to their tracks using the mc particle // 2. For unmatched clusters create neutrals and add to the particle list #include @@ -71,7 +71,7 @@ public: debug() << "Processing cluster info for new event" << endmsg; } // input collection - const auto& mcparticles = *(m_inputMCParticles.get()); + //const auto& mcparticles = *(m_inputMCParticles.get()); const auto& inparts = *(m_inputParticles.get()); const auto& inpartsassoc = *(m_inputParticlesAssoc.get()); auto& outparts = *(m_outputParticles.createAndPut()); @@ -100,40 +100,40 @@ public: auto outpart = inpart.clone(); outparts.push_back(outpart); - int mcID = -1; + edm4hep::MCParticle mc; // find associated particle for (const auto& assoc: inpartsassoc) { if (assoc.getRec() == inpart) { - mcID = assoc.getSimID(); + mc = assoc.getSim(); break; } } if (msgLevel(MSG::VERBOSE)) { - verbose() << " --> Found particle with mcID " << mcID << endmsg; + verbose() << " --> Found particle with mc.id() " << mc.id() << endmsg; } - if (mcID < 0) { + if (mc.id() == 0) { if (msgLevel(MSG::DEBUG)) { - debug() << " --> cannot match track without associated mcID" << endmsg; + debug() << " --> cannot match track without associated mc particle" << endmsg; } continue; } - if (clusterMap.count(mcID)) { - const auto& clus = clusterMap[mcID]; + if (clusterMap.count(mc)) { + const auto& clus = clusterMap[mc]; if (msgLevel(MSG::DEBUG)) { debug() << " --> found matching cluster with energy: " << clus.getEnergy() << endmsg; } - clusterMap.erase(mcID); + clusterMap.erase(mc); } // create truth associations auto assoc = outpartsassoc.create(); - assoc.setSimID(mcID); assoc.setWeight(1.0); assoc.setRec(outpart); + assoc.setSim(mc); } // 2. Now loop over all remaining clusters and add neutrals. Also add in Hcal energy @@ -141,14 +141,13 @@ public: if (msgLevel(MSG::DEBUG)) { debug() << "Step 2/2: Creating neutrals for remaining clusters..." << endmsg; } - for (const auto& [mcID, clus] : clusterMap) { + for (const auto& [mc, clus] : clusterMap) { if (msgLevel(MSG::DEBUG)) { debug() << " --> Processing unmatched cluster with energy: " << clus.getEnergy() << endmsg; } // get mass/PDG from mcparticles, 0 (unidentified) in case the matched particle is charged. - const auto& mc = mcparticles[mcID]; const double mass = (!mc.getCharge()) ? mc.getMass() : 0; const int32_t pdg = (!mc.getCharge()) ? mc.getPDG() : 0; if (msgLevel(MSG::DEBUG)) { @@ -171,9 +170,9 @@ public: // Create truth associations auto assoc = outpartsassoc.create(); - assoc.setSimID(mcID); assoc.setWeight(1.0); assoc.setRec(outpart); + assoc.setSim(mc); } return StatusCode::SUCCESS; } @@ -197,14 +196,14 @@ private: return ret; } - // get a map of mcID --> cluster + // get a map of mc --> cluster // input: cluster_collections --> list of handles to all cluster collections - std::map + std::map indexedClusters( const std::vector*>& cluster_collections, const std::vector*>& associations_collections ) const { - std::map matched = {}; + std::map matched = {}; // loop over cluster collections for (const auto& cluster_handle : cluster_collections) { @@ -213,7 +212,7 @@ private: // loop over clusters for (const auto& cluster : clusters) { - int mcID = -1; + edm4hep::MCParticle mcp; // loop over association collections for (const auto& associations_handle : associations_collections) { @@ -222,39 +221,39 @@ private: // find associated particle for (const auto& assoc : associations) { if (assoc.getRec() == cluster) { - mcID = assoc.getSimID(); + mcp = assoc.getSim(); break; } } // found associated particle - if (mcID != -1) { + if (mcp.id() > 0) { break; } } if (msgLevel(MSG::VERBOSE)) { - verbose() << " --> Found cluster with mcID " << mcID << " and energy " + verbose() << " --> Found cluster with mcp.id() " << mcp.id() << " and energy " << cluster.getEnergy() << endmsg; } - if (mcID < 0) { + if (mcp.id() == 0) { if (msgLevel(MSG::VERBOSE)) { verbose() << " --> WARNING: no valid MC truth link found, skipping cluster..." << endmsg; } continue; } - const bool duplicate = matched.count(mcID); + const bool duplicate = matched.count(mcp); if (duplicate) { if (msgLevel(MSG::VERBOSE)) { - verbose() << " --> WARNING: this is a duplicate mcID, keeping the higher energy cluster" << endmsg; + verbose() << " --> WARNING: this is a duplicate mc, keeping the higher energy cluster" << endmsg; } - if (cluster.getEnergy() < matched[mcID].getEnergy()) { + if (cluster.getEnergy() < matched[mcp].getEnergy()) { continue; } } - matched[mcID] = cluster; + matched[mcp] = cluster; } } return matched; diff --git a/JugFast/src/components/ParticlesWithTruthPID.cpp b/JugFast/src/components/ParticlesWithTruthPID.cpp index 739b9a806959cc9e0b024775a9c10102b274a6ce..5bca2a71d2fc7e0012b0c9c68af482a0fe499214 100644 --- a/JugFast/src/components/ParticlesWithTruthPID.cpp +++ b/JugFast/src/components/ParticlesWithTruthPID.cpp @@ -123,9 +123,9 @@ public: // Also write MC <--> truth particle association if match was found if (best_match >= 0) { auto rec_assoc = assoc.create(); - rec_assoc.setSimID(mc[best_match].getObjectID().index); rec_assoc.setWeight(1); rec_assoc.setRec(rec_part); + rec_assoc.setSim(mc[best_match]); } if (msgLevel(MSG::DEBUG)) { if (best_match > 0) { @@ -152,7 +152,7 @@ public: return StatusCode::SUCCESS; } -}; // namespace Jug::Fast +}; // NOLINTNEXTLINE(cppcoreguidelines-avoid-non-const-global-variables) DECLARE_COMPONENT(ParticlesWithTruthPID) diff --git a/JugFast/src/components/SmearedFarForwardParticles.cpp b/JugFast/src/components/SmearedFarForwardParticles.cpp index d58b7fae5ef18c905b8ed965d0b8ce8d3c950bfc..d4ee2f3cd1059f0b8f5f05e57a1262f1faf0106d 100644 --- a/JugFast/src/components/SmearedFarForwardParticles.cpp +++ b/JugFast/src/components/SmearedFarForwardParticles.cpp @@ -205,9 +205,9 @@ private: rec_part.setGoodnessOfPID(1.); rec_part.setPDG(part.getPDG()); Assoc assoc; - assoc.setSimID(part.id()); assoc.setWeight(1.); assoc.setRec(rec_part); + assoc.setSim(part); // rec_part.mcID(); rc.emplace_back(rec_part, assoc); @@ -380,7 +380,7 @@ private: rec_part.setGoodnessOfPID(1); // perfect PID rec_part.setPDG(part.getPDG()); Assoc assoc; - assoc.setSimID(part.id()); + assoc.setSim(part); assoc.setWeight(1.); assoc.setRec(rec_part); diff --git a/JugFast/src/components/TruthEnergyPositionClusterMerger.cpp b/JugFast/src/components/TruthEnergyPositionClusterMerger.cpp index fc27ad6453e1661bf6951583a5137ec1bdd5fc0d..79961d60277a3d12dea0d6bd0e12ba495733ce3c 100644 --- a/JugFast/src/components/TruthEnergyPositionClusterMerger.cpp +++ b/JugFast/src/components/TruthEnergyPositionClusterMerger.cpp @@ -63,7 +63,6 @@ public: debug() << "Merging energy and position clusters for new event" << endmsg; } // input - const auto& mcparticles = *(m_inputMCParticles.get()); const auto& energy_clus = *(m_energyClusters.get()); const auto& energy_assoc = *(m_energyAssociations.get()); const auto& pos_clus = *(m_positionClusters.get()); @@ -90,13 +89,13 @@ public: if (msgLevel(MSG::DEBUG)) { debug() << "Step 1/2: Matching all position clusters to the available energy clusters..." << endmsg; } - for (const auto& [mcID, pclus] : posMap) { + for (const auto& [mc, pclus] : posMap) { if (msgLevel(MSG::DEBUG)) { - debug() << " --> Processing position cluster " << pclus.id() << ", mcID: " << mcID << ", energy: " << pclus.getEnergy() + debug() << " --> Processing position cluster " << pclus.id() << ", mc.id(): " << mc.id() << ", energy: " << pclus.getEnergy() << endmsg; } - if (energyMap.count(mcID)) { - const auto& eclus = energyMap[mcID]; + if (energyMap.count(mc)) { + const auto& eclus = energyMap[mc]; auto new_clus = merged_clus.create(); new_clus.setEnergy(eclus.getEnergy()); new_clus.setEnergyError(eclus.getEnergyError()); @@ -122,14 +121,14 @@ public: // set association eicd::MutableMCRecoClusterParticleAssociation clusterassoc; - clusterassoc.setSimID(mcID); clusterassoc.setWeight(1.0); clusterassoc.setRec(new_clus); + clusterassoc.setSim(mc); merged_assoc.push_back(clusterassoc); // erase the energy cluster from the map, so we can in the end account for all // remaining clusters - energyMap.erase(mcID); + energyMap.erase(mc); } else { if (msgLevel(MSG::DEBUG)) { debug() << " --> No matching energy cluster found, copying over position cluster" << endmsg; @@ -140,9 +139,9 @@ public: // set association eicd::MutableMCRecoClusterParticleAssociation clusterassoc; - clusterassoc.setSimID(mcID); clusterassoc.setWeight(1.0); clusterassoc.setRec(new_clus); + clusterassoc.setSim(mc); merged_assoc.push_back(clusterassoc); } } @@ -152,8 +151,7 @@ public: if (msgLevel(MSG::DEBUG)) { debug() << "Step 2/2: Collecting remaining energy clusters..." << endmsg; } - for (const auto& [mcID, eclus] : energyMap) { - const auto& mc = mcparticles[mcID]; + for (const auto& [mc, eclus] : energyMap) { const auto& p = mc.getMomentum(); const auto phi = std::atan2(p.y, p.x); const auto theta = std::atan2(std::hypot(p.x, p.y), p.z); @@ -166,16 +164,16 @@ public: new_clus.setPosition(eicd::sphericalToVector(110.*cm, theta, phi)); new_clus.addToClusters(eclus); if (msgLevel(MSG::DEBUG)) { - debug() << " --> Processing energy cluster " << eclus.id() << ", mcID: " << mcID << ", energy: " << eclus.getEnergy() + debug() << " --> Processing energy cluster " << eclus.id() << ", mc.id(): " << mc.id() << ", energy: " << eclus.getEnergy() << endmsg; debug() << " --> Created new 'combined' cluster " << new_clus.id() << ", energy: " << new_clus.getEnergy() << endmsg; } // set association eicd::MutableMCRecoClusterParticleAssociation clusterassoc; - clusterassoc.setSimID(mcID); clusterassoc.setWeight(1.0); clusterassoc.setRec(new_clus); + clusterassoc.setSim(mc); merged_assoc.push_back(clusterassoc); } @@ -185,47 +183,47 @@ public: // get a map of MCParticle index --> cluster // input: cluster_collections --> list of handles to all cluster collections - std::map indexedClusters( + std::map indexedClusters( const eicd::ClusterCollection& clusters, const eicd::MCRecoClusterParticleAssociationCollection& associations ) const { - std::map matched = {}; + std::map matched = {}; for (const auto& cluster : clusters) { - int mcID = -1; + edm4hep::MCParticle mc; // find associated particle for (const auto& assoc : associations) { if (assoc.getRec() == cluster) { - mcID = assoc.getSimID(); + mc = assoc.getSim(); break; } } if (msgLevel(MSG::VERBOSE)) { - verbose() << " --> Found cluster: " << cluster.getObjectID().index << " with mcID " << mcID << " and energy " + verbose() << " --> Found cluster: " << cluster.getObjectID().index << " with mc.id() " << mc.id() << " and energy " << cluster.getEnergy() << endmsg; } - if (mcID < 0) { + if (mc.id() == 0) { if (msgLevel(MSG::VERBOSE)) { verbose() << " --> WARNING: no valid MC truth link found, skipping cluster..." << endmsg; } continue; } - const bool duplicate = matched.count(mcID); + const bool duplicate = matched.count(mc); if (duplicate) { if (msgLevel(MSG::VERBOSE)) { - verbose() << " --> WARNING: this is a duplicate mcID, keeping the higher energy cluster" << endmsg; + verbose() << " --> WARNING: this is a duplicate mc particle, keeping the higher energy cluster" << endmsg; } - if (cluster.getEnergy() < matched[mcID].getEnergy()) { + if (cluster.getEnergy() < matched[mc].getEnergy()) { continue; } } - matched[mcID] = cluster; + matched[mc] = cluster; } return matched; } diff --git a/JugReco/src/components/CalorimeterIslandCluster.cpp b/JugReco/src/components/CalorimeterIslandCluster.cpp index 194f6476a6315412d90a907a8e7da2035a887d7f..ab7578791014de7e20307c5580aedbcd161e3bf9 100644 --- a/JugReco/src/components/CalorimeterIslandCluster.cpp +++ b/JugReco/src/components/CalorimeterIslandCluster.cpp @@ -33,11 +33,10 @@ #include "JugBase/IGeoSvc.h" // Event Model related classes +#include "edm4hep/Vector2f.h" #include "eicd/CalorimeterHitCollection.h" #include "eicd/ClusterCollection.h" #include "eicd/ProtoClusterCollection.h" -#include "eicd/Vector2f.h" -#include "eicd/Vector3f.h" #include "eicd/vector_utils.h" using namespace Gaudi::Units; @@ -48,25 +47,25 @@ using CaloHit = eicd::CalorimeterHit; using CaloHitCollection = eicd::CalorimeterHitCollection; // helper functions to get distance between hits -static eicd::Vector2f localDistXY(const CaloHit& h1, const CaloHit& h2) { +static edm4hep::Vector2f localDistXY(const CaloHit& h1, const CaloHit& h2) { const auto delta = h1.getLocal() - h2.getLocal(); return {delta.x, delta.y}; } -static eicd::Vector2f localDistXZ(const CaloHit& h1, const CaloHit& h2) { +static edm4hep::Vector2f localDistXZ(const CaloHit& h1, const CaloHit& h2) { const auto delta = h1.getLocal() - h2.getLocal(); return {delta.x, delta.z}; } -static eicd::Vector2f localDistYZ(const CaloHit& h1, const CaloHit& h2) { +static edm4hep::Vector2f localDistYZ(const CaloHit& h1, const CaloHit& h2) { const auto delta = h1.getLocal() - h2.getLocal(); return {delta.y, delta.z}; } -static eicd::Vector2f dimScaledLocalDistXY(const CaloHit& h1, const CaloHit& h2) { +static edm4hep::Vector2f dimScaledLocalDistXY(const CaloHit& h1, const CaloHit& h2) { const auto delta = h1.getLocal() - h2.getLocal(); const auto dimsum = h1.getDimension() + h2.getDimension(); return {2 * delta.x / dimsum.x, 2 * delta.y / dimsum.y}; } -static eicd::Vector2f globalDistRPhi(const CaloHit& h1, const CaloHit& h2) { - using vector_type = decltype(eicd::Vector2f::a); +static edm4hep::Vector2f globalDistRPhi(const CaloHit& h1, const CaloHit& h2) { + using vector_type = decltype(edm4hep::Vector2f::a); return { static_cast( eicd::magnitude(h1.getPosition()) - eicd::magnitude(h2.getPosition()) @@ -76,9 +75,9 @@ static eicd::Vector2f globalDistRPhi(const CaloHit& h1, const CaloHit& h2) { ) }; } -static eicd::Vector2f globalDistEtaPhi(const CaloHit& h1, +static edm4hep::Vector2f globalDistEtaPhi(const CaloHit& h1, const CaloHit& h2) { - using vector_type = decltype(eicd::Vector2f::a); + using vector_type = decltype(edm4hep::Vector2f::a); return { static_cast( eicd::eta(h1.getPosition()) - eicd::eta(h2.getPosition()) @@ -90,7 +89,7 @@ static eicd::Vector2f globalDistEtaPhi(const CaloHit& h1, } // name: {method, units} static std::map, std::vector>> + std::tuple, std::vector>> distMethods{ {"localDistXY", {localDistXY, {mm, mm}}}, {"localDistXZ", {localDistXZ, {mm, mm}}}, {"localDistYZ", {localDistYZ, {mm, mm}}}, {"dimScaledLocalDistXY", {dimScaledLocalDistXY, {1., 1.}}}, @@ -130,7 +129,7 @@ private: Gaudi::Property> u_globalDistEtaPhi{this, "globalDistEtaPhi", {}}; Gaudi::Property> u_dimScaledLocalDistXY{this, "dimScaledLocalDistXY", {1.8, 1.8}}; // neighbor checking function - std::function hitsDist; + std::function hitsDist; // unitless counterparts of the input parameters double minClusterHitEdep{0}, minClusterCenterEdep{0}, sectorDist{0}; diff --git a/JugReco/src/components/ClusterRecoCoG.cpp b/JugReco/src/components/ClusterRecoCoG.cpp index 5a78bb79dc1ac37187f3b46a5418a4db33dcf1cb..d542282396087cbb2c0ffacd8ffc08dd7e3d6ee7 100644 --- a/JugReco/src/components/ClusterRecoCoG.cpp +++ b/JugReco/src/components/ClusterRecoCoG.cpp @@ -232,9 +232,9 @@ public: // set association eicd::MutableMCRecoClusterParticleAssociation clusterassoc; - clusterassoc.setSimID(mcp.getObjectID().index); - clusterassoc.setWeight(1.0); clusterassoc.setRec(cl); + clusterassoc.setSim(mcp); + clusterassoc.setWeight(1.0); associations->push_back(clusterassoc); } else { if (msgLevel(MSG::DEBUG)) { diff --git a/JugReco/src/components/ImagingClusterReco.cpp b/JugReco/src/components/ImagingClusterReco.cpp index ada734c11de5d75c35d013b1b7dd504f32654290..630d0571fd0ffbd65bfe726f85e1f480f880c1b5 100644 --- a/JugReco/src/components/ImagingClusterReco.cpp +++ b/JugReco/src/components/ImagingClusterReco.cpp @@ -171,9 +171,9 @@ public: // set association eicd::MutableMCRecoClusterParticleAssociation clusterassoc; - clusterassoc.setSimID(mcp.getObjectID().index); clusterassoc.setWeight(1.0); clusterassoc.setRec(cl); + clusterassoc.setSim(mcp); associations->push_back(clusterassoc); } @@ -313,7 +313,7 @@ private: std::pair fit_track(const std::vector& layers) const { int nrows = 0; - eicd::Vector3f mean_pos{0, 0, 0}; + edm4hep::Vector3f mean_pos{0, 0, 0}; for (const auto& layer : layers) { if ((layer.getNhits() > 0) && (layer.getHits(0).getLayer() <= m_trackStopLayer)) { mean_pos = mean_pos + layer.getPosition(); diff --git a/JugReco/src/components/InclusiveKinematicsDA.cpp b/JugReco/src/components/InclusiveKinematicsDA.cpp index fb165d6539bab6d2f594a0538591106290dfa3fa..fafb7f2754f59714e9ccb7b68dce132f4a9cfad4 100644 --- a/JugReco/src/components/InclusiveKinematicsDA.cpp +++ b/JugReco/src/components/InclusiveKinematicsDA.cpp @@ -130,10 +130,10 @@ public: //const auto ef_assoc = std::find_if( // rcassoc.begin(), // rcassoc.end(), - // [&ef_coll](const auto& a){ return a.getSimID() == ef_coll[0].getObjectID().index; }); + // [&ef_coll](const auto& a){ return a.getSim() == ef_coll[0]; }); auto ef_assoc = rcassoc.begin(); for (; ef_assoc != rcassoc.end(); ++ef_assoc) { - if (ef_assoc->getSimID() == (unsigned) ef_coll[0].getObjectID().index) { + if (ef_assoc->getSim() == ef_coll[0]) { break; } } @@ -144,7 +144,6 @@ public: return StatusCode::SUCCESS; } const auto ef_rc{ef_assoc->getRec()}; - const auto ef_rc_id{ef_rc.getObjectID().index}; // Loop over reconstructed particles to get all outgoing particles // ----------------------------------------------------------------- @@ -171,7 +170,7 @@ public: for(const auto& p : rcparts) { // Get the scattered electron index and angle - if (p.getObjectID().index == ef_rc_id) { + if (p == ef_rc) { // Lorentz vector in lab frame PxPyPzEVector e_lab(p.getMomentum().x, p.getMomentum().y, p.getMomentum().z, p.getEnergy()); // Boost to colinear frame diff --git a/JugReco/src/components/InclusiveKinematicsElectron.cpp b/JugReco/src/components/InclusiveKinematicsElectron.cpp index e16ad98ecaaee617c2d8ae22c78601555979676d..23aad30816406ee27ac73b41086743ab469f0cec 100644 --- a/JugReco/src/components/InclusiveKinematicsElectron.cpp +++ b/JugReco/src/components/InclusiveKinematicsElectron.cpp @@ -178,10 +178,10 @@ public: //const auto ef_assoc = std::find_if( // rcassoc.begin(), // rcassoc.end(), - // [&ef_coll](const auto& a){ return a.getSimID() == ef_coll[0].getObjectID().index; }); + // [&ef_coll](const auto& a){ return a.getSim() == ef_coll[0]; }); auto ef_assoc = rcassoc.begin(); for (; ef_assoc != rcassoc.end(); ++ef_assoc) { - if (ef_assoc->getSimID() == (unsigned) ef_coll[0].getObjectID().index) { + if (ef_assoc->getSim() == ef_coll[0]) { break; } } diff --git a/JugReco/src/components/InclusiveKinematicsJB.cpp b/JugReco/src/components/InclusiveKinematicsJB.cpp index 3eb9af359c13947dadc467600d005a0dc1b487ec..57587a6040f4e3859eb892da33342e638064fe2a 100644 --- a/JugReco/src/components/InclusiveKinematicsJB.cpp +++ b/JugReco/src/components/InclusiveKinematicsJB.cpp @@ -131,10 +131,10 @@ public: //const auto ef_assoc = std::find_if( // rcassoc.begin(), // rcassoc.end(), - // [&ef_coll](const auto& a){ return a.getSimID() == ef_coll[0].getObjectID().index; }); + // [&ef_coll](const auto& a){ return a.getSim() == ef_coll[0]; }); auto ef_assoc = rcassoc.begin(); for (; ef_assoc != rcassoc.end(); ++ef_assoc) { - if (ef_assoc->getSimID() == (unsigned) ef_coll[0].getObjectID().index) { + if (ef_assoc->getSim() == ef_coll[0]) { break; } } diff --git a/JugReco/src/components/InclusiveKinematicsSigma.cpp b/JugReco/src/components/InclusiveKinematicsSigma.cpp index 8070171c6aafcbf44846aa76e61b3b3594c1ff6b..7011d3151f56979441c3b3c547a61adef3470cfe 100644 --- a/JugReco/src/components/InclusiveKinematicsSigma.cpp +++ b/JugReco/src/components/InclusiveKinematicsSigma.cpp @@ -130,10 +130,10 @@ public: //const auto ef_assoc = std::find_if( // rcassoc.begin(), // rcassoc.end(), - // [&ef_coll](const auto& a){ return a.getSimID() == ef_coll[0].getObjectID().index; }); + // [&ef_coll](const auto& a){ return a.getSim() == ef_coll[0]; }); auto ef_assoc = rcassoc.begin(); for (; ef_assoc != rcassoc.end(); ++ef_assoc) { - if (ef_assoc->getSimID() == (unsigned) ef_coll[0].getObjectID().index) { + if (ef_assoc->getSim() == ef_coll[0]) { break; } } diff --git a/JugReco/src/components/InclusiveKinematicseSigma.cpp b/JugReco/src/components/InclusiveKinematicseSigma.cpp index 1fca5366c9b79a9d5cb0f44b7229dbc85eded8ab..7ccc43a94bb8bf38bf26b001a776b7ada144833c 100644 --- a/JugReco/src/components/InclusiveKinematicseSigma.cpp +++ b/JugReco/src/components/InclusiveKinematicseSigma.cpp @@ -130,10 +130,10 @@ public: //const auto ef_assoc = std::find_if( // rcassoc.begin(), // rcassoc.end(), - // [&ef_coll](const auto& a){ return a.getSimID() == ef_coll[0].getObjectID().index; }); + // [&ef_coll](const auto& a){ return a.getSim() == ef_coll[0]; }); auto ef_assoc = rcassoc.begin(); for (; ef_assoc != rcassoc.end(); ++ef_assoc) { - if (ef_assoc->getSimID() == (unsigned) ef_coll[0].getObjectID().index) { + if (ef_assoc->getSim() == ef_coll[0]) { break; } } @@ -144,7 +144,6 @@ public: return StatusCode::SUCCESS; } const auto ef_rc{ef_assoc->getRec()}; - const auto ef_rc_id{ef_rc.getObjectID().index}; // Loop over reconstructed particles to get all outgoing particles // ----------------------------------------------------------------- @@ -173,7 +172,7 @@ public: for (const auto& p: rcparts) { // Get the scattered electron index and angle - if (p.getObjectID().index == ef_rc_id) { + if (p == ef_rc) { // Lorentz vector in lab frame PxPyPzEVector e_lab(p.getMomentum().x, p.getMomentum().y, p.getMomentum().z, p.getEnergy()); // Boost to colinear frame diff --git a/JugTrack/src/components/ParticlesFromTrackFit.cpp b/JugTrack/src/components/ParticlesFromTrackFit.cpp index 8590f6c234291aab68ea125a00c7af9bceabd5e3..8f2b2601a1b713f09158e5a1af75ea143440fa87 100644 --- a/JugTrack/src/components/ParticlesFromTrackFit.cpp +++ b/JugTrack/src/components/ParticlesFromTrackFit.cpp @@ -116,9 +116,9 @@ namespace Jug::Reco { debug() << " chi2 = " << trajState.chi2Sum << endmsg; } - const eicd::Vector2f loc { - parameter[Acts::eBoundLoc0], - parameter[Acts::eBoundLoc1] + const edm4hep::Vector2f loc { + static_cast(parameter[Acts::eBoundLoc0]), + static_cast(parameter[Acts::eBoundLoc1]) }; const eicd::Cov3f covMomentum { static_cast(covariance(Acts::eBoundTheta, Acts::eBoundTheta)), diff --git a/JugTrack/src/components/TrackParamACTSSeeding.cpp b/JugTrack/src/components/TrackParamACTSSeeding.cpp index 67d42c94f73b59554b26d3af6b9f90621dfa89e7..b89303828de912b9f370edf11d9cdc6114e50dc6 100644 --- a/JugTrack/src/components/TrackParamACTSSeeding.cpp +++ b/JugTrack/src/components/TrackParamACTSSeeding.cpp @@ -35,6 +35,7 @@ #include "Math/Vector3D.h" +using Vector3f = decltype(eicd::TrackerHitData::position); ///// (Reconstructed) track parameters e.g. close to the vertex. //using TrackParameters = Acts::CurvilinearTrackParameters; @@ -332,7 +333,7 @@ namespace Jug::Reco { SpacePoint( eicd::TrackerHit( static_cast(spacePoint.size()), - eicd::Vector3f(v[0], v[1], v[2]), + Vector3f(v[0], v[1], v[2]), eicd::CovDiag3f(25.0e-6 / 3.0, 25.0e-6 / 3.0, 0.0), 0.0, 10.0, 0.05, 0.0), diff --git a/JugTrack/src/components/TrackProjector.cpp b/JugTrack/src/components/TrackProjector.cpp index 19ad12ecf96d4ecba8d11a35f62775f512c22fc4..94c7d3ba344f5da47f5c30b65c0d059789de64d9 100644 --- a/JugTrack/src/components/TrackProjector.cpp +++ b/JugTrack/src/components/TrackProjector.cpp @@ -140,16 +140,16 @@ namespace Jug::Reco { {0, 0, 0} ); // global position - const eicd::Vector3f position { - global.x(), - global.y(), - global.z() + const edm4hep::Vector3f position { + static_cast(global.x()), + static_cast(global.y()), + static_cast(global.z()) }; // local position - const eicd::Vector2f loc { - parameter[Acts::eBoundLoc0], - parameter[Acts::eBoundLoc1] + const edm4hep::Vector2f loc { + static_cast(parameter[Acts::eBoundLoc0]), + static_cast(parameter[Acts::eBoundLoc1]) }; const eicd::Cov2f covLoc { static_cast(covariance(Acts::eBoundLoc0, Acts::eBoundLoc0)), @@ -157,7 +157,7 @@ namespace Jug::Reco { static_cast(covariance(Acts::eBoundLoc0, Acts::eBoundLoc1)) }; const eicd::Cov3f positionError{0, 0, 0}; - const eicd::Vector3f momentum = eicd::sphericalToVector( + const edm4hep::Vector3f momentum = eicd::sphericalToVector( 1.0 / std::abs(parameter[Acts::eBoundQOverP]), parameter[Acts::eBoundTheta], parameter[Acts::eBoundPhi]