Skip to content
Snippets Groups Projects
Commit 4df09f26 authored by scott snyder's avatar scott snyder Committed by scott snyder
Browse files

JetTagCalibration: Fix gcc11 warning.

Check result of dynamic_cast before dereferenceing.
parent c2338251
No related branches found
No related tags found
No related merge requests found
/* /*
Copyright (C) 2002-2018 CERN for the benefit of the ATLAS collaboration Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration
*/ */
#include "JetTagCalibration/CalibrationBroker.h" #include "JetTagCalibration/CalibrationBroker.h"
...@@ -173,8 +173,10 @@ namespace Analysis { ...@@ -173,8 +173,10 @@ namespace Analysis {
if((*hI).second.first) { if((*hI).second.first) {
if(((*hI).second.first)->InheritsFrom("TH1")){ if(((*hI).second.first)->InheritsFrom("TH1")){
if( msgLvl(MSG::VERBOSE) ){ if( msgLvl(MSG::VERBOSE) ){
msg(MSG::VERBOSE)<< " entries: " if (auto th1 = dynamic_cast<TH1*>(((*hI).second).first)) {
<< dynamic_cast<TH1*>(((*hI).second).first)->GetEntries(); msg(MSG::VERBOSE)<< " entries: "
<< th1->GetEntries();
}
} }
} }
} else { } else {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment