Skip to content

Commit

Permalink
Merge pull request #34131 from smuzaffar/12_0-codechecks-DQM
Browse files Browse the repository at this point in the history
[DQM] Apply code-checks/format
  • Loading branch information
cmsbuild authored Jun 16, 2021
2 parents 1b9f5d6 + c6d47c0 commit 6fba119
Show file tree
Hide file tree
Showing 9 changed files with 29 additions and 29 deletions.
2 changes: 1 addition & 1 deletion DQM/TrackerRemapper/interface/Phase1PixelSummaryMap.h
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ namespace Ph1PMapSummaryHelper {
//============================================================================
// utility to tokenize std::string
//============================================================================
std::vector<std::string> tokenize(std::string line, char delimiter) {
inline std::vector<std::string> tokenize(std::string line, char delimiter) {
// Vector of string to save tokens
std::vector<std::string> tokens;
std::stringstream check1(line);
Expand Down
2 changes: 1 addition & 1 deletion DQMOffline/CalibCalo/src/DQMSourcePi0.h
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
#include "RecoEcal/EgammaCoreTools/interface/PositionCalc.h"

// Less than operator for sorting EcalRecHits according to energy.
bool ecalRecHitGreater(EcalRecHit x, EcalRecHit y) { return (x.energy() > y.energy()); }
inline bool ecalRecHitGreater(EcalRecHit x, EcalRecHit y) { return (x.energy() > y.energy()); }

class DQMSourcePi0 : public DQMEDAnalyzer {
public:
Expand Down
28 changes: 14 additions & 14 deletions DQMOffline/Trigger/interface/UtilFuncs.h
Original file line number Diff line number Diff line change
Expand Up @@ -11,11 +11,11 @@
#include "DataFormats/Math/interface/deltaR.h"

namespace hltdqm {
bool passTrig(const float objEta,
float objPhi,
const trigger::TriggerEvent& trigEvt,
const std::string& filterName,
const std::string& processName) {
inline bool passTrig(const float objEta,
float objPhi,
const trigger::TriggerEvent& trigEvt,
const std::string& filterName,
const std::string& processName) {
constexpr float kMaxDR2 = 0.1 * 0.1;

edm::InputTag filterTag(filterName, "", processName);
Expand All @@ -33,12 +33,12 @@ namespace hltdqm {
}

//empty filters is auto pass
bool passTrig(const float objEta,
float objPhi,
const trigger::TriggerEvent& trigEvt,
const std::vector<std::string>& filterNames,
bool orFilters,
const std::string& processName) {
inline bool passTrig(const float objEta,
float objPhi,
const trigger::TriggerEvent& trigEvt,
const std::vector<std::string>& filterNames,
bool orFilters,
const std::string& processName) {
if (orFilters) {
if (filterNames.empty())
return true; //auto pass if empty filters
Expand All @@ -59,9 +59,9 @@ namespace hltdqm {
//inspired by https://github.com/cms-sw/cmssw/blob/fc4f8bbe1258790e46e2d554aacea15c3e5d9afa/HLTrigger/HLTfilters/src/HLTHighLevel.cc#L124-L165
//triggers are ORed together
//empty pattern is auto pass
bool passTrig(const std::string& trigPattern,
const edm::TriggerNames& trigNames,
const edm::TriggerResults& trigResults) {
inline bool passTrig(const std::string& trigPattern,
const edm::TriggerNames& trigNames,
const edm::TriggerResults& trigResults) {
if (trigPattern.empty())
return true;

Expand Down
4 changes: 2 additions & 2 deletions HLTriggerOffline/B2G/interface/B2GDoubleLeptonHLTValidation.h
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,7 @@ inline void B2GDoubleLeptonHLTValidation::triggerBinLabels(const std::vector<std
//
// constructors and destructor
//
B2GDoubleLeptonHLTValidation::B2GDoubleLeptonHLTValidation(const edm::ParameterSet &iConfig)
inline B2GDoubleLeptonHLTValidation::B2GDoubleLeptonHLTValidation(const edm::ParameterSet &iConfig)
: sDir_(iConfig.getUntrackedParameter<std::string>("sDir", "HLTValidation/B2G/Efficiencies/")),
sElectrons_(iConfig.getUntrackedParameter<std::string>("sElectrons", "gsfElectrons")),
ptElectrons_(iConfig.getUntrackedParameter<double>("ptElectrons", 0.)),
Expand All @@ -143,7 +143,7 @@ B2GDoubleLeptonHLTValidation::B2GDoubleLeptonHLTValidation(const edm::ParameterS
tokTrigger_ = consumes<edm::TriggerResults>(edm::InputTag(sTrigger_, "", "HLT"));
}

B2GDoubleLeptonHLTValidation::~B2GDoubleLeptonHLTValidation() {
inline B2GDoubleLeptonHLTValidation::~B2GDoubleLeptonHLTValidation() {
// do anything here that needs to be done at desctruction time
// (e.g. close files, deallocate resources etc.)
}
Expand Down
4 changes: 2 additions & 2 deletions HLTriggerOffline/B2G/interface/B2GHadronicHLTValidation.h
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,7 @@ inline void B2GHadronicHLTValidation::triggerBinLabels(const std::vector<std::st
//
// constructors and destructor
//
B2GHadronicHLTValidation::B2GHadronicHLTValidation(const edm::ParameterSet &iConfig)
inline B2GHadronicHLTValidation::B2GHadronicHLTValidation(const edm::ParameterSet &iConfig)
: sDir_(iConfig.getUntrackedParameter<std::string>("sDir", "HLTValidation/B2G/Efficiencies/")),
sJets_(iConfig.getUntrackedParameter<std::string>("sJets", "ak5PFJets")),
ptJets_(iConfig.getUntrackedParameter<double>("ptJets", 0.)),
Expand All @@ -127,7 +127,7 @@ B2GHadronicHLTValidation::B2GHadronicHLTValidation(const edm::ParameterSet &iCon
tokTrigger_ = consumes<edm::TriggerResults>(edm::InputTag(sTrigger_, "", "HLT"));
}

B2GHadronicHLTValidation::~B2GHadronicHLTValidation() {
inline B2GHadronicHLTValidation::~B2GHadronicHLTValidation() {
// do anything here that needs to be done at desctruction time
// (e.g. close files, deallocate resources etc.)
}
Expand Down
4 changes: 2 additions & 2 deletions HLTriggerOffline/B2G/interface/B2GSingleLeptonHLTValidation.h
Original file line number Diff line number Diff line change
Expand Up @@ -127,7 +127,7 @@ inline void B2GSingleLeptonHLTValidation::triggerBinLabels(const std::vector<std
//
// constructors and destructor
//
B2GSingleLeptonHLTValidation::B2GSingleLeptonHLTValidation(const edm::ParameterSet &iConfig)
inline B2GSingleLeptonHLTValidation::B2GSingleLeptonHLTValidation(const edm::ParameterSet &iConfig)
: sDir_(iConfig.getUntrackedParameter<std::string>("sDir", "HLTValidation/B2G/Efficiencies/")),
sElectrons_(iConfig.getUntrackedParameter<std::string>("sElectrons", "gsfElectrons")),
ptElectrons_(iConfig.getUntrackedParameter<double>("ptElectrons", 0.)),
Expand Down Expand Up @@ -159,7 +159,7 @@ B2GSingleLeptonHLTValidation::B2GSingleLeptonHLTValidation(const edm::ParameterS
tokTrigger_ = consumes<edm::TriggerResults>(edm::InputTag(sTrigger_, "", "HLT"));
}

B2GSingleLeptonHLTValidation::~B2GSingleLeptonHLTValidation() {
inline B2GSingleLeptonHLTValidation::~B2GSingleLeptonHLTValidation() {
// do anything here that needs to be done at desctruction time
// (e.g. close files, deallocate resources etc.)
}
Expand Down
6 changes: 3 additions & 3 deletions Validation/RecoParticleFlow/bin/include/Plot1D.h
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
#include <string>

template <>
bool PlotCompareUtility::compare<Plot1D>(HistoData *HD) {
inline bool PlotCompareUtility::compare<Plot1D>(HistoData *HD) {
// get the reference and comparison histograms
TH1F *href = (TH1F *)HD->getRefHisto();
TH1F *hnew = (TH1F *)HD->getNewHisto();
Expand Down Expand Up @@ -64,7 +64,7 @@ bool PlotCompareUtility::compare<Plot1D>(HistoData *HD) {
}

template <>
void PlotCompareUtility::makePlots<Plot1D>(HistoData *HD) {
inline void PlotCompareUtility::makePlots<Plot1D>(HistoData *HD) {
std::cerr << HD->getName() << "makePlots<Plot1D>\n";

// do not make any new plot if empty
Expand Down Expand Up @@ -146,7 +146,7 @@ void PlotCompareUtility::makePlots<Plot1D>(HistoData *HD) {
}

template <>
void PlotCompareUtility::makeHTML<Plot1D>(HistoData *HD) {
inline void PlotCompareUtility::makeHTML<Plot1D>(HistoData *HD) {
/* HTML is not presently required for 1D histograms -- do nothing
// create HTML support code for this HistoData
Expand Down
6 changes: 3 additions & 3 deletions Validation/RecoParticleFlow/bin/include/Plot2D.h
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
#include <string>

template <>
bool PlotCompareUtility::compare<Plot2D>(HistoData *HD) {
inline bool PlotCompareUtility::compare<Plot2D>(HistoData *HD) {
// get the reference and comparison histograms
TH2F *href2d = (TH2F *)HD->getRefHisto();
TH2F *hnew2d = (TH2F *)HD->getNewHisto();
Expand Down Expand Up @@ -143,7 +143,7 @@ bool PlotCompareUtility::compare<Plot2D>(HistoData *HD) {
}

template <>
void PlotCompareUtility::makePlots<Plot2D>(HistoData *HD) {
inline void PlotCompareUtility::makePlots<Plot2D>(HistoData *HD) {
// do not make any new plot if empty
if (HD->getIsEmpty()) {
HD->setResultImage("NoData_Results.gif");
Expand Down Expand Up @@ -337,7 +337,7 @@ void PlotCompareUtility::makePlots<Plot2D>(HistoData *HD) {
}

template <>
void PlotCompareUtility::makeHTML<Plot2D>(HistoData *HD) {
inline void PlotCompareUtility::makeHTML<Plot2D>(HistoData *HD) {
/* at present, makeHTML<Plot1D> does nothing, so don't waste the CPU cycles
// loop over projections and produce HTML
std::vector<HistoData>::iterator hd;
Expand Down
2 changes: 1 addition & 1 deletion Validation/RecoParticleFlow/bin/include/Style.h
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
#include "TStyle.h"

// tdrGrid: Turns the grid lines on (true) or off (false)
TStyle genStyle() {
inline TStyle genStyle() {
TStyle myStyle("myStyle", "Style similar to P-TDR");

// For the canvas:
Expand Down

0 comments on commit 6fba119

Please sign in to comment.