From 3ea00a5be94a546827ec79afbabe06326550ef22 Mon Sep 17 00:00:00 2001 From: mmusich Date: Tue, 21 Mar 2023 14:47:23 +0100 Subject: [PATCH] remove the const_cast from SiStripFedCablingFakeESSource --- .../fake/SiStripFedCablingFakeESSource.cc | 18 ++++++++---------- 1 file changed, 8 insertions(+), 10 deletions(-) diff --git a/CalibTracker/SiStripESProducers/plugins/fake/SiStripFedCablingFakeESSource.cc b/CalibTracker/SiStripESProducers/plugins/fake/SiStripFedCablingFakeESSource.cc index 4d2e77bb87e6b..33bf811a98365 100644 --- a/CalibTracker/SiStripESProducers/plugins/fake/SiStripFedCablingFakeESSource.cc +++ b/CalibTracker/SiStripESProducers/plugins/fake/SiStripFedCablingFakeESSource.cc @@ -95,15 +95,13 @@ SiStripFedCabling* SiStripFedCablingFakeESSource::make(const SiStripFedCablingRc bool insufficient = false; Feds::const_iterator ifed = feds.begin(); uint16_t fed_ch = 0; - for (std::vector::const_iterator icrate = fec_cabling->crates().begin(); + for (std::vector::iterator icrate = fec_cabling->crates().begin(); icrate != fec_cabling->crates().end(); icrate++) { - for (std::vector::const_iterator ifec = icrate->fecs().begin(); ifec != icrate->fecs().end(); ifec++) { - for (std::vector::const_iterator iring = ifec->rings().begin(); iring != ifec->rings().end(); - iring++) { - for (std::vector::const_iterator iccu = iring->ccus().begin(); iccu != iring->ccus().end(); - iccu++) { - for (std::vector::const_iterator imod = iccu->modules().begin(); imod != iccu->modules().end(); + for (std::vector::iterator ifec = icrate->fecs().begin(); ifec != icrate->fecs().end(); ifec++) { + for (std::vector::iterator iring = ifec->rings().begin(); iring != ifec->rings().end(); iring++) { + for (std::vector::iterator iccu = iring->ccus().begin(); iccu != iring->ccus().end(); iccu++) { + for (std::vector::iterator imod = iccu->modules().begin(); imod != iccu->modules().end(); imod++) { if (populateAllFeds) { for (uint16_t ipair = 0; ipair < imod->nApvPairs(); ipair++) { @@ -121,7 +119,7 @@ SiStripFedCabling* SiStripFedCablingFakeESSource::make(const SiStripFedCablingRc (*ifed) % 16 + 2, // FED slot starts from 2 *ifed, fed_ch); - const_cast(*imod).fedCh(addr.first, fed_channel); + imod->fedCh(addr.first, fed_channel); ifed++; } } else { @@ -134,12 +132,12 @@ SiStripFedCabling* SiStripFedCablingFakeESSource::make(const SiStripFedCablingRc fed_ch = 0; } // move to next FED for (uint16_t ipair = 0; ipair < imod->nApvPairs(); ipair++) { - std::pair addr = imod->activeApvPair((*imod).lldChannel(ipair)); + std::pair addr = imod->activeApvPair(imod->lldChannel(ipair)); SiStripModule::FedChannel fed_channel((*ifed) / 16 + 1, // 16 FEDs per crate, numbering starts from 1 (*ifed) % 16 + 2, // FED slot starts from 2 (*ifed), fed_ch); - const_cast(*imod).fedCh(addr.first, fed_channel); + imod->fedCh(addr.first, fed_channel); fed_ch++; } }