File indexing completed on 2024-04-06 12:31:02
0001 #include "SimTracker/TrackerHitAssociation/interface/ClusterTPAssociation.h"
0002 #include "FWCore/Utilities/interface/Exception.h"
0003
0004 void ClusterTPAssociation::checkKeyProductID(const edm::ProductID& id) const {
0005 if (std::find(std::begin(keyProductIDs_), std::end(keyProductIDs_), id) == std::end(keyProductIDs_)) {
0006 auto e = cms::Exception("InvalidReference");
0007 e << "ClusterTPAssociation has OmniClusterRefs with ProductIDs ";
0008 for (size_t i = 0; i < keyProductIDs_.size(); ++i) {
0009 e << keyProductIDs_[i];
0010 if (i < keyProductIDs_.size() - 1) {
0011 e << ",";
0012 }
0013 }
0014 e << " but got OmniClusterRef/ProductID with ID " << id << ". This is typically caused by a configuration error.";
0015 throw e;
0016 }
0017 }
0018
0019 void ClusterTPAssociation::checkMappedProductID(const edm::ProductID& id) const {
0020 if (id != mappedProductId_) {
0021 throw cms::Exception("InvalidReference")
0022 << "ClusterTPAssociation has TrackingParticles with ProductID " << mappedProductId_
0023 << ", but got TrackingParticleRef/Handle/ProductID with ID " << id
0024 << ". This is typically caused by a configuration error.";
0025 }
0026 }