diff --git a/Alignment/HIPAlignmentAlgorithm/test/testHIPAnalyzers.cc b/Alignment/HIPAlignmentAlgorithm/test/testHIPAnalyzers.cc index bad25808c0333..75692c3569534 100644 --- a/Alignment/HIPAlignmentAlgorithm/test/testHIPAnalyzers.cc +++ b/Alignment/HIPAlignmentAlgorithm/test/testHIPAnalyzers.cc @@ -2,6 +2,7 @@ #include "FWCore/Utilities/interface/Exception.h" #include "FWCore/ServiceRegistry/interface/Service.h" #include "CommonTools/UtilAlgos/interface/TFileService.h" +#include #define CATCH_CONFIG_MAIN #include "catch.hpp" @@ -61,8 +62,8 @@ process.add_(cms.Service('JobReportService')) process.add_(cms.Service('TFileService',fileName=cms.string('{}'))) )_"; - // Format the raw string literal using fmt::format - return fmt::format(rawString, analyzerName, analyzerName, analyzerName, rootFileName); + // Format the raw string literal using std::format + return std::format(rawString, analyzerName, analyzerName, analyzerName, rootFileName); } //___________________________________________________________________________________________ diff --git a/Alignment/OfflineValidation/test/testTrackAnalyzers.cc b/Alignment/OfflineValidation/test/testTrackAnalyzers.cc index 8efeab347a878..fbef6338487b3 100644 --- a/Alignment/OfflineValidation/test/testTrackAnalyzers.cc +++ b/Alignment/OfflineValidation/test/testTrackAnalyzers.cc @@ -4,6 +4,7 @@ #include "CommonTools/UtilAlgos/interface/TFileService.h" #include "Alignment/OfflineValidation/interface/TkAlStyle.h" +#include #define CATCH_CONFIG_MAIN #include "catch.hpp" @@ -56,8 +57,8 @@ process.add_(cms.Service('JobReportService')) process.add_(cms.Service('TFileService',fileName=cms.string('{}'))) )_"; - // Format the raw string literal using fmt::format - return fmt::format(rawString, analyzerName, analyzerName, analyzerName, rootFileName); + // Format the raw string literal using std::format + return std::format(rawString, analyzerName, analyzerName, analyzerName, rootFileName); } //___________________________________________________________________________________________ diff --git a/CalibTracker/SiPixelESProducers/test/test_catch2_ESSources.cc b/CalibTracker/SiPixelESProducers/test/test_catch2_ESSources.cc index 3384cecc4f00f..f556d6261bd3f 100644 --- a/CalibTracker/SiPixelESProducers/test/test_catch2_ESSources.cc +++ b/CalibTracker/SiPixelESProducers/test/test_catch2_ESSources.cc @@ -1,6 +1,7 @@ #include "FWCore/TestProcessor/interface/TestProcessor.h" #include "FWCore/Utilities/interface/Exception.h" #include "FWCore/ServiceRegistry/interface/Service.h" +#include #define CATCH_CONFIG_MAIN #include "catch.hpp" @@ -62,8 +63,8 @@ process.add_(cms.Service('JobReportService')) process.moduleToTest(process.getConditions) )_"; - // Format the raw string literal using fmt::format - return fmt::format(rawString, recordName, dataName, esProducerName); + // Format the raw string literal using std::format + return std::format(rawString, recordName, dataName, esProducerName); } //___________________________________________________________________________________________ diff --git a/DQM/EcalCommon/test/testEcalCommon.cc b/DQM/EcalCommon/test/testEcalCommon.cc index d4eb9db6a0875..73e566c869f47 100644 --- a/DQM/EcalCommon/test/testEcalCommon.cc +++ b/DQM/EcalCommon/test/testEcalCommon.cc @@ -1,6 +1,7 @@ #include "FWCore/TestProcessor/interface/TestProcessor.h" #include "FWCore/Utilities/interface/Exception.h" #include "FWCore/ServiceRegistry/interface/Service.h" +#include #define CATCH_CONFIG_MAIN #include "catch.hpp" @@ -32,8 +33,8 @@ process.add_(cms.Service('JobReportService')) process.add_(cms.Service('DQMStore')) )_"; - // Format the raw string literal using fmt::format - return fmt::format(rawString, cfiName, analyzerName, analyzerName); + // Format the raw string literal using std::format + return std::format(rawString, cfiName, analyzerName, analyzerName); } //___________________________________________________________________________________________ diff --git a/DQM/HcalTasks/plugins/HcalFEDIntegrityTask.cc b/DQM/HcalTasks/plugins/HcalFEDIntegrityTask.cc index 6ef60e681abf3..87d6defd67e00 100644 --- a/DQM/HcalTasks/plugins/HcalFEDIntegrityTask.cc +++ b/DQM/HcalTasks/plugins/HcalFEDIntegrityTask.cc @@ -17,6 +17,7 @@ #include #include +#include using namespace std; using namespace edm; @@ -141,7 +142,7 @@ void HcalFEDIntegrityTask::labelBins(MonitorElement *me) { return; for (int i = 0; i < xbins; i++) { - const std::string xLabel = fmt::format("{}", minFEDNum_ + i); + const std::string xLabel = std::format("{}", minFEDNum_ + i); me->setBinLabel(i + 1, xLabel, 1); } } diff --git a/DQM/RPCMonitorClient/plugins/RPCEventSummary.cc b/DQM/RPCMonitorClient/plugins/RPCEventSummary.cc index be357e2155b49..10f63cb4590bb 100644 --- a/DQM/RPCMonitorClient/plugins/RPCEventSummary.cc +++ b/DQM/RPCMonitorClient/plugins/RPCEventSummary.cc @@ -5,6 +5,7 @@ #include "FWCore/MessageLogger/interface/MessageLogger.h" #include "FWCore/Framework/interface/EventSetup.h" #include "FWCore/Framework/interface/ESHandle.h" +#include RPCEventSummary::RPCEventSummary(const edm::ParameterSet& ps) { edm::LogVerbatim("rpceventsummary") << "[RPCEventSummary]: Constructor"; @@ -95,14 +96,14 @@ void RPCEventSummary::dqmEndLuminosityBlock(DQMStore::IBooker& ibooker, std::vector segmentNames; for (int i = -2; i <= 2; i++) { - const std::string segName = fmt::format("RPC_Wheel{}", i); + const std::string segName = std::format("RPC_Wheel{}", i); segmentNames.push_back(segName); } for (int i = -numberDisk_; i <= numberDisk_; i++) { if (i == 0) continue; - const std::string segName = fmt::format("RPC_Disk{}", i); + const std::string segName = std::format("RPC_Disk{}", i); segmentNames.push_back(segName); } @@ -146,8 +147,8 @@ void RPCEventSummary::clientOperation(DQMStore::IGetter& igetter) { float barrelFactor = 0; for (int w = -2; w < 3; w++) { - const std::string meName1 = fmt::format("{}/DeadChannelFraction_Roll_vs_Sector_Wheel{}", globalFolder_, w); - const std::string meName2 = fmt::format("{}/RPCNoisyStrips_Roll_vs_Sector_Wheel{}", globalFolder_, w); + const std::string meName1 = std::format("{}/DeadChannelFraction_Roll_vs_Sector_Wheel{}", globalFolder_, w); + const std::string meName2 = std::format("{}/RPCNoisyStrips_Roll_vs_Sector_Wheel{}", globalFolder_, w); MonitorElement* myMe1 = igetter.get(meName1); MonitorElement* myMe2 = igetter.get(meName2); @@ -182,7 +183,7 @@ void RPCEventSummary::clientOperation(DQMStore::IGetter& igetter) { wheelFactor = wheelFactor / myMe1->getNbinsX(); - const std::string globalMEName = fmt::format("{}/reportSummaryContents/RPC_Wheel{}", eventInfoPath_, w); + const std::string globalMEName = std::format("{}/reportSummaryContents/RPC_Wheel{}", eventInfoPath_, w); MonitorElement* globalMe = igetter.get(globalMEName); if (globalMe) globalMe->Fill(wheelFactor); @@ -201,8 +202,8 @@ void RPCEventSummary::clientOperation(DQMStore::IGetter& igetter) { if (d == 0) continue; - const std::string meName1 = fmt::format("{}/DeadChannelFraction_Ring_vs_Segment_Disk{}", globalFolder_, d); - const std::string meName2 = fmt::format("{}/RPCNoisyStrips_Ring_vs_Segment_Disk{}", globalFolder_, d); + const std::string meName1 = std::format("{}/DeadChannelFraction_Ring_vs_Segment_Disk{}", globalFolder_, d); + const std::string meName2 = std::format("{}/RPCNoisyStrips_Ring_vs_Segment_Disk{}", globalFolder_, d); MonitorElement* myMe1 = igetter.get(meName1); MonitorElement* myMe2 = igetter.get(meName2); @@ -245,7 +246,7 @@ void RPCEventSummary::clientOperation(DQMStore::IGetter& igetter) { diskFactor = diskFactor / 6; - const std::string globalMEName = fmt::format("{}/reportSummaryContents/RPC_Disk{}", eventInfoPath_, d); + const std::string globalMEName = std::format("{}/reportSummaryContents/RPC_Disk{}", eventInfoPath_, d); MonitorElement* globalMe = igetter.get(globalMEName); if (globalMe) globalMe->Fill(diskFactor); diff --git a/DQM/RPCMonitorClient/src/RPCClusterSizeTest.cc b/DQM/RPCMonitorClient/src/RPCClusterSizeTest.cc index bafb112e79131..a37c096b1a430 100644 --- a/DQM/RPCMonitorClient/src/RPCClusterSizeTest.cc +++ b/DQM/RPCMonitorClient/src/RPCClusterSizeTest.cc @@ -4,6 +4,7 @@ #include "FWCore/MessageLogger/interface/MessageLogger.h" #include "Geometry/RPCGeometry/interface/RPCGeomServ.h" +#include RPCClusterSizeTest::RPCClusterSizeTest(const edm::ParameterSet& ps) { edm::LogVerbatim("rpceventsummary") << "[RPCClusterSizeTest]: Constructor"; @@ -55,7 +56,7 @@ void RPCClusterSizeTest::clientOperation() { //Barrel for (int wheel = -2; wheel <= 2; wheel++) { for (int sector = 1; sector <= 12; sector++) { - std::string tmpName = fmt::format("ClusterSize_Wheel_{}_Sector_{}", wheel, sector); + std::string tmpName = std::format("ClusterSize_Wheel_{}_Sector_{}", wheel, sector); if (tmpName == meName) { MEAN = MEANWheel[wheel + 2]; @@ -97,7 +98,7 @@ void RPCClusterSizeTest::clientOperation() { for (int disk = 1; disk <= numberOfDisks_; disk++) { for (int ring = 2; ring < numberOfRings_ + 2; ring++) { for (unsigned int ich = 0; ich < chNames.size(); ich++) { - std::string tmpName = fmt::format("ClusterSize_Disk_{}_Ring_{}_{}", (region * disk), ring, chNames[ich]); + std::string tmpName = std::format("ClusterSize_Disk_{}_Ring_{}_{}", (region * disk), ring, chNames[ich]); if (tmpName == meName) { xBin = (ich * 9); diff --git a/DQM/RPCMonitorDigi/src/RPCFEDIntegrity.cc b/DQM/RPCMonitorDigi/src/RPCFEDIntegrity.cc index 15cf5f478ab07..da13f1d2fdd71 100644 --- a/DQM/RPCMonitorDigi/src/RPCFEDIntegrity.cc +++ b/DQM/RPCMonitorDigi/src/RPCFEDIntegrity.cc @@ -4,6 +4,8 @@ #include "DQM/RPCMonitorDigi/interface/RPCRawDataCountsHistoMaker.h" #include "FWCore/MessageLogger/interface/MessageLogger.h" +#include + RPCFEDIntegrity::RPCFEDIntegrity(const edm::ParameterSet& ps) { edm::LogVerbatim("rpcfedintegrity") << "[RPCFEDIntegrity]: Constructor"; @@ -70,7 +72,7 @@ void RPCFEDIntegrity::labelBins(MonitorElement* myMe) { return; for (int i = 0; i < xbins; i++) { - const std::string xLabel = fmt::format("{}", minFEDNum_ + i); + const std::string xLabel = std::format("{}", minFEDNum_ + i); myMe->setBinLabel(i + 1, xLabel, 1); } } diff --git a/DQM/TrackingMonitorSource/test/testTrackingDQMAnalyzers.cc b/DQM/TrackingMonitorSource/test/testTrackingDQMAnalyzers.cc index c4c5248e559fe..7404a06c480ae 100644 --- a/DQM/TrackingMonitorSource/test/testTrackingDQMAnalyzers.cc +++ b/DQM/TrackingMonitorSource/test/testTrackingDQMAnalyzers.cc @@ -2,6 +2,7 @@ #include "FWCore/Utilities/interface/Exception.h" #include "FWCore/ServiceRegistry/interface/Service.h" #include "CommonTools/UtilAlgos/interface/TFileService.h" +#include #define CATCH_CONFIG_MAIN #include "catch.hpp" @@ -57,8 +58,8 @@ process.add_(cms.Service('JobReportService')) process.add_(cms.Service('TFileService',fileName=cms.string('{}'))) )_"; - // Format the raw string literal using fmt::format - return fmt::format(rawString, analyzerName, analyzerName, analyzerName, rootFileName); + // Format the raw string literal using std::format + return std::format(rawString, analyzerName, analyzerName, analyzerName, rootFileName); } //___________________________________________________________________________________________ diff --git a/DQMServices/StreamerIO/test/BuildFile.xml b/DQMServices/StreamerIO/test/BuildFile.xml index 51bfce9ce2b3b..ed32b59d9b143 100644 --- a/DQMServices/StreamerIO/test/BuildFile.xml +++ b/DQMServices/StreamerIO/test/BuildFile.xml @@ -3,6 +3,7 @@ + diff --git a/DataFormats/CSCDigi/src/CSCWireDigi.cc b/DataFormats/CSCDigi/src/CSCWireDigi.cc index ae5be38819c37..582723813f59c 100644 --- a/DataFormats/CSCDigi/src/CSCWireDigi.cc +++ b/DataFormats/CSCDigi/src/CSCWireDigi.cc @@ -7,6 +7,7 @@ #include "DataFormats/CSCDigi/interface/CSCWireDigi.h" #include "FWCore/MessageLogger/interface/MessageLogger.h" #include +#include #include /// Constructors diff --git a/DataFormats/FEDRawData/interface/SLinkRocketHeaders.h b/DataFormats/FEDRawData/interface/SLinkRocketHeaders.h index 457fc657f353e..8487d3fda19c6 100644 --- a/DataFormats/FEDRawData/interface/SLinkRocketHeaders.h +++ b/DataFormats/FEDRawData/interface/SLinkRocketHeaders.h @@ -3,7 +3,7 @@ #include "FWCore/Utilities/interface/Exception.h" -//#include +#include #include /* diff --git a/DataFormats/FEDRawData/src/RawDataBuffer.cc b/DataFormats/FEDRawData/src/RawDataBuffer.cc index ebbc6dd22e409..9910cd670fa17 100644 --- a/DataFormats/FEDRawData/src/RawDataBuffer.cc +++ b/DataFormats/FEDRawData/src/RawDataBuffer.cc @@ -7,6 +7,8 @@ #include #include #include +#include "FWCore/Utilities/interface/Exception.h" +#include RawDataBuffer::RawDataBuffer() {} RawDataBuffer::RawDataBuffer(uint32_t preallocSize) : usedSize_(0), data_(preallocSize) {} diff --git a/DataFormats/Provenance/src/ThinnedAssociationsHelper.cc b/DataFormats/Provenance/src/ThinnedAssociationsHelper.cc index 3c6131e2c0886..4c1472b48b9a8 100644 --- a/DataFormats/Provenance/src/ThinnedAssociationsHelper.cc +++ b/DataFormats/Provenance/src/ThinnedAssociationsHelper.cc @@ -3,7 +3,7 @@ #include "FWCore/Utilities/interface/EDMException.h" #include -#include +#include namespace edm { @@ -72,7 +72,7 @@ namespace edm { ensureSlimmingConstraints(); } catch (edm::Exception& ex) { ex.addContext("Calling ThinnedAssociationsHelper::addAssociation()"); - ex.addAdditionalInfo(fmt::format("When adding a slimmed collection with BranchID {}", branches.thinned().id())); + ex.addAdditionalInfo(std::format("When adding a slimmed collection with BranchID {}", branches.thinned().id())); throw ex; } } diff --git a/DataFormats/SoATemplate/BuildFile.xml b/DataFormats/SoATemplate/BuildFile.xml index 00e24da5047ac..ab3499e61e144 100644 --- a/DataFormats/SoATemplate/BuildFile.xml +++ b/DataFormats/SoATemplate/BuildFile.xml @@ -1,4 +1,3 @@ - diff --git a/DataFormats/SoATemplate/interface/SoACommon.h b/DataFormats/SoATemplate/interface/SoACommon.h index 79c605a63e874..49ee141c88803 100644 --- a/DataFormats/SoATemplate/interface/SoACommon.h +++ b/DataFormats/SoATemplate/interface/SoACommon.h @@ -17,7 +17,7 @@ #include -#include +#include #include "FWCore/Utilities/interface/typedefs.h" @@ -49,7 +49,7 @@ } #else #define SOA_THROW_OUT_OF_RANGE(A, I, R) \ - { throw std::out_of_range(fmt::format("{}: index {} out of range {}", (A), (I), (R))); } + { throw std::out_of_range(std::format("{}: index {} out of range {}", (A), (I), (R))); } #endif /* declare "scalars" (one value shared across the whole SoA) and "columns" (one value per element) */ diff --git a/EventFilter/CTPPSRawToDigi/plugins/TotemVFATRawToDigi.cc b/EventFilter/CTPPSRawToDigi/plugins/TotemVFATRawToDigi.cc index f16c4c1b1d0c3..daad30cab1415 100644 --- a/EventFilter/CTPPSRawToDigi/plugins/TotemVFATRawToDigi.cc +++ b/EventFilter/CTPPSRawToDigi/plugins/TotemVFATRawToDigi.cc @@ -41,6 +41,7 @@ #include "FWCore/ParameterSet/interface/ParameterSetDescription.h" #include +#include class TotemVFATRawToDigi : public edm::stream::EDProducer<> { public: @@ -209,7 +210,7 @@ void TotemVFATRawToDigi::run(edm::Event &event, const edm::EventSetup &es) { if (analysisMaskHandle.isValid() && !analysisMaskHandle.failedToGet()) { analysisMask = *analysisMaskHandle; } else { - errSummary.add(fmt::format("No AnalysisMask found for {0}", subSystemName), ""); + errSummary.add(std::format("No AnalysisMask found for {0}", subSystemName), ""); analysisMask = TotemAnalysisMask(); } diff --git a/EventFilter/CTPPSRawToDigi/src/CTPPSPixelDataFormatter.cc b/EventFilter/CTPPSRawToDigi/src/CTPPSPixelDataFormatter.cc index 120a66988305b..806ca0e891e84 100644 --- a/EventFilter/CTPPSRawToDigi/src/CTPPSPixelDataFormatter.cc +++ b/EventFilter/CTPPSRawToDigi/src/CTPPSPixelDataFormatter.cc @@ -12,6 +12,7 @@ #include #include #include +#include using namespace edm; using namespace std; @@ -176,7 +177,7 @@ void CTPPSPixelDataFormatter::interpretRawData( } else if ((nroc - 1) >= maxRocIndex) { m_ErrorCheck.conversionError(fedId, iD, InvalidROCId, ww, errors); m_ErrorSummary.add("Invalid ROC", - fmt::format("Id {0}, in link {1}, of FED {2} in DetId {3}", convroc, nlink, fedId, iD)); + std::format("Id {0}, in link {1}, of FED {2} in DetId {3}", convroc, nlink, fedId, iD)); } else { m_ErrorCheck.conversionError(fedId, iD, Unknown, ww, errors); @@ -210,7 +211,7 @@ void CTPPSPixelDataFormatter::interpretRawData( if (!isRun3 && (dcol < min_Dcol || dcol > max_Dcol || pxid < min_Pixid || pxid > max_Pixid)) { m_ErrorSummary.add( "unphysical dcol and/or pxid", - fmt::format("fedId= {0}, nllink= {1}, convroc= {2}, adc= {3}, dcol= {4}, pxid= {5}, detId= {6}", + std::format("fedId= {0}, nllink= {1}, convroc= {2}, adc= {3}, dcol= {4}, pxid= {5}, detId= {6}", fedId, nlink, convroc, @@ -225,7 +226,7 @@ void CTPPSPixelDataFormatter::interpretRawData( } if (isRun3 && (col < min_COL || col > max_COL || row < min_ROW || row > max_ROW)) { m_ErrorSummary.add("unphysical col and/or row", - fmt::format("fedId= {0}, nllink= {1}, convroc= {2}, adc= {3}, col= {4}, row= {5}, detId= {6}", + std::format("fedId= {0}, nllink= {1}, convroc= {2}, adc= {3}, col= {4}, row= {5}, detId= {6}", fedId, nlink, convroc, diff --git a/EventFilter/SiStripRawToDigi/plugins/SiStripDigiToRaw.cc b/EventFilter/SiStripRawToDigi/plugins/SiStripDigiToRaw.cc index e2c179cb33551..774e0410cd698 100644 --- a/EventFilter/SiStripRawToDigi/plugins/SiStripDigiToRaw.cc +++ b/EventFilter/SiStripRawToDigi/plugins/SiStripDigiToRaw.cc @@ -1,8 +1,7 @@ #include #include #include - -#include +#include #include "CondFormats/SiStripObjects/interface/SiStripFedCabling.h" #include "DataFormats/FEDRawData/interface/FEDHeader.h" @@ -136,7 +135,7 @@ namespace sistrip { //need to construct full object to copy full header if (rawfedData.size() == 0) - warnings_.add("Invalid raw data for FED, skipping", fmt::format("id {0}", *ifed)); + warnings_.add("Invalid raw data for FED, skipping", std::format("id {0}", *ifed)); const auto st_buffer = preconstructCheckFEDBuffer(rawfedData, true); if (FEDBufferStatusCode::SUCCESS != st_buffer) { edm::LogWarning("DigiToRaw") << "[sistrip::DigiToRaw::createFedBuffers_]" @@ -150,7 +149,7 @@ namespace sistrip { << " Could not construct FEDBuffer for FED " << *ifed << std::endl; } if (fedbuffer.headerType() == sistrip::HEADER_TYPE_INVALID) { - warnings_.add("Invalid header type for FED, skipping", fmt::format("id {0}", *ifed)); + warnings_.add("Invalid header type for FED, skipping", std::format("id {0}", *ifed)); continue; } diff --git a/EventFilter/SiStripRawToDigi/plugins/SiStripRawToDigiUnpacker.cc b/EventFilter/SiStripRawToDigi/plugins/SiStripRawToDigiUnpacker.cc index e914d689d699d..7b887b20b5e12 100644 --- a/EventFilter/SiStripRawToDigi/plugins/SiStripRawToDigiUnpacker.cc +++ b/EventFilter/SiStripRawToDigi/plugins/SiStripRawToDigiUnpacker.cc @@ -3,7 +3,7 @@ #include #include -#include +#include #include "CondFormats/SiStripObjects/interface/SiStripFedCabling.h" #include "DataFormats/Common/interface/DetSet.h" @@ -155,12 +155,12 @@ namespace sistrip { // construct FEDBuffer if (FEDBufferStatusCode::SUCCESS != st_buffer) { if (FEDBufferStatusCode::BUFFER_NULL == st_buffer) { - warnings_.add("NULL pointer to FEDRawData for FED", fmt::format("id {0}", *ifed)); + warnings_.add("NULL pointer to FEDRawData for FED", std::format("id {0}", *ifed)); } else if (!input.size()) { - warnings_.add("FEDRawData has zero size for FED", fmt::format("id {0}", *ifed)); + warnings_.add("FEDRawData has zero size for FED", std::format("id {0}", *ifed)); } else { warnings_.add("Exception caught when creating FEDBuffer object for FED", - fmt::format("id {0}: {1}", *ifed, static_cast(st_buffer))); + std::format("id {0}: {1}", *ifed, static_cast(st_buffer))); } // FED buffer is bad and should not be unpacked. Skip this FED and mark all modules as bad. maskFED(detids, conns); @@ -170,20 +170,20 @@ namespace sistrip { const FEDBufferStatusCode st_chan = buffer.findChannels(); if (FEDBufferStatusCode::SUCCESS != st_chan) { warnings_.add("Exception caught when creating FEDBuffer object for FED", - fmt::format("id {0}: {1}", *ifed, static_cast(st_chan))); + std::format("id {0}: {1}", *ifed, static_cast(st_chan))); maskFED(detids, conns); continue; } buffer.setLegacyMode(legacy_); if ((!buffer.doChecks(true)) && (!unpackBadChannels_ || !buffer.checkNoFEOverflows())) { warnings_.add("Exception caught when creating FEDBuffer object for FED", - fmt::format("id {0}: FED Buffer check fails for FED ID {0}.", *ifed)); + std::format("id {0}: FED Buffer check fails for FED ID {0}.", *ifed)); maskFED(detids, conns); continue; } if (doFullCorruptBufferChecks_ && !buffer.doCorruptBufferChecks()) { warnings_.add("Exception caught when creating FEDBuffer object for FED", - fmt::format("id {0}: FED corrupt buffer check fails for FED ID {0}.", *ifed)); + std::format("id {0}: FED corrupt buffer check fails for FED ID {0}.", *ifed)); maskFED(detids, conns); continue; } @@ -295,11 +295,11 @@ namespace sistrip { fedChannel, std::back_inserter(zs_work_digis_), ipair * 256, isNonLite, mode, legacy_, lmode, pCode); if (fedchannelunpacker::StatusCode::ZERO_PACKET_CODE == st_ch || fedchannelunpacker::StatusCode::BAD_PACKET_CODE == st_ch) { - warnings_.add(fmt::format("Invalid packet code {0:#x} for zero-suppressed data", uint16_t(pCode)), - fmt::format("FED {0} channel {1}", *ifed, iconn->fedCh())); + warnings_.add(std::format("Invalid packet code {0:#x} for zero-suppressed data", uint16_t(pCode)), + std::format("FED {0} channel {1}", *ifed, iconn->fedCh())); } else if (fedchannelunpacker::StatusCode::SUCCESS != st_ch) { warnings_.add("Clusters are not ordered", - fmt::format("FED {0} channel {1}: {2}", *ifed, iconn->fedCh(), toString(st_ch))); + std::format("FED {0} channel {1}: {2}", *ifed, iconn->fedCh(), toString(st_ch))); detids.push_back(iconn->detId()); //@@ Possible multiple entries (ok for Giovanni) continue; } @@ -319,7 +319,7 @@ namespace sistrip { } else { detids.push_back(iconn->detId()); //@@ Possible multiple entries (ok for Giovanni) warnings_.add("Problem extracting common modes", - fmt::format("FED {0} channel {1}:\n Request for CM median from channel with non-ZS " + std::format("FED {0} channel {1}:\n Request for CM median from channel with non-ZS " "packet code. Packet code is {2}.", *ifed, iconn->fedCh(), @@ -354,7 +354,7 @@ namespace sistrip { scope_work_registry_.push_back(regItem); } } else { // Unknown readout mode! => assume scope mode - warnings_.add(fmt::format("Unknown FED readout mode ({0})! Assuming SCOPE MODE...", int(mode))); + warnings_.add(std::format("Unknown FED readout mode ({0})! Assuming SCOPE MODE...", int(mode))); Registry regItem(key, 0, scope_work_digis_.size(), 0); st_ch = fedchannelunpacker::unpackScope(fedChannel, std::back_inserter(scope_work_digis_)); if (regItem.index != scope_work_digis_.size()) { @@ -372,7 +372,7 @@ namespace sistrip { } } if (fedchannelunpacker::StatusCode::SUCCESS != st_ch) { - warnings_.add(toString(st_ch), fmt::format("FED {0} channel {1}:", *ifed, iconn->fedCh())); + warnings_.add(toString(st_ch), std::format("FED {0} channel {1}:", *ifed, iconn->fedCh())); } } } // channel loop diff --git a/EventFilter/Utilities/BuildFile.xml b/EventFilter/Utilities/BuildFile.xml index 2270817d5ce0a..24768cea83453 100644 --- a/EventFilter/Utilities/BuildFile.xml +++ b/EventFilter/Utilities/BuildFile.xml @@ -1,6 +1,7 @@ + diff --git a/EventFilter/Utilities/src/DAQSourceModelsDTH.cc b/EventFilter/Utilities/src/DAQSourceModelsDTH.cc index d9c93cedf54a4..3d920b7dc0535 100644 --- a/EventFilter/Utilities/src/DAQSourceModelsDTH.cc +++ b/EventFilter/Utilities/src/DAQSourceModelsDTH.cc @@ -9,6 +9,7 @@ #include #include #include +#include #include "FWCore/MessageLogger/interface/MessageLogger.h" @@ -252,7 +253,7 @@ void DataModeDTH::makeDataBlockView(unsigned char* addr, RawInputFile* rawFile) checksumValid_ = false; if (!checksumError_.empty()) checksumError_ += "\n"; - checksumError_ += fmt::format( + checksumError_ += std::format( "Found a wrong crc32c checksum in orbit header v{} run: {} orbit: {} sourceId: {} wcount: {} events: {} " "flags: {}. Expected {:x} but calculated {:x}", orbitHeader->version(), diff --git a/FWCore/Framework/interface/ComponentMaker.h b/FWCore/Framework/interface/ComponentMaker.h index 06557e8916b7f..7f15ef6b5fc8b 100644 --- a/FWCore/Framework/interface/ComponentMaker.h +++ b/FWCore/Framework/interface/ComponentMaker.h @@ -22,7 +22,7 @@ #include #include -#include +#include // user include files #include "FWCore/Framework/interface/ComponentDescription.h" @@ -97,7 +97,7 @@ namespace edm { iConfiguration.registerIt(); }); } catch (cms::Exception& iException) { - iException.addContext(fmt::format( + iException.addContext(std::format( "Validating configuration of {} of type {} with label: '{}'", T::baseType(), modtype, moduleLabel)); throw; } diff --git a/FWCore/Framework/src/ESSourceProductResolverBase.cc b/FWCore/Framework/src/ESSourceProductResolverBase.cc index 4840ea4f88b2c..cedaeb90e924e 100644 --- a/FWCore/Framework/src/ESSourceProductResolverBase.cc +++ b/FWCore/Framework/src/ESSourceProductResolverBase.cc @@ -11,7 +11,7 @@ // // system include files -#include +#include // user include files #include "FWCore/Framework/interface/ESSourceProductResolverBase.h" @@ -51,7 +51,7 @@ void edm::eventsetup::ESSourceProductResolverBase::doPrefetchAndSignals( try { convertException::wrap([&] { prefetch(iKey, EventSetupRecordDetails(&iRecord)); }); } catch (cms::Exception& iException) { - iException.addContext(fmt::format( + iException.addContext(std::format( "Retrieving data product {} '{}' in record {}", iKey.type().name(), iKey.name().value(), iRecord.key().name())); exceptionContext(iException, context); throw; diff --git a/FWCore/Framework/src/StreamSchedule.cc b/FWCore/Framework/src/StreamSchedule.cc index 6a63804d9a76d..9fc1ee8cf4a49 100644 --- a/FWCore/Framework/src/StreamSchedule.cc +++ b/FWCore/Framework/src/StreamSchedule.cc @@ -38,7 +38,7 @@ #include #include #include -#include +#include namespace edm { @@ -248,7 +248,7 @@ namespace edm { if (not consumes.empty()) { bool foundAtLeastOneMatchingBranch = false; for (auto const& product : consumes) { - std::string branch = fmt::format("{}_{}_{}_{}", + std::string branch = std::format("{}_{}_{}_{}", product.type().friendlyClassName(), product.label().data(), product.instance().data(), diff --git a/FWCore/Integration/test/BuildFile.xml b/FWCore/Integration/test/BuildFile.xml index f5569f8c0b002..db95dfadd88f2 100644 --- a/FWCore/Integration/test/BuildFile.xml +++ b/FWCore/Integration/test/BuildFile.xml @@ -46,7 +46,6 @@ - @@ -55,7 +54,6 @@ - diff --git a/FWCore/Integration/test/EDAlias_t.cpp b/FWCore/Integration/test/EDAlias_t.cpp index 4141f12ce10a5..d7063c7bf065a 100644 --- a/FWCore/Integration/test/EDAlias_t.cpp +++ b/FWCore/Integration/test/EDAlias_t.cpp @@ -6,7 +6,7 @@ #include "FWCore/TestProcessor/interface/TestProcessor.h" #include -#include +#include static constexpr auto s_tag = "[EDAlias]"; @@ -198,7 +198,7 @@ process.test = cms.EDProducer('AddIntsProducer', process.moduleToTest(process.test, cms.Task(process.intprod)) )_"}; - edm::test::TestProcessor::Config config{fmt::format(baseConfig, "'intalias:another'")}; + edm::test::TestProcessor::Config config{std::format(baseConfig, "'intalias:another'")}; SECTION("Base configuration is OK") { REQUIRE_NOTHROW(edm::test::TestProcessor(config)); } @@ -230,12 +230,12 @@ process.moduleToTest(process.test, cms.Task(process.intprod)) SECTION("Other product instances are not aliased") { { - edm::test::TestProcessor::Config config{fmt::format(baseConfig, "'intalias:foo'")}; + edm::test::TestProcessor::Config config{std::format(baseConfig, "'intalias:foo'")}; edm::test::TestProcessor tester(config); REQUIRE_THROWS_WITH(tester.test(), Catch::Contains("ProductNotFound")); } { - edm::test::TestProcessor::Config config{fmt::format(baseConfig, "'intalias'")}; + edm::test::TestProcessor::Config config{std::format(baseConfig, "'intalias'")}; edm::test::TestProcessor tester(config); REQUIRE_THROWS_WITH(tester.test(), Catch::Contains("ProductNotFound")); } @@ -337,7 +337,7 @@ process.moduleToTest(process.test, cms.Task(process.intprod)) )_"}; SECTION("Type wildcard") { - edm::test::TestProcessor::Config config{fmt::format( + edm::test::TestProcessor::Config config{std::format( baseConfig, "intprod = cms.VPSet(cms.PSet(type = cms.string('*'), fromProductInstance = cms.string('nonexistent')))")}; @@ -348,7 +348,7 @@ process.moduleToTest(process.test, cms.Task(process.intprod)) SECTION("Instance wildcard") { edm::test::TestProcessor::Config config{ - fmt::format(baseConfig, "intprod = cms.VPSet(cms.PSet(type = cms.string('nonexistentType')))")}; + std::format(baseConfig, "intprod = cms.VPSet(cms.PSet(type = cms.string('nonexistentType')))")}; REQUIRE_THROWS_WITH(edm::test::TestProcessor(config), Catch::Contains("There are no products of type 'nonexistentType'") && diff --git a/FWCore/Integration/test/ProcessAccelerator_t.cpp b/FWCore/Integration/test/ProcessAccelerator_t.cpp index 58ae58041855f..e55a390321f74 100644 --- a/FWCore/Integration/test/ProcessAccelerator_t.cpp +++ b/FWCore/Integration/test/ProcessAccelerator_t.cpp @@ -6,7 +6,7 @@ #include "FWCore/ParameterSetReader/interface/ParameterSetReader.h" #include "FWCore/TestProcessor/interface/TestProcessor.h" -#include +#include #include #include @@ -17,8 +17,8 @@ namespace { std::string makeResolverConfig(bool enableOther, std::string_view accelerator, std::string_view variant) { const std::string appendOther = enableOther ? "self._enabled.append('other')" : ""; const std::string explicitVariant = - variant.empty() ? std::string(variant) : fmt::format(", variant=cms.untracked.string('{}')", variant); - return fmt::format( + variant.empty() ? std::string(variant) : std::format(", variant=cms.untracked.string('{}')", variant); + return std::format( R"_(from FWCore.TestProcessor.TestProcess import * import FWCore.ParameterSet.Config as cms diff --git a/FWCore/MessageLogger/BuildFile.xml b/FWCore/MessageLogger/BuildFile.xml index 2b719a173e8e4..791d9d487d11d 100644 --- a/FWCore/MessageLogger/BuildFile.xml +++ b/FWCore/MessageLogger/BuildFile.xml @@ -1,7 +1,6 @@ - diff --git a/FWCore/MessageLogger/interface/ErrorObj.h b/FWCore/MessageLogger/interface/ErrorObj.h index 8afe69b190d0f..21bb13338bf1a 100644 --- a/FWCore/MessageLogger/interface/ErrorObj.h +++ b/FWCore/MessageLogger/interface/ErrorObj.h @@ -25,7 +25,7 @@ #include "FWCore/MessageLogger/interface/ELextendedID.h" #include "FWCore/MessageLogger/interface/ELseverityLevel.h" -#include "fmt/format.h" +#include #include #include @@ -80,8 +80,8 @@ namespace edm { inline ErrorObj& operator<<(std::ostream& (*f)(std::ostream&)); inline ErrorObj& operator<<(std::ios_base& (*f)(std::ios_base&)); template - inline ErrorObj& format(fmt::format_string format, Args&&... args); - inline ErrorObj& vformat(std::string_view fmt, fmt::format_args args); + inline ErrorObj& format(std::format_string format, Args&&... args); + inline ErrorObj& vformat(std::string_view fmt, std::format_args args); virtual ErrorObj& emitToken(std::string_view txt); diff --git a/FWCore/MessageLogger/interface/ErrorObj.icc b/FWCore/MessageLogger/interface/ErrorObj.icc index c0a8ed2d9e776..8ef4ff4eeeece 100644 --- a/FWCore/MessageLogger/interface/ErrorObj.icc +++ b/FWCore/MessageLogger/interface/ErrorObj.icc @@ -14,8 +14,6 @@ #include -#include "fmt/ostream.h" - namespace edm { // ---------------------------------------------------------------------- @@ -57,15 +55,15 @@ namespace edm { } template - inline ErrorObj& ErrorObj::format(fmt::format_string format, Args&&... args) { - auto str = fmt::format(std::move(format), std::forward(args)...); + inline ErrorObj& ErrorObj::format(std::format_string format, Args&&... args) { + auto str = std::format(std::move(format), std::forward(args)...); if (!str.empty()) emitToken(str); return *this; } - inline ErrorObj& ErrorObj::vformat(std::string_view format, fmt::format_args args) { - auto str = fmt::vformat(format, args); + inline ErrorObj& ErrorObj::vformat(std::string_view format, std::format_args args) { + auto str = std::vformat(format, args); if (!str.empty()) emitToken(str); return *this; diff --git a/FWCore/MessageLogger/interface/MessageLogger.h b/FWCore/MessageLogger/interface/MessageLogger.h index 6e41427960656..2506df2f08b20 100644 --- a/FWCore/MessageLogger/interface/MessageLogger.h +++ b/FWCore/MessageLogger/interface/MessageLogger.h @@ -95,13 +95,13 @@ namespace edm { } template - ThisLog& format(fmt::format_string format, Args&&... args) { + ThisLog& format(std::format_string format, Args&&... args) { if (ap.valid()) ap.format(std::move(format), std::forward(args)...); return *this; } - ThisLog& vformat(std::string_view fmt, fmt::format_args args) { + ThisLog& vformat(std::string_view fmt, std::format_args args) { if (ap.valid()) ap.vformat(fmt, args); return *this; @@ -204,11 +204,11 @@ namespace edm { Suppress_LogDebug_& operator<<(std::ios_base& (*)(std::ios_base&)) { return *this; } template - Suppress_LogDebug_& format(fmt::format_string format, Args&&... args) { + Suppress_LogDebug_& format(std::format_string format, Args&&... args) { return *this; } - Suppress_LogDebug_& vformat(std::string_view fmt, fmt::format_args args) { return *this; } + Suppress_LogDebug_& vformat(std::string_view fmt, std::format_args args) { return *this; } template Suppress_LogDebug_& log(F&& iF) { diff --git a/FWCore/MessageLogger/interface/MessageSender.h b/FWCore/MessageLogger/interface/MessageSender.h index 0920d5a1c7d2b..014ad4c49832c 100644 --- a/FWCore/MessageLogger/interface/MessageSender.h +++ b/FWCore/MessageLogger/interface/MessageSender.h @@ -38,14 +38,14 @@ namespace edm { } template - MessageSender& format(fmt::format_string format, Args&&... args) { + MessageSender& format(std::format_string format, Args&&... args) { if (valid()) errorobj_p->format(std::move(format), std::forward(args)...); return *this; } template - MessageSender& vformat(std::string_view fmt, fmt::format_args args) { + MessageSender& vformat(std::string_view fmt, std::format_args args) { if (valid()) errorobj_p->vformat(fmt, args); return *this; diff --git a/FWCore/MessageService/test/BuildFile.xml b/FWCore/MessageService/test/BuildFile.xml index 4ca743ab52cbc..24e979e156227 100644 --- a/FWCore/MessageService/test/BuildFile.xml +++ b/FWCore/MessageService/test/BuildFile.xml @@ -261,8 +261,3 @@ - - - - - diff --git a/FWCore/MessageService/test/UnitTestClient_C.cc b/FWCore/MessageService/test/UnitTestClient_C.cc index 36b18e2ab22f5..ef204d7217668 100644 --- a/FWCore/MessageService/test/UnitTestClient_C.cc +++ b/FWCore/MessageService/test/UnitTestClient_C.cc @@ -34,9 +34,9 @@ namespace edmtest { .format("Test of format fill and width: ") .format("The following should read ++abcdefg $$$12: {:+>9} {:$>5}", "abcdefg", 12); edm::LogWarning("cat_A").vformat(std::string("Test of format precision: Pi with precision 12 is {:.12g}"), - fmt::make_format_args(d)); + std::make_format_args(d)); edm::LogWarning("cat_A").vformat("Test of format spacing: The following should read a b cc: {} {:+>} {:>2}", - fmt::make_format_args("a", "b", "cc")); + std::make_format_args("a", "b", "cc")); } } // namespace edmtest diff --git a/FWCore/MessageService/test/fmt_test.cppunit.cpp b/FWCore/MessageService/test/fmt_test.cppunit.cpp deleted file mode 100644 index f3cf79fd28fc3..0000000000000 --- a/FWCore/MessageService/test/fmt_test.cppunit.cpp +++ /dev/null @@ -1,66 +0,0 @@ -/*---------------------------------------------------------------------- - -Test program for fmt external. - - ----------------------------------------------------------------------*/ - -#include -#include - -class test_fmt_external : public CppUnit::TestFixture { - CPPUNIT_TEST_SUITE(test_fmt_external); - - CPPUNIT_TEST(test_fmt); - - CPPUNIT_TEST_SUITE_END(); - -public: - void setUp() {} - void tearDown() {} - void test_fmt(); -}; - -///registration of the test so that the runner can find it -CPPUNIT_TEST_SUITE_REGISTRATION(test_fmt_external); - -//using std::cerr; -//using std::endl; - -struct date { - int year, month, day; -}; - -template <> -struct fmt::formatter { - constexpr auto parse(format_parse_context& ctx) { return ctx.begin(); } - - template - auto format(const date& d, FormatContext& ctx) { - return format_to(ctx.out(), "{}-{}-{}", d.year, d.month, d.day); - } -}; - -template -auto capture(const Args&... args) { - return std::make_tuple(args...); -} - -auto vprint_message = [](auto&& format, auto&&... args) { - fmt::vprint(format, fmt::make_format_args(std::forward(args)...)); -}; - -void test_fmt_external::test_fmt() - -{ - std::string s = fmt::format("The date is {}", date{2012, 12, 9}); - std::string s_check = "The date is 2012-12-9"; - CPPUNIT_ASSERT(s_check == s); - auto args = capture("{} {}", 42, "foo"); - std::apply(vprint_message, args); - auto buf = fmt::memory_buffer(); - format_to(std::back_inserter(buf), "{}", 42); // replaces itoa(42, buffer, 10) - fmt::vprint(to_string(buf), fmt::make_format_args()); - format_to(std::back_inserter(buf), "{:x}", 42); // replaces itoa(42, buffer, 16) - fmt::vprint(to_string(buf), fmt::make_format_args()); -} -#include diff --git a/FWCore/Services/plugins/CPU.cc b/FWCore/Services/plugins/CPU.cc index 68a251e94b9b4..d800288f24c62 100644 --- a/FWCore/Services/plugins/CPU.cc +++ b/FWCore/Services/plugins/CPU.cc @@ -40,7 +40,7 @@ #include #include #include -#include +#include #ifdef __linux__ #include @@ -247,16 +247,16 @@ namespace edm { model = info.brand_string; #elif defined(CPU_FEATURES_ARCH_ARM) const auto info{GetArmInfo()}; - model = fmt::format("ARM {} {} {}", info.implementer, info.architecture, info.variant); + model = std::format("ARM {} {} {}", info.implementer, info.architecture, info.variant); #elif defined(CPU_FEATURES_ARCH_AARCH64) const auto info{GetAarch64Info()}; - model = fmt::format("aarch64 {} {}", info.implementer, info.variant); + model = std::format("aarch64 {} {}", info.implementer, info.variant); #elif defined(CPU_FEATURES_ARCH_PPC) const auto strings{GetPPCPlatformStrings()}; model = strings.machine; #elif defined(CPU_FEATURES_ARCH_RISCV) const auto info{GetRiscvInfo()}; - model = fmt::format("riscv64 {} {}", info.vendor, info.uarch); + model = std::format("riscv64 {} {}", info.vendor, info.uarch); #endif return model; } diff --git a/FWCore/Utilities/BuildFile.xml b/FWCore/Utilities/BuildFile.xml index 9e5a6c7c5dd2f..3a547776f479c 100644 --- a/FWCore/Utilities/BuildFile.xml +++ b/FWCore/Utilities/BuildFile.xml @@ -1,6 +1,5 @@ - diff --git a/FWCore/Utilities/bin/BuildFile.xml b/FWCore/Utilities/bin/BuildFile.xml index a7ce6ff3436ad..77203154bf748 100644 --- a/FWCore/Utilities/bin/BuildFile.xml +++ b/FWCore/Utilities/bin/BuildFile.xml @@ -3,6 +3,5 @@ - diff --git a/FWCore/Utilities/bin/adler32.cc b/FWCore/Utilities/bin/adler32.cc index b20d10ce9bea7..961651f381c99 100644 --- a/FWCore/Utilities/bin/adler32.cc +++ b/FWCore/Utilities/bin/adler32.cc @@ -15,12 +15,13 @@ #include #include #include -#include +#include #include #include #include #include #include +#include #ifdef __APPLE__ typedef off_t off64_t; #define O_LARGEFILE 0 @@ -54,7 +55,7 @@ int main(int argc, char* argv[]) { fileSize += readSize; } - std::cout << fmt::format("{:x} {} {}\n", adlerCksum, fileSize, argv[fileNum]); + std::cout << std::format("{:x} {} {}\n", adlerCksum, fileSize, argv[fileNum]); } return (0); diff --git a/FWCore/Utilities/interface/Exception.h b/FWCore/Utilities/interface/Exception.h index f9c3e9888675d..69d323db6e0a7 100644 --- a/FWCore/Utilities/interface/Exception.h +++ b/FWCore/Utilities/interface/Exception.h @@ -41,7 +41,7 @@ #include #include -#include +#include #include "FWCore/Utilities/interface/thread_safety_macros.h" #include "FWCore/Utilities/interface/Likely.h" @@ -123,8 +123,8 @@ namespace cms { friend E& operator<<(E&& e, std::ios_base& (*f)(std::ios_base&)); template - inline void format(fmt::format_string format, Args&&... args); - inline void vformat(std::string_view fmt, fmt::format_args args); + inline void format(std::format_string format, Args&&... args); + inline void vformat(std::string_view fmt, std::format_args args); // This function is deprecated and we are in the process of removing // all code that uses it from CMSSW. It will then be deleted. @@ -153,11 +153,11 @@ namespace cms { // -------- implementation --------- template - inline void Exception::format(fmt::format_string format, Args&&... args) { - ost_ << fmt::format(std::move(format), std::forward(args)...); + inline void Exception::format(std::format_string format, Args&&... args) { + ost_ << std::format(std::move(format), std::forward(args)...); } - inline void Exception::vformat(std::string_view format, fmt::format_args args) { ost_ << fmt::vformat(format, args); } + inline void Exception::vformat(std::string_view format, std::format_args args) { ost_ << std::vformat(format, args); } template requires std::derived_from, Exception> diff --git a/FWCore/Utilities/src/Digest.cc b/FWCore/Utilities/src/Digest.cc index 08d5785f2cfc4..83664a6c60c69 100644 --- a/FWCore/Utilities/src/Digest.cc +++ b/FWCore/Utilities/src/Digest.cc @@ -1,5 +1,6 @@ #include #include +#include #include "FWCore/Utilities/interface/EDMException.h" #include "FWCore/Utilities/interface/Digest.h" diff --git a/HeterogeneousCore/AlpakaCore/plugins/ModuleTypeResolverAlpaka.cc b/HeterogeneousCore/AlpakaCore/plugins/ModuleTypeResolverAlpaka.cc index e343e7b77b6b5..3800b58f580a1 100644 --- a/HeterogeneousCore/AlpakaCore/plugins/ModuleTypeResolverAlpaka.cc +++ b/HeterogeneousCore/AlpakaCore/plugins/ModuleTypeResolverAlpaka.cc @@ -8,6 +8,7 @@ #include #include #include +#include class ModuleTypeResolverAlpaka : public edm::ModuleTypeResolverBase { public: @@ -42,7 +43,7 @@ class ModuleTypeResolverMakerAlpaka : public edm::ModuleTypeResolverMaker { if (modulePSet.existsAs("alpaka", false)) { auto const& backend = modulePSet.getUntrackedParameter("alpaka").getUntrackedParameter("backend"); - prefix = fmt::format("alpaka_{}::", backend); + prefix = std::format("alpaka_{}::", backend); LogDebug("AlpakaModuleTypeResolver") .format("AlpakaModuleTypeResolver: module {} backend prefix {}", diff --git a/HeterogeneousCore/CUDAServices/plugins/BuildFile.xml b/HeterogeneousCore/CUDAServices/plugins/BuildFile.xml index 535438b400fcd..a352551b9bfa1 100644 --- a/HeterogeneousCore/CUDAServices/plugins/BuildFile.xml +++ b/HeterogeneousCore/CUDAServices/plugins/BuildFile.xml @@ -1,6 +1,7 @@ + diff --git a/HeterogeneousCore/SonicTriton/src/TritonService.cc b/HeterogeneousCore/SonicTriton/src/TritonService.cc index d0d82bbaa9efc..c1c0b6c4a7754 100644 --- a/HeterogeneousCore/SonicTriton/src/TritonService.cc +++ b/HeterogeneousCore/SonicTriton/src/TritonService.cc @@ -24,6 +24,7 @@ #include #include #include +#include namespace tc = triton::client; @@ -385,7 +386,7 @@ void TritonService::postEndJob() { printFallbackServerLog(); if (rv != 0) { std::string stopCat("FallbackFailed"); - std::string stopMsg = fmt::format("TritonService: Stopping the fallback server failed with exit code {}", rv); + std::string stopMsg = std::format("TritonService: Stopping the fallback server failed with exit code {}", rv); //avoid throwing if the stack is already unwinding if (callFails_ > 0) edm::LogWarning(stopCat) << stopMsg; diff --git a/IOPool/Common/bin/BuildFile.xml b/IOPool/Common/bin/BuildFile.xml index d3e1983302bfc..51dbcb9ad5656 100644 --- a/IOPool/Common/bin/BuildFile.xml +++ b/IOPool/Common/bin/BuildFile.xml @@ -1,6 +1,5 @@ - diff --git a/IOPool/Common/bin/EdmProvDump.cc b/IOPool/Common/bin/EdmProvDump.cc index 1eb81558b5a37..72dc54a2c266b 100644 --- a/IOPool/Common/bin/EdmProvDump.cc +++ b/IOPool/Common/bin/EdmProvDump.cc @@ -27,7 +27,7 @@ #include "boost/program_options.hpp" -#include +#include #include #include @@ -114,7 +114,7 @@ namespace { std::string formatHeader(std::string_view text) { constexpr std::string_view decoration = "---------"; - return fmt::format("{}{}{}", decoration, text, decoration); + return std::format("{}{}{}", decoration, text, decoration); } } // namespace diff --git a/IOPool/Input/src/RootInputFileSequence.cc b/IOPool/Input/src/RootInputFileSequence.cc index e80822eeecd86..22730e8fc013f 100644 --- a/IOPool/Input/src/RootInputFileSequence.cc +++ b/IOPool/Input/src/RootInputFileSequence.cc @@ -279,11 +279,11 @@ namespace edm { throw ex; } else { exInfo.push_back("Calling RootInputFileSequence::initTheFile(): fail to open the file with name " + (*it)); - additionalMessage.push_back(fmt::format( + additionalMessage.push_back(std::format( "Input file {} could not be opened, and fallback was attempted.\nAdditional information:", *it)); char c = 'a'; for (auto const& ai : e.additionalInfo()) { - additionalMessage.push_back(fmt::format(" [{}] {}", c, ai)); + additionalMessage.push_back(std::format(" [{}] {}", c, ai)); ++c; } } diff --git a/L1Trigger/L1TGlobal/plugins/BuildFile.xml b/L1Trigger/L1TGlobal/plugins/BuildFile.xml index 3aa197fe126dc..1ab8c0bbd4e08 100644 --- a/L1Trigger/L1TGlobal/plugins/BuildFile.xml +++ b/L1Trigger/L1TGlobal/plugins/BuildFile.xml @@ -10,6 +10,7 @@ + diff --git a/RecoMTD/TrackExtender/plugins/TrackExtenderWithMTD.cc b/RecoMTD/TrackExtender/plugins/TrackExtenderWithMTD.cc index 8a14d52395e6e..651b3b40edf13 100644 --- a/RecoMTD/TrackExtender/plugins/TrackExtenderWithMTD.cc +++ b/RecoMTD/TrackExtender/plugins/TrackExtenderWithMTD.cc @@ -1,4 +1,5 @@ #include +#include #include @@ -980,12 +981,12 @@ void TrackExtenderWithMTDT::produce(edm::Event& ev, const edm:: LogTrace("TrackExtenderWithMTD") << "TrackExtenderWithMTD: tmtd " << tmtdMap << " +/- " << sigmatmtdMap << " t0 " << t0Map << " +/- " << sigmat0Map << " tof pi/K/p " << tofpiMap - << "+/-" << fmt::format("{:0.2g}", sigmatofpiMap) << " (" - << fmt::format("{:0.2g}", sigmatofpiMap / tofpiMap * 100) << "%) " << tofkMap - << "+/-" << fmt::format("{:0.2g}", sigmatofkMap) << " (" - << fmt::format("{:0.2g}", sigmatofkMap / tofkMap * 100) << "%) " << tofpMap - << "+/-" << fmt::format("{:0.2g}", sigmatofpMap) << " (" - << fmt::format("{:0.2g}", sigmatofpMap / tofpMap * 100) << "%) "; + << "+/-" << std::format("{:0.2g}", sigmatofpiMap) << " (" + << std::format("{:0.2g}", sigmatofpiMap / tofpiMap * 100) << "%) " << tofkMap + << "+/-" << std::format("{:0.2g}", sigmatofkMap) << " (" + << std::format("{:0.2g}", sigmatofkMap / tofkMap * 100) << "%) " << tofpMap + << "+/-" << std::format("{:0.2g}", sigmatofpMap) << " (" + << std::format("{:0.2g}", sigmatofpMap / tofpMap * 100) << "%) "; } else { LogTrace("TrackExtenderWithMTD") << "Error in the MTD track refitting. This should not happen"; } diff --git a/SimTracker/TrackerMaterialAnalysis/plugins/BuildFile.xml b/SimTracker/TrackerMaterialAnalysis/plugins/BuildFile.xml index 6a73331d0458c..c6e80acea3124 100644 --- a/SimTracker/TrackerMaterialAnalysis/plugins/BuildFile.xml +++ b/SimTracker/TrackerMaterialAnalysis/plugins/BuildFile.xml @@ -11,6 +11,7 @@ + @@ -28,6 +29,7 @@ + diff --git a/Utilities/StorageFactory/plugins/BuildFile.xml b/Utilities/StorageFactory/plugins/BuildFile.xml index c8791c77d1445..40b63f5bfe9c0 100644 --- a/Utilities/StorageFactory/plugins/BuildFile.xml +++ b/Utilities/StorageFactory/plugins/BuildFile.xml @@ -10,7 +10,6 @@ - diff --git a/Utilities/StorageFactory/plugins/StorageTracerProxy.cc b/Utilities/StorageFactory/plugins/StorageTracerProxy.cc index e7a74ddb91004..49cd67da24a99 100644 --- a/Utilities/StorageFactory/plugins/StorageTracerProxy.cc +++ b/Utilities/StorageFactory/plugins/StorageTracerProxy.cc @@ -14,7 +14,7 @@ #include #include -#include +#include namespace edm::storage { class StorageTracerProxy : public Storage { @@ -41,35 +41,35 @@ namespace edm::storage { using namespace std::literals::string_literals; file_.write( "# Format\n"s + "# --------\n"s + "# prefixes\n"s + "# #: comment\n"s + - fmt::format("# {}: file open\n", kOpen) + fmt::format("# {}: singular read\n", kRead) + - fmt::format("# {}: vector read\n", kReadv) + - fmt::format("# {}: vector read element of the preceding '{}' line\n", kReadvElement, kReadv) + - fmt::format("# {}: singular write\n", kWrite) + fmt::format("# {}: vector write\n", kWritev) + - fmt::format("# {}: vector write element of the preceding '{}' line\n", kWritevElement, kWritev) + - fmt::format("# {}: position (seek)\n", kPosition) + fmt::format("# {}: prefetch\n", kPrefetch) + - fmt::format("# {}: prefetch element of the preceding '{}' line\n", kPrefetch, kPrefetchElement) + - fmt::format("# {}: resize\n", kResize) + fmt::format("# {}: flush\n", kFlush) + - fmt::format("# {}: close\n", kClose) + "# --------\n"s + "# line formats\n"s + - fmt::format("# {} \n", kOpen) + - fmt::format("# {} \n", kRead) + - fmt::format( + std::format("# {}: file open\n", kOpen) + std::format("# {}: singular read\n", kRead) + + std::format("# {}: vector read\n", kReadv) + + std::format("# {}: vector read element of the preceding '{}' line\n", kReadvElement, kReadv) + + std::format("# {}: singular write\n", kWrite) + std::format("# {}: vector write\n", kWritev) + + std::format("# {}: vector write element of the preceding '{}' line\n", kWritevElement, kWritev) + + std::format("# {}: position (seek)\n", kPosition) + std::format("# {}: prefetch\n", kPrefetch) + + std::format("# {}: prefetch element of the preceding '{}' line\n", kPrefetch, kPrefetchElement) + + std::format("# {}: resize\n", kResize) + std::format("# {}: flush\n", kFlush) + + std::format("# {}: close\n", kClose) + "# --------\n"s + "# line formats\n"s + + std::format("# {} \n", kOpen) + + std::format("# {} \n", kRead) + + std::format( "# {} \n", kReadv) + - fmt::format("# {} \n", kReadvElement) + - fmt::format("# {} \n", kWrite) + - fmt::format( + std::format("# {} \n", kReadvElement) + + std::format("# {} \n", kWrite) + + std::format( "# {} \n", kWritev) + - fmt::format("# {} \n", kWritevElement) + - fmt::format("# {} \n", kPosition) + - fmt::format("# {} \n", + std::format("# {} \n", kWritevElement) + + std::format("# {} \n", kPosition) + + std::format("# {} \n", kPrefetch) + - fmt::format("# {} \n", kPrefetchElement) + - fmt::format("# {} \n", kResize) + - fmt::format("# {} \n", kFlush) + - fmt::format("# {} \n", kClose) + "# --------\n"s); + std::format("# {} \n", kPrefetchElement) + + std::format("# {} \n", kResize) + + std::format("# {} \n", kFlush) + + std::format("# {} \n", kClose) + "# --------\n"s); auto const entryId = idCounter_.fetch_add(1); - file_.write(fmt::format("{} {} {} {}\n", + file_.write(std::format("{} {} {} {}\n", kOpen, entryId, std::chrono::round(now().time_since_epoch()).count(), @@ -80,13 +80,13 @@ namespace edm::storage { IOSize read(void* into, IOSize n) override { auto const offset = baseStorage_->position(); auto const [result, message] = operate([this, into, n]() { return baseStorage_->read(into, n); }); - file_.write(fmt::format("{} {} {} {} {}\n", kRead, message, offset, n, result)); + file_.write(std::format("{} {} {} {} {}\n", kRead, message, offset, n, result)); return result; } IOSize read(void* into, IOSize n, IOOffset pos) override { auto const [result, message] = operate([this, into, n, pos]() { return baseStorage_->read(into, n, pos); }); - file_.write(fmt::format("{} {} {} {} {}\n", kRead, message, pos, n, result)); + file_.write(std::format("{} {} {} {} {}\n", kRead, message, pos, n, result)); return result; } @@ -96,11 +96,11 @@ namespace edm::storage { std::string elements; IOSize total = 0; for (IOSize i = 0; i < n; ++i) { - elements += fmt::format("{} {} {} {}\n", kReadvElement, i, offset, into[i].size()); + elements += std::format("{} {} {} {}\n", kReadvElement, i, offset, into[i].size()); total += into[i].size(); offset += into[i].size(); } - file_.write(fmt::format("{} {} {} {} {}\n", kReadv, message, total, result, n) + elements); + file_.write(std::format("{} {} {} {} {}\n", kReadv, message, total, result, n) + elements); return result; } @@ -109,23 +109,23 @@ namespace edm::storage { std::string elements; IOSize total = 0; for (IOSize i = 0; i < n; ++i) { - elements += fmt::format("{} {} {} {}\n", kReadvElement, i, into[i].offset(), into[i].size()); + elements += std::format("{} {} {} {}\n", kReadvElement, i, into[i].offset(), into[i].size()); total += into[i].size(); } - file_.write(fmt::format("{} {} {} {} {}\n", kReadv, message, total, result, n) + elements); + file_.write(std::format("{} {} {} {} {}\n", kReadv, message, total, result, n) + elements); return result; } IOSize write(const void* from, IOSize n) override { auto const offset = baseStorage_->position(); auto const [result, message] = operate([this, from, n]() { return baseStorage_->write(from, n); }); - file_.write(fmt::format("{} {} {} {} {}\n", kWrite, message, offset, n, result)); + file_.write(std::format("{} {} {} {} {}\n", kWrite, message, offset, n, result)); return result; } IOSize write(const void* from, IOSize n, IOOffset pos) override { auto const [result, message] = operate([this, from, n, pos]() { return baseStorage_->write(from, n, pos); }); - file_.write(fmt::format("{} {} {} {} {}\n", kWrite, message, pos, n, result)); + file_.write(std::format("{} {} {} {} {}\n", kWrite, message, pos, n, result)); return result; } @@ -135,11 +135,11 @@ namespace edm::storage { std::string elements; IOSize total = 0; for (IOSize i = 0; i < n; ++i) { - elements += fmt::format("{} {} {} {}\n", kWritevElement, i, offset, from[i].size()); + elements += std::format("{} {} {} {}\n", kWritevElement, i, offset, from[i].size()); total += from[i].size(); offset += from[i].size(); } - file_.write(fmt::format("{} {} {} {} {}\n", kWritev, message, total, result, n) + elements); + file_.write(std::format("{} {} {} {} {}\n", kWritev, message, total, result, n) + elements); return result; } @@ -148,33 +148,33 @@ namespace edm::storage { std::string elements; IOSize total = 0; for (IOSize i = 0; i < n; ++i) { - elements += fmt::format("{} {} {} {}\n", kWritevElement, i, from[i].offset(), from[i].size()); + elements += std::format("{} {} {} {}\n", kWritevElement, i, from[i].offset(), from[i].size()); total += from[i].size(); } - file_.write(fmt::format("{} {} {} {} {}\n", kWritev, message, total, result, n) + elements); + file_.write(std::format("{} {} {} {} {}\n", kWritev, message, total, result, n) + elements); return result; } IOOffset position(IOOffset offset, Relative whence) override { auto const [result, message] = operate([this, offset, whence]() { return baseStorage_->position(offset, whence); }); - file_.write(fmt::format("{} {} {} {}\n", kPosition, message, offset, static_cast(whence))); + file_.write(std::format("{} {} {} {}\n", kPosition, message, offset, static_cast(whence))); return result; } void resize(IOOffset size) override { auto const message = operate([this, size]() { return baseStorage_->resize(size); }); - file_.write(fmt::format("{} {} {}\n", kResize, message, size)); + file_.write(std::format("{} {} {}\n", kResize, message, size)); } void flush() override { auto const message = operate([this]() { return baseStorage_->flush(); }); - file_.write(fmt::format("{} {}\n", kFlush, message)); + file_.write(std::format("{} {}\n", kFlush, message)); } void close() override { auto const message = operate([this]() { return baseStorage_->close(); }); - file_.write(fmt::format("{} {}\n", kClose, message)); + file_.write(std::format("{} {}\n", kClose, message)); } bool prefetch(const IOPosBuffer* what, IOSize n) override { @@ -182,10 +182,10 @@ namespace edm::storage { std::string elements; IOSize total = 0; for (IOSize i = 0; i < n; ++i) { - elements += fmt::format("{} {} {} {}\n", kPrefetchElement, i, what[i].offset(), what[i].size()); + elements += std::format("{} {} {} {}\n", kPrefetchElement, i, what[i].offset(), what[i].size()); total += what[i].size(); } - file_.write(fmt::format("{} {} {} {} {}\n", kPrefetch, message, total, n, value) + elements); + file_.write(std::format("{} {} {} {} {}\n", kPrefetch, message, total, n, value) + elements); return value; } @@ -198,7 +198,7 @@ namespace edm::storage { auto const end = now(); LogTrace("IOTrace").format("IOTrace {} id {}", traceId_, id); return std::tuple(result, - fmt::format("{} {} {}", + std::format("{} {} {}", id, std::chrono::round(begin.time_since_epoch()).count(), std::chrono::round(end - begin).count())); @@ -212,7 +212,7 @@ namespace edm::storage { func(); auto const end = now(); LogTrace("IOTrace").format("IOTrace {} id {}", traceId_, id); - return fmt::format("{} {} {}", + return std::format("{} {} {}", id, std::chrono::round(begin.time_since_epoch()).count(), std::chrono::round(end - begin).count()); diff --git a/Validation/RecoJets/plugins/JetTester.cc b/Validation/RecoJets/plugins/JetTester.cc index 622854757e82d..5d3e896ae9db6 100644 --- a/Validation/RecoJets/plugins/JetTester.cc +++ b/Validation/RecoJets/plugins/JetTester.cc @@ -6,6 +6,7 @@ #include "JetTester.h" #include +#include using namespace edm; using namespace reco; @@ -459,59 +460,59 @@ void JetTester::bookHistograms(DQMStore::IBooker& ibooker, edm::Run const& iRun, const auto& [etaRegion, etaLabel, etaMin, etaMax] = etaInfo[j]; mNJets_EtaBins[j] = ibooker.book1D( - fmt::format("NJets_{}", etaRegion), - fmt::format("Number of jets p_{{T}}>{} GeV - {};# jets;# events", int(mRecoJetPtThreshold), etaLabel), + std::format("NJets_{}", etaRegion), + std::format("Number of jets p_{{T}}>{} GeV - {};# jets;# events", int(mRecoJetPtThreshold), etaLabel), 15, 0, 15); mGenPt_EtaBins[j] = ibooker.book1D( - fmt::format("GenPt_{}", etaRegion), - fmt::format("Gen Jets p_{{T}}>{} GeV - {};p_{{T}} [GeV];# jets", int(mMatchGenPtThreshold), etaLabel), + std::format("GenPt_{}", etaRegion), + std::format("Gen Jets p_{{T}}>{} GeV - {};p_{{T}} [GeV];# jets", int(mMatchGenPtThreshold), etaLabel), n_PtBins, PtRange[0], PtRange[1]); mJetPt_EtaBins[j] = ibooker.book1D( - fmt::format("JetPt_{}", etaRegion), - fmt::format("Reco Jets p_{{T}}>{} GeV - {};p_{{T}} [GeV];# jets", int(mRecoJetPtThreshold), etaLabel), + std::format("JetPt_{}", etaRegion), + std::format("Reco Jets p_{{T}}>{} GeV - {};p_{{T}} [GeV];# jets", int(mRecoJetPtThreshold), etaLabel), n_PtBins, PtRange[0], PtRange[1]); - mMatchedJetPt_EtaBins[j] = ibooker.book1D(fmt::format("MatchedJetPt_{}", etaRegion), - fmt::format("Matched Jets - {};p_{{T}} [GeV];# jets", etaLabel), + mMatchedJetPt_EtaBins[j] = ibooker.book1D(std::format("MatchedJetPt_{}", etaRegion), + std::format("Matched Jets - {};p_{{T}} [GeV];# jets", etaLabel), n_PtBins, PtRange[0], PtRange[1]); - mMatchedGenPt_EtaBins[j] = ibooker.book1D(fmt::format("MatchedGenPt_{}", etaRegion), - fmt::format("Matched Gen Jets - {};p_{{T}} [GeV];# jets", etaLabel), + mMatchedGenPt_EtaBins[j] = ibooker.book1D(std::format("MatchedGenPt_{}", etaRegion), + std::format("Matched Gen Jets - {};p_{{T}} [GeV];# jets", etaLabel), n_PtBins, PtRange[0], PtRange[1]); mDuplicatesGenPt_EtaBins[j] = - ibooker.book1D(fmt::format("DuplicatesGenPt_{}", etaRegion), - fmt::format("Reco jets matched to multiple gen jets [{}];p_{{T}} [GeV];# Duplicates", etaLabel), + ibooker.book1D(std::format("DuplicatesGenPt_{}", etaRegion), + std::format("Reco jets matched to multiple gen jets [{}];p_{{T}} [GeV];# Duplicates", etaLabel), n_PtBins, PtRange[0], PtRange[1]); mDuplicatesJetPt_EtaBins[j] = - ibooker.book1D(fmt::format("DuplicatesJetPt_{}", etaRegion), - fmt::format("Gen jets matched to multiple reco jets [{}];p_{{T}} [GeV];# Duplicates", etaLabel), + ibooker.book1D(std::format("DuplicatesJetPt_{}", etaRegion), + std::format("Gen jets matched to multiple reco jets [{}];p_{{T}} [GeV];# Duplicates", etaLabel), n_PtBins, PtRange[0], PtRange[1]); h_JetPtRecoOverGen[j] = - ibooker.book1D(fmt::format("h_PtRecoOverGen_{}", etaRegion), - fmt::format("Response Reco Jets - {};p_{{T}}^{{reco}}/p_{{T}}^{{gen}};# jets", etaLabel), + ibooker.book1D(std::format("h_PtRecoOverGen_{}", etaRegion), + std::format("Response Reco Jets - {};p_{{T}}^{{reco}}/p_{{T}}^{{gen}};# jets", etaLabel), n_RespBins, RespRange[0], RespRange[1]); h2d_JetPtRecoOverGen_vs_GenPhi_EtaBins[j] = - ibooker.book2D(fmt::format("h2d_PtRecoOverGen_GenPhi_{}", etaRegion), - fmt::format("Response Reco Jets - {};#phi^{{gen}};p_{{T}}^{{reco}}/p_{{T}}^{{gen}}", etaLabel), + ibooker.book2D(std::format("h2d_PtRecoOverGen_GenPhi_{}", etaRegion), + std::format("Response Reco Jets - {};#phi^{{gen}};p_{{T}}^{{reco}}/p_{{T}}^{{gen}}", etaLabel), n_PhiBins, PhiRange[0], PhiRange[1], @@ -519,8 +520,8 @@ void JetTester::bookHistograms(DQMStore::IBooker& ibooker, edm::Run const& iRun, RespRange[0], RespRange[1]); h2d_JetPtRecoOverGen_vs_GenPt_EtaBins[j] = ibooker.book2D( - fmt::format("h2d_PtRecoOverGen_GenPt_{}", etaRegion), - fmt::format("Response Reco Jets - {};p_{{T}}^{{gen}};p_{{T}}^{{reco}}/p_{{T}}^{{gen}}", etaLabel), + std::format("h2d_PtRecoOverGen_GenPt_{}", etaRegion), + std::format("Response Reco Jets - {};p_{{T}}^{{gen}};p_{{T}}^{{reco}}/p_{{T}}^{{gen}}", etaLabel), n_PtBins, PtRange[0], PtRange[1], @@ -529,8 +530,8 @@ void JetTester::bookHistograms(DQMStore::IBooker& ibooker, edm::Run const& iRun, RespRange[1]); h2d_chHadMult_vs_pt[j] = ibooker.book2D( - fmt::format("h2d_chHadMult_pt_{}", etaRegion), - fmt::format("Profiled charged HAD multiplicity - {};p_{{T}}^{{reco}};charged HAD multiplicity", etaLabel), + std::format("h2d_chHadMult_pt_{}", etaRegion), + std::format("Profiled charged HAD multiplicity - {};p_{{T}}^{{reco}};charged HAD multiplicity", etaLabel), n_PtBins, PtRange[0], PtRange[1], @@ -538,8 +539,8 @@ void JetTester::bookHistograms(DQMStore::IBooker& ibooker, edm::Run const& iRun, 0, 50); h2d_neHadMult_vs_pt[j] = ibooker.book2D( - fmt::format("h2d_neHadMult_pt_{}", etaRegion), - fmt::format("Profiled neutral HAD multiplicity - {};p_{{T}}^{{reco}};neutral HAD multiplicity", etaLabel), + std::format("h2d_neHadMult_pt_{}", etaRegion), + std::format("Profiled neutral HAD multiplicity - {};p_{{T}}^{{reco}};neutral HAD multiplicity", etaLabel), n_PtBins, PtRange[0], PtRange[1], @@ -547,8 +548,8 @@ void JetTester::bookHistograms(DQMStore::IBooker& ibooker, edm::Run const& iRun, 0, 50); h2d_chMult_vs_pt[j] = ibooker.book2D( - fmt::format("h2d_chMult_pt_{}", etaRegion), - fmt::format("Profiled charged multiplicity - {};p_{{T}}^{{reco}};charged multiplicity", etaLabel), + std::format("h2d_chMult_pt_{}", etaRegion), + std::format("Profiled charged multiplicity - {};p_{{T}}^{{reco}};charged multiplicity", etaLabel), n_PtBins, PtRange[0], PtRange[1], @@ -556,8 +557,8 @@ void JetTester::bookHistograms(DQMStore::IBooker& ibooker, edm::Run const& iRun, 0, 50); h2d_neMult_vs_pt[j] = ibooker.book2D( - fmt::format("h2d_neMult_pt_{}", etaRegion), - fmt::format("Profiled neutral multiplicity - {};p_{{T}}^{{reco}};neutral EM multiplicity", etaLabel), + std::format("h2d_neMult_pt_{}", etaRegion), + std::format("Profiled neutral multiplicity - {};p_{{T}}^{{reco}};neutral EM multiplicity", etaLabel), n_PtBins, PtRange[0], PtRange[1], @@ -565,8 +566,8 @@ void JetTester::bookHistograms(DQMStore::IBooker& ibooker, edm::Run const& iRun, 0, 50); h2d_phoMult_vs_pt[j] = - ibooker.book2D(fmt::format("h2d_phoMult_pt_{}", etaRegion), - fmt::format("Profiled photon multiplicity - {};p_{{T}}^{{reco}};photon multiplicity", etaLabel), + ibooker.book2D(std::format("h2d_phoMult_pt_{}", etaRegion), + std::format("Profiled photon multiplicity - {};p_{{T}}^{{reco}};photon multiplicity", etaLabel), n_PtBins, PtRange[0], PtRange[1], @@ -575,8 +576,8 @@ void JetTester::bookHistograms(DQMStore::IBooker& ibooker, edm::Run const& iRun, 15); h2d_chHad_vs_pt[j] = ibooker.book2D( - fmt::format("h2d_chHad_pt_{}", etaRegion), - fmt::format("Profiled charged HAD energy fraction - {};p_{{T}}^{{reco}};charged HAD energy fraction", etaLabel), + std::format("h2d_chHad_pt_{}", etaRegion), + std::format("Profiled charged HAD energy fraction - {};p_{{T}}^{{reco}};charged HAD energy fraction", etaLabel), n_PtBins, PtRange[0], PtRange[1], @@ -584,8 +585,8 @@ void JetTester::bookHistograms(DQMStore::IBooker& ibooker, edm::Run const& iRun, 0, 1); h2d_neHad_vs_pt[j] = ibooker.book2D( - fmt::format("h2d_neHad_pt_{}", etaRegion), - fmt::format("Profiled neutral HAD energy fraction - {};p_{{T}}^{{reco}};neutral HAD energy fraction", etaLabel), + std::format("h2d_neHad_pt_{}", etaRegion), + std::format("Profiled neutral HAD energy fraction - {};p_{{T}}^{{reco}};neutral HAD energy fraction", etaLabel), n_PtBins, PtRange[0], PtRange[1], @@ -593,8 +594,8 @@ void JetTester::bookHistograms(DQMStore::IBooker& ibooker, edm::Run const& iRun, 0, 1); h2d_chEm_vs_pt[j] = ibooker.book2D( - fmt::format("h2d_chEm_pt_{}", etaRegion), - fmt::format("Profiled charged EM energy fraction - {};p_{{T}}^{{reco}};charged EM energy fraction", etaLabel), + std::format("h2d_chEm_pt_{}", etaRegion), + std::format("Profiled charged EM energy fraction - {};p_{{T}}^{{reco}};charged EM energy fraction", etaLabel), n_PtBins, PtRange[0], PtRange[1], @@ -602,8 +603,8 @@ void JetTester::bookHistograms(DQMStore::IBooker& ibooker, edm::Run const& iRun, 0, 1); h2d_neEm_vs_pt[j] = ibooker.book2D( - fmt::format("h2d_neEm_pt_{}", etaRegion), - fmt::format("Profiled neutral EM energy fraction - {};p_{{T}}^{{reco}};neutral EM energy fraction", etaLabel), + std::format("h2d_neEm_pt_{}", etaRegion), + std::format("Profiled neutral EM energy fraction - {};p_{{T}}^{{reco}};neutral EM energy fraction", etaLabel), n_PtBins, PtRange[0], PtRange[1], @@ -612,8 +613,8 @@ void JetTester::bookHistograms(DQMStore::IBooker& ibooker, edm::Run const& iRun, 1); h2d_JetPtRecoOverGen_vs_chHad[j] = ibooker.book2D( - fmt::format("h2d_PtRecoOverGen_chHad_{}", etaRegion), - fmt::format("Response Reco Jets - {};charged HAD energy Fraction;p_{{T}}^{{reco}}/p_{{T}}^{{gen}}", etaLabel), + std::format("h2d_PtRecoOverGen_chHad_{}", etaRegion), + std::format("Response Reco Jets - {};charged HAD energy Fraction;p_{{T}}^{{reco}}/p_{{T}}^{{gen}}", etaLabel), 30, 0, 1, @@ -621,8 +622,8 @@ void JetTester::bookHistograms(DQMStore::IBooker& ibooker, edm::Run const& iRun, RespRange[0], RespRange[1]); h2d_JetPtRecoOverGen_vs_neHad[j] = ibooker.book2D( - fmt::format("h2d_PtRecoOverGen_neHad_{}", etaRegion), - fmt::format("Response Reco Jets - {};neutral HAD energy Fraction;p_{{T}}^{{reco}}/p_{{T}}^{{gen}}", etaLabel), + std::format("h2d_PtRecoOverGen_neHad_{}", etaRegion), + std::format("Response Reco Jets - {};neutral HAD energy Fraction;p_{{T}}^{{reco}}/p_{{T}}^{{gen}}", etaLabel), 30, 0, 1, @@ -630,8 +631,8 @@ void JetTester::bookHistograms(DQMStore::IBooker& ibooker, edm::Run const& iRun, RespRange[0], RespRange[1]); h2d_JetPtRecoOverGen_vs_chEm[j] = ibooker.book2D( - fmt::format("h2d_PtRecoOverGen_chEm_{}", etaRegion), - fmt::format("Response Reco Jets - {};charged EM energy Fraction;p_{{T}}^{{reco}}/p_{{T}}^{{gen}}", etaLabel), + std::format("h2d_PtRecoOverGen_chEm_{}", etaRegion), + std::format("Response Reco Jets - {};charged EM energy Fraction;p_{{T}}^{{reco}}/p_{{T}}^{{gen}}", etaLabel), 30, 0, 1, @@ -639,8 +640,8 @@ void JetTester::bookHistograms(DQMStore::IBooker& ibooker, edm::Run const& iRun, RespRange[0], RespRange[1]); h2d_JetPtRecoOverGen_vs_neEm[j] = ibooker.book2D( - fmt::format("h2d_PtRecoOverGen_neEm_{}", etaRegion), - fmt::format("Response Reco Jets - {};neutral EM energy Fraction;p_{{T}}^{{reco}}/p_{{T}}^{{gen}}", etaLabel), + std::format("h2d_PtRecoOverGen_neEm_{}", etaRegion), + std::format("Response Reco Jets - {};neutral EM energy Fraction;p_{{T}}^{{reco}}/p_{{T}}^{{gen}}", etaLabel), 30, 0, 1, @@ -648,8 +649,8 @@ void JetTester::bookHistograms(DQMStore::IBooker& ibooker, edm::Run const& iRun, RespRange[0], RespRange[1]); h2d_JetPtRecoOverGen_vs_nCost[j] = - ibooker.book2D(fmt::format("h2d_PtRecoOverGen_nCost_{}", etaRegion), - fmt::format("Response Reco Jets - {};# constituents;p_{{T}}^{{reco}}/p_{{T}}^{{gen}}", etaLabel), + ibooker.book2D(std::format("h2d_PtRecoOverGen_nCost_{}", etaRegion), + std::format("Response Reco Jets - {};# constituents;p_{{T}}^{{reco}}/p_{{T}}^{{gen}}", etaLabel), 100, 0, 100, @@ -660,9 +661,9 @@ void JetTester::bookHistograms(DQMStore::IBooker& ibooker, edm::Run const& iRun, for (int i = 0; i < ptSize; ++i) { int ptMin = int(ptBins_[i]); int ptMax = int(ptBins_[i + 1]); - auto h_name_RoG = fmt::format("h_PtRecoOverGen_{}_Pt{}_{}", etaRegion, ptMin, ptMax); + auto h_name_RoG = std::format("h_PtRecoOverGen_{}_Pt{}_{}", etaRegion, ptMin, ptMax); auto h_title_RoG = - fmt::format("Response Reco Jets - {} - {}{} GeV - {};p_{{T}} [GeV];# jets", int(mRecoJetPtThreshold), etaLabel), + std::format("CorrJetPt_{}", etaRegion), + std::format("Corr Jets p_{{T}}>{} GeV - {};p_{{T}} [GeV];# jets", int(mRecoJetPtThreshold), etaLabel), n_PtBins, PtRange[0], PtRange[1]); - mMatchedCorrPt_EtaBins[j] = ibooker.book1D(fmt::format("MatchedCorrPt_{}", etaRegion), - fmt::format("Matched Corr Jets - {};p_{{T}} [GeV];# jets", etaLabel), + mMatchedCorrPt_EtaBins[j] = ibooker.book1D(std::format("MatchedCorrPt_{}", etaRegion), + std::format("Matched Corr Jets - {};p_{{T}} [GeV];# jets", etaLabel), n_PtBins, PtRange[0], PtRange[1]); h_JetPtCorrOverGen[j] = - ibooker.book1D(fmt::format("h_JetPtCorrOverGen_{}", etaRegion), - fmt::format("Response Corr Jets - {};p_{{T}}^{{corr}}/p_{{T}}^{{gen}};# jets", etaLabel), + ibooker.book1D(std::format("h_JetPtCorrOverGen_{}", etaRegion), + std::format("Response Corr Jets - {};p_{{T}}^{{corr}}/p_{{T}}^{{gen}};# jets", etaLabel), n_RespBins, RespRange[0], RespRange[1]); h_JetPtCorrOverReco[j] = - ibooker.book1D(fmt::format("h_JetPtCorrOverReco_{}", etaRegion), - fmt::format("Response Corr Jets - {};p_{{T}}^{{corr}}/p_{{T}}^{{reco}};# jets", etaLabel), + ibooker.book1D(std::format("h_JetPtCorrOverReco_{}", etaRegion), + std::format("Response Corr Jets - {};p_{{T}}^{{corr}}/p_{{T}}^{{reco}};# jets", etaLabel), n_RespBins, RespRange[0], RespRange[1]); h2d_JetPtCorrOverGen_vs_GenPhi_EtaBins[j] = - ibooker.book2D(fmt::format("h2d_PtCorrOverGen_GenPhi_{}", etaRegion), - fmt::format("Response Corr Jets - {};#phi^{{gen}};p_{{T}}^{{corr}}/p_{{T}}^{{gen}}", etaLabel), + ibooker.book2D(std::format("h2d_PtCorrOverGen_GenPhi_{}", etaRegion), + std::format("Response Corr Jets - {};#phi^{{gen}};p_{{T}}^{{corr}}/p_{{T}}^{{gen}}", etaLabel), n_PhiBins, PhiRange[0], PhiRange[1], @@ -819,8 +820,8 @@ void JetTester::bookHistograms(DQMStore::IBooker& ibooker, edm::Run const& iRun, RespRange[0], RespRange[1]); h2d_JetPtCorrOverGen_vs_GenPt_EtaBins[j] = ibooker.book2D( - fmt::format("h2d_PtCorrOverGen_GenPt_{}", etaRegion), - fmt::format("Response Corr Jets - {};p_{{T}}^{{gen}};p_{{T}}^{{corr}}/p_{{T}}^{{gen}}", etaLabel), + std::format("h2d_PtCorrOverGen_GenPt_{}", etaRegion), + std::format("Response Corr Jets - {};p_{{T}}^{{gen}};p_{{T}}^{{corr}}/p_{{T}}^{{gen}}", etaLabel), n_PtBins, PtRange[0], PtRange[1], @@ -828,8 +829,8 @@ void JetTester::bookHistograms(DQMStore::IBooker& ibooker, edm::Run const& iRun, RespRange[0], RespRange[1]); h2d_JetPtCorrOverReco_vs_Phi_EtaBins[j] = ibooker.book2D( - fmt::format("h2d_PtCorrOverReco_Phi_{}", etaRegion), - fmt::format("Response Corr Jets - {};#phi^{{reco}};p_{{T}}^{{corr}}/p_{{T}}^{{reco}}", etaLabel), + std::format("h2d_PtCorrOverReco_Phi_{}", etaRegion), + std::format("Response Corr Jets - {};#phi^{{reco}};p_{{T}}^{{corr}}/p_{{T}}^{{reco}}", etaLabel), n_PhiBins, PhiRange[0], PhiRange[1], @@ -837,8 +838,8 @@ void JetTester::bookHistograms(DQMStore::IBooker& ibooker, edm::Run const& iRun, RespRange[0], RespRange[1]); h2d_JetPtCorrOverReco_vs_Pt_EtaBins[j] = ibooker.book2D( - fmt::format("h2d_PtCorrOverReco_Pt_{}", etaRegion), - fmt::format("Response Corr Jets - {};p_{{T}}^{{reco}};p_{{T}}^{{corr}}/p_{{T}}^{{reco}}", etaLabel), + std::format("h2d_PtCorrOverReco_Pt_{}", etaRegion), + std::format("Response Corr Jets - {};p_{{T}}^{{reco}};p_{{T}}^{{corr}}/p_{{T}}^{{reco}}", etaLabel), n_PtBins, PtRange[0], PtRange[1], @@ -849,18 +850,18 @@ void JetTester::bookHistograms(DQMStore::IBooker& ibooker, edm::Run const& iRun, for (int i = 0; i < ptSize; ++i) { double ptMin = ptBins_[i]; double ptMax = ptBins_[i + 1]; - auto h_name_CoG = fmt::format("h_PtCorrOverGen_{}_Pt{}_{}", etaRegion, ptMin, ptMax); + auto h_name_CoG = std::format("h_PtCorrOverGen_{}_Pt{}_{}", etaRegion, ptMin, ptMax); auto h_title_CoG = - fmt::format("Response Corr Jets - {} - {}{} GeV;# jets;# events", mRecoJetPtThreshold), 15, 0, 15); + "NJets", std::format("Number of jets p_{{T}}>{} GeV;# jets;# events", mRecoJetPtThreshold), 15, 0, 15); mNJetsPt1 = ibooker.bookProfile( "NJetsPt1", "Number of jets above Pt threshold;p_{T} [GeV];# jets", 100, 0, 200, 100, 0, 50, "s"); mNJetsPt2 = ibooker.bookProfile( @@ -971,26 +972,26 @@ void JetTester::bookHistograms(DQMStore::IBooker& ibooker, edm::Run const& iRun, for (size_t j = 0; j < etaInfo.size(); ++j) { const auto& [etaRegion, etaLabel, etaMin, etaMax] = etaInfo[j]; photonMultiplicity_EtaBins[j] = ibooker.book1D( - fmt::format("photonMultiplicity_{}", etaRegion), fmt::format("photonMultiplicity_{}", etaRegion), 15, 0, 15); - electronMultiplicity_EtaBins[j] = ibooker.book1D(fmt::format("electronMultiplicity_{}", etaRegion), - fmt::format("electronMultiplicity_{}", etaRegion), + std::format("photonMultiplicity_{}", etaRegion), std::format("photonMultiplicity_{}", etaRegion), 15, 0, 15); + electronMultiplicity_EtaBins[j] = ibooker.book1D(std::format("electronMultiplicity_{}", etaRegion), + std::format("electronMultiplicity_{}", etaRegion), 15, 0, 15); - neutralHadronMultiplicity_EtaBins[j] = ibooker.book1D(fmt::format("neutralHadronMultiplicity_{}", etaRegion), - fmt::format("neutralHadronMultiplicity_{}", etaRegion), + neutralHadronMultiplicity_EtaBins[j] = ibooker.book1D(std::format("neutralHadronMultiplicity_{}", etaRegion), + std::format("neutralHadronMultiplicity_{}", etaRegion), 50, 0, 50); neutralMultiplicity_EtaBins[j] = ibooker.book1D( - fmt::format("neutralMultiplicity_{}", etaRegion), fmt::format("neutralMultiplicity_{}", etaRegion), 50, 0, 50); - chargedHadronMultiplicity_EtaBins[j] = ibooker.book1D(fmt::format("chargedHadronMultiplicity_{}", etaRegion), - fmt::format("chargedHadronMultiplicity_{}", etaRegion), + std::format("neutralMultiplicity_{}", etaRegion), std::format("neutralMultiplicity_{}", etaRegion), 50, 0, 50); + chargedHadronMultiplicity_EtaBins[j] = ibooker.book1D(std::format("chargedHadronMultiplicity_{}", etaRegion), + std::format("chargedHadronMultiplicity_{}", etaRegion), 50, 0, 50); - chargedMultiplicity_EtaBins[j] = ibooker.book1D(fmt::format("chargedMultiplicity_{}", etaRegion), - fmt::format("chargedMultiplicity_{}", etaRegion), + chargedMultiplicity_EtaBins[j] = ibooker.book1D(std::format("chargedMultiplicity_{}", etaRegion), + std::format("chargedMultiplicity_{}", etaRegion), 100, 0, 100); diff --git a/Validation/RecoMET/plugins/METTester.cc b/Validation/RecoMET/plugins/METTester.cc index 02e2c54eb1f1e..74ec29f5a881e 100644 --- a/Validation/RecoMET/plugins/METTester.cc +++ b/Validation/RecoMET/plugins/METTester.cc @@ -1,4 +1,5 @@ #include "METTester.h" +#include using namespace reco; using namespace std; @@ -98,7 +99,7 @@ std::string METTester::binStr(float left, float right, bool roundInt) { if (roundInt) { out = std::to_string((int)left) + "to" + std::to_string((int)right); } else { - out = fmt::format("{:.2f}", left) + "to" + fmt::format("{:.2f}", right); + out = std::format("{:.2f}", left) + "to" + std::format("{:.2f}", right); std::replace(out.begin(), out.end(), '.', 'p'); } return out;