diff --git a/DataFormats/PatCandidates/interface/PATObject.h b/DataFormats/PatCandidates/interface/PATObject.h index 7e78486e9b8e8..db362b95c027f 100644 --- a/DataFormats/PatCandidates/interface/PATObject.h +++ b/DataFormats/PatCandidates/interface/PATObject.h @@ -195,8 +195,8 @@ namespace pat { /// add a trigger match void addTriggerObjectMatch( const TriggerObjectStandAlone & trigObj ) { triggerObjectMatchesEmbedded_.push_back( trigObj ); }; /// unpack path names of matched trigger objects (if they were packed before embedding, which is not normally the case) - void unpackTriggerObjectPathNames( const edm::TriggerNames &names ) const { - for (std::vector::const_iterator it = triggerObjectMatchesEmbedded_.begin(), ed = triggerObjectMatchesEmbedded_.end(); it != ed; ++it) it->unpackPathNames(names); + void unpackTriggerObjectPathNames( const edm::TriggerNames &names ) { + for (std::vector::iterator it = triggerObjectMatchesEmbedded_.begin(), ed = triggerObjectMatchesEmbedded_.end(); it != ed; ++it) it->unpackPathNames(names); } /// Returns an efficiency given its name diff --git a/DataFormats/PatCandidates/interface/TriggerObjectStandAlone.h b/DataFormats/PatCandidates/interface/TriggerObjectStandAlone.h index 7568f428a6ab7..f78a74027429d 100644 --- a/DataFormats/PatCandidates/interface/TriggerObjectStandAlone.h +++ b/DataFormats/PatCandidates/interface/TriggerObjectStandAlone.h @@ -148,9 +148,9 @@ namespace pat { virtual bool coll( const std::string & collName ) const { return hasCollection( collName ); }; /// pack trigger names into indices - void packPathNames(const edm::TriggerNames &names) const ; + void packPathNames(const edm::TriggerNames &names) ; /// unpack trigger names into indices - void unpackPathNames(const edm::TriggerNames &names) const ; + void unpackPathNames(const edm::TriggerNames &names) ; }; diff --git a/DataFormats/PatCandidates/src/TriggerObjectStandAlone.cc b/DataFormats/PatCandidates/src/TriggerObjectStandAlone.cc index 1d1904a3592d1..42eac43ee1102 100644 --- a/DataFormats/PatCandidates/src/TriggerObjectStandAlone.cc +++ b/DataFormats/PatCandidates/src/TriggerObjectStandAlone.cc @@ -261,7 +261,7 @@ bool TriggerObjectStandAlone::checkIfPathsAreUnpacked(bool throwIfPacked) const return unpacked; } -void TriggerObjectStandAlone::packPathNames(const edm::TriggerNames &names) const { +void TriggerObjectStandAlone::packPathNames(const edm::TriggerNames &names) { if (!pathIndices_.empty()) { if (!pathNames_.empty()) { throw cms::Exception("RuntimeError", "Error, trying to pack a partially packed TriggerObjectStandAlone"); @@ -283,12 +283,12 @@ void TriggerObjectStandAlone::packPathNames(const edm::TriggerNames &names) cons } } if (ok) { - (const_cast &>(pathIndices_)).swap(indices); - (const_cast &>(pathNames_)).clear(); + pathIndices_.swap(indices); + pathNames_.clear(); } } -void TriggerObjectStandAlone::unpackPathNames(const edm::TriggerNames &names) const { +void TriggerObjectStandAlone::unpackPathNames(const edm::TriggerNames &names) { if (!pathNames_.empty()) { if (!pathIndices_.empty()) { throw cms::Exception("RuntimeError", "Error, trying to unpack a partially unpacked TriggerObjectStandAlone"); @@ -302,7 +302,7 @@ void TriggerObjectStandAlone::unpackPathNames(const edm::TriggerNames &names) co if (pathIndices_[i] >= end) throw cms::Exception("RuntimeError", "Error, path index out of bounds"); paths[i] = names.triggerName(pathIndices_[i]); } - (const_cast &>(pathIndices_)).clear(); - (const_cast &>(pathNames_)).swap(paths); + pathIndices_.clear(); + pathNames_.swap(paths); }