From d36e1c748030f78ba252fe77eb1484c53b17296f Mon Sep 17 00:00:00 2001 From: Tadej Novak <tadej.novak@cern.ch> Date: Tue, 6 Dec 2022 11:01:44 +0100 Subject: [PATCH] Fix compilation warning --- DataQuality/dqm_algorithms/src/MUCTPISLAnyHit.cxx | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/DataQuality/dqm_algorithms/src/MUCTPISLAnyHit.cxx b/DataQuality/dqm_algorithms/src/MUCTPISLAnyHit.cxx index 0f727ea34b47..8c270a10337b 100644 --- a/DataQuality/dqm_algorithms/src/MUCTPISLAnyHit.cxx +++ b/DataQuality/dqm_algorithms/src/MUCTPISLAnyHit.cxx @@ -49,11 +49,11 @@ MUCTPISLAnyHit::execute( const std::string& name, const TObject& object, const d { using namespace std; - TH2 * hist; + const TH2 *hist; //ensure that input histo is 2D if( object.IsA()->InheritsFrom( "TH2" ) ) { - hist = (TH2*)&object; + hist = dynamic_cast<const TH2 *>(&object); if (hist->GetDimension() != 2 ){ throw dqm_core::BadConfig( ERS_HERE, name, "dimension != 2 " ); } -- GitLab