diff --git a/TileCalorimeter/TileRecUtils/TileRecUtils/ITileRawChannelTool.h b/TileCalorimeter/TileRecUtils/TileRecUtils/ITileRawChannelTool.h index 8389b927aeed9a55552670694c0e7e031d4841e3..27b58b3894e945139dc4c24b00cde4176b603f78 100644 --- a/TileCalorimeter/TileRecUtils/TileRecUtils/ITileRawChannelTool.h +++ b/TileCalorimeter/TileRecUtils/TileRecUtils/ITileRawChannelTool.h @@ -19,7 +19,7 @@ class ITileRawChannelTool: virtual public IAlgTool { public: // update TileRawChannelContainer, subtract common mode noise for example - virtual StatusCode process( const TileRawChannelContainer * rchCnt)=0 ; + virtual StatusCode process(TileRawChannelContainer * rchCnt)=0 ; static const InterfaceID& interfaceID() { return IID_ITileRawChannelTool;} }; diff --git a/TileCalorimeter/TileRecUtils/TileRecUtils/TileRawChannelNoiseFilter.h b/TileCalorimeter/TileRecUtils/TileRecUtils/TileRawChannelNoiseFilter.h index 72eac34f9a925c8561095b3eb0efc83c0ee443bc..4b77aea3255bca4b5c368cb54294bf0cc5a0bd58 100644 --- a/TileCalorimeter/TileRecUtils/TileRecUtils/TileRawChannelNoiseFilter.h +++ b/TileCalorimeter/TileRecUtils/TileRecUtils/TileRawChannelNoiseFilter.h @@ -51,7 +51,7 @@ class TileRawChannelNoiseFilter: public AthAlgTool, virtual public ITileRawChann virtual StatusCode finalize(); /** proceed the coherent noise subtruction algorithm and correct TileRawChannel amplitudes */ - virtual StatusCode process(const TileRawChannelContainer *rchCnt); + virtual StatusCode process(TileRawChannelContainer *rchCnt); private: diff --git a/TileCalorimeter/TileRecUtils/TileRecUtils/TileRawChannelOF1Corrector.h b/TileCalorimeter/TileRecUtils/TileRecUtils/TileRawChannelOF1Corrector.h index a1a2bbaaa77b38cee11d1209950cb038a15028f4..17f8abcfcbe7a3c103840582858f24c60b65c2cf 100644 --- a/TileCalorimeter/TileRecUtils/TileRecUtils/TileRawChannelOF1Corrector.h +++ b/TileCalorimeter/TileRecUtils/TileRecUtils/TileRawChannelOF1Corrector.h @@ -49,7 +49,7 @@ class TileRawChannelOF1Corrector: public AthAlgTool, virtual public ITileRawChan virtual StatusCode finalize() override; /** Correct TileRawChannel amplitudes if pedestal changed */ - virtual StatusCode process(const TileRawChannelContainer* rawChannelContainer) override; + virtual StatusCode process(TileRawChannelContainer* rawChannelContainer) override; private: diff --git a/TileCalorimeter/TileRecUtils/src/TileCellBuilder.cxx b/TileCalorimeter/TileRecUtils/src/TileCellBuilder.cxx index d5d741b513a42cf5a729927ec49c62790a33de0a..b89cdd8b609662995db2236f0e2c7ab1c29583a5 100644 --- a/TileCalorimeter/TileRecUtils/src/TileCellBuilder.cxx +++ b/TileCalorimeter/TileRecUtils/src/TileCellBuilder.cxx @@ -383,7 +383,8 @@ StatusCode TileCellBuilder::process(CaloCellContainer * theCellContainer) { ToolHandleArray<ITileRawChannelTool>::iterator endTool=m_noiseFilterTools.end(); for (; itrTool != endTool; ++itrTool) { - if ((*itrTool)->process(dspChannels).isFailure()) { + /// FIXME: const_cast; tools can change the container! + if ((*itrTool)->process(const_cast<TileRawChannelContainer*>(dspChannels)).isFailure()) { ATH_MSG_ERROR( " Error status returned from noise filter " ); } else { ATH_MSG_DEBUG( "Noise filter applied to the container" ); @@ -495,7 +496,8 @@ StatusCode TileCellBuilder::process(CaloCellContainer * theCellContainer) { ToolHandleArray<ITileRawChannelTool>::iterator endTool = m_noiseFilterTools.end(); for (; itrTool != endTool; ++itrTool) { - if ((*itrTool)->process(rawChannels).isFailure()) { + /// FIXME: const_cast; tools can change the container! + if ((*itrTool)->process(const_cast<TileRawChannelContainer*>(rawChannels)).isFailure()) { ATH_MSG_ERROR( " Error status returned from noise filter " ); } else { ATH_MSG_DEBUG( "Noise filter applied to the container" ); @@ -648,6 +650,7 @@ StatusCode TileCellBuilder::process(CaloCellContainer * theCellContainer) { } xAOD::EventInfo* eventInfo = 0; if (eventInfo_c) { + /// FIXME: const_cast; changing EventInfo. eventInfo = const_cast<xAOD::EventInfo*>(eventInfo_c); if (!eventInfo->getStore()) { const SG::IAuxStore* store = dynamic_cast<const SG::IAuxStore*> (eventInfo->getConstStore()); diff --git a/TileCalorimeter/TileRecUtils/src/TileRawChannelBuilder.cxx b/TileCalorimeter/TileRecUtils/src/TileRawChannelBuilder.cxx index c6aec277d3a3448914c28753dfba3d1fa499ce2a..12bbe42cce7ba2c3c6a3c8810a581b11b23659a0 100644 --- a/TileCalorimeter/TileRecUtils/src/TileRawChannelBuilder.cxx +++ b/TileCalorimeter/TileRecUtils/src/TileRawChannelBuilder.cxx @@ -504,7 +504,8 @@ StatusCode TileRawChannelBuilder::commitContainer() { ATH_MSG_DEBUG( "Noise filter was already applied to DSP container before, use it as it is" ); } else { for (;itrTool!=endTool;++itrTool){ - if ((*itrTool)->process(dspCnt).isFailure()) { + /// FIXME: const_cast + if ((*itrTool)->process(const_cast<TileRawChannelContainer*>(dspCnt)).isFailure()) { ATH_MSG_ERROR( " Error status returned from noise filter " ); } else { ATH_MSG_DEBUG( "Noise filter applied to DSP container" ); @@ -540,7 +541,7 @@ StatusCode TileRawChannelBuilder::commitContainer() { TileRawChannelCollection::const_iterator dspLast=dcoll->end(); for(; rchItr!=lastRch; ++rchItr) { - TileRawChannel* rch = (*rchItr); + const TileRawChannel* rch = (*rchItr); HWIdentifier adc_id = rch->adc_HWID(); while (dspItr != dspLast && adc_id != (*dspItr)->adc_HWID()) { ++dspItr; @@ -550,8 +551,9 @@ StatusCode TileRawChannelBuilder::commitContainer() { ATH_MSG_VERBOSE( "Ch "<<m_tileHWID->to_string(adc_id) <<" amp " << rch->amplitude() << " ped " << rch->pedestal() << " corr " << corr ); - rch->setAmplitude (rch->amplitude() - corr); - rch->setPedestal (rch->pedestal() + corr); + /// FIXME: const_cast + const_cast<TileRawChannel*>(rch)->setAmplitude (rch->amplitude() - corr); + const_cast<TileRawChannel*>(rch)->setPedestal (rch->pedestal() + corr); } else { ATH_MSG_WARNING(" Problem in applying noise corrections " << " can not find channel in DSP container with HWID " diff --git a/TileCalorimeter/TileRecUtils/src/TileRawChannelNoiseFilter.cxx b/TileCalorimeter/TileRecUtils/src/TileRawChannelNoiseFilter.cxx index 860b7b5b5167ffd17391e8d4cb35c3012e9721ec..bde807b6800504c9edc795034dbe9d2fc6e94aaf 100644 --- a/TileCalorimeter/TileRecUtils/src/TileRawChannelNoiseFilter.cxx +++ b/TileCalorimeter/TileRecUtils/src/TileRawChannelNoiseFilter.cxx @@ -88,7 +88,8 @@ StatusCode TileRawChannelNoiseFilter::initialize() { // ============================================================================ // process container -StatusCode TileRawChannelNoiseFilter::process(const TileRawChannelContainer *rchCont) { +StatusCode TileRawChannelNoiseFilter::process( + TileRawChannelContainer *rchCont) { ATH_MSG_DEBUG("in process()"); @@ -281,7 +282,8 @@ StatusCode TileRawChannelNoiseFilter::process(const TileRawChannelContainer *rch // iterate over all channels in a collection again for (rchItr = coll->begin(); rchItr != lastRch; ++rchItr) { - TileRawChannel* rch = (*rchItr); + /// FIXME: const_cast + TileRawChannel* rch = const_cast<TileRawChannel*>(*rchItr); int chan = m_tileHWID->channel(rch->adc_HWID()); int gain = m_tileHWID->adc(rch->adc_HWID()); diff --git a/TileCalorimeter/TileRecUtils/src/TileRawChannelOF1Corrector.cxx b/TileCalorimeter/TileRecUtils/src/TileRawChannelOF1Corrector.cxx index ec3f5b09d9f3b65aa88e9eef4cd016318d999faa..d0da887c0670e2075d3e8b6d5975bf14501f3ec5 100644 --- a/TileCalorimeter/TileRecUtils/src/TileRawChannelOF1Corrector.cxx +++ b/TileCalorimeter/TileRecUtils/src/TileRawChannelOF1Corrector.cxx @@ -85,7 +85,7 @@ StatusCode TileRawChannelOF1Corrector::initialize() { // ============================================================================ // process container -StatusCode TileRawChannelOF1Corrector::process(const TileRawChannelContainer* rawChannelContainer) { +StatusCode TileRawChannelOF1Corrector::process(TileRawChannelContainer* rawChannelContainer) { ATH_MSG_DEBUG("in process()"); @@ -127,7 +127,8 @@ StatusCode TileRawChannelOF1Corrector::process(const TileRawChannelContainer* ra } } - for (TileRawChannel* rawChannel : *rawChannelCollection) { + /// FIXME: const_cast + for (TileRawChannel* rawChannel : const_cast<TileRawChannelCollection&>(*rawChannelCollection)) { HWIdentifier adcId = rawChannel->adc_HWID(); int channel = m_tileHWID->channel(adcId); int gain = m_tileHWID->adc(adcId);