diff --git a/algo/ca/core/data/CaDataManager.h b/algo/ca/core/data/CaDataManager.h index a95b7383f8e667612b5092cb045d4663e9144a43..ccf124a53d8159438865043f3a027fec8b298789 100644 --- a/algo/ca/core/data/CaDataManager.h +++ b/algo/ca/core/data/CaDataManager.h @@ -7,8 +7,7 @@ /// \since 05.08.2022 /// \author S.Zharko <s.zharko@gsi.de> -#ifndef CaDataManager_h -#define CaDataManager_h 1 +#pragma once // include this header only once per compilation unit #include "CaConstants.h" #include "CaInputData.h" @@ -159,4 +158,3 @@ namespace cbm::algo::ca } } // namespace cbm::algo::ca -#endif // CaDataManager_h diff --git a/algo/ca/core/data/CaGrid.h b/algo/ca/core/data/CaGrid.h index 01f193c1da9a5e667f1996fe6def8f31816b16a3..eca4cd70b64e0fbfba6d361248dfca51f688b5ef 100644 --- a/algo/ca/core/data/CaGrid.h +++ b/algo/ca/core/data/CaGrid.h @@ -8,8 +8,7 @@ /// This code is based on the code of the ALICE HLT Project /// -#ifndef CaGrid_h -#define CaGrid_h 1 +#pragma once // include this header only once per compilation unit #include "CaGridEntry.h" #include "CaHit.h" @@ -193,4 +192,3 @@ namespace cbm::algo::ca } // namespace cbm::algo::ca -#endif diff --git a/algo/ca/core/data/CaGridArea.h b/algo/ca/core/data/CaGridArea.h index 5ec34be08fa490ed9ee533e3c68392b9d678d260..a0c2efca09a5a8061d6b56a1d0ef1f8306bcd479 100644 --- a/algo/ca/core/data/CaGridArea.h +++ b/algo/ca/core/data/CaGridArea.h @@ -4,8 +4,7 @@ /// \file CaGrid.h -#ifndef CaGridArea_H -#define CaGridArea_H 1 +#pragma once // include this header only once per compilation unit #include "CaGrid.h" #include "CaHit.h" @@ -114,6 +113,4 @@ namespace cbm::algo::ca fAreaCurrentBinY = 0; } - } // namespace cbm::algo::ca -#endif diff --git a/algo/ca/core/data/CaGridEntry.h b/algo/ca/core/data/CaGridEntry.h index 5fa81820fbc8ee0d65ce08cd9d0ab079ba06149b..67502b1c6c619d6392f5e810e0803beaf38cc2a5 100644 --- a/algo/ca/core/data/CaGridEntry.h +++ b/algo/ca/core/data/CaGridEntry.h @@ -2,8 +2,7 @@ SPDX-License-Identifier: GPL-3.0-only Authors: Valentina Akishina, Igor Kulakov [committer], Maksym Zyzak */ -#ifndef CaGridEntry_h -#define CaGridEntry_h +#pragma once // include this header only once per compilation unit #include "CaConstants.h" #include "CaHit.h" @@ -58,4 +57,3 @@ namespace cbm::algo::ca } // namespace cbm::algo::ca -#endif diff --git a/algo/ca/core/data/CaHit.h b/algo/ca/core/data/CaHit.h index ff7fb114ca61db9526320285c745ffd9ec207888..6273d38a0db1a7d5676c758b2b16f1ace773474c 100644 --- a/algo/ca/core/data/CaHit.h +++ b/algo/ca/core/data/CaHit.h @@ -6,8 +6,7 @@ /// \brief ca::Hit class describes a generic hit for the CA tracker /// \date 2007-2023 -#ifndef CaHit_h -#define CaHit_h 1 +#pragma once // include this header only once per compilation unit #include <boost/serialization/access.hpp> @@ -20,7 +19,7 @@ namespace cbm::algo::ca /// \brief ca::Hit class describes a generic hit for the CA tracker /// - struct Hit { + class Hit { friend class boost::serialization::access; public: @@ -86,5 +85,3 @@ namespace cbm::algo::ca }; } // namespace cbm::algo::ca - -#endif diff --git a/algo/ca/core/data/CaInputData.h b/algo/ca/core/data/CaInputData.h index 22ddec7f0a360a6f8f21567f3fe6379f542578da..2172ad8b4346896fd344f86657a19dd162dd4fe4 100644 --- a/algo/ca/core/data/CaInputData.h +++ b/algo/ca/core/data/CaInputData.h @@ -7,8 +7,7 @@ /// \since 08.08.2022 /// \author Sergei Zharko <s.zharko@gsi.de> -#ifndef CaInputData_h -#define CaInputData_h 1 +#pragma once // include this header only once per compilation unit #include <boost/serialization/access.hpp> #include <boost/serialization/array.hpp> @@ -125,5 +124,3 @@ namespace cbm::algo::ca } } // namespace cbm::algo::ca - -#endif // InputData_h diff --git a/algo/ca/core/data/CaTrack.h b/algo/ca/core/data/CaTrack.h index 37f919c345fb7550a9c397f88ab614d782bc6bea..647f7f18fad7c956aaacd01115dd0399c88ef0f0 100644 --- a/algo/ca/core/data/CaTrack.h +++ b/algo/ca/core/data/CaTrack.h @@ -7,8 +7,7 @@ /// \since 02.06.2022 /// \author S.Zharko <s.zharko@gsi.de> -#ifndef CaTrack_h -#define CaTrack_h 1 +#pragma once // include this header only once per compilation unit #include <boost/serialization/access.hpp> @@ -48,5 +47,3 @@ namespace cbm::algo::ca }; } // namespace cbm::algo::ca - -#endif // CaTrack_h diff --git a/algo/ca/core/data/CaTrackParam.h b/algo/ca/core/data/CaTrackParam.h index 1902b044af7027a14ce1ec184f0f9d4810ffb5a6..eb2b4e33b2d6e213447ca8545f1e49e4808ea23e 100644 --- a/algo/ca/core/data/CaTrackParam.h +++ b/algo/ca/core/data/CaTrackParam.h @@ -8,8 +8,7 @@ /// \since 02.06.2022 /// \author Sergey Gorbunov -#ifndef CaTrackParam_h -#define CaTrackParam_h 1 +#pragma once // include this header only once per compilation unit #include <boost/serialization/access.hpp> @@ -720,4 +719,3 @@ namespace cbm::algo::ca } // namespace cbm::algo::ca -#endif // CaTrackParam_h diff --git a/algo/ca/core/pars/CaConfigReader.h b/algo/ca/core/pars/CaConfigReader.h index 2bbba170d216886a6e2f26e8dba01570366db03d..7f3006eb4be9abbb5b0134e5cb7819e5edea837a 100644 --- a/algo/ca/core/pars/CaConfigReader.h +++ b/algo/ca/core/pars/CaConfigReader.h @@ -7,8 +7,7 @@ /// \author S.Zharko <s.zharko@gsi.de> /// \since 18.07.2022 -#ifndef CaConfigRW_h -#define CaConfigRW_h 1 +#pragma once // include this header only once per compilation unit #include <string> #include <unordered_map> @@ -101,4 +100,3 @@ namespace cbm::algo::ca YAML::Node fUserConfigNode {YAML::NodeType::Undefined}; ///< User configuration node }; } // namespace cbm::algo::ca -#endif // CaConfigRW_h diff --git a/algo/ca/core/pars/CaConstants.h b/algo/ca/core/pars/CaConstants.h index 2c1b7f8650089b7c83814bb34ba2a899f3e74144..cff4ad0baf9ab06bced23723975976e77643f9cf 100644 --- a/algo/ca/core/pars/CaConstants.h +++ b/algo/ca/core/pars/CaConstants.h @@ -7,8 +7,7 @@ /// \since 02.06.2022 /// \author S.Zharko <s.zharko@gsi.de> -#ifndef CaConstants_h -#define CaConstants_h 1 +#pragma once // include this header only once per compilation unit #include <limits> @@ -246,5 +245,3 @@ namespace cbm::algo::ca::constants } // namespace cbm::algo::ca::constants - -#endif // CaConstants_h diff --git a/algo/ca/core/pars/CaField.h b/algo/ca/core/pars/CaField.h index 0e56f96e03e1e102b1ea7f07b2de88a98613d76a..39e93a59d575e78ce7145be064c608c6dd2b5e40 100644 --- a/algo/ca/core/pars/CaField.h +++ b/algo/ca/core/pars/CaField.h @@ -2,8 +2,8 @@ SPDX-License-Identifier: GPL-3.0-only Authors: Sergey Gorbunov [committer], Igor Kulakov, Maksym Zyzak, Sergei Zharko */ -#ifndef CaField_h -#define CaField_h 1 +#pragma once // include this header only once per compilation unit + #include <boost/serialization/access.hpp> @@ -229,4 +229,3 @@ namespace cbm::algo::ca } _fvecalignment; } // namespace cbm::algo::ca -#endif diff --git a/algo/ca/core/pars/CaInitManager.h b/algo/ca/core/pars/CaInitManager.h index 1b836d09fa0e48cf7edf8e6e9e8259cc64ab4f57..b75ac7cdc06f59f2ea33d1ad89f96a900af75d97 100644 --- a/algo/ca/core/pars/CaInitManager.h +++ b/algo/ca/core/pars/CaInitManager.h @@ -7,8 +7,7 @@ /// \since 24.12.2021 /// \author Sergei Zharko <s.zharko@gsi.de> -#ifndef CaInitManager_h -#define CaInitManager_h 1 +#pragma once // include this header only once per compilation unit #include <array> #include <bitset> @@ -305,5 +304,3 @@ namespace cbm::algo::ca std::string fConfigOutputName = ""; ///< name for the output configuration file }; } // namespace cbm::algo::ca - -#endif diff --git a/algo/ca/core/pars/CaIteration.h b/algo/ca/core/pars/CaIteration.h index 5198ecff6f9e4b7a64ae4ae2e0f45d3f98ee1bd7..f3b06c3563f449d63dc4eba4a63917b795831fd6 100644 --- a/algo/ca/core/pars/CaIteration.h +++ b/algo/ca/core/pars/CaIteration.h @@ -9,8 +9,7 @@ * @author S.Zharko <s.zharko@gsi.de> ***************************************************************************************************/ -#ifndef CaIteration_h -#define CaIteration_h 1 +#pragma once // include this header only once per compilation unit #include <boost/serialization/access.hpp> #include <boost/serialization/string.hpp> @@ -280,6 +279,3 @@ namespace cbm::algo::ca } }; } // namespace cbm::algo::ca - - -#endif // L1CAIteration_h diff --git a/algo/ca/core/pars/CaMaterialMap.h b/algo/ca/core/pars/CaMaterialMap.h index e12c6a2d8dc5c86ba5950af2423ba6670d499400..af77e37874485c120db324dd09568c267273013b 100644 --- a/algo/ca/core/pars/CaMaterialMap.h +++ b/algo/ca/core/pars/CaMaterialMap.h @@ -2,8 +2,7 @@ SPDX-License-Identifier: GPL-3.0-only Authors: Igor Kulakov, Sergey Gorbunov [committer], Andrey Lebedev, Sergei Zharko */ -#ifndef CaMaterialMap_h -#define CaMaterialMap_h 1 +#pragma once // include this header only once per compilation unit #include <boost/serialization/vector.hpp> @@ -130,4 +129,3 @@ namespace cbm::algo::ca } // namespace cbm::algo::ca -#endif diff --git a/algo/ca/core/pars/CaParameters.h b/algo/ca/core/pars/CaParameters.h index f4faf7d6ec2520eb46f6778f7d1c330e6a4f7ac5..01dfb21c6bbb444fda97563479044bf25021b22b 100644 --- a/algo/ca/core/pars/CaParameters.h +++ b/algo/ca/core/pars/CaParameters.h @@ -7,8 +7,7 @@ /// @since 19.12.2021 /// @author S.Zharko <s.zharko@gsi.de> -#ifndef L1Parameters_h -#define L1Parameters_h 1 +#pragma once // include this header only once per compilation unit #include <boost/serialization/array.hpp> #include <boost/serialization/utility.hpp> @@ -341,4 +340,3 @@ namespace cbm::algo::ca }; } // namespace cbm::algo::ca -#endif // L1Parameters_h diff --git a/algo/ca/core/pars/CaSearchWindow.h b/algo/ca/core/pars/CaSearchWindow.h index 3fe43fcb6d8ebba553b3c36cdca6197055616c4c..ea7e73c18a846f25df77b3ce4c07bfd0d87f8f6b 100644 --- a/algo/ca/core/pars/CaSearchWindow.h +++ b/algo/ca/core/pars/CaSearchWindow.h @@ -7,8 +7,7 @@ /// \date 08.11.2022 /// \author S.Zharko <s.zharko@gsi.de> -#ifndef CaSearchWindow_h -#define CaSearchWindow_h 1 +#pragma once // include this header only once per compilation unit #include <boost/serialization/array.hpp> #include <boost/serialization/string.hpp> @@ -174,5 +173,3 @@ namespace cbm::algo::ca } }; } // namespace cbm::algo::ca - -#endif // L1SearchWindow_h diff --git a/algo/ca/core/pars/CaStation.h b/algo/ca/core/pars/CaStation.h index 6f5bdc134cc194a95582b9e78d7aad93e1060f09..3fb76957e9a159dd00b86c5bbc8aa9fa7ba5318f 100644 --- a/algo/ca/core/pars/CaStation.h +++ b/algo/ca/core/pars/CaStation.h @@ -2,8 +2,7 @@ SPDX-License-Identifier: GPL-3.0-only Authors: Sergey Gorbunov [committer], Igor Kulakov, Sergei Zharko */ -#ifndef CaStation_h -#define CaStation_h 1 +#pragma once // include this header only once per compilation unit #include <string> @@ -87,5 +86,3 @@ namespace cbm::algo::ca } _fvecalignment; } // namespace cbm::algo::ca - -#endif // CaStation_h diff --git a/algo/ca/core/pars/CaStationInitializer.h b/algo/ca/core/pars/CaStationInitializer.h index 221438ed0eee281e5a32445d792297a0a4d51ab9..0dc5a80f698da7905d0fa95978bf191e3a394ed9 100644 --- a/algo/ca/core/pars/CaStationInitializer.h +++ b/algo/ca/core/pars/CaStationInitializer.h @@ -7,8 +7,7 @@ /// \since 18.12.2021 /// \author S.Zharko <s.zharko@gsi.de> -#ifndef CaStationInitializer_h -#define CaStationInitializer_h 1 +#pragma once // include this header only once per compilation unit #include <bitset> #include <functional> @@ -216,5 +215,3 @@ namespace cbm::algo::ca /// swap function for two StationInitializer objects, expected to be used instead of std::swap inline void swap(StationInitializer& a, StationInitializer& b) noexcept { a.Swap(b); } } // namespace cbm::algo::ca - -#endif // CaStationInitializer_h diff --git a/algo/ca/core/utils/CaDefines.h b/algo/ca/core/utils/CaDefines.h index d98b0fc592e5d1fc6a01676287b61c7197d4c423..ae101e651f80a85f94ae0543357d13e90c1d4ce7 100644 --- a/algo/ca/core/utils/CaDefines.h +++ b/algo/ca/core/utils/CaDefines.h @@ -6,8 +6,7 @@ /// \brief Macros for the CA tracking algorithm /// \details Try to minimize the amount of macros. Try to call this header only from cxx files. -#ifndef CaDefines_h -#define CaDefines_h +#pragma once // include this header only once per compilation unit #include <iostream> @@ -27,6 +26,3 @@ #define CBMCA_DEBUG_ASSERT(v) #endif // CBMCA_DEBUG_MODE - - -#endif // CaDefines_h diff --git a/algo/ca/core/utils/CaEnumArray.h b/algo/ca/core/utils/CaEnumArray.h index 25ec11a725d0a58c44c927ab47452377fceb56ec..bcf5a270e6b916f668d156460775f281cb2531a5 100644 --- a/algo/ca/core/utils/CaEnumArray.h +++ b/algo/ca/core/utils/CaEnumArray.h @@ -7,8 +7,7 @@ /// @since 02.05.2023 /// @author Sergei Zharko <s.zharko@gsi.de> -#ifndef CaEnumArray_h -#define CaEnumArray_h 1 +#pragma once // include this header only once per compilation unit #include <array> @@ -49,5 +48,3 @@ namespace cbm::algo::ca operator Arr&() const { return *this; } }; } // namespace cbm::algo::ca - -#endif // L1EArray_h diff --git a/algo/ca/core/utils/CaMonitor.h b/algo/ca/core/utils/CaMonitor.h index 39d3209b75081d34725e89e9173ad3697863a532..5ba1711a4071a8375ca6b12d0ae1b5e0a51ce16e 100644 --- a/algo/ca/core/utils/CaMonitor.h +++ b/algo/ca/core/utils/CaMonitor.h @@ -7,8 +7,8 @@ /// @since 25.08.2023 /// @author S.Zharko <s.zharko@gsi.de> -#ifndef CaMonitor_h -#define CaMonitor_h 1 +#pragma once // include this header only once per compilation unit + #include <iomanip> #include <sstream> @@ -110,5 +110,3 @@ namespace cbm::algo::ca return msg.str(); } } // namespace cbm::algo::ca - -#endif // CaMonitor_h diff --git a/algo/ca/core/utils/CaObjectInitController.h b/algo/ca/core/utils/CaObjectInitController.h index 31a88feb1b9ab78bd21c81ebf980e3d210de83da..45b5f7db3d4f2260872bb63fea3291ade8488dac 100644 --- a/algo/ca/core/utils/CaObjectInitController.h +++ b/algo/ca/core/utils/CaObjectInitController.h @@ -2,8 +2,7 @@ SPDX-License-Identifier: GPL-3.0-only Authors: Sergey Gorbunov, Sergei Zharko [committer] */ -#ifndef CaObjectInitController_h -#define CaObjectInitController_h 1 +#pragma once // include this header only once per compilation unit /// @file CaObjectInitController.h /// @author Sergei Zharko @@ -97,5 +96,3 @@ namespace cbm::algo::ca } } // namespace cbm::algo::ca - -#endif // CaObjectInitController_h diff --git a/algo/ca/core/utils/CaSimd.h b/algo/ca/core/utils/CaSimd.h index 4c5406445d1067be6884bfca8f58ee76e7625096..06f4017fdc1a623ec9ee4bcf61c073110f9f0c58 100644 --- a/algo/ca/core/utils/CaSimd.h +++ b/algo/ca/core/utils/CaSimd.h @@ -2,10 +2,7 @@ SPDX-License-Identifier: GPL-3.0-only Authors: Sergey Gorbunov [committer]*/ -#ifndef Ca_CaSimd_H -#define Ca_CaSimd_H 1 +#pragma once // include this header only once per compilation unit #include "CaSimdVc.h" //#include "CaSimdPseudo.h" - -#endif diff --git a/algo/ca/core/utils/CaSimdPseudo.h b/algo/ca/core/utils/CaSimdPseudo.h index 9bbd745d58ebc7dd5f89e67a38b984c17acfe39e..5bd20718e080cdc5ad5feae76e39ee9d2d85a122 100644 --- a/algo/ca/core/utils/CaSimdPseudo.h +++ b/algo/ca/core/utils/CaSimdPseudo.h @@ -2,8 +2,7 @@ SPDX-License-Identifier: GPL-3.0-only Authors: Igor Kulakov [committer] */ -#ifndef Ca_CaSimdPseudo_H -#define Ca_CaSimdPseudo_H 1 +#pragma once // include this header only once per compilation unit #include <boost/serialization/access.hpp> @@ -279,5 +278,3 @@ namespace cbm::algo::ca #define _fvecalignment __attribute__((aligned(fvec::size() * sizeof(fscal)))) } // namespace cbm::algo::ca - -#endif diff --git a/algo/ca/core/utils/CaSimdVc.h b/algo/ca/core/utils/CaSimdVc.h index f8b22b5d1cdafe63a7a9ec68b31766f1232fd5bc..656de918e833101f2b73d868a0ed8f3c6d960eb3 100644 --- a/algo/ca/core/utils/CaSimdVc.h +++ b/algo/ca/core/utils/CaSimdVc.h @@ -2,8 +2,7 @@ SPDX-License-Identifier: GPL-3.0-only Authors: Igor Kulakov [committer], Maksym Zyzak */ -#ifndef Ca_CaSimdVc_H -#define Ca_CaSimdVc_H +#pragma once // include this header only once per compilation unit #include <boost/serialization/access.hpp> #include <boost/serialization/array.hpp> @@ -53,6 +52,3 @@ namespace boost::serialization split_free(ar, vect, version); } } // namespace boost::serialization - - -#endif diff --git a/algo/ca/core/utils/CaUtils.h b/algo/ca/core/utils/CaUtils.h index a3e7cc079436344151428929fafdb01a4ab5544f..6a0fa0ee70977c912caf1d70c6646ce7cdafb7ca 100644 --- a/algo/ca/core/utils/CaUtils.h +++ b/algo/ca/core/utils/CaUtils.h @@ -7,8 +7,8 @@ /// \since 02.06.2022 /// \author S.Zharko <s.zharko@gsi.de> -#ifndef CaUtils_h -#define CaUtils_h 1 +#pragma once // include this header only once per compilation unit + #include <sstream> @@ -37,24 +37,13 @@ namespace cbm::algo::ca::utils } /// tell the CPU that the bool condition is likely to be true - __always_inline bool IsLikely(bool b) - { #if defined(__GNUC__) && __GNUC__ - 0 >= 3 - return __builtin_expect(!!(b), 1); + __attribute__((always_inline)) inline bool IsLikely(bool b) { return __builtin_expect(!!(b), 1); } + __attribute__((always_inline)) inline bool IsUnlikely(bool b) { return __builtin_expect(!!(b), 0); } #else - return b; + inline bool IsLikely(bool b) { return b; } + inline bool IsUnlikely(bool b) { return b; } #endif - } - - /// tell the CPU that the bool condition is unlikely to be true - __always_inline bool IsUnlikely(bool b) - { -#if defined(__GNUC__) && __GNUC__ - 0 >= 3 - return __builtin_expect(!!(b), 0); -#else - return b; -#endif - } /// \brief Checks whether a variable of a particular type defined /// \param val Value to be checked @@ -137,6 +126,3 @@ namespace cbm::algo::ca::utils } }; } // namespace cbm::algo::ca::utils - - -#endif // CaUtils_h diff --git a/algo/ca/core/utils/CaVector.h b/algo/ca/core/utils/CaVector.h index 8fa8245a6b0e3ef2e39d58704b04531dc66029b7..5630dfbdf46973e9dd39b020e86f5bb5a9d566a1 100644 --- a/algo/ca/core/utils/CaVector.h +++ b/algo/ca/core/utils/CaVector.h @@ -6,8 +6,7 @@ /// \author Sergey Gorbunov /// \date 2021-06-16 -#ifndef Ca_CaVector_H -#define Ca_CaVector_H +#pragma once // include this header only once per compilation unit #ifndef FAST_CODE @@ -293,4 +292,3 @@ namespace cbm::algo::ca class Vector<bool> { }; } // namespace cbm::algo::ca -#endif