diff --git a/Trigger/TrigCost/RatesAnalysis/CMakeLists.txt b/Trigger/TrigCost/RatesAnalysis/CMakeLists.txt index f77688a5b76dc81202c135d1394c0107aeaefee9..bda30c86e0821a6259388670b381df45af110f85 100644 --- a/Trigger/TrigCost/RatesAnalysis/CMakeLists.txt +++ b/Trigger/TrigCost/RatesAnalysis/CMakeLists.txt @@ -1,4 +1,4 @@ -# Copyright (C) 2002-2021 CERN for the benefit of the ATLAS collaboration +# Copyright (C) 2002-2022 CERN for the benefit of the ATLAS collaboration # Declare the package name: atlas_subdir( RatesAnalysis ) @@ -11,8 +11,8 @@ atlas_add_library( RatesAnalysisLib src/Rates*.cxx PUBLIC_HEADERS RatesAnalysis INCLUDE_DIRS ${ROOT_INCLUDE_DIRS} - LINK_LIBRARIES ${ROOT_LIBRARIES} GaudiKernel AthAnalysisBaseCompsLib TrigDecisionToolLib EnhancedBiasWeighterLib - PRIVATE_LINK_LIBRARIES AthenaBaseComps EventInfo TrigConfL1Data xAODEventInfo ) + LINK_LIBRARIES ${ROOT_LIBRARIES} GaudiKernel AthAnalysisBaseCompsLib AthenaBaseComps TrigDecisionToolLib EnhancedBiasWeighterLib + PRIVATE_LINK_LIBRARIES EventInfo TrigConfData TrigConfL1Data xAODEgamma xAODEventInfo ) # Component(s) in the package: atlas_add_component( RatesAnalysis diff --git a/Trigger/TrigCost/RatesAnalysis/RatesAnalysis/ATLAS_CHECK_THREAD_SAFETY b/Trigger/TrigCost/RatesAnalysis/RatesAnalysis/ATLAS_CHECK_THREAD_SAFETY new file mode 100644 index 0000000000000000000000000000000000000000..5e543686ddcf164c2f119497adc6ad88fed9875b --- /dev/null +++ b/Trigger/TrigCost/RatesAnalysis/RatesAnalysis/ATLAS_CHECK_THREAD_SAFETY @@ -0,0 +1 @@ +Trigger/TrigCost/RatesAnalysis diff --git a/Trigger/TrigCost/RatesAnalysis/RatesAnalysis/RatesGroup.h b/Trigger/TrigCost/RatesAnalysis/RatesAnalysis/RatesGroup.h index 9d3cac92df8851cbfd1123c043f0a30edef31824..bf067284fa41e8fce1748888b5e10bff5368799e 100644 --- a/Trigger/TrigCost/RatesAnalysis/RatesAnalysis/RatesGroup.h +++ b/Trigger/TrigCost/RatesAnalysis/RatesAnalysis/RatesGroup.h @@ -1,5 +1,5 @@ /* - Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration + Copyright (C) 2002-2022 CERN for the benefit of the ATLAS collaboration */ #ifndef RATESANALYSIS_RATESTGROUP_H @@ -32,12 +32,12 @@ class RatesGroup : public RatesHistoBase { /** * @brief Construct new RatesGroup to enumerate the combined union (OR) and intersection (AND) rate of a set of trigger at L1 or the HLT * @param name Name of the group - * @param log Reference to message service + * @param msgSvc Reference to message service * @param prescale Prescale to apply to the whole group * @param doHistograms Flag to mint histograms or not * @param doExtrapolation Flag to switch on or off extrapolation within the group */ - RatesGroup(const std::string& name, const MsgStream& log, const bool doHistograms = true, const bool doExtrapolation = true); + RatesGroup(const std::string& name, IMessageSvc* msgSvc, const bool doHistograms = true, const bool doExtrapolation = true); virtual ~RatesGroup(); diff --git a/Trigger/TrigCost/RatesAnalysis/RatesAnalysis/RatesHistoBase.h b/Trigger/TrigCost/RatesAnalysis/RatesAnalysis/RatesHistoBase.h index 61a20677cbc0263a3e9ce9005723453e03aed5c8..4885d71a25ba04133057e44e336a5f698f39a2e5 100644 --- a/Trigger/TrigCost/RatesAnalysis/RatesAnalysis/RatesHistoBase.h +++ b/Trigger/TrigCost/RatesAnalysis/RatesAnalysis/RatesHistoBase.h @@ -1,5 +1,5 @@ /* - Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration + Copyright (C) 2002-2022 CERN for the benefit of the ATLAS collaboration */ #ifndef RATESANALYSIS_RATESHISTOBASE_H @@ -8,9 +8,10 @@ #include "TH1.h" #include "TString.h" -#include "GaudiKernel/MsgStream.h" #include "GaudiKernel/ServiceHandle.h" +#include "AthenaBaseComps/AthMessaging.h" + #include <string> #include <unordered_map> #include <set> @@ -80,10 +81,10 @@ struct WeightingValuesSummary_t { * @brief Basic base class for any common functionality between RatesTrigger and RatesGroup * This means that everyone has access to the same histograms */ -class RatesHistoBase { +class RatesHistoBase : public AthMessaging { public: - RatesHistoBase(const std::string& name, const MsgStream& log, const bool doHistograms = true); + RatesHistoBase(const std::string& name, IMessageSvc* msgSvc, const bool doHistograms = true); virtual ~RatesHistoBase(); RatesHistoBase(const RatesHistoBase&) = delete; @@ -114,8 +115,6 @@ class RatesHistoBase { bool m_givenRateVsMu; //!< m_rateVsMu has been given to the THistSvc and should not be deleted bool m_givenRateVsTrain; //!< m_rateVsTrain has been given to the THistSvc and should not be deleted bool m_givenData; //!< m_data has been given to the THistSvc and should not be deleted - - mutable MsgStream m_log; //!< For ATHENA messaging }; #endif //> !RATESANALYSIS_RATESHISTOBASE_H diff --git a/Trigger/TrigCost/RatesAnalysis/RatesAnalysis/RatesScanTrigger.h b/Trigger/TrigCost/RatesAnalysis/RatesAnalysis/RatesScanTrigger.h index dd55384a94c3d818476ffc1436fd3ee93315c25b..9ea2dfaca2c3091fd5c53d4d107347be7a066a57 100644 --- a/Trigger/TrigCost/RatesAnalysis/RatesAnalysis/RatesScanTrigger.h +++ b/Trigger/TrigCost/RatesAnalysis/RatesAnalysis/RatesScanTrigger.h @@ -1,5 +1,5 @@ /* - Copyright (C) 2002-2018 CERN for the benefit of the ATLAS collaboration + Copyright (C) 2002-2022 CERN for the benefit of the ATLAS collaboration */ #ifndef RATESANALYSIS_RATESSCANTRIGGER_H @@ -25,7 +25,7 @@ class RatesScanTrigger : public RatesTrigger { /** * @brief Construct new RatesScanTrigger to enumerate the rate for a single L1 or HLT trigger as a function of some threshold * @param name Name of the trigger - * @param log Reference to message service + * @param msgSvc Reference to message service * @param thresholdMin The lower threshold of this trigger, rates will not be available below this threshold * @param thresholdMax The upper threshold of this trigger, rates will not be available above this threshold * @param thresholdBins Granularity @@ -36,7 +36,7 @@ class RatesScanTrigger : public RatesTrigger { * @param extrapolation The luminosity extrapolation strategy to be applied to this trigger */ RatesScanTrigger(const std::string& name, - const MsgStream& log, + IMessageSvc* msgSvc, const double thresholdMin, const double thresholdMax, const uint32_t thresholdBins = 100, @@ -58,7 +58,7 @@ class RatesScanTrigger : public RatesTrigger { * @param extrapolation The luminosity extrapolation strategy to be applied to this trigger */ RatesScanTrigger(const std::string& name, - const MsgStream& log, + IMessageSvc* msgSvc, const std::vector<double>& thresholdBinEdges, const TriggerBehaviour_t behaviour = kTriggerBelowThreshold, const double prescale = 1., diff --git a/Trigger/TrigCost/RatesAnalysis/RatesAnalysis/RatesTrigger.h b/Trigger/TrigCost/RatesAnalysis/RatesAnalysis/RatesTrigger.h index 66b0e86c2b41fdc7d385d35b674a260d1270de24..83c5a2475f4d689422a89f623e9bd1cead4968dd 100644 --- a/Trigger/TrigCost/RatesAnalysis/RatesAnalysis/RatesTrigger.h +++ b/Trigger/TrigCost/RatesAnalysis/RatesAnalysis/RatesTrigger.h @@ -1,5 +1,5 @@ /* - Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration + Copyright (C) 2002-2022 CERN for the benefit of the ATLAS collaboration */ #ifndef RATESANALYSIS_RATESTRIGGER_H @@ -19,7 +19,7 @@ class RatesTrigger : public RatesHistoBase { * @brief Construct new RatesTrigger to enumerate the rate for a single L1 or HLT trigger * Provide pass/fail information to RatesGroups which this trigger is part of. * @param name Name of the trigger - * @param log Reference to message service + * @param msgSvc Reference to message service * @param prescale The prescale of the trigger. Anything < 1 is considered disabled * @param expressPrescale If the trigger is HLT and in the express group, its express prescale. Otherwise set = 0 * @param seedName The name of any L1 seed the trigger has, leave blank if L1 item / no L1 seed. @@ -28,7 +28,7 @@ class RatesTrigger : public RatesHistoBase { * @param extrapolation The luminosity extrapolation strategy to be applied to this trigger */ RatesTrigger(const std::string& name, - const MsgStream& log, + IMessageSvc* log, const double prescale = 1., const double expressPrescale = -1, const std::string& seedName = "", diff --git a/Trigger/TrigCost/RatesAnalysis/src/RatesAnalysisAlg.cxx b/Trigger/TrigCost/RatesAnalysis/src/RatesAnalysisAlg.cxx index b7c04500459b1b6cbe21e4e564c7edb23570f471..48e934d0580a0841844452981da042ef2bad9786 100644 --- a/Trigger/TrigCost/RatesAnalysis/src/RatesAnalysisAlg.cxx +++ b/Trigger/TrigCost/RatesAnalysis/src/RatesAnalysisAlg.cxx @@ -1,5 +1,5 @@ /* - Copyright (C) 2002-2021 CERN for the benefit of the ATLAS collaboration + Copyright (C) 2002-2022 CERN for the benefit of the ATLAS collaboration */ // RatesAnalysis includes @@ -53,7 +53,7 @@ StatusCode RatesAnalysisAlg::newScanTrigger(const std::string& name, } const ExtrapStrat_t e = (m_enableLumiExtrapolation ? extrapolation : ExtrapStrat_t::kNONE); - m_scanTriggers.emplace(name, std::make_unique<RatesScanTrigger>(name, msg(), thresholdMin, thresholdMax, thresholdBins, behaviour, prescale, seedName, seedPrecale, e)); + m_scanTriggers.emplace(name, std::make_unique<RatesScanTrigger>(name, msgSvc(), thresholdMin, thresholdMax, thresholdBins, behaviour, prescale, seedName, seedPrecale, e)); RatesScanTrigger* newScanTrigger = m_scanTriggers.at(name).get(); if (isRandomSeed(name, seedName)) newScanTrigger->setSeedsFromRandom(true); ATH_MSG_DEBUG("newScanTrigger " << name << " added"); @@ -77,7 +77,7 @@ StatusCode RatesAnalysisAlg::newScanTrigger(const std::string& name, const ExtrapStrat_t e = (m_enableLumiExtrapolation ? extrapolation : ExtrapStrat_t::kNONE); - m_scanTriggers.emplace(name, std::make_unique<RatesScanTrigger>(name, msg(), thresholdBinEdges, behaviour, prescale, seedName, seedPrecale, e)); + m_scanTriggers.emplace(name, std::make_unique<RatesScanTrigger>(name, msgSvc(), thresholdBinEdges, behaviour, prescale, seedName, seedPrecale, e)); RatesScanTrigger* newScanTrigger = m_scanTriggers.at(name).get(); if (isRandomSeed(name, seedName)) newScanTrigger->setSeedsFromRandom(true); ATH_MSG_DEBUG("newScanTrigger " << name << " added"); @@ -129,7 +129,7 @@ StatusCode RatesAnalysisAlg::newTrigger(const std::string& name, const ExtrapStrat_t e = (m_enableLumiExtrapolation ? extrapolation : ExtrapStrat_t::kNONE); - m_triggers.emplace(name, std::make_unique<RatesTrigger>(name, msg(), prescale, expressPrescale, seedName, seedPrecale, m_doHistograms, e)); + m_triggers.emplace(name, std::make_unique<RatesTrigger>(name, msgSvc(), prescale, expressPrescale, seedName, seedPrecale, m_doHistograms, e)); RatesTrigger* newTriggerPtr = m_triggers.at(name).get(); if (isRandomSeed(name, seedName)) newTriggerPtr->setSeedsFromRandom(true); @@ -153,7 +153,7 @@ StatusCode RatesAnalysisAlg::newTrigger(const std::string& name, // Ignore BW and PS groups if (group.find("BW") == 0 || group.find("PS") == 0) continue; if (m_groups.count(group) == 0) { - m_groups.emplace(group, std::make_unique<RatesGroup>(group, msg(), m_doHistograms, m_enableLumiExtrapolation)); + m_groups.emplace(group, std::make_unique<RatesGroup>(group, msgSvc(), m_doHistograms, m_enableLumiExtrapolation)); // As the group is formed from at least one active trigger - it must be active itself (counter example - CPS group of a PS=-1 trigger) m_activeGroups.insert( m_groups.at(group).get() ); } @@ -312,11 +312,12 @@ StatusCode RatesAnalysisAlg::checkGotTDT() { ATH_MSG_ERROR("TriggerDecisionTool is not available!"); return StatusCode::FAILURE; } - static bool printed = false; - if (!printed) ATH_MSG_INFO("TDT contains: " << m_tdt->getListOfTriggers().size() << " triggers, " - << m_tdt->getListOfStreams().size() << " streams and " - << m_tdt->getListOfGroups().size() << " groups."); - printed = true; + [[maybe_unused]] static std::atomic<bool> printed = [&]() { + ATH_MSG_INFO("TDT contains: " << m_tdt->getListOfTriggers().size() << " triggers, " + << m_tdt->getListOfStreams().size() << " streams and " + << m_tdt->getListOfGroups().size() << " groups."); + return true; + }(); return StatusCode::SUCCESS; } @@ -391,11 +392,11 @@ StatusCode RatesAnalysisAlg::populateTriggers() { ATH_MSG_INFO("Initializing User's Triggers (note: we are actually now in the event loop)"); if (m_doGlobalGroups) { - m_globalGroups.emplace(m_l1GroupName, std::make_unique<RatesGroup>(m_l1GroupName, msg(), m_doHistograms, m_enableLumiExtrapolation)); - m_globalGroups.emplace(m_l2GroupName, std::make_unique<RatesGroup>(m_l2GroupName, msg(), m_doHistograms, m_enableLumiExtrapolation)); + m_globalGroups.emplace(m_l1GroupName, std::make_unique<RatesGroup>(m_l1GroupName, msgSvc(), m_doHistograms, m_enableLumiExtrapolation)); + m_globalGroups.emplace(m_l2GroupName, std::make_unique<RatesGroup>(m_l2GroupName, msgSvc(), m_doHistograms, m_enableLumiExtrapolation)); m_globalGroups.at(m_l2GroupName)->setDoCachedWeights( m_doUniqueRates ); // This extra sub-weight caching is only utilised by unique-rate groups if (m_doExpressRates) { - m_globalGroups.emplace(m_expressGroupName, std::make_unique<RatesGroup>(m_expressGroupName, msg(), m_doHistograms, m_enableLumiExtrapolation)); + m_globalGroups.emplace(m_expressGroupName, std::make_unique<RatesGroup>(m_expressGroupName, msgSvc(), m_doHistograms, m_enableLumiExtrapolation)); m_globalGroups.at(m_expressGroupName)->setExpressGroup( true ); } } @@ -417,7 +418,7 @@ StatusCode RatesAnalysisAlg::populateTriggers() { const RatesGroup* l1GroupPtr = m_globalGroups.at(m_l1GroupName).get(); // The finalised list of all L1 chains for (const auto& trigger : m_triggers) { const uint32_t level = getLevel(trigger.first); - m_uniqueGroups.emplace(trigger.first, std::make_unique<RatesGroup>(trigger.first, msg(), false, m_enableLumiExtrapolation)); // Each trigger gets its own unique group. No hist needed + m_uniqueGroups.emplace(trigger.first, std::make_unique<RatesGroup>(trigger.first, msgSvc(), false, m_enableLumiExtrapolation)); // Each trigger gets its own unique group. No hist needed RatesTrigger* triggerPtr = m_triggers.at(trigger.first).get(); RatesGroup* uniqueGroupPtr = m_uniqueGroups.at(trigger.first).get(); triggerPtr->setUniqueGroup( uniqueGroupPtr ); // Create two-way links diff --git a/Trigger/TrigCost/RatesAnalysis/src/RatesGroup.cxx b/Trigger/TrigCost/RatesAnalysis/src/RatesGroup.cxx index 94220c044c17920cd473102941d34197b5053189..df30307a801ba69db3d598d29e1d411629b48a1f 100644 --- a/Trigger/TrigCost/RatesAnalysis/src/RatesGroup.cxx +++ b/Trigger/TrigCost/RatesAnalysis/src/RatesGroup.cxx @@ -1,5 +1,5 @@ /* - Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration + Copyright (C) 2002-2022 CERN for the benefit of the ATLAS collaboration */ #include "RatesAnalysis/RatesGroup.h" @@ -13,8 +13,8 @@ double RatesCPS::getWeight() const { return (1. - m_weight) / m_coherentFactor; } -RatesGroup::RatesGroup(const std::string& name, const MsgStream& log, const bool doHistograms, const bool doExtrapolation) : - RatesHistoBase(name, log, doHistograms), +RatesGroup::RatesGroup(const std::string& name, IMessageSvc* msgSvc, const bool doHistograms, const bool doExtrapolation) : + RatesHistoBase(name, msgSvc, doHistograms), m_name(name), m_nameHash(std::hash<std::string>{}(name)), m_rateAccumulatorOR(0.), diff --git a/Trigger/TrigCost/RatesAnalysis/src/RatesHistoBase.cxx b/Trigger/TrigCost/RatesAnalysis/src/RatesHistoBase.cxx index 1f15d8b7ba23a51655beeb643e3966778ff3febd..b5559e3e132bb5f22265ed2c5f949f6b32866f46 100644 --- a/Trigger/TrigCost/RatesAnalysis/src/RatesHistoBase.cxx +++ b/Trigger/TrigCost/RatesAnalysis/src/RatesHistoBase.cxx @@ -1,5 +1,5 @@ /* - Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration + Copyright (C) 2002-2022 CERN for the benefit of the ATLAS collaboration */ #include "RatesAnalysis/RatesHistoBase.h" @@ -7,11 +7,11 @@ #include "GaudiKernel/ITHistSvc.h" #include "AthenaBaseComps/AthCheckMacros.h" -RatesHistoBase::RatesHistoBase(const std::string& name, const MsgStream& log, const bool doHistograms) : +RatesHistoBase::RatesHistoBase(const std::string& name, IMessageSvc* msgSvc, const bool doHistograms) : + AthMessaging(msgSvc, name), m_name(name), m_doHistograms(doHistograms), m_rateVsMu(nullptr), m_rateVsTrain(nullptr), m_data(nullptr), - m_rateVsMuCachedPtr(nullptr), m_rateVsTrainCachedPtr(nullptr), m_dataCachedPtr(nullptr), - m_log(log) + m_rateVsMuCachedPtr(nullptr), m_rateVsTrainCachedPtr(nullptr), m_dataCachedPtr(nullptr) { if (doHistograms) { m_rateVsMu = std::make_unique<TH1D>("",TString(name + ";#mu;Rate / Unit #mu [Hz]"),226,-.5,225.5); @@ -46,18 +46,18 @@ RatesHistoBase::~RatesHistoBase() { StatusCode RatesHistoBase::giveMuHist(const ServiceHandle<ITHistSvc>& svc, const std::string& name) { if (!m_rateVsMu.get()) { - m_log << MSG::ERROR << "RatesHistoBase::giveMuHist Warning requested histograms when histograming is OFF here." << endmsg; + ATH_MSG_ERROR("RatesHistoBase::giveMuHist Warning requested histograms when histograming is OFF here."); return StatusCode::FAILURE; } ATH_CHECK( svc->regHist(name, std::move(m_rateVsMu), m_rateVsMuCachedPtr) ); - m_log << MSG::DEBUG << "For " << m_name << "(" << this << ") m_rateVsMuCachedPtr is updated to " << (uint64_t) m_rateVsMuCachedPtr << endmsg; + ATH_MSG_DEBUG("For " << m_name << "(" << this << ") m_rateVsMuCachedPtr is updated to " << (uint64_t) m_rateVsMuCachedPtr); return StatusCode::SUCCESS; } StatusCode RatesHistoBase::giveTrainHist(const ServiceHandle<ITHistSvc>& svc, const std::string& name) { if (!m_rateVsTrain.get()) { - m_log << MSG::ERROR << "RatesHistoBase::giveTrainHist Warning requested histograms when histograming is OFF here." << endmsg; + ATH_MSG_ERROR("RatesHistoBase::giveTrainHist Warning requested histograms when histograming is OFF here."); return StatusCode::FAILURE; } ATH_CHECK( svc->regHist(name, std::move(m_rateVsTrain), m_rateVsTrainCachedPtr) ); @@ -67,7 +67,7 @@ StatusCode RatesHistoBase::giveTrainHist(const ServiceHandle<ITHistSvc>& svc, co StatusCode RatesHistoBase::giveDataHist(const ServiceHandle<ITHistSvc>& svc, const std::string& name) { if (!m_data.get()) { - m_log << MSG::ERROR << "RatesHistoBase::giveDataHist Warning requested histograms when histograming is OFF here." << endmsg; + ATH_MSG_ERROR("RatesHistoBase::giveDataHist Warning requested histograms when histograming is OFF here."); return StatusCode::FAILURE; } ATH_CHECK( svc->regHist(name, std::move(m_data), m_dataCachedPtr) ); @@ -99,7 +99,7 @@ double RatesHistoBase::getExtrapolationFactor(const WeightingValuesSummary_t& we case kBUNCH_SCALING: return weights.m_bunchFactor; case kMU_SCALING: return weights.m_muFactor; case kNONE: return weights.m_noScaling; - default: m_log << MSG::ERROR << "Error in getExtrapolationFactor. Unknown ExtrapStrat_t ENUM supplied " << strat << endmsg; + default: ATH_MSG_ERROR("Error in getExtrapolationFactor. Unknown ExtrapStrat_t ENUM supplied " << strat); } return 0.; } diff --git a/Trigger/TrigCost/RatesAnalysis/src/RatesScanTrigger.cxx b/Trigger/TrigCost/RatesAnalysis/src/RatesScanTrigger.cxx index 0cc7fa569f8c13b4c059ca24d99fadfcae28e15f..9af72ae5936874c532355deab503ca296007d97c 100644 --- a/Trigger/TrigCost/RatesAnalysis/src/RatesScanTrigger.cxx +++ b/Trigger/TrigCost/RatesAnalysis/src/RatesScanTrigger.cxx @@ -1,5 +1,5 @@ /* - Copyright (C) 2002-2018 CERN for the benefit of the ATLAS collaboration + Copyright (C) 2002-2022 CERN for the benefit of the ATLAS collaboration */ #include "RatesAnalysis/RatesScanTrigger.h" @@ -8,13 +8,13 @@ #include "AthenaBaseComps/AthCheckMacros.h" RatesScanTrigger::RatesScanTrigger( const std::string& name, - const MsgStream& log, + IMessageSvc* msgSvc, const double thresholdMin, const double thresholdMax, const uint32_t thresholdBins, const TriggerBehaviour_t behaviour, const double prescale, const std::string& seedName, const double seedPrescale, const ExtrapStrat_t extrapolation) : - RatesTrigger(name, log, prescale, -1, seedName, seedPrescale, /*base histograms*/false, extrapolation), + RatesTrigger(name, msgSvc, prescale, -1, seedName, seedPrescale, /*base histograms*/false, extrapolation), m_rateScanHist(nullptr), m_rateScanHistCachedPtr(nullptr), m_thresholdPassed(0), m_behaviour(behaviour) { m_rateScanHist = std::make_unique<TH1D>("", TString(name + ";Threshold;Rate [Hz]"), thresholdBins, thresholdMin, thresholdMax); @@ -24,17 +24,17 @@ RatesScanTrigger::RatesScanTrigger( const std::string& name, } RatesScanTrigger::RatesScanTrigger( const std::string& name, - const MsgStream& log, + IMessageSvc* msgSvc, const std::vector<double>& thresholdBinEdged, const TriggerBehaviour_t behaviour, const double prescale, const std::string& seedName, const double seedPrescale, const ExtrapStrat_t extrapolation) : - RatesTrigger(name, log, prescale, -1, seedName, seedPrescale, false, extrapolation), + RatesTrigger(name, msgSvc, prescale, -1, seedName, seedPrescale, false, extrapolation), m_rateScanHist(nullptr), m_rateScanHistCachedPtr(nullptr), m_thresholdPassed(0), m_behaviour(behaviour) { if (thresholdBinEdged.size() < 2) { - m_log << MSG::ERROR << "Need more than one entry in thresholdBinEdged to define histogram binning." << endmsg; + ATH_MSG_ERROR("Need more than one entry in thresholdBinEdged to define histogram binning."); return; } size_t nBins = thresholdBinEdged.size() - 1; diff --git a/Trigger/TrigCost/RatesAnalysis/src/RatesTrigger.cxx b/Trigger/TrigCost/RatesAnalysis/src/RatesTrigger.cxx index 9d1ee4b1e88436e3fb6c30bd6f36a7fc9be102c7..0ddfa92e778129b198206cea87837c7fcf93b9eb 100644 --- a/Trigger/TrigCost/RatesAnalysis/src/RatesTrigger.cxx +++ b/Trigger/TrigCost/RatesAnalysis/src/RatesTrigger.cxx @@ -1,14 +1,14 @@ /* - Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration + Copyright (C) 2002-2022 CERN for the benefit of the ATLAS collaboration */ #include "RatesAnalysis/RatesTrigger.h" #include "RatesAnalysis/RatesGroup.h" -RatesTrigger::RatesTrigger(const std::string& name, const MsgStream& log, const double prescale, const double expressPrescale, +RatesTrigger::RatesTrigger(const std::string& name, IMessageSvc* msgSvc, const double prescale, const double expressPrescale, const std::string& seedName, const double seedPrescale, const bool doHistograms, const ExtrapStrat_t extrapolation) : - RatesHistoBase(name, log, doHistograms), + RatesHistoBase(name, msgSvc, doHistograms), m_pass(false), m_active(false), m_seedsFromRandom(false), diff --git a/Trigger/TrigCost/RatesAnalysis/test/RatesAnalysis_test.cxx b/Trigger/TrigCost/RatesAnalysis/test/RatesAnalysis_test.cxx index 4e645b854b1bc9b759ae7b1bbbbe9390f2c85675..4e3d462bca88e8ef9ee1ecd960f24b6ade67bf58 100644 --- a/Trigger/TrigCost/RatesAnalysis/test/RatesAnalysis_test.cxx +++ b/Trigger/TrigCost/RatesAnalysis/test/RatesAnalysis_test.cxx @@ -1,12 +1,12 @@ /* - Copyright (C) 2002-2021 CERN for the benefit of the ATLAS collaboration + Copyright (C) 2002-2022 CERN for the benefit of the ATLAS collaboration */ #include "../RatesAnalysis/RatesTrigger.h" #include "../RatesAnalysis/RatesScanTrigger.h" #include "../RatesAnalysis/RatesGroup.h" -#include "GaudiKernel/MsgStream.h" +#include "GaudiKernel/IMessageSvc.h" #include "CxxUtils/ubsan_suppress.h" #include "TInterpreter.h" @@ -16,7 +16,7 @@ int main() { CxxUtils::ubsan_suppress ([]() { TInterpreter::Instance(); }); - MsgStream log(nullptr, "RatesAnalysis_test"); + IMessageSvc* log = nullptr; // using cout RatesTrigger* triggerA1 = new RatesTrigger("TriggerA1", log, /*prescale*/1, /*XpressPrescale*/1, "SeedA", /*seedPrescale*/2); RatesTrigger* triggerA2 = new RatesTrigger("TriggerA2", log, /*prescale*/2, /*XpressPrescale*/1, "SeedA", /*seedPrescale*/2);