diff --git a/PhysicsTools/NanoAOD/interface/AssociationMapFlatTableProducer.h b/PhysicsTools/NanoAOD/interface/AssociationMapFlatTableProducer.h index 623d1831288a5..c2586ab8ac4e5 100644 --- a/PhysicsTools/NanoAOD/interface/AssociationMapFlatTableProducer.h +++ b/PhysicsTools/NanoAOD/interface/AssociationMapFlatTableProducer.h @@ -247,46 +247,50 @@ class AssociationOneToManyFlatTableProducer : public SimpleFlatTableProducerBase // OneToOne, Fraction and Fraction with Score template -using AssociationMapOneToOneFraction = - ticl::AssociationMap>, std::vector, std::vector>; +using AssociationMapOneToOneFraction = ticl:: + TICLAssociationMap>, std::vector, std::vector>; template using AssociationMapOneToOneFractionScore = - ticl::AssociationMap>>, - std::vector, - std::vector>; + ticl::TICLAssociationMap>>, + std::vector, + std::vector>; // OneToOne, SharedEnergy and SharedEnergy with Score template -using AssociationMapOneToOneSharedEnergy = ticl:: - AssociationMap>, std::vector, std::vector>; +using AssociationMapOneToOneSharedEnergy = + ticl::TICLAssociationMap>, + std::vector, + std::vector>; template using AssociationMapOneToOneSharedEnergyScore = - ticl::AssociationMap>>, - std::vector, - std::vector>; + ticl::TICLAssociationMap>>, + std::vector, + std::vector>; // OneToMany, Fraction and Fraction with Score template -using AssociationMapOneToManyFraction = - ticl::AssociationMap>>, vector, vector>; +using AssociationMapOneToManyFraction = ticl:: + TICLAssociationMap>>, vector, vector>; template using AssociationMapOneToManyFractionScore = - ticl::AssociationMap>>>, - vector, - vector>; + ticl::TICLAssociationMap>>>, + vector, + vector>; // OneToMany, SharedEnergy and SharedEnergy with Score template -using AssociationMapOneToManySharedEnergy = ticl:: - AssociationMap>>, vector, vector>; +using AssociationMapOneToManySharedEnergy = + ticl::TICLAssociationMap>>, + vector, + vector>; template using AssociationMapOneToManySharedEnergyScore = - ticl::AssociationMap>>>, - vector, - vector>; + ticl::TICLAssociationMap>>>, + vector, + vector>; #endif diff --git a/PhysicsTools/TruthInfo/plugins/TruthBranchCaloAssociationProducer.cc b/PhysicsTools/TruthInfo/plugins/TruthBranchCaloAssociationProducer.cc index 7ce7967a7c031..e756a88a6fc54 100644 --- a/PhysicsTools/TruthInfo/plugins/TruthBranchCaloAssociationProducer.cc +++ b/PhysicsTools/TruthInfo/plugins/TruthBranchCaloAssociationProducer.cc @@ -39,7 +39,7 @@ namespace { // Raw-index AssociationMap (object index -> [(branch id, sharedEnergy, score)]). - using BranchAssociationMap = ticl::AssociationMap; + using BranchAssociationMap = ticl::TICLAssociationMap; } // namespace class TruthBranchCaloAssociationProducer : public edm::stream::EDProducer<> { diff --git a/PhysicsTools/TruthInfo/plugins/TruthBranchTrackingAssociationProducer.cc b/PhysicsTools/TruthInfo/plugins/TruthBranchTrackingAssociationProducer.cc index eb6626d43b621..14832c1105ad4 100644 --- a/PhysicsTools/TruthInfo/plugins/TruthBranchTrackingAssociationProducer.cc +++ b/PhysicsTools/TruthInfo/plugins/TruthBranchTrackingAssociationProducer.cc @@ -44,7 +44,7 @@ namespace { // Raw-index AssociationMap (object index -> [(branch id, sharedHits, score)]). - using BranchAssociationMap = ticl::AssociationMap; + using BranchAssociationMap = ticl::TICLAssociationMap; } // namespace class TruthBranchTrackingAssociationProducer : public edm::stream::EDProducer<> { diff --git a/RecoHGCal/TICL/plugins/TICLDumper.cc b/RecoHGCal/TICL/plugins/TICLDumper.cc index 05d6ce8cf4603..44872199732e1 100644 --- a/RecoHGCal/TICL/plugins/TICLDumper.cc +++ b/RecoHGCal/TICL/plugins/TICLDumper.cc @@ -65,8 +65,8 @@ #include "FWCore/ServiceRegistry/interface/Service.h" #include "CommonTools/UtilAlgos/interface/TFileService.h" -using TracksterToTracksterMap = - ticl::AssociationMap, std::vector>; +using TracksterToTracksterMap = ticl:: + TICLAssociationMap, std::vector>; // Helper class for geometry, magnetic field, etc class DetectorTools { public: diff --git a/SimCalorimetry/HGCalAssociatorProducers/plugins/AllHitToTracksterAssociatorsProducer.cc b/SimCalorimetry/HGCalAssociatorProducers/plugins/AllHitToTracksterAssociatorsProducer.cc index a24735c537a81..db15d82b88422 100644 --- a/SimCalorimetry/HGCalAssociatorProducers/plugins/AllHitToTracksterAssociatorsProducer.cc +++ b/SimCalorimetry/HGCalAssociatorProducers/plugins/AllHitToTracksterAssociatorsProducer.cc @@ -45,8 +45,8 @@ AllHitToTracksterAssociatorsProducerT::AllHitToTracksterAssociatorsProducer } for (const auto& tracksterToken : tracksterCollectionTokens_) { - produces>("hitTo" + tracksterToken.first); - produces>(tracksterToken.first + "ToHit"); + produces>("hitTo" + tracksterToken.first); + produces>(tracksterToken.first + "ToHit"); } } @@ -62,8 +62,8 @@ void AllHitToTracksterAssociatorsProducerT::produce(edm::StreamID, if (!layer_clusters.isValid()) { edm::LogWarning("AllHitToTracksterAssociatorsProducer") << "Missing LayerCluster collection."; for (const auto& tracksterToken : tracksterCollectionTokens_) { - iEvent.put(std::make_unique>(), "hitTo" + tracksterToken.first); - iEvent.put(std::make_unique>(), tracksterToken.first + "ToHit"); + iEvent.put(std::make_unique>(), "hitTo" + tracksterToken.first); + iEvent.put(std::make_unique>(), tracksterToken.first + "ToHit"); } return; } @@ -74,8 +74,8 @@ void AllHitToTracksterAssociatorsProducerT::produce(edm::StreamID, if (!iEvent.getHandle(hitsToken_)) { edm::LogWarning("AllHitToTracksterAssociatorsProducer") << "Missing edm::RefProdVector."; for (const auto& tracksterToken : tracksterCollectionTokens_) { - iEvent.put(std::make_unique>(), "hitTo" + tracksterToken.first); - iEvent.put(std::make_unique>(), tracksterToken.first + "ToHit"); + iEvent.put(std::make_unique>(), "hitTo" + tracksterToken.first); + iEvent.put(std::make_unique>(), tracksterToken.first + "ToHit"); } return; } @@ -95,8 +95,8 @@ void AllHitToTracksterAssociatorsProducerT::produce(edm::StreamID, LogDebug("HitToSimClusterCaloParticleAssociatorProducer") << "Only empty RecHitCollections found. Association maps will be empty."; for (const auto& tracksterToken : tracksterCollectionTokens_) { - iEvent.put(std::make_unique>(), "hitTo" + tracksterToken.first); - iEvent.put(std::make_unique>(), tracksterToken.first + "ToHit"); + iEvent.put(std::make_unique>(), "hitTo" + tracksterToken.first); + iEvent.put(std::make_unique>(), tracksterToken.first + "ToHit"); } return; } @@ -108,13 +108,13 @@ void AllHitToTracksterAssociatorsProducerT::produce(edm::StreamID, if (!tracksters.isValid()) { LogDebug("AllHitToTracksterAssociatorsProducer") << "Missing Tracksters for collection " << tracksterToken.first << ". Association maps will be empty."; - iEvent.put(std::make_unique>(), "hitTo" + tracksterToken.first); - iEvent.put(std::make_unique>(), tracksterToken.first + "ToHit"); + iEvent.put(std::make_unique>(), "hitTo" + tracksterToken.first); + iEvent.put(std::make_unique>(), tracksterToken.first + "ToHit"); continue; } - auto hitToTracksterMap = std::make_unique>(rechitSpan.size()); - auto tracksterToHitMap = std::make_unique>(tracksters->size()); + auto hitToTracksterMap = std::make_unique>(rechitSpan.size()); + auto tracksterToHitMap = std::make_unique>(tracksters->size()); for (unsigned int tracksterId = 0; tracksterId < tracksters->size(); ++tracksterId) { const auto& trackster = (*tracksters)[tracksterId]; diff --git a/SimCalorimetry/HGCalAssociatorProducers/plugins/AllLayerClusterToTracksterAssociatorsProducer.cc b/SimCalorimetry/HGCalAssociatorProducers/plugins/AllLayerClusterToTracksterAssociatorsProducer.cc index 26e844bc04ad7..b3ca0ea7a7c60 100644 --- a/SimCalorimetry/HGCalAssociatorProducers/plugins/AllLayerClusterToTracksterAssociatorsProducer.cc +++ b/SimCalorimetry/HGCalAssociatorProducers/plugins/AllLayerClusterToTracksterAssociatorsProducer.cc @@ -40,9 +40,9 @@ AllLayerClusterToTracksterAssociatorsProducer::AllLayerClusterToTracksterAssocia // Produce separate association maps for each trackster collection using the trackster label for (const auto& tracksterToken : tracksterCollectionTokens_) { - produces< - ticl::AssociationMap, std::vector>>( - tracksterToken.first); + produces, + std::vector>>(tracksterToken.first); } } @@ -58,9 +58,9 @@ void AllLayerClusterToTracksterAssociatorsProducer::produce(edm::StreamID, if (!layerClustersHandle.isValid()) { edm::LogWarning("MissingInput") << "Layer clusters collection not found. Producing empty maps."; for (const auto& tracksterToken : tracksterCollectionTokens_) { - iEvent.put(std::make_unique, - std::vector>>(), + iEvent.put(std::make_unique, + std::vector>>(), tracksterToken.first); } return; @@ -71,16 +71,16 @@ void AllLayerClusterToTracksterAssociatorsProducer::produce(edm::StreamID, // If tracksters collection is missing, produce empty map and continue if (!trackstersHandle.isValid()) { LogDebug("MissingInput") << "Tracksters collection '" << tracksterToken.first << "' not found."; - iEvent.put(std::make_unique, - std::vector>>(), + iEvent.put(std::make_unique, + std::vector>>(), tracksterToken.first); continue; } // Create association map auto lcToTracksterMap = std::make_unique< - ticl::AssociationMap, std::vector>>( + ticl::TICLAssociationMap, std::vector>>( layerClustersHandle, trackstersHandle, iEvent); // Loop over tracksters diff --git a/SimCalorimetry/HGCalAssociatorProducers/plugins/AllTracksterToSimTracksterAssociatorsByHitsProducer.cc b/SimCalorimetry/HGCalAssociatorProducers/plugins/AllTracksterToSimTracksterAssociatorsByHitsProducer.cc index e8d55ff7b865b..2ddc9ff7d370e 100644 --- a/SimCalorimetry/HGCalAssociatorProducers/plugins/AllTracksterToSimTracksterAssociatorsByHitsProducer.cc +++ b/SimCalorimetry/HGCalAssociatorProducers/plugins/AllTracksterToSimTracksterAssociatorsByHitsProducer.cc @@ -32,20 +32,20 @@ class AllTracksterToSimTracksterAssociatorsByHitsProducerT : public edm::global: std::vector>>> tracksterCollectionTokens_; std::vector>>> simTracksterCollectionTokens_; - std::vector>>> + std::vector>>> hitToTracksterMapTokens_; - std::vector>>> + std::vector>>> tracksterToHitMapTokens_; - std::vector>>> + std::vector>>> hitToSimTracksterMapTokens_; - std::vector>>> + std::vector>>> simTracksterToHitMapTokens_; edm::EDGetTokenT hitsToken_; edm::EDGetTokenT> caloParticleToken_; - edm::EDGetTokenT> hitToSimClusterMapToken_; - edm::EDGetTokenT> hitToCaloParticleMapToken_; + edm::EDGetTokenT> hitToSimClusterMapToken_; + edm::EDGetTokenT> hitToCaloParticleMapToken_; }; template @@ -53,9 +53,9 @@ AllTracksterToSimTracksterAssociatorsByHitsProducerT::AllTracksterToSimTrac const edm::ParameterSet& pset) : hitsToken_(consumes(pset.getParameter("hits"))), caloParticleToken_(consumes>(pset.getParameter("caloParticles"))), - hitToSimClusterMapToken_(consumes>( + hitToSimClusterMapToken_(consumes>( pset.getParameter("hitToSimClusterMap"))), - hitToCaloParticleMapToken_(consumes>( + hitToCaloParticleMapToken_(consumes>( pset.getParameter("hitToCaloParticleMap"))) { const auto& tracksterCollections = pset.getParameter>("tracksterCollections"); @@ -67,9 +67,11 @@ AllTracksterToSimTracksterAssociatorsByHitsProducerT::AllTracksterToSimTrac } tracksterCollectionTokens_.emplace_back(label, consumes>(tag)); hitToTracksterMapTokens_.emplace_back( - label, consumes>(edm::InputTag(allHitToTSAccoc, "hitTo" + label))); + label, + consumes>(edm::InputTag(allHitToTSAccoc, "hitTo" + label))); tracksterToHitMapTokens_.emplace_back( - label, consumes>(edm::InputTag(allHitToTSAccoc, label + "ToHit"))); + label, + consumes>(edm::InputTag(allHitToTSAccoc, label + "ToHit"))); } const auto& simTracksterCollections = pset.getParameter>("simTracksterCollections"); @@ -80,22 +82,24 @@ AllTracksterToSimTracksterAssociatorsByHitsProducerT::AllTracksterToSimTrac } simTracksterCollectionTokens_.emplace_back(label, consumes>(tag)); hitToSimTracksterMapTokens_.emplace_back( - label, consumes>(edm::InputTag(allHitToTSAccoc, "hitTo" + label))); + label, + consumes>(edm::InputTag(allHitToTSAccoc, "hitTo" + label))); simTracksterToHitMapTokens_.emplace_back( - label, consumes>(edm::InputTag(allHitToTSAccoc, label + "ToHit"))); + label, + consumes>(edm::InputTag(allHitToTSAccoc, label + "ToHit"))); } // Produce separate association maps for each trackster-simTrackster combination for (const auto& tracksterToken : tracksterCollectionTokens_) { for (const auto& simTracksterToken : simTracksterCollectionTokens_) { std::string instanceLabel = tracksterToken.first + "To" + simTracksterToken.first; - produces, - std::vector>>(instanceLabel); + produces, + std::vector>>(instanceLabel); std::string reverseInstanceLabel = simTracksterToken.first + "To" + tracksterToken.first; - produces, - std::vector>>(reverseInstanceLabel); + produces, + std::vector>>(reverseInstanceLabel); } } } @@ -111,13 +115,13 @@ void AllTracksterToSimTracksterAssociatorsByHitsProducerT::produce(edm::Str << "Missing MultiRecHitCollection. Association maps will be empty."; for (const auto& tracksterToken : tracksterCollectionTokens_) { for (const auto& simTracksterToken : simTracksterCollectionTokens_) { - iEvent.put(std::make_unique, - std::vector>>(), + iEvent.put(std::make_unique, + std::vector>>(), tracksterToken.first + "To" + simTracksterToken.first); - iEvent.put(std::make_unique, - std::vector>>(), + iEvent.put(std::make_unique, + std::vector>>(), simTracksterToken.first + "To" + tracksterToken.first); } } @@ -141,24 +145,24 @@ void AllTracksterToSimTracksterAssociatorsByHitsProducerT::produce(edm::Str for (const auto& tracksterToken : tracksterCollectionTokens_) { for (const auto& simTracksterToken : simTracksterCollectionTokens_) { - iEvent.put(std::make_unique, - std::vector>>(), + iEvent.put(std::make_unique, + std::vector>>(), tracksterToken.first + "To" + simTracksterToken.first); - iEvent.put(std::make_unique, - std::vector>>(), + iEvent.put(std::make_unique, + std::vector>>(), simTracksterToken.first + "To" + tracksterToken.first); } } return; } - Handle> hitToSimClusterMapHandle; + Handle> hitToSimClusterMapHandle; iEvent.getByToken(hitToSimClusterMapToken_, hitToSimClusterMapHandle); const auto& hitToSimClusterMap = *hitToSimClusterMapHandle; - Handle> hitToCaloParticleMapHandle; + Handle> hitToCaloParticleMapHandle; iEvent.getByToken(hitToCaloParticleMapToken_, hitToCaloParticleMapHandle); const auto& hitToCaloParticleMap = *hitToCaloParticleMapHandle; @@ -175,13 +179,13 @@ void AllTracksterToSimTracksterAssociatorsByHitsProducerT::produce(edm::Str for (const auto& simTracksterToken : simTracksterCollectionTokens_) { Handle> simTrackstersHandle; - iEvent.put(std::make_unique, - std::vector>>(), + iEvent.put(std::make_unique, + std::vector>>(), tracksterToken.first + "To" + simTracksterToken.first); - iEvent.put(std::make_unique, - std::vector>>(), + iEvent.put(std::make_unique, + std::vector>>(), simTracksterToken.first + "To" + tracksterToken.first); } continue; @@ -190,7 +194,7 @@ void AllTracksterToSimTracksterAssociatorsByHitsProducerT::produce(edm::Str const auto& recoTracksters = *recoTrackstersHandle; // Retrieve the correct HitToTracksterMap for the current trackster collection - Handle> hitToTracksterMapHandle; + Handle> hitToTracksterMapHandle; auto tracksterMapTokenIter = std::find_if( hitToTracksterMapTokens_.begin(), hitToTracksterMapTokens_.end(), [&tracksterToken](const auto& pair) { return pair.first == tracksterToken.first; @@ -201,7 +205,7 @@ void AllTracksterToSimTracksterAssociatorsByHitsProducerT::produce(edm::Str const auto& hitToTracksterMap = *hitToTracksterMapHandle; // Retrieve the correct TracksterToHitMap for the current trackster collection - Handle> tracksterToHitMapHandle; + Handle> tracksterToHitMapHandle; auto tracksterToHitMapTokenIter = std::find_if( tracksterToHitMapTokens_.begin(), tracksterToHitMapTokens_.end(), [&tracksterToken](const auto& pair) { return pair.first == tracksterToken.first; @@ -222,13 +226,13 @@ void AllTracksterToSimTracksterAssociatorsByHitsProducerT::produce(edm::Str iEvent.getByToken(simTracksterToken.second, simTrackstersHandle); if (!simTrackstersHandle.isValid()) { - iEvent.put(std::make_unique, - std::vector>>(), + iEvent.put(std::make_unique, + std::vector>>(), tracksterToken.first + "To" + simTracksterToken.first); - iEvent.put(std::make_unique, - std::vector>>(), + iEvent.put(std::make_unique, + std::vector>>(), simTracksterToken.first + "To" + tracksterToken.first); continue; } @@ -236,7 +240,7 @@ void AllTracksterToSimTracksterAssociatorsByHitsProducerT::produce(edm::Str const auto& simTracksters = *simTrackstersHandle; // Retrieve the correct HitToSimTracksterMap for the current simTrackster collection - Handle> hitToSimTracksterMapHandle; + Handle> hitToSimTracksterMapHandle; auto simTracksterMapTokenIter = std::find_if(hitToSimTracksterMapTokens_.begin(), hitToSimTracksterMapTokens_.end(), @@ -247,7 +251,7 @@ void AllTracksterToSimTracksterAssociatorsByHitsProducerT::produce(edm::Str const auto& hitToSimTracksterMap = *hitToSimTracksterMapHandle; // Retrieve the correct SimTracksterToHitMap for the current simTrackster collection - Handle> simTracksterToHitMapHandle; + Handle> simTracksterToHitMapHandle; auto simTracksterToHitMapTokenIter = std::find_if(simTracksterToHitMapTokens_.begin(), simTracksterToHitMapTokens_.end(), @@ -258,13 +262,13 @@ void AllTracksterToSimTracksterAssociatorsByHitsProducerT::produce(edm::Str const auto& simTracksterToHitMap = *simTracksterToHitMapHandle; // Create the association maps - auto tracksterToSimTracksterMap = std::make_unique, - std::vector>>( + auto tracksterToSimTracksterMap = std::make_unique, + std::vector>>( recoTrackstersHandle, simTrackstersHandle, iEvent); - auto simTracksterToTracksterMap = std::make_unique, - std::vector>>( + auto simTracksterToTracksterMap = std::make_unique, + std::vector>>( simTrackstersHandle, recoTrackstersHandle, iEvent); for (unsigned int tracksterIndex = 0; tracksterIndex < recoTracksters.size(); ++tracksterIndex) { @@ -276,7 +280,7 @@ void AllTracksterToSimTracksterAssociatorsByHitsProducerT::produce(edm::Str if (tracksterToHitMap.size() == 0) continue; - ticl::AssociationMap hitToAssociatedSimTracksterMap( + ticl::TICLAssociationMap hitToAssociatedSimTracksterMap( recoTracksterHitsAndFractions.size()); std::vector associatedSimTracksterIndices; @@ -372,7 +376,7 @@ void AllTracksterToSimTracksterAssociatorsByHitsProducerT::produce(edm::Str edm::Ref> simTracksterRef(simTrackstersHandle, tracksterIndex); float simToRecoScoresDenominator = 0.f; const auto& simTracksterHitsAndFractions = simTracksterToHitMap[tracksterIndex]; - ticl::AssociationMap hitToAssociatedRecoTracksterMap( + ticl::TICLAssociationMap hitToAssociatedRecoTracksterMap( simTracksterHitsAndFractions.size()); std::vector associatedRecoTracksterIndices; const auto& simTrackster = simTracksters[tracksterIndex]; diff --git a/SimCalorimetry/HGCalAssociatorProducers/plugins/AllTracksterToSimTracksterAssociatorsByLCsProducer.cc b/SimCalorimetry/HGCalAssociatorProducers/plugins/AllTracksterToSimTracksterAssociatorsByLCsProducer.cc index d10388e3cab5f..564eb491cb665 100644 --- a/SimCalorimetry/HGCalAssociatorProducers/plugins/AllTracksterToSimTracksterAssociatorsByLCsProducer.cc +++ b/SimCalorimetry/HGCalAssociatorProducers/plugins/AllTracksterToSimTracksterAssociatorsByLCsProducer.cc @@ -25,15 +25,15 @@ class AllTracksterToSimTracksterAssociatorsByLCsProducer : public edm::global::E std::vector>>> tracksterCollectionTokens_; std::vector>>> simTracksterCollectionTokens_; edm::EDGetTokenT> layerClustersToken_; - std::vector, std::vector>>>> + std::vector, + std::vector>>>> layerClusterToTracksterMapTokens_; - std::vector, std::vector>>>> + std::vector, + std::vector>>>> layerClusterToSimTracksterMapTokens_; }; @@ -51,9 +51,9 @@ AllTracksterToSimTracksterAssociatorsByLCsProducer::AllTracksterToSimTracksterAs tracksterCollectionTokens_.emplace_back(label, consumes>(tag)); layerClusterToTracksterMapTokens_.emplace_back( label, - consumes, - std::vector>>(edm::InputTag(allLCtoTSAccoc, label))); + consumes, + std::vector>>(edm::InputTag(allLCtoTSAccoc, label))); } const auto& simTracksterCollections = pset.getParameter>("simTracksterCollections"); @@ -65,22 +65,22 @@ AllTracksterToSimTracksterAssociatorsByLCsProducer::AllTracksterToSimTracksterAs simTracksterCollectionTokens_.emplace_back(label, consumes>(tag)); layerClusterToSimTracksterMapTokens_.emplace_back( label, - consumes, - std::vector>>(edm::InputTag(allLCtoTSAccoc, label))); + consumes, + std::vector>>(edm::InputTag(allLCtoTSAccoc, label))); } // Produce separate association maps for each trackster-simTrackster combination for (const auto& tracksterToken : tracksterCollectionTokens_) { for (const auto& simTracksterToken : simTracksterCollectionTokens_) { std::string instanceLabel = tracksterToken.first + "To" + simTracksterToken.first; - produces, - std::vector>>(instanceLabel); + produces, + std::vector>>(instanceLabel); std::string reverseInstanceLabel = simTracksterToken.first + "To" + tracksterToken.first; - produces, - std::vector>>(reverseInstanceLabel); + produces, + std::vector>>(reverseInstanceLabel); } } } @@ -98,14 +98,14 @@ void AllTracksterToSimTracksterAssociatorsByLCsProducer::produce(edm::StreamID, edm::LogWarning("MissingInput") << "Layer clusters collection is invalid. Producing empty maps."; for (const auto& tracksterToken : tracksterCollectionTokens_) { for (const auto& simTracksterToken : simTracksterCollectionTokens_) { - iEvent.put(std::make_unique, - std::vector>>(), + iEvent.put(std::make_unique, + std::vector>>(), tracksterToken.first + "To" + simTracksterToken.first); - iEvent.put(std::make_unique, - std::vector>>(), + iEvent.put(std::make_unique, + std::vector>>(), simTracksterToken.first + "To" + tracksterToken.first); } } @@ -121,14 +121,14 @@ void AllTracksterToSimTracksterAssociatorsByLCsProducer::produce(edm::StreamID, if (!recoTrackstersHandle.isValid()) { LogDebug("MissingInput") << "trackster collection " + tracksterToken.first + " not found. Producing empty maps."; for (const auto& simTracksterToken : simTracksterCollectionTokens_) { - iEvent.put(std::make_unique, - std::vector>>(), + iEvent.put(std::make_unique, + std::vector>>(), tracksterToken.first + "To" + simTracksterToken.first); - iEvent.put(std::make_unique, - std::vector>>(), + iEvent.put(std::make_unique, + std::vector>>(), simTracksterToken.first + "To" + tracksterToken.first); } continue; @@ -137,7 +137,8 @@ void AllTracksterToSimTracksterAssociatorsByLCsProducer::produce(edm::StreamID, const auto& recoTracksters = *recoTrackstersHandle; // Retrieve the correct LayerClusterToTracksterMap for the current trackster collection - Handle, std::vector>> + Handle< + ticl::TICLAssociationMap, std::vector>> layerClusterToTracksterMapHandle; auto tracksterMapTokenIter = std::find_if(layerClusterToTracksterMapTokens_.begin(), @@ -154,8 +155,9 @@ void AllTracksterToSimTracksterAssociatorsByLCsProducer::produce(edm::StreamID, const auto& simTracksters = *simTrackstersHandle; // Retrieve the correct LayerClusterToSimTracksterMap for the current simTrackster collection - Handle< - ticl::AssociationMap, std::vector>> + Handle, + std::vector>> layerClusterToSimTracksterMapHandle; auto simTracksterMapTokenIter = std::find_if(layerClusterToSimTracksterMapTokens_.begin(), @@ -167,13 +169,13 @@ void AllTracksterToSimTracksterAssociatorsByLCsProducer::produce(edm::StreamID, const auto& layerClusterToSimTracksterMap = *layerClusterToSimTracksterMapHandle; // Create the association maps - auto tracksterToSimTracksterMap = std::make_unique, - std::vector>>( + auto tracksterToSimTracksterMap = std::make_unique, + std::vector>>( recoTrackstersHandle, simTrackstersHandle, iEvent); - auto simTracksterToTracksterMap = std::make_unique, - std::vector>>( + auto simTracksterToTracksterMap = std::make_unique, + std::vector>>( simTrackstersHandle, recoTrackstersHandle, iEvent); for (unsigned int tracksterIndex = 0; tracksterIndex < recoTracksters.size(); ++tracksterIndex) { @@ -181,7 +183,7 @@ void AllTracksterToSimTracksterAssociatorsByLCsProducer::produce(edm::StreamID, edm::Ref> recoTracksterRef(recoTrackstersHandle, tracksterIndex); const auto& layerClustersIds = recoTrackster.vertices(); float recoToSimScoresDenominator = 0.f; - ticl::AssociationMap layerClusterToAssociatedSimTracksterMap( + ticl::TICLAssociationMap layerClusterToAssociatedSimTracksterMap( layerClustersIds.size()); std::vector associatedSimTracksterIndices; for (unsigned int i = 0; i < layerClustersIds.size(); ++i) { @@ -254,7 +256,8 @@ void AllTracksterToSimTracksterAssociatorsByLCsProducer::produce(edm::StreamID, edm::Ref> simTracksterRef(simTrackstersHandle, tracksterIndex); const auto& layerClustersIds = simTrackster.vertices(); float simToRecoScoresDenominator = 0.f; - ticl::AssociationMap layerClusterToAssociatedTracksterMap(layerClustersIds.size()); + ticl::TICLAssociationMap layerClusterToAssociatedTracksterMap( + layerClustersIds.size()); std::vector associatedRecoTracksterIndices; for (unsigned int i = 0; i < layerClustersIds.size(); ++i) { unsigned int layerClusterId = layerClustersIds[i]; diff --git a/SimCalorimetry/HGCalAssociatorProducers/plugins/HitToLayerClusterAssociatorProducer.cc b/SimCalorimetry/HGCalAssociatorProducers/plugins/HitToLayerClusterAssociatorProducer.cc index 7803c8c0e9269..3ca7bc7a0e321 100644 --- a/SimCalorimetry/HGCalAssociatorProducers/plugins/HitToLayerClusterAssociatorProducer.cc +++ b/SimCalorimetry/HGCalAssociatorProducers/plugins/HitToLayerClusterAssociatorProducer.cc @@ -21,7 +21,7 @@ HitToLayerClusterAssociatorProducerT::HitToLayerClusterAssociatorProducerT( for (const auto &tag : hitsTags) { hitsTokens_.push_back(consumes>(tag)); } - produces>("hitToLayerClusterMap"); + produces>("hitToLayerClusterMap"); } template @@ -47,7 +47,7 @@ void HitToLayerClusterAssociatorProducerT::produce(edm::StreamID, } // Create association map - auto hitToLayerClusterMap = std::make_unique>(rechitSpan.size()); + auto hitToLayerClusterMap = std::make_unique>(rechitSpan.size()); // Loop over layer clusters for (unsigned int lcId = 0; lcId < layer_clusters->size(); ++lcId) { diff --git a/SimCalorimetry/HGCalAssociatorProducers/plugins/HitToSimClusterCaloParticleAssociatorProducer.cc b/SimCalorimetry/HGCalAssociatorProducers/plugins/HitToSimClusterCaloParticleAssociatorProducer.cc index 8db7aef3bd0dd..016904036ffd7 100644 --- a/SimCalorimetry/HGCalAssociatorProducers/plugins/HitToSimClusterCaloParticleAssociatorProducer.cc +++ b/SimCalorimetry/HGCalAssociatorProducers/plugins/HitToSimClusterCaloParticleAssociatorProducer.cc @@ -23,8 +23,8 @@ HitToSimClusterCaloParticleAssociatorProducerT::HitToSimClusterCaloParticle caloParticleToken_(consumes>(pset.getParameter("caloParticles"))), hitMapToken_(consumes>(pset.getParameter("hitMap"))), hitsToken_(consumes(pset.getParameter("hits"))) { - produces>("hitToSimClusterMap"); - produces>("hitToCaloParticleMap"); + produces>("hitToSimClusterMap"); + produces>("hitToCaloParticleMap"); } template @@ -46,8 +46,8 @@ void HitToSimClusterCaloParticleAssociatorProducerT::produce(edm::StreamID, edm::LogWarning("HitToSimClusterCaloParticleAssociatorProducer") << "RecHitCollections is invalid. Association maps will be empty."; // Store empty maps in the event - iEvent.put(std::make_unique>(), "hitToSimClusterMap"); - iEvent.put(std::make_unique>(), "hitToCaloParticleMap"); + iEvent.put(std::make_unique>(), "hitToSimClusterMap"); + iEvent.put(std::make_unique>(), "hitToCaloParticleMap"); return; } @@ -66,14 +66,14 @@ void HitToSimClusterCaloParticleAssociatorProducerT::produce(edm::StreamID, LogDebug("HitToSimClusterCaloParticleAssociatorProducer") << "RecHitCollection is empty. Association maps will be empty."; // Store empty maps in the event - iEvent.put(std::make_unique>(), "hitToSimClusterMap"); - iEvent.put(std::make_unique>(), "hitToCaloParticleMap"); + iEvent.put(std::make_unique>(), "hitToSimClusterMap"); + iEvent.put(std::make_unique>(), "hitToCaloParticleMap"); return; } // Create association maps - auto hitToSimClusterMap = std::make_unique>(rechitSpan.size()); - auto hitToCaloParticleMap = std::make_unique>(rechitSpan.size()); + auto hitToSimClusterMap = std::make_unique>(rechitSpan.size()); + auto hitToCaloParticleMap = std::make_unique>(rechitSpan.size()); // Loop over caloParticles for (unsigned int cpId = 0; cpId < caloParticles.size(); ++cpId) { diff --git a/SimCalorimetry/HGCalAssociatorProducers/plugins/HitToTracksterAssociatorProducer.cc b/SimCalorimetry/HGCalAssociatorProducers/plugins/HitToTracksterAssociatorProducer.cc index 5614ff50adf17..6854f347e1fa5 100644 --- a/SimCalorimetry/HGCalAssociatorProducers/plugins/HitToTracksterAssociatorProducer.cc +++ b/SimCalorimetry/HGCalAssociatorProducers/plugins/HitToTracksterAssociatorProducer.cc @@ -25,8 +25,8 @@ HitToTracksterAssociatorProducerT::HitToTracksterAssociatorProducerT(const for (const auto &tag : hitsTags) { hitsTokens_.push_back(consumes>(tag)); } - produces>("hitToTracksterMap"); - produces>("tracksterToHitMap"); + produces>("hitToTracksterMap"); + produces>("tracksterToHitMap"); } template @@ -55,8 +55,8 @@ void HitToTracksterAssociatorProducerT::produce(edm::StreamID, } // Create association map - auto hitToTracksterMap = std::make_unique>(rechitSpan.size()); - auto tracksterToHitMap = std::make_unique>(tracksters->size()); + auto hitToTracksterMap = std::make_unique>(rechitSpan.size()); + auto tracksterToHitMap = std::make_unique>(tracksters->size()); // Loop over tracksters for (unsigned int tracksterId = 0; tracksterId < tracksters->size(); ++tracksterId) { diff --git a/SimCalorimetry/HGCalAssociatorProducers/plugins/LCToTSAssociatorProducer.cc b/SimCalorimetry/HGCalAssociatorProducers/plugins/LCToTSAssociatorProducer.cc index f4968e960d64c..04378f5868794 100644 --- a/SimCalorimetry/HGCalAssociatorProducers/plugins/LCToTSAssociatorProducer.cc +++ b/SimCalorimetry/HGCalAssociatorProducers/plugins/LCToTSAssociatorProducer.cc @@ -19,7 +19,7 @@ LCToTSAssociatorProducer::LCToTSAssociatorProducer(const edm::ParameterSet &pset tracksterCollectionToken_( consumes>(pset.getParameter("tracksters"))) { produces< - ticl::AssociationMap, std::vector>>(); + ticl::TICLAssociationMap, std::vector>>(); } LCToTSAssociatorProducer::~LCToTSAssociatorProducer() {} @@ -40,7 +40,7 @@ void LCToTSAssociatorProducer::produce(edm::StreamID, edm::Event &iEvent, const // Create association map auto lcToTracksterMap = std::make_unique< - ticl::AssociationMap, std::vector>>( + ticl::TICLAssociationMap, std::vector>>( layer_clusters, tracksters, iEvent); // Loop over tracksters @@ -66,4 +66,4 @@ void LCToTSAssociatorProducer::fillDescriptions(edm::ConfigurationDescriptions & descriptions.add("LCToTSAssociatorProducer", desc); } -DEFINE_FWK_MODULE(LCToTSAssociatorProducer); \ No newline at end of file +DEFINE_FWK_MODULE(LCToTSAssociatorProducer); diff --git a/SimCalorimetry/HGCalAssociatorProducers/plugins/SimClusterToCaloParticleAssociatorProducer.cc b/SimCalorimetry/HGCalAssociatorProducers/plugins/SimClusterToCaloParticleAssociatorProducer.cc index d7787c565fe54..bc87ee7bd01fa 100644 --- a/SimCalorimetry/HGCalAssociatorProducers/plugins/SimClusterToCaloParticleAssociatorProducer.cc +++ b/SimCalorimetry/HGCalAssociatorProducers/plugins/SimClusterToCaloParticleAssociatorProducer.cc @@ -9,7 +9,7 @@ SimClusterToCaloParticleAssociatorProducer::SimClusterToCaloParticleAssociatorProducer(const edm::ParameterSet &pset) : simClusterToken_(consumes>(pset.getParameter("simClusters"))), caloParticleToken_(consumes>(pset.getParameter("caloParticles"))) { - produces, std::vector>>( + produces, std::vector>>( "simClusterToCaloParticleMap"); } @@ -29,7 +29,7 @@ void SimClusterToCaloParticleAssociatorProducer::produce(edm::StreamID, // Create association map auto simClusterToCaloParticleMap = std::make_unique< - ticl::AssociationMap, std::vector>>( + ticl::TICLAssociationMap, std::vector>>( simClustersHandle, caloParticlesHandle, iEvent); // Loop over caloParticles diff --git a/SimDataFormats/Associations/interface/TICLAssociationMap.h b/SimDataFormats/Associations/interface/TICLAssociationMap.h index 3e04b9f92cef6..322ebcc3783fa 100644 --- a/SimDataFormats/Associations/interface/TICLAssociationMap.h +++ b/SimDataFormats/Associations/interface/TICLAssociationMap.h @@ -152,9 +152,9 @@ namespace ticl { using oneToOneMapWithSharedEnergy = std::vector>; using oneToOneMapWithSharedEnergyAndScore = std::vector>>; - // AssociationMap class templated on MapType + // TICLAssociationMap class templated on MapType template - class AssociationMap { + class TICLAssociationMap { private: MapType map_; @@ -173,13 +173,13 @@ namespace ticl { using V = typename Traits::ValueType; using Type = MapType; static constexpr bool is_one_to_one = Traits::is_one_to_one; - AssociationMap() : collectionRefProds() {} + TICLAssociationMap() : collectionRefProds() {} // Constructor for generic use template && std::is_void_v, int> = 0> - AssociationMap(const unsigned int size1 = 0) { + TICLAssociationMap(const unsigned int size1 = 0) { map_.resize(size1); } @@ -187,7 +187,7 @@ namespace ticl { template && !std::is_void_v, int> = 0> - AssociationMap(const edm::RefProd& id1, const edm::RefProd& id2, const edm::Event& event) + TICLAssociationMap(const edm::RefProd& id1, const edm::RefProd& id2, const edm::Event& event) : collectionRefProds(std::make_pair(id1, id2)) { resize(event); } @@ -196,7 +196,7 @@ namespace ticl { template && !std::is_void_v, int> = 0> - AssociationMap(const edm::Handle& handle1, const edm::Handle& handle2, const edm::Event& event) + TICLAssociationMap(const edm::Handle& handle1, const edm::Handle& handle2, const edm::Event& event) : collectionRefProds(std::make_pair(edm::RefProd(handle1), edm::RefProd(handle2))) { resize(event); } @@ -320,7 +320,7 @@ namespace ticl { const auto& at(unsigned int index1) const { const auto& elem = map_.at(index1); if (!elem.isValid()) { - throw std::out_of_range("Attempted to access an unset element in AssociationMap. Element index: " + + throw std::out_of_range("Attempted to access an unset element in TICLAssociationMap. Element index: " + std::to_string(index1)); } return elem; @@ -329,7 +329,7 @@ namespace ticl { auto& at(unsigned int index1) { auto& elem = map_.at(index1); if (!elem.isValid()) { - throw std::out_of_range("Attempted to access an unset element in AssociationMap. Element index: " + + throw std::out_of_range("Attempted to access an unset element in TICLAssociationMap. Element index: " + std::to_string(index1)); } return elem; diff --git a/SimDataFormats/Associations/src/classes_def.xml b/SimDataFormats/Associations/src/classes_def.xml index 757b7f7091c34..f50b612aa7ccd 100644 --- a/SimDataFormats/Associations/src/classes_def.xml +++ b/SimDataFormats/Associations/src/classes_def.xml @@ -61,38 +61,38 @@ - - - - + + + + - - - - + + + + - - - - + + + + - - - - + + + + - - - - + + + + - - - - + + + + diff --git a/Validation/HGCalValidation/interface/BarrelVHistoProducerAlgo.h b/Validation/HGCalValidation/interface/BarrelVHistoProducerAlgo.h index 5f7039fd00d17..aaa1e82409a21 100644 --- a/Validation/HGCalValidation/interface/BarrelVHistoProducerAlgo.h +++ b/Validation/HGCalValidation/interface/BarrelVHistoProducerAlgo.h @@ -199,10 +199,10 @@ class BarrelVHistoProducerAlgo { public: typedef dqm::legacy::DQMStore DQMStore; typedef dqm::legacy::MonitorElement MonitorElement; - using TracksterToTracksterMap = - ticl::AssociationMap, std::vector>; + using TracksterToTracksterMap = ticl:: + TICLAssociationMap, std::vector>; using SimClusterToCaloParticleMap = - ticl::AssociationMap, std::vector>; + ticl::TICLAssociationMap, std::vector>; enum validationType { byHits_CP = 0, byLCs, byLCs_CP, byHits }; BarrelVHistoProducerAlgo(const edm::ParameterSet& pset); diff --git a/Validation/HGCalValidation/interface/BarrelValidator.h b/Validation/HGCalValidation/interface/BarrelValidator.h index 3d0ee84b7b785..d5a0882803666 100644 --- a/Validation/HGCalValidation/interface/BarrelValidator.h +++ b/Validation/HGCalValidation/interface/BarrelValidator.h @@ -40,10 +40,10 @@ struct BarrelValidatorHistograms { class BarrelValidator : public DQMGlobalEDAnalyzer { public: using Histograms = BarrelValidatorHistograms; - using TracksterToTracksterMap = - ticl::AssociationMap, std::vector>; + using TracksterToTracksterMap = ticl:: + TICLAssociationMap, std::vector>; using SimClusterToCaloParticleMap = - ticl::AssociationMap, std::vector>; + ticl::TICLAssociationMap, std::vector>; /// Constructor BarrelValidator(const edm::ParameterSet& pset); diff --git a/Validation/HGCalValidation/interface/HGCalValidator.h b/Validation/HGCalValidation/interface/HGCalValidator.h index 39bfcd71b8686..b1b02f7ea8ac9 100644 --- a/Validation/HGCalValidation/interface/HGCalValidator.h +++ b/Validation/HGCalValidation/interface/HGCalValidator.h @@ -48,10 +48,10 @@ struct HGCalValidatorHistograms { class HGCalValidator : public DQMGlobalEDAnalyzer { public: using Histograms = HGCalValidatorHistograms; - using TracksterToTracksterMap = - ticl::AssociationMap, std::vector>; + using TracksterToTracksterMap = ticl:: + TICLAssociationMap, std::vector>; using SimClusterToCaloParticleMap = - ticl::AssociationMap, std::vector>; + ticl::TICLAssociationMap, std::vector>; /// Constructor HGCalValidator(const edm::ParameterSet& pset); diff --git a/Validation/HGCalValidation/interface/HGVHistoProducerAlgo.h b/Validation/HGCalValidation/interface/HGVHistoProducerAlgo.h index 3f480efa87283..c4e1ac87e3c5f 100644 --- a/Validation/HGCalValidation/interface/HGVHistoProducerAlgo.h +++ b/Validation/HGCalValidation/interface/HGVHistoProducerAlgo.h @@ -254,10 +254,10 @@ class HGVHistoProducerAlgo { public: typedef dqm::legacy::DQMStore DQMStore; typedef dqm::legacy::MonitorElement MonitorElement; - using TracksterToTracksterMap = - ticl::AssociationMap, std::vector>; + using TracksterToTracksterMap = ticl:: + TICLAssociationMap, std::vector>; using SimClusterToCaloParticleMap = - ticl::AssociationMap, std::vector>; + ticl::TICLAssociationMap, std::vector>; enum validationType { byHits_CP = 0, byLCs, byLCs_CP, byHits }; HGVHistoProducerAlgo(const edm::ParameterSet& pset); diff --git a/Validation/HGCalValidation/interface/TICLCandidateValidator.h b/Validation/HGCalValidation/interface/TICLCandidateValidator.h index 339b2c3b4febf..935e668eb93a8 100644 --- a/Validation/HGCalValidation/interface/TICLCandidateValidator.h +++ b/Validation/HGCalValidation/interface/TICLCandidateValidator.h @@ -23,8 +23,8 @@ #include "DQMServices/Core/interface/DQMStore.h" namespace ticl { - using TracksterToTracksterMap = - ticl::AssociationMap, std::vector>; + using TracksterToTracksterMap = ticl:: + TICLAssociationMap, std::vector>; } struct TICLCandidateValidatorHistograms { diff --git a/Validation/HGCalValidation/plugins/TracksterAssociationMaskProducer.cc b/Validation/HGCalValidation/plugins/TracksterAssociationMaskProducer.cc index 3026ff3d7a569..29bf39cd02f53 100644 --- a/Validation/HGCalValidation/plugins/TracksterAssociationMaskProducer.cc +++ b/Validation/HGCalValidation/plugins/TracksterAssociationMaskProducer.cc @@ -26,12 +26,12 @@ // using namespace ticl; using std::vector; -using ticl::AssociationMap; +using ticl::TICLAssociationMap; using ticl::Trackster; using ticl::TracksterCollection; using TracksterToTracksterMap = - ticl::AssociationMap, vector>; + ticl::TICLAssociationMap, vector>; class TracksterAssociationMaskProducer : public edm::stream::EDProducer<> { public: diff --git a/Validation/HGCalValidation/plugins/TracksterSuperclusteringValidCandidateMaskProducer.cc b/Validation/HGCalValidation/plugins/TracksterSuperclusteringValidCandidateMaskProducer.cc index 1479efa5e7b4c..1bac4f56e3c51 100644 --- a/Validation/HGCalValidation/plugins/TracksterSuperclusteringValidCandidateMaskProducer.cc +++ b/Validation/HGCalValidation/plugins/TracksterSuperclusteringValidCandidateMaskProducer.cc @@ -24,12 +24,12 @@ // using namespace ticl; using std::vector; -using ticl::AssociationMap; +using ticl::TICLAssociationMap; using ticl::Trackster; using ticl::TracksterCollection; using TracksterToTracksterMap = - ticl::AssociationMap, vector>; + ticl::TICLAssociationMap, vector>; class TracksterSuperclusteringValidCandidateMaskProducer : public edm::stream::EDProducer<> { public: