File tree Expand file tree Collapse file tree 1 file changed +4
-3
lines changed
Expand file tree Collapse file tree 1 file changed +4
-3
lines changed Original file line number Diff line number Diff line change 11#include " Validation/HLTrigger/interface/HLTGenResHistColl.h"
2+ #include < optional>
23
34namespace {
45 // function to get the trigger objects of a specific collection
@@ -141,20 +142,20 @@ void HLTGenResHistColl::bookHists(DQMStore::IBooker& iBooker) {
141142void HLTGenResHistColl::fillHists (const HLTGenValObject& obj, edm::Handle<trigger::TriggerEvent>& triggerEvent) {
142143 // get the trigger objects of the collection
143144 auto keyRange = getTrigObjIndicesOfCollection (*triggerEvent, collectionName_, hltProcessName_);
144- const trigger::TriggerObject* bestMatch = nullptr ;
145+ std::optional< trigger::TriggerObject> bestMatch;
145146 float bestDR2 = dR2limit_;
146147 for (trigger::size_type key = keyRange.first ; key < keyRange.second ; ++key) {
147148 if (passFilterSelection (key, *triggerEvent)) {
148149 const trigger::TriggerObject objTrig = triggerEvent->getObjects ().at (key);
149150 if (isEventLevelVariable_) {
150151 bestDR2 = 0 ;
151- bestMatch = & objTrig;
152+ bestMatch = objTrig;
152153 break ;
153154 } else {
154155 float dR2 = reco::deltaR2 (obj, objTrig);
155156 if (dR2 < bestDR2) {
156157 bestDR2 = dR2;
157- bestMatch = & objTrig;
158+ bestMatch = objTrig;
158159 }
159160 }
160161 }
You can’t perform that action at this time.
0 commit comments