diff --git a/LArCalorimeter/LArCnv/LArByteStream/LArByteStream/LArRodBlockCalibrationV0.h b/LArCalorimeter/LArCnv/LArByteStream/LArByteStream/LArRodBlockCalibrationV0.h index 287a57df0e0c901d635fc6e656d98048ac4ef158..8e8dea542cf2c959e5d4b4f9d597cf92317dfbd7 100644 --- a/LArCalorimeter/LArCnv/LArByteStream/LArByteStream/LArRodBlockCalibrationV0.h +++ b/LArCalorimeter/LArCnv/LArByteStream/LArByteStream/LArRodBlockCalibrationV0.h @@ -1,7 +1,7 @@ //Dear emacs, this is -*- c++ -*- /* - Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration + Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration */ #ifndef LARBYTESTREAM_LARRODBLOCKCALIBRATIONV0_H @@ -106,7 +106,7 @@ inline void LArRodBlockCalibrationV0<DSPHEADER>::setPulsed(const unsigned chann #ifdef LARBYTESTREAMRODBLOCK_CHCKBOUNDARIES if (channelNumber>=128) { std::cout << "ERROR WRITE BEYOND ARRAY BONDARY!" << std::endl; - exit(-1); + std::abort(); } #endif this->setBit((uint32_t*) (&(this->m_vFragment->front())+(DSPHEADER::IsPulsed/2)),channelNumber); diff --git a/LArCalorimeter/LArCnv/LArByteStream/LArByteStream/LArRodBlockPhysicsV3.h b/LArCalorimeter/LArCnv/LArByteStream/LArByteStream/LArRodBlockPhysicsV3.h index 8a002aca1e8ba32e29334f9695e24ae38f23505d..89008d97a2904869ebd1f9256bb91ffbb9507592 100644 --- a/LArCalorimeter/LArCnv/LArByteStream/LArByteStream/LArRodBlockPhysicsV3.h +++ b/LArCalorimeter/LArCnv/LArByteStream/LArByteStream/LArRodBlockPhysicsV3.h @@ -1,7 +1,7 @@ //Dear emacs, this is -*- c++ -*- /* - Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration + Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration */ #ifndef LARBYTESTREAM_LARRODBLOCKPYSICSV3_H @@ -322,9 +322,8 @@ inline int32_t LArRodBlockPhysicsV3::getEx() const // To be checked if ((*(m_CounterPtr+5))&(1<<15)) // number id negative ex = -ex; return ex;*/ - uint32_t* copy32u = (uint32_t*)(m_CounterPtr+4); - int32_t* ex = (int32_t*)copy32u; - return *ex; + const uint32_t* copy32u = reinterpret_cast<const uint32_t*>(m_CounterPtr+4); + return *copy32u; } inline int32_t LArRodBlockPhysicsV3::getEy() const // To be checked @@ -337,16 +336,14 @@ inline int32_t LArRodBlockPhysicsV3::getEy() const // To be checked if ((*(m_CounterPtr+7))&(1<<15)) // number id negative ey = -ey; return ey;*/ - uint32_t* copy32u = (uint32_t*)(m_CounterPtr+6); - int32_t* ey = (int32_t*)copy32u; - return *ey; + const uint32_t* copy32u = reinterpret_cast<const uint32_t*>(m_CounterPtr+6); + return *copy32u; } inline int32_t LArRodBlockPhysicsV3::getEz() const { - uint32_t* aux = (uint32_t*)(m_CounterPtr+10); - int32_t* ez = (int32_t*)aux; - return *ez; + const uint32_t* aux = reinterpret_cast<const uint32_t*>(m_CounterPtr+10); + return *aux; } inline uint16_t LArRodBlockPhysicsV3::getHottestCellIndex() // to be checked diff --git a/LArCalorimeter/LArCnv/LArByteStream/LArByteStream/LArRodBlockPhysicsV5.h b/LArCalorimeter/LArCnv/LArByteStream/LArByteStream/LArRodBlockPhysicsV5.h index 7f2afc21098d516683125327fd5d4bd992ce50f2..4227107d2685abd03af79110b84d7222362bd2cc 100644 --- a/LArCalorimeter/LArCnv/LArByteStream/LArByteStream/LArRodBlockPhysicsV5.h +++ b/LArCalorimeter/LArCnv/LArByteStream/LArByteStream/LArRodBlockPhysicsV5.h @@ -1,7 +1,7 @@ //Dear emacs, this is -*- c++ -*- /* - Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration + Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration */ #ifndef LARBYTESTREAM_LARRODBLOCKPHYSICSV5_H @@ -94,7 +94,7 @@ public: virtual inline int32_t getEx() const; virtual inline int32_t getEy() const; virtual inline int32_t getEz() const; - virtual inline uint32_t getVROBFebId() const; + virtual inline uint32_t getVROBFebId(); virtual inline int32_t getVROBEx() const; virtual inline int32_t getVROBEy() const; virtual inline int32_t getVROBEz() const; @@ -283,7 +283,7 @@ inline int LArRodBlockPhysicsV5::getNextEnergy(int& channelNumber,int32_t& energ if (m_TimeQualityPointer && hasTQ) // Data has Time and Quality information { //Time is in 10 ps in ByteStream, hence the factor 10 to convert to ps - time = 10*((int16_t *)m_TimeQualityPointer)[m_TimeQualityIndex++]; + time = 10*(reinterpret_cast<const int16_t *>(m_TimeQualityPointer))[m_TimeQualityIndex++]; quality = m_TimeQualityPointer[m_TimeQualityIndex++]; #ifdef LARBSDBGOUTPUT @@ -329,7 +329,7 @@ inline int32_t LArRodBlockPhysicsV5::getEz() const return 0; } -inline uint32_t LArRodBlockPhysicsV5::getVROBFebId() const +inline uint32_t LArRodBlockPhysicsV5::getVROBFebId() { m_ROB_to_decode--; if ( m_ROB_to_decode>=0 ) { @@ -342,19 +342,22 @@ inline uint32_t LArRodBlockPhysicsV5::getVROBFebId() const inline int32_t LArRodBlockPhysicsV5::getVROBEx() const { - if(m_virtualROBPointerLocal) return (((int32_t*)m_virtualROBPointerLocal)[1]>>9); + const int32_t* p = reinterpret_cast<const int32_t*>(m_virtualROBPointerLocal); + if(p) return (p[1]>>9); return 0; } inline int32_t LArRodBlockPhysicsV5::getVROBEy() const { - if(m_virtualROBPointerLocal) return (((int32_t*)m_virtualROBPointerLocal)[2]>>9); + const int32_t* p = reinterpret_cast<const int32_t*>(m_virtualROBPointerLocal); + if(p) return (p[2]>>9); return 0; } inline int32_t LArRodBlockPhysicsV5::getVROBEz() const { - if(m_virtualROBPointerLocal) return (((int32_t*)m_virtualROBPointerLocal)[3]>>9); + const int32_t* p = reinterpret_cast<const int32_t*>(m_virtualROBPointerLocal); + if(p) return (p[3]>>9); return 0; } diff --git a/LArCalorimeter/LArCnv/LArByteStream/LArByteStream/LArRodBlockPhysicsV6.h b/LArCalorimeter/LArCnv/LArByteStream/LArByteStream/LArRodBlockPhysicsV6.h index a7b65303757388af9d4e73247853ccdf17ef1970..9c76411b5e0ca379e5519d9bd0b5e0cb205b5db6 100644 --- a/LArCalorimeter/LArCnv/LArByteStream/LArByteStream/LArRodBlockPhysicsV6.h +++ b/LArCalorimeter/LArCnv/LArByteStream/LArByteStream/LArRodBlockPhysicsV6.h @@ -1,7 +1,7 @@ //Dear emacs, this is -*- c++ -*- /* - Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration + Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration */ #ifndef LARBYTESTREAM_LARRODBLOCKPHYSICSV6_H @@ -95,7 +95,7 @@ public: virtual inline int32_t getEy() const; virtual inline int32_t getEz() const; virtual inline int32_t getSumE() const; - virtual inline uint32_t getVROBFebId() const; + virtual inline uint32_t getVROBFebId(); virtual inline int32_t getVROBEx() const; virtual inline int32_t getVROBEy() const; virtual inline int32_t getVROBEz() const; @@ -286,7 +286,7 @@ inline int LArRodBlockPhysicsV6::getNextEnergy(int& channelNumber,int32_t& energ if (m_TimeQualityPointer && hasTQ) // Data has Time and Quality information { //Time is in 10 ps in ByteStream, hence the factor 10 to convert to ps - time = 10*((int16_t *)m_TimeQualityPointer)[m_TimeQualityIndex++]; + time = 10*(reinterpret_cast<const int16_t *>(m_TimeQualityPointer))[m_TimeQualityIndex++]; quality = m_TimeQualityPointer[m_TimeQualityIndex++]; #ifdef LARBSDBGOUTPUT @@ -337,7 +337,7 @@ inline int32_t LArRodBlockPhysicsV6::getSumE() const return 0; } -inline uint32_t LArRodBlockPhysicsV6::getVROBFebId() const +inline uint32_t LArRodBlockPhysicsV6::getVROBFebId() { m_ROB_to_decode--; if ( m_ROB_to_decode>=0){ @@ -350,25 +350,29 @@ inline uint32_t LArRodBlockPhysicsV6::getVROBFebId() const inline int32_t LArRodBlockPhysicsV6::getVROBEx() const { - if(m_virtualROBPointerLocal) return (((int32_t*)m_virtualROBPointerLocal)[1]>>9); + const int32_t* p = reinterpret_cast<const int32_t*>(m_virtualROBPointerLocal); + if(p) return (p[1]>>9); return 0; } inline int32_t LArRodBlockPhysicsV6::getVROBEy() const { - if(m_virtualROBPointerLocal) return (((int32_t*)m_virtualROBPointerLocal)[2]>>9); + const int32_t* p = reinterpret_cast<const int32_t*>(m_virtualROBPointerLocal); + if(p) return (p[2]>>9); return 0; } inline int32_t LArRodBlockPhysicsV6::getVROBEz() const { - if(m_virtualROBPointerLocal) return (((int32_t*)m_virtualROBPointerLocal)[3]>>9); + const int32_t* p = reinterpret_cast<const int32_t*>(m_virtualROBPointerLocal); + if(p) return (p[3]>>9); return 0; } inline int32_t LArRodBlockPhysicsV6::getVROBSumE() const { - if(m_virtualROBPointerLocal) return (((int32_t*)m_virtualROBPointerLocal)[4]>>9); + const int32_t* p = reinterpret_cast<const int32_t*>(m_virtualROBPointerLocal); + if(p) return (p[4]>>9); return 0; } diff --git a/LArCalorimeter/LArCnv/LArByteStream/LArByteStream/LArRodBlockStructure.h b/LArCalorimeter/LArCnv/LArByteStream/LArByteStream/LArRodBlockStructure.h index 3212b60a7080c4340b5d0ea8c04613ba691c2744..6d5e294aa6d18eb3a037a3d1710c5e01ce10a648 100644 --- a/LArCalorimeter/LArCnv/LArByteStream/LArByteStream/LArRodBlockStructure.h +++ b/LArCalorimeter/LArCnv/LArByteStream/LArByteStream/LArRodBlockStructure.h @@ -1,7 +1,7 @@ //Dear emacs, this is -*- c++ -*- /* - Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration + Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration */ @@ -113,7 +113,7 @@ public : virtual inline int32_t getEy() const; virtual inline int32_t getEz() const; virtual inline int32_t getSumE() const; - virtual inline uint32_t getVROBFebId() const; + virtual inline uint32_t getVROBFebId(); virtual inline int32_t getVROBEx() const; virtual inline int32_t getVROBEy() const; virtual inline int32_t getVROBEz() const; @@ -223,8 +223,8 @@ public : //Number of channels per FEB int m_channelsPerFEB; //Full ROD fragment for decoding - uint32_t* m_FebBlock; //Pointer to the first element of the current FEB-Fragement (used only for decoding!) - uint32_t* m_RodBlock; //Pointer to the very beginning of the ROD-Block + const uint32_t* m_FebBlock; //Pointer to the first element of the current FEB-Fragement (used only for decoding!) + const uint32_t* m_RodBlock; //Pointer to the very beginning of the ROD-Block int32_t m_FebBlockSize; int32_t m_RodBlockSize; std::vector<uint32_t> *m_vFragment; //Pointer to the vector that holds the current FEB-block (used only for encoding!) @@ -233,8 +233,8 @@ public : FEBMAPTYPE m_mFebBlocks; //Map of feb-Blocks (for encoding only); //static uint32_t FebToOfflineGainMap[3]; //static uint32_t OfflineToFebGainMap[3]; - static uint32_t m_RawToOfflineGainMap[4]; - static uint32_t m_OfflineToRawGainMap[3]; + static const uint32_t m_RawToOfflineGainMap[4]; + static const uint32_t m_OfflineToRawGainMap[3]; int32_t m_MiddleHeaderSize; // Free gain mode needs raw data to be rearranged unsigned int m_rearrangeFirstSample; @@ -242,16 +242,16 @@ public : bool m_error_next_feb; // Jump from one virtual ROB uint32_t m_virtualROBJump; - mutable int32_t m_ROB_to_decode; - mutable uint32_t* m_virtualROBPointer; - mutable uint32_t* m_virtualROBPointerLocal; + int32_t m_ROB_to_decode; + const uint32_t* m_virtualROBPointer; + const uint32_t* m_virtualROBPointerLocal; }; // Implementation of inline-functions: inline bool LArRodBlockStructure::setFragment(const uint32_t* p, uint32_t n) { resetPointers(); - m_FebBlock = (uint32_t *) p; + m_FebBlock = p; m_RodBlock = m_FebBlock; m_RodBlockSize = n; uint32_t BlockSize = 0; @@ -315,7 +315,7 @@ inline int32_t LArRodBlockStructure::getSumE() const { return 0; } -inline uint32_t LArRodBlockStructure::getVROBFebId() const{ +inline uint32_t LArRodBlockStructure::getVROBFebId(){ return 0; } @@ -381,7 +381,7 @@ inline void LArRodBlockStructure::setHeader16(const unsigned n, const uint16_t w #ifdef LARBYTESTREAMRODBLOCK_CHCKBOUNDARIES if ((unsigned)n>=m_vFragment->size()*2) { std::cout << "ERROR WRITE BEYOND ARRAY BONDARY!" << std::endl; - exit(-1); + std::abort(); } #endif if (n&0x1) // n is a odd number @@ -395,14 +395,16 @@ inline void LArRodBlockStructure::setHeader32(const unsigned n, const uint32_t w #ifdef LARBYTESTREAMRODBLOCK_CHCKBOUNDARIES if ((unsigned)n>=m_vFragment->size()*2) { std::cout << "ERROR WRITE BEYOND ARRAY BONDARY!" << std::endl; - exit(-1); + std::abort(); } #endif m_vFragment->at(n>>1) = w; } inline uint16_t LArRodBlockStructure::LE_getHeader16(const unsigned n) const // n should be choosen from the above enum -{return ((uint16_t*)(m_FebBlock))[n];} +{ + return (reinterpret_cast<const uint16_t*>(m_FebBlock))[n]; +} inline uint16_t LArRodBlockStructure::LE_getVectorHeader16(const unsigned n) const // n should be choosen from the above enum {return ((uint16_t*)(&(m_vFragment->front())))[n];} @@ -412,7 +414,7 @@ inline void LArRodBlockStructure::LE_setHeader16(const unsigned n, const uint16_ #ifdef LARBYTESTREAMRODBLOCK_CHCKBOUNDARIES if ((unsigned)n>=m_vFragment->size()*2) { std::cout << "LArRodBlockStructure::LE_setHeader16 ERROR: WRITE BEYOND ARRAY BONDARY!" << std::endl; - exit(-1); + std::abort(); } #endif ((uint16_t*)(&(m_vFragment->front())))[n] = w; diff --git a/LArCalorimeter/LArCnv/LArByteStream/LArByteStream/LArRodBlockTransparentV0.icc b/LArCalorimeter/LArCnv/LArByteStream/LArByteStream/LArRodBlockTransparentV0.icc index 3264815e35881d6f78f0189b0da1f7d95f5620b6..fe4c45b2a1b4338d2a041639cae14b6ecf24f45d 100644 --- a/LArCalorimeter/LArCnv/LArByteStream/LArByteStream/LArRodBlockTransparentV0.icc +++ b/LArCalorimeter/LArCnv/LArByteStream/LArByteStream/LArRodBlockTransparentV0.icc @@ -1,7 +1,7 @@ //Dear emacs, this is -*- c++ -*- /* - Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration + Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration */ // Implementation of a LArRODBlockStructure class @@ -128,7 +128,7 @@ void LArRodBlockTransparentV0<DSPHEADER>::setRawDataFixed(const int channel, con logstr << MSG::ERROR << "Number of samples mismatch!\n"; logstr << " nsamples =" << nsamples; logstr << " samples.size() =" << samples.size() << endmsg; - exit(0); + std::abort(); } //std::cout << "Size of Raw Data block # " << febgain << " = " << m_RawDataBlock.size(); diff --git a/LArCalorimeter/LArCnv/LArByteStream/src/LArRodBlockPhysicsV0.cxx b/LArCalorimeter/LArCnv/LArByteStream/src/LArRodBlockPhysicsV0.cxx index ba89a05cad51c0c359c5a925961293b8f5ba4bdf..cf37165fed9288d3b94126a2a183aed2a340077f 100644 --- a/LArCalorimeter/LArCnv/LArByteStream/src/LArRodBlockPhysicsV0.cxx +++ b/LArCalorimeter/LArCnv/LArByteStream/src/LArRodBlockPhysicsV0.cxx @@ -1,5 +1,5 @@ /* - Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration + Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration */ // Implementation of the LArRODBlockStructure_3 class @@ -44,14 +44,14 @@ m_logstr(Athena::getMessageSvc(), BlockType()) StatusCode sc =svcLoc->service( "DetectorStore", detStore ); if (sc.isFailure()) { m_logstr << MSG::ERROR << "Unable to locate DetectorStore" << endmsg; - exit(1); + std::abort(); } else { m_logstr << MSG::INFO << "Successfully located DetectorStore" << endmsg; } sc = detStore->retrieve(online_id, "LArOnlineID"); if (sc.isFailure()) { m_logstr << MSG::FATAL << "Could not get LArOnlineID helper !" << endmsg; - exit(1); + std::abort(); } else { m_onlineHelper=online_id; @@ -225,7 +225,7 @@ void LArRodBlockPhysicsV0::setRawData(const int channel, const std::vector<short m_logstr << MSG::ERROR << "Number of samples mismatch!\n"; m_logstr << " nsamples =" << nsamples; m_logstr << " samples.size() =" << samples.size() << endmsg; - exit(0); + std::abort(); } setBit(&m_RawDataBlock[0],rcNb); @@ -307,7 +307,7 @@ void LArRodBlockPhysicsV0::finalizeFEB() n = m_HighEnergyBlock.size(); BlockOffset=LE_getVectorHeader16(HighEBlkOffset); LARBSDBG("Checking High Energy Block n=" << n << "BlockOffset=" << BlockOffset); - //Check if High Energy-Block exits and is not yet part of the fragment + //Check if High Energy-Block exists and is not yet part of the fragment if (n && !BlockOffset) {LE_setHeader16(HighEBlkOffset,m_vFragment->size()); for(unsigned int i=0;i<n;i++) diff --git a/LArCalorimeter/LArCnv/LArByteStream/src/LArRodBlockPhysicsV1.cxx b/LArCalorimeter/LArCnv/LArByteStream/src/LArRodBlockPhysicsV1.cxx index 54cc58ccd70dd7b7ce94178ce5cc17e3c50a98cb..3f5dfbe7e3eb0c7844d2ae6d6f5cd8818a8a4354 100644 --- a/LArCalorimeter/LArCnv/LArByteStream/src/LArRodBlockPhysicsV1.cxx +++ b/LArCalorimeter/LArCnv/LArByteStream/src/LArRodBlockPhysicsV1.cxx @@ -1,5 +1,5 @@ /* - Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration + Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration */ // Implementation of the LArRODBlockStructure_3 class @@ -44,14 +44,14 @@ m_logstr(Athena::getMessageSvc(), BlockType()) StatusCode sc =svcLoc->service( "DetectorStore", detStore ); if (sc.isFailure()) { m_logstr << MSG::ERROR << "Unable to locate DetectorStore" << endmsg; - exit(1); + std::abort(); } else { m_logstr << MSG::INFO << "Successfully located DetectorStore" << endmsg; } sc = detStore->retrieve(online_id, "LArOnlineID"); if (sc.isFailure()) { m_logstr << MSG::FATAL << "Could not get LArOnlineID helper !" << endmsg; - exit(1); + std::abort(); } else { m_onlineHelper=online_id; @@ -224,7 +224,7 @@ void LArRodBlockPhysicsV1::setRawData(const int channel, const std::vector<short m_logstr << MSG::ERROR << "Number of samples mismatch!\n"; m_logstr << " nsamples =" << nsamples; m_logstr << " samples.size() =" << samples.size() << endmsg; - exit(0); + std::abort(); } setBit(&m_RawDataBlock[0],rcNb); @@ -306,7 +306,7 @@ void LArRodBlockPhysicsV1::finalizeFEB() n = m_HighEnergyBlock.size(); BlockOffset=getVectorHeader16(HighEBlkOffset); LARBSDBG("Checking High Energy Block n=" << n << "BlockOffset=" << BlockOffset); - //Check if High Energy-Block exits and is not yet part of the fragment + //Check if High Energy-Block exists and is not yet part of the fragment if (n && !BlockOffset) {setHeader16(HighEBlkOffset,m_vFragment->size()); for(unsigned int i=0;i<n;i++) diff --git a/LArCalorimeter/LArCnv/LArByteStream/src/LArRodBlockPhysicsV2.cxx b/LArCalorimeter/LArCnv/LArByteStream/src/LArRodBlockPhysicsV2.cxx index f88440fd5ce31118d3233dd600488885d4aec325..95726fb35b1a0815ade21bd71634259ca91f93ae 100644 --- a/LArCalorimeter/LArCnv/LArByteStream/src/LArRodBlockPhysicsV2.cxx +++ b/LArCalorimeter/LArCnv/LArByteStream/src/LArRodBlockPhysicsV2.cxx @@ -1,5 +1,5 @@ /* - Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration + Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration */ // Implementation of the LArRODBlockStructure_3 class @@ -44,14 +44,14 @@ m_logstr(Athena::getMessageSvc(), BlockType()) StatusCode sc =svcLoc->service( "DetectorStore", detStore ); if (sc.isFailure()) { m_logstr << MSG::ERROR << "Unable to locate DetectorStore" << endmsg; - exit(1); + std::abort(); } else { m_logstr << MSG::INFO << "Successfully located DetectorStore" << endmsg; } sc = detStore->retrieve(online_id, "LArOnlineID"); if (sc.isFailure()) { m_logstr << MSG::FATAL << "Could not get LArOnlineID helper !" << endmsg; - exit(1); + std::abort(); } else { m_onlineHelper=online_id; @@ -258,7 +258,7 @@ void LArRodBlockPhysicsV2::setRawData(const int channel, const std::vector<short m_logstr << MSG::ERROR << "Number of samples mismatch!\n"; m_logstr << " nsamples =" << nsamples; m_logstr << " samples.size() =" << samples.size() << endmsg; - exit(0); + std::abort(); } setBit(&m_RawDataBlock[0],rcNb); @@ -340,7 +340,7 @@ void LArRodBlockPhysicsV2::finalizeFEB() n = m_HighEnergyBlock.size(); BlockOffset=LE_getVectorHeader16(HighEBlkOffset); LARBSDBG("Checking High Energy Block n=" << n << "BlockOffset=" << BlockOffset); - //Check if High Energy-Block exits and is not yet part of the fragment + //Check if High Energy-Block exists and is not yet part of the fragment if (n && !BlockOffset) {LE_setHeader16(HighEBlkOffset,m_vFragment->size()); for(unsigned int i=0;i<n;i++) diff --git a/LArCalorimeter/LArCnv/LArByteStream/src/LArRodBlockPhysicsV3.cxx b/LArCalorimeter/LArCnv/LArByteStream/src/LArRodBlockPhysicsV3.cxx index c9b59409630718474765d945b46b110a86460ae2..e1cbcb54334b4b2cc32f0abb68b202d5ec0b43d2 100644 --- a/LArCalorimeter/LArCnv/LArByteStream/src/LArRodBlockPhysicsV3.cxx +++ b/LArCalorimeter/LArCnv/LArByteStream/src/LArRodBlockPhysicsV3.cxx @@ -1,5 +1,5 @@ /* - Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration + Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration */ // Implementation of the LArRODBlockStructure_3 class @@ -44,14 +44,14 @@ m_logstr(Athena::getMessageSvc(), BlockType()) StatusCode sc =svcLoc->service( "DetectorStore", detStore ); if (sc.isFailure()) { m_logstr << MSG::ERROR << "Unable to locate DetectorStore" << endmsg; - exit(1); + std::abort(); } else { m_logstr << MSG::INFO << "Successfully located DetectorStore" << endmsg; } sc = detStore->retrieve(online_id, "LArOnlineID"); if (sc.isFailure()) { m_logstr << MSG::FATAL << "Could not get LArOnlineID helper !" << endmsg; - exit(1); + std::abort(); } else { m_onlineHelper=online_id; @@ -429,7 +429,7 @@ void LArRodBlockPhysicsV3::setRawData(const int channel, const std::vector<short m_logstr << MSG::ERROR << "Number of samples mismatch!\n"; m_logstr << " nsamples =" << nsamples; m_logstr << " samples.size() =" << samples.size() << endmsg; - exit(0); + std::abort(); } setBit(&m_RawDataBlock[0],rcNb); @@ -581,7 +581,7 @@ void LArRodBlockPhysicsV3::finalizeFEB() n = m_EnergyBlock.size(); BlockOffset=LE_getVectorHeader16(EBlkOffset); LARBSDBG("Checking Energy Block n=" << n << "BlockOffset=" << BlockOffset); - //Check if Energy-Block exits and is not yet part of the fragment + //Check if Energy-Block exists and is not yet part of the fragment if (n && !BlockOffset) { LE_setHeader16(EBlkOffset,m_vFragment->size()); @@ -596,7 +596,7 @@ void LArRodBlockPhysicsV3::finalizeFEB() n = m_GainBlock.size(); BlockOffset=LE_getVectorHeader16(GainBlkOffset); LARBSDBG("Checking Gain Block n=" << n << "BlockOffset=" << BlockOffset); - //Check if Gain-Block exits and is not yet part of the fragment + //Check if Gain-Block exists and is not yet part of the fragment if (n && !BlockOffset) { LE_setHeader16(GainBlkOffset,m_vFragment->size()); @@ -614,7 +614,7 @@ void LArRodBlockPhysicsV3::finalizeFEB() n = m_FebInfoBlock.size(); BlockOffset=LE_getVectorHeader16(FebInfoBlkOffset); LARBSDBG("Checking FebInfo Block n=" << n << "BlockOffset=" << BlockOffset); - //Check if Gain-Block exits and is not yet part of the fragment + //Check if Gain-Block exists and is not yet part of the fragment if (n && !BlockOffset) { LE_setHeader16(FebInfoBlkOffset,m_vFragment->size()); @@ -628,7 +628,7 @@ void LArRodBlockPhysicsV3::finalizeFEB() n = m_TimeQualityBlock.size(); BlockOffset=LE_getVectorHeader16(TimeQualityBlkOffset); LARBSDBG("Checking Time and Quality Block n=" << n << "BlockOffset=" << BlockOffset); - //Check if Time and Quality Block exits and is not yet part of the fragment + //Check if Time and Quality Block exists and is not yet part of the fragment if (n && !BlockOffset) { LE_setHeader16(TimeQualityBlkOffset,m_vFragment->size()); diff --git a/LArCalorimeter/LArCnv/LArByteStream/src/LArRodBlockPhysicsV5.cxx b/LArCalorimeter/LArCnv/LArByteStream/src/LArRodBlockPhysicsV5.cxx index 11353fa4666fd94be6162d156687778a59e90a79..ff1b24816b19253cac019d27bc8873d1e43d8277 100644 --- a/LArCalorimeter/LArCnv/LArByteStream/src/LArRodBlockPhysicsV5.cxx +++ b/LArCalorimeter/LArCnv/LArByteStream/src/LArRodBlockPhysicsV5.cxx @@ -1,7 +1,7 @@ //Dear emacs, this is -*- c++ -*- /* - Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration + Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration */ // Implementation of a LArRODBlockStructure class @@ -55,12 +55,12 @@ LArRodBlockPhysicsV5::LArRodBlockPhysicsV5() StatusCode sc =svcLoc->service( "DetectorStore", detStore ); if (sc.isFailure()) { std::cout << "Unable to locate DetectorStore" << std::endl; - exit(1); + std::abort(); } sc = detStore->retrieve(m_onlineHelper, "LArOnlineID"); if (sc.isFailure()) { std::cout << "Could not get LArOnlineID helper !" << std::endl; - exit(1); + std::abort(); } } @@ -883,7 +883,7 @@ setHeader16(InFPGAFormat_h,0x2); n = m_GainBlock.size(); //BlockOffset=0; //LARBSDBG("Checking Gain Block n=" << n << "BlockOffset=" << BlockOffset); -//Check if Gain-Block exits and is not yet part of the fragment +//Check if Gain-Block exists and is not yet part of the fragment if (n) { //LARBSDBG(MSG::DEBUG << "In finalyseFEB-------------------->>>>> " << "Checking for Gain Block : length= " << n << " BlockOffset=" << BlockOffset); @@ -938,7 +938,7 @@ if (n) // Block also include time, whenever necessary int size_of_block=80+(nsamples+1)/2+(m_TimeQualityBlock.size())/2; //LARBSDBG("Checking Energy Block n=" << n << "BlockOffset=" << BlockOffset); - //Check if Energy-Block exits and is not yet part of the fragment + //Check if Energy-Block exists and is not yet part of the fragment if (n) { setHeader16(ResultsOff1,18); @@ -955,7 +955,7 @@ if (n) // Magic numbers (3 or 6) for Ex, Ey and Ez n = m_TimeQualityBlock.size(); //LARBSDBG("Checking Time and Quality Block n=" << n << "BlockOffset=" << BlockOffset); - //Check if Time and Quality Block exits and is not yet part of the fragment + //Check if Time and Quality Block exists and is not yet part of the fragment if (n) { unsigned int imax = n/2; diff --git a/LArCalorimeter/LArCnv/LArByteStream/src/LArRodBlockPhysicsV6.cxx b/LArCalorimeter/LArCnv/LArByteStream/src/LArRodBlockPhysicsV6.cxx index 0494b23e9a0a3c3aaf4d49bf9a37cb63f8084c2a..6142887dd119c775073a9161e083de693d4e9b77 100644 --- a/LArCalorimeter/LArCnv/LArByteStream/src/LArRodBlockPhysicsV6.cxx +++ b/LArCalorimeter/LArCnv/LArByteStream/src/LArRodBlockPhysicsV6.cxx @@ -1,7 +1,7 @@ //Dear emacs, this is -*- c++ -*- /* - Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration + Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration */ // Implementation of a LArRODBlockStructure class @@ -55,12 +55,12 @@ LArRodBlockPhysicsV6::LArRodBlockPhysicsV6() StatusCode sc =svcLoc->service( "DetectorStore", detStore ); if (sc.isFailure()) { std::cout << "Unable to locate DetectorStore" << std::endl; - exit(1); + std::abort(); } sc = detStore->retrieve(m_onlineHelper, "LArOnlineID"); if (sc.isFailure()) { std::cout << "Could not get LArOnlineID helper !" << std::endl; - exit(1); + std::abort(); } } @@ -894,7 +894,7 @@ setHeader16(InFPGAFormat_h,0x2); n = m_GainBlock.size(); //BlockOffset=0; //LARBSDBG("Checking Gain Block n=" << n << "BlockOffset=" << BlockOffset); -//Check if Gain-Block exits and is not yet part of the fragment +//Check if Gain-Block exists and is not yet part of the fragment if (n) { //LARBSDBG(MSG::DEBUG << "In finalyseFEB-------------------->>>>> " << "Checking for Gain Block : length= " << n << " BlockOffset=" << BlockOffset); @@ -949,7 +949,7 @@ if (n) // Block also include time, whenever necessary int size_of_block=80+(nsamples+1)/2+(m_TimeQualityBlock.size())/2; //LARBSDBG("Checking Energy Block n=" << n << "BlockOffset=" << BlockOffset); - //Check if Energy-Block exits and is not yet part of the fragment + //Check if Energy-Block exists and is not yet part of the fragment if (n) { setHeader16(ResultsOff1,18); @@ -966,7 +966,7 @@ if (n) // Magic numbers (4 or 8) for Ex, Ey and Ez n = m_TimeQualityBlock.size(); //LARBSDBG("Checking Time and Quality Block n=" << n << "BlockOffset=" << BlockOffset); - //Check if Time and Quality Block exits and is not yet part of the fragment + //Check if Time and Quality Block exists and is not yet part of the fragment if (n) { unsigned int imax = n/2; diff --git a/LArCalorimeter/LArCnv/LArByteStream/src/LArRodBlockStructure.cxx b/LArCalorimeter/LArCnv/LArByteStream/src/LArRodBlockStructure.cxx index c17a58ed6bd306e235f369907a8d19501f5d12da..99d1b098212d72c1518a20190308b6eb57399380 100644 --- a/LArCalorimeter/LArCnv/LArByteStream/src/LArRodBlockStructure.cxx +++ b/LArCalorimeter/LArCnv/LArByteStream/src/LArRodBlockStructure.cxx @@ -1,5 +1,5 @@ /* - Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration + Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration */ // Implementation of LArRODBlockStructure class @@ -17,8 +17,8 @@ //uint32_t LArRodBlockStructure::OfflineToFebGainMap[3]={2,1,0}; // uint32_t LArRodBlockStructure::m_RawToOfflineGainMap[4]={0, 0, 1,2}; // uint32_t LArRodBlockStructure::m_OfflineToRawGainMap[3]={1,2,3}; - uint32_t LArRodBlockStructure::m_RawToOfflineGainMap[4]={0, 2, 1,0}; - uint32_t LArRodBlockStructure::m_OfflineToRawGainMap[3]={3,2,1}; +const uint32_t LArRodBlockStructure::m_RawToOfflineGainMap[4]={0, 2, 1,0}; +const uint32_t LArRodBlockStructure::m_OfflineToRawGainMap[3]={3,2,1}; LArRodBlockStructure::LArRodBlockStructure() : m_Ex(0), m_Ey(0),