From 83548f01d8cde262c24de379bd4c0bcfd3fd4000 Mon Sep 17 00:00:00 2001 From: Tamas Vami Date: Fri, 15 Sep 2023 15:30:34 -0700 Subject: [PATCH 1/2] Resolve narrowing conversions in HcalGeometry.cxx --- DetDescr/include/DetDescr/HcalID.h | 12 ++++++------ DetDescr/src/DetDescr/HcalGeometry.cxx | 6 +++--- SimCore | 2 +- 3 files changed, 10 insertions(+), 10 deletions(-) diff --git a/DetDescr/include/DetDescr/HcalID.h b/DetDescr/include/DetDescr/HcalID.h index 88cdb0596..12aa89ce2 100644 --- a/DetDescr/include/DetDescr/HcalID.h +++ b/DetDescr/include/DetDescr/HcalID.h @@ -73,37 +73,37 @@ class HcalID : public HcalAbstractID { * Get the value of the 'section' field from the ID. * @return The value of the 'strip' field. */ - int getSection() const { return (id_ >> SECTION_SHIFT) & SECTION_MASK; } + unsigned int getSection() const { return (id_ >> SECTION_SHIFT) & SECTION_MASK; } /* * Get the value of the 'section' field from the ID. * @return The value of the 'strip' field. */ - int section() const { return (id_ >> SECTION_SHIFT) & SECTION_MASK; } + unsigned int section() const { return (id_ >> SECTION_SHIFT) & SECTION_MASK; } /** * Get the value of the layer field from the ID. * @return The value of the layer field. */ - int layer() const { return (id_ >> LAYER_SHIFT) & LAYER_MASK; } + unsigned int layer() const { return (id_ >> LAYER_SHIFT) & LAYER_MASK; } /** * Get the value of the layer field from the ID. * @return The value of the layer field. */ - int getLayerID() const { return (id_ >> LAYER_SHIFT) & LAYER_MASK; } + unsigned int getLayerID() const { return (id_ >> LAYER_SHIFT) & LAYER_MASK; } /** * Get the value of the 'strip' field from the ID. * @return The value of 'strip' field. */ - int getStrip() const { return (id_ >> STRIP_SHIFT) & STRIP_MASK; } + unsigned int getStrip() const { return (id_ >> STRIP_SHIFT) & STRIP_MASK; } /** * Get the value of the 'strip' field from the ID. * @return The value of 'strip' field. */ - int strip() const { return (id_ >> STRIP_SHIFT) & STRIP_MASK; } + unsigned int strip() const { return (id_ >> STRIP_SHIFT) & STRIP_MASK; } static void createInterpreters(); }; diff --git a/DetDescr/src/DetDescr/HcalGeometry.cxx b/DetDescr/src/DetDescr/HcalGeometry.cxx index b25c261b4..ae6ddc390 100644 --- a/DetDescr/src/DetDescr/HcalGeometry.cxx +++ b/DetDescr/src/DetDescr/HcalGeometry.cxx @@ -143,9 +143,9 @@ void HcalGeometry::printPositionMap(int section) const { void HcalGeometry::buildStripPositionMap() { // We hard-code the number of sections as seen in HcalID - for (int section = 0; section < num_sections_; section++) { - for (int layer = 1; layer <= num_layers_[section]; layer++) { - for (int strip = 0; strip < getNumStrips(section, layer); strip++) { + for (unsigned int section = 0; section < num_sections_; section++) { + for (unsigned int layer = 1; layer <= num_layers_[section]; layer++) { + for (unsigned int strip = 0; strip < getNumStrips(section, layer); strip++) { // initialize values double x{-99999}, y{-99999}, z{-99999}; diff --git a/SimCore b/SimCore index f4202a00f..ce00acb10 160000 --- a/SimCore +++ b/SimCore @@ -1 +1 @@ -Subproject commit f4202a00f58609b4b0e70485b5675bc21144b241 +Subproject commit ce00acb101a61a81a2e75de49e6338ff37e246ec From 69675a484681926774b9eb25756b76a6de33f5df Mon Sep 17 00:00:00 2001 From: Tamas Vami Date: Fri, 15 Sep 2023 15:58:13 -0700 Subject: [PATCH 2/2] Resolve narrowing conversions in HgcrocEmulator.cxx --- SimCore | 2 +- Tools/src/Tools/HgcrocEmulator.cxx | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/SimCore b/SimCore index ce00acb10..f4202a00f 160000 --- a/SimCore +++ b/SimCore @@ -1 +1 @@ -Subproject commit ce00acb101a61a81a2e75de49e6338ff37e246ec +Subproject commit f4202a00f58609b4b0e70485b5675bc21144b241 diff --git a/Tools/src/Tools/HgcrocEmulator.cxx b/Tools/src/Tools/HgcrocEmulator.cxx index d711e25a4..625a3e671 100644 --- a/Tools/src/Tools/HgcrocEmulator.cxx +++ b/Tools/src/Tools/HgcrocEmulator.cxx @@ -232,12 +232,12 @@ std::vector HgcrocEmulator::noiseDigi( std::vector noise_digi; for (int iADC{0}; iADC(pedestal)}; if (iADC > 0) adc_tm1 = noise_digi.at(iADC-1).adc_t(); else adc_tm1 += noise(channel)/gain; - int adc_t{pedestal + noise(channel)/gain}; + int adc_t{static_cast(pedestal + noise(channel)/gain)}; if (iADC == iSOI_) adc_t += soi_amplitude/gain;