Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Migrate HLTrigerOffline from boost::format to {fmt} #30859

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
4 changes: 2 additions & 2 deletions HLTriggerOffline/Egamma/interface/EmDQMReco.h
Expand Up @@ -52,8 +52,8 @@ class EmDQMReco : public DQMEDAnalyzer {
class FourVectorMonitorElements {
public:
/** @param histogramNameTemplate should be a format string (like used in
* printf(..) or boost::format(..) for the histogram NAME where the first %s
* is replaced with et,eta or phi.
* printf(..) for the histogram NAME where the first %s is replaced with
* et,eta or phi.
*
* @param histogramTitleTemplate should be a format string (see
* histogramNameTemplate) for the histogram TITLE where the first %s is
Expand Down
65 changes: 32 additions & 33 deletions HLTriggerOffline/Egamma/src/EmDQMReco.cc
@@ -1,45 +1,44 @@
////////////////////////////////////////////////////////////////////////////
#include <iostream>
#include <string>

#include <fmt/printf.h>

////////////////////////////////////////////////////////////////////////////////
// Root include files //
////////////////////////////////////////////////////////////////////////////////
#include <TDirectory.h>
#include <TFile.h>
#include <TH1F.h>
#include <Math/VectorUtil.h>

////////////////////////////////////////////////////////////////////////////////
// Header file for this //
////////////////////////////////////////////////////////////////////////////////
#include "HLTriggerOffline/Egamma/interface/EmDQMReco.h"

////////////////////////////////////////////////////////////////////////////////
// Collaborating Class Header //
////////////////////////////////////////////////////////////////////////////////
#include "DataFormats/EgammaCandidates/interface/Electron.h"
#include "DataFormats/HLTReco/interface/TriggerEventWithRefs.h"
#include "DataFormats/RecoCandidate/interface/RecoEcalCandidate.h"
#include "FWCore/Framework/interface/Frameworkfwd.h"
#include "FWCore/Framework/interface/MakerMacros.h"
#include "FWCore/ParameterSet/interface/ParameterSet.h"
//#include "DataFormats/EgammaCandidates/interface/PhotonFwd.h"
//#include "DataFormats/EgammaCandidates/interface/Photon.h"
#include "DataFormats/L1Trigger/interface/L1EmParticle.h"
#include "DataFormats/L1Trigger/interface/L1EmParticleFwd.h"
//#include "SimDataFormats/HepMCProduct/interface/HepMCProduct.h"
#include "DataFormats/Common/interface/AssociationMap.h"
#include "FWCore/MessageLogger/interface/MessageLogger.h"
#include "SimDataFormats/GeneratorProducts/interface/HepMCProduct.h"

#include "DataFormats/Common/interface/Handle.h"
#include "DataFormats/Common/interface/RefToBase.h"
#include "FWCore/ServiceRegistry/interface/Service.h"
//#include "PhysicsTools/UtilAlgos/interface/TFileService.h"
#include "DataFormats/Common/interface/TriggerResults.h"
#include "DataFormats/EgammaCandidates/interface/Electron.h"
#include "DataFormats/HLTReco/interface/TriggerEvent.h"
#include "DataFormats/HLTReco/interface/TriggerEventWithRefs.h"
#include "DataFormats/HLTReco/interface/TriggerObject.h"
#include "DataFormats/HLTReco/interface/TriggerTypeDefs.h"
#include "DataFormats/L1Trigger/interface/L1EmParticle.h"
#include "DataFormats/L1Trigger/interface/L1EmParticleFwd.h"
#include "DataFormats/RecoCandidate/interface/RecoEcalCandidate.h"
#include "FWCore/Framework/interface/Frameworkfwd.h"
#include "FWCore/Framework/interface/MakerMacros.h"
#include "FWCore/MessageLogger/interface/MessageLogger.h"
#include "FWCore/ParameterSet/interface/ParameterSet.h"
#include "FWCore/ServiceRegistry/interface/Service.h"
#include "FWCore/Utilities/interface/Exception.h"
#include <boost/format.hpp>
////////////////////////////////////////////////////////////////////////////////
// Root include files //
////////////////////////////////////////////////////////////////////////////////
#include "TDirectory.h"
#include "TFile.h"
#include "TH1F.h"
#include <Math/VectorUtil.h>
#include <iostream>
#include <string>
#include "SimDataFormats/GeneratorProducts/interface/HepMCProduct.h"

using namespace ROOT::Math::VectorUtil;

//----------------------------------------------------------------------
Expand All @@ -55,20 +54,20 @@ EmDQMReco::FourVectorMonitorElements::FourVectorMonitorElements(EmDQMReco *_pare
std::string histTitle;

// et
histName = boost::str(boost::format(histogramNameTemplate) % "et");
histTitle = boost::str(boost::format(histogramTitleTemplate) % "E_{T}");
histName = fmt::sprintf(histogramNameTemplate, "et");
histTitle = fmt::sprintf(histogramTitleTemplate, "E_{T}");
etMonitorElement =
iBooker.book1D(histName.c_str(), histTitle.c_str(), parent->plotBins, parent->plotPtMin, parent->plotPtMax);

// eta
histName = boost::str(boost::format(histogramNameTemplate) % "eta");
histTitle = boost::str(boost::format(histogramTitleTemplate) % "#eta");
histName = fmt::sprintf(histogramNameTemplate, "eta");
histTitle = fmt::sprintf(histogramTitleTemplate, "#eta");
etaMonitorElement =
iBooker.book1D(histName.c_str(), histTitle.c_str(), parent->plotBins, -parent->plotEtaMax, parent->plotEtaMax);

// phi
histName = boost::str(boost::format(histogramNameTemplate) % "phi");
histTitle = boost::str(boost::format(histogramTitleTemplate) % "#phi");
histName = fmt::sprintf(histogramNameTemplate, "phi");
histTitle = fmt::sprintf(histogramTitleTemplate, "#phi");
phiMonitorElement =
iBooker.book1D(histName.c_str(), histTitle.c_str(), parent->plotBins, -parent->plotPhiMax, parent->plotPhiMax);
}
Expand Down