diff --git a/CalibCalorimetry/CastorCalib/interface/CastorDbXml.h b/CalibCalorimetry/CastorCalib/interface/CastorDbXml.h index 5b4193928bb94..eeec993f7937a 100644 --- a/CalibCalorimetry/CastorCalib/interface/CastorDbXml.h +++ b/CalibCalorimetry/CastorCalib/interface/CastorDbXml.h @@ -26,13 +26,13 @@ namespace CastorDbXml { const std::string& fTag, unsigned fVersion, const CastorPedestals& fObject); - bool dumpObject(std::ostream& fOutput, - unsigned fRun, - unsigned long fGMTIOVBegin, - unsigned long fGMTIOVEnd, - const std::string& fTag, - unsigned fVersion, - const CastorPedestalWidths& fObject) { + inline bool dumpObject(std::ostream& fOutput, + unsigned fRun, + unsigned long fGMTIOVBegin, + unsigned long fGMTIOVEnd, + const std::string& fTag, + unsigned fVersion, + const CastorPedestalWidths& fObject) { return false; } bool dumpObject(std::ostream& fOutput, @@ -50,40 +50,40 @@ namespace CastorDbXml { const std::string& fTag, unsigned fVersion, const CastorGains& fObject); - bool dumpObject(std::ostream& fOutput, - unsigned fRun, - unsigned long fGMTIOVBegin, - unsigned long fGMTIOVEnd, - const std::string& fTag, - unsigned fVersion, - const CastorGainWidths& fObject) { + inline bool dumpObject(std::ostream& fOutput, + unsigned fRun, + unsigned long fGMTIOVBegin, + unsigned long fGMTIOVEnd, + const std::string& fTag, + unsigned fVersion, + const CastorGainWidths& fObject) { return false; } - bool dumpObject(std::ostream& fOutput, - unsigned fRun, - unsigned long fGMTIOVBegin, - unsigned long fGMTIOVEnd, - const std::string& fTag, - unsigned fVersion, - const CastorElectronicsMap& fObject) { + inline bool dumpObject(std::ostream& fOutput, + unsigned fRun, + unsigned long fGMTIOVBegin, + unsigned long fGMTIOVEnd, + const std::string& fTag, + unsigned fVersion, + const CastorElectronicsMap& fObject) { return false; } - bool dumpObject(std::ostream& fOutput, - unsigned fRun, - unsigned long fGMTIOVBegin, - unsigned long fGMTIOVEnd, - const std::string& fTag, - unsigned fVersion, - const CastorQIEData& fObject) { + inline bool dumpObject(std::ostream& fOutput, + unsigned fRun, + unsigned long fGMTIOVBegin, + unsigned long fGMTIOVEnd, + const std::string& fTag, + unsigned fVersion, + const CastorQIEData& fObject) { return false; } - bool dumpObject(std::ostream& fOutput, - unsigned fRun, - unsigned long fGMTIOVBegin, - unsigned long fGMTIOVEnd, - const std::string& fTag, - unsigned fVersion, - const CastorCalibrationQIEData& fObject) { + inline bool dumpObject(std::ostream& fOutput, + unsigned fRun, + unsigned long fGMTIOVBegin, + unsigned long fGMTIOVEnd, + const std::string& fTag, + unsigned fVersion, + const CastorCalibrationQIEData& fObject) { return false; } } // namespace CastorDbXml diff --git a/CalibCalorimetry/HcalAlgos/interface/HcalDbXml.h b/CalibCalorimetry/HcalAlgos/interface/HcalDbXml.h index bdfba690b9141..fde882915a01f 100644 --- a/CalibCalorimetry/HcalAlgos/interface/HcalDbXml.h +++ b/CalibCalorimetry/HcalAlgos/interface/HcalDbXml.h @@ -30,13 +30,13 @@ namespace HcalDbXml { const std::string& fTag, unsigned fVersion, const HcalPedestals& fObject); - bool dumpObject(std::ostream& fOutput, - unsigned fRun, - unsigned long fGMTIOVBegin, - unsigned long fGMTIOVEnd, - const std::string& fTag, - unsigned fVersion, - const HcalPedestalWidths& fObject) { + inline bool dumpObject(std::ostream& fOutput, + unsigned fRun, + unsigned long fGMTIOVBegin, + unsigned long fGMTIOVEnd, + const std::string& fTag, + unsigned fVersion, + const HcalPedestalWidths& fObject) { return false; } bool dumpObject(std::ostream& fOutput, @@ -54,58 +54,58 @@ namespace HcalDbXml { const std::string& fTag, unsigned fVersion, const HcalGains& fObject); - bool dumpObject(std::ostream& fOutput, - unsigned fRun, - unsigned long fGMTIOVBegin, - unsigned long fGMTIOVEnd, - const std::string& fTag, - unsigned fVersion, - const HcalGainWidths& fObject) { + inline bool dumpObject(std::ostream& fOutput, + unsigned fRun, + unsigned long fGMTIOVBegin, + unsigned long fGMTIOVEnd, + const std::string& fTag, + unsigned fVersion, + const HcalGainWidths& fObject) { return false; } - bool dumpObject(std::ostream& fOutput, - unsigned fRun, - unsigned long fGMTIOVBegin, - unsigned long fGMTIOVEnd, - const std::string& fTag, - unsigned fVersion, - const HcalElectronicsMap& fObject) { + inline bool dumpObject(std::ostream& fOutput, + unsigned fRun, + unsigned long fGMTIOVBegin, + unsigned long fGMTIOVEnd, + const std::string& fTag, + unsigned fVersion, + const HcalElectronicsMap& fObject) { return false; } - bool dumpObject(std::ostream& fOutput, - unsigned fRun, - unsigned long fGMTIOVBegin, - unsigned long fGMTIOVEnd, - const std::string& fTag, - unsigned fVersion, - const HcalQIEData& fObject) { + inline bool dumpObject(std::ostream& fOutput, + unsigned fRun, + unsigned long fGMTIOVBegin, + unsigned long fGMTIOVEnd, + const std::string& fTag, + unsigned fVersion, + const HcalQIEData& fObject) { return false; } - bool dumpObject(std::ostream& fOutput, - unsigned fRun, - unsigned long fGMTIOVBegin, - unsigned long fGMTIOVEnd, - const std::string& fTag, - unsigned fVersion, - const HcalCalibrationQIEData& fObject) { + inline bool dumpObject(std::ostream& fOutput, + unsigned fRun, + unsigned long fGMTIOVBegin, + unsigned long fGMTIOVEnd, + const std::string& fTag, + unsigned fVersion, + const HcalCalibrationQIEData& fObject) { return false; } - bool dumpObject(std::ostream& fOutput, - unsigned fRun, - unsigned long fGMTIOVBegin, - unsigned long fGMTIOVEnd, - const std::string& fTag, - unsigned fVersion, - const HcalQIETypes& fObject) { + inline bool dumpObject(std::ostream& fOutput, + unsigned fRun, + unsigned long fGMTIOVBegin, + unsigned long fGMTIOVEnd, + const std::string& fTag, + unsigned fVersion, + const HcalQIETypes& fObject) { return false; } - bool dumpObject(std::ostream& fOutput, - unsigned fRun, - unsigned long fGMTIOVBegin, - unsigned long fGMTIOVEnd, - const std::string& fTag, - unsigned fVersion, - const HcalFrontEndMap& fObject) { + inline bool dumpObject(std::ostream& fOutput, + unsigned fRun, + unsigned long fGMTIOVBegin, + unsigned long fGMTIOVEnd, + const std::string& fTag, + unsigned fVersion, + const HcalFrontEndMap& fObject) { return false; } bool dumpObject(std::ostream& fOutput, diff --git a/Calibration/HcalCalibAlgos/interface/hcalCalib.h b/Calibration/HcalCalibAlgos/interface/hcalCalib.h index 27da8ebd35585..c2311f816ac9f 100644 --- a/Calibration/HcalCalibAlgos/interface/hcalCalib.h +++ b/Calibration/HcalCalibAlgos/interface/hcalCalib.h @@ -206,7 +206,7 @@ class hcalCalib : public TSelector { #endif #ifdef hcalCalib_cxx -void hcalCalib::Init(TTree *tree) { +inline void hcalCalib::Init(TTree *tree) { // The Init() function is called when the selector needs to initialize // a new tree or chain. Typically here the branch addresses and branch // pointers of the tree will be set. @@ -250,7 +250,7 @@ void hcalCalib::Init(TTree *tree) { fChain->SetBranchAddress("probeJetP4", &probeJetP4, &b_probeJetP4); } -Bool_t hcalCalib::Notify() { +inline Bool_t hcalCalib::Notify() { // The Notify() function is called when a new file is opened. This // can be either for a new TTree in a TChain or when when a new TTree // is started when using PROOF. It is normaly not necessary to make changes diff --git a/CommonTools/RecoAlgos/interface/FKDTree.h b/CommonTools/RecoAlgos/interface/FKDTree.h index 41fabba79dd54..f825610d14195 100644 --- a/CommonTools/RecoAlgos/interface/FKDTree.h +++ b/CommonTools/RecoAlgos/interface/FKDTree.h @@ -21,7 +21,7 @@ namespace { const std::array MultiplyDeBruijnBitPosition{{0, 9, 1, 10, 13, 21, 2, 29, 11, 14, 16, 18, 22, 25, 3, 30, 8, 12, 20, 28, 15, 17, 24, 7, 19, 27, 23, 6, 26, 5, 4, 31}}; - unsigned int ilog2(unsigned int v) { + inline unsigned int ilog2(unsigned int v) { v |= v >> 1; // first round down to one less than a power of 2 v |= v >> 2; v |= v >> 4; diff --git a/CommonTools/RecoAlgos/plugins/PrimaryVertexSorter.h b/CommonTools/RecoAlgos/plugins/PrimaryVertexSorter.h index 518b4c3434807..300ce6cb2c14b 100644 --- a/CommonTools/RecoAlgos/plugins/PrimaryVertexSorter.h +++ b/CommonTools/RecoAlgos/plugins/PrimaryVertexSorter.h @@ -301,27 +301,28 @@ void PrimaryVertexSorter::produce(edm::Event& iEvent, const } template <> -void PrimaryVertexSorter>::doConsumesForTiming( +inline void PrimaryVertexSorter>::doConsumesForTiming( const edm::ParameterSet& iConfig) { tokenTrackTimeTag_ = consumes>(iConfig.getParameter("trackTimeTag")); tokenTrackTimeResoTag_ = consumes>(iConfig.getParameter("trackTimeResoTag")); } template <> -void PrimaryVertexSorter>::doConsumesForTiming(const edm::ParameterSet& iConfig) {} +inline void PrimaryVertexSorter>::doConsumesForTiming(const edm::ParameterSet& iConfig) { +} template <> -bool PrimaryVertexSorter>::needsProductsForTiming() { +inline bool PrimaryVertexSorter>::needsProductsForTiming() { return true; } template <> -bool PrimaryVertexSorter>::needsProductsForTiming() { +inline bool PrimaryVertexSorter>::needsProductsForTiming() { return false; } template <> -std::pair +inline std::pair PrimaryVertexSorter>::runAlgo(const reco::VertexCollection& vertices, const reco::RecoChargedRefCandidate& pf, const edm::ValueMap* trackTimeTag, @@ -332,7 +333,7 @@ PrimaryVertexSorter>::runAlgo(const r } template <> -std::pair PrimaryVertexSorter>::runAlgo( +inline std::pair PrimaryVertexSorter>::runAlgo( const reco::VertexCollection& vertices, const reco::PFCandidate& pf, const edm::ValueMap* trackTimeTag, diff --git a/CondCore/AlignmentPlugins/interface/AlignmentPayloadInspectorHelper.h b/CondCore/AlignmentPlugins/interface/AlignmentPayloadInspectorHelper.h index 3814fa6dcde52..80a44790c3c64 100644 --- a/CondCore/AlignmentPlugins/interface/AlignmentPayloadInspectorHelper.h +++ b/CondCore/AlignmentPlugins/interface/AlignmentPayloadInspectorHelper.h @@ -71,7 +71,9 @@ namespace AlignmentPI { PARTITION::TECp, PARTITION::TECm}; - std::ostream& operator<<(std::ostream& o, PARTITION x) { return o << std::underlying_type::type(x); } + inline std::ostream& operator<<(std::ostream& o, PARTITION x) { + return o << std::underlying_type::type(x); + } enum regions { BPixL1o, //0 Barrel Pixel Layer 1 outer @@ -149,7 +151,7 @@ namespace AlignmentPI { }; /*--------------------------------------------------------------------*/ - std::string getStringFromRegionEnum(AlignmentPI::regions e) + inline std::string getStringFromRegionEnum(AlignmentPI::regions e) /*--------------------------------------------------------------------*/ { switch (e) { @@ -300,7 +302,7 @@ namespace AlignmentPI { } /*--------------------------------------------------------------------*/ - bool isBPixOuterLadder(const DetId& detid, const TrackerTopology& tTopo, bool isPhase0) + inline bool isBPixOuterLadder(const DetId& detid, const TrackerTopology& tTopo, bool isPhase0) /*--------------------------------------------------------------------*/ { bool isOuter = false; @@ -344,7 +346,7 @@ namespace AlignmentPI { }; /*--------------------------------------------------------------------*/ - void topolInfo::printAll() + inline void topolInfo::printAll() /*--------------------------------------------------------------------*/ { std::cout << " detId:" << m_rawid << " subdetid: " << m_subdetid << " layer: " << m_layer << " side: " << m_side @@ -353,7 +355,7 @@ namespace AlignmentPI { } /*--------------------------------------------------------------------*/ - void topolInfo::init() + inline void topolInfo::init() /*--------------------------------------------------------------------*/ { m_rawid = 0; @@ -367,7 +369,7 @@ namespace AlignmentPI { }; /*--------------------------------------------------------------------*/ - bool topolInfo::sanityCheck() + inline bool topolInfo::sanityCheck() /*--------------------------------------------------------------------*/ { if (m_layer == 0 || (m_subdetid == 1 && m_layer > 4) || (m_subdetid == 2 && m_layer > 3)) { @@ -377,7 +379,7 @@ namespace AlignmentPI { } } /*--------------------------------------------------------------------*/ - void topolInfo::fillGeometryInfo(const DetId& detId, const TrackerTopology& tTopo, bool isPhase0) + inline void topolInfo::fillGeometryInfo(const DetId& detId, const TrackerTopology& tTopo, bool isPhase0) /*--------------------------------------------------------------------*/ { unsigned int subdetId = static_cast(detId.subdetId()); @@ -424,7 +426,7 @@ namespace AlignmentPI { // ------------ method to assign a partition based on the topology struct info --------------- /*--------------------------------------------------------------------*/ - AlignmentPI::regions topolInfo::filterThePartition() + inline AlignmentPI::regions topolInfo::filterThePartition() /*--------------------------------------------------------------------*/ { AlignmentPI::regions ret = AlignmentPI::NUM_OF_REGIONS; @@ -594,7 +596,7 @@ namespace AlignmentPI { } /*--------------------------------------------------------------------*/ - std::string getStringFromCoordinate(AlignmentPI::coordinate coord) + inline std::string getStringFromCoordinate(AlignmentPI::coordinate coord) /*--------------------------------------------------------------------*/ { switch (coord) { @@ -616,7 +618,7 @@ namespace AlignmentPI { } /*--------------------------------------------------------------------*/ - std::string getStringFromIndex(AlignmentPI::index i) + inline std::string getStringFromIndex(AlignmentPI::index i) /*--------------------------------------------------------------------*/ { switch (i) { @@ -638,7 +640,7 @@ namespace AlignmentPI { } /*--------------------------------------------------------------------*/ - std::string getStringFromPart(AlignmentPI::partitions i) + inline std::string getStringFromPart(AlignmentPI::partitions i) /*--------------------------------------------------------------------*/ { switch (i) { @@ -660,7 +662,7 @@ namespace AlignmentPI { } /*--------------------------------------------------------------------*/ - std::pair getIndices(AlignmentPI::index i) + inline std::pair getIndices(AlignmentPI::index i) /*--------------------------------------------------------------------*/ { switch (i) { @@ -682,7 +684,7 @@ namespace AlignmentPI { } /*--------------------------------------------------------------------*/ - void makeNicePlotStyle(TH1* hist, int color) + inline void makeNicePlotStyle(TH1* hist, int color) /*--------------------------------------------------------------------*/ { hist->SetStats(kFALSE); @@ -707,7 +709,7 @@ namespace AlignmentPI { } /*--------------------------------------------------------------------*/ - void makeNiceStats(TH1F* hist, AlignmentPI::partitions part, int color) + inline void makeNiceStats(TH1F* hist, AlignmentPI::partitions part, int color) /*--------------------------------------------------------------------*/ { char buffer[255]; @@ -740,7 +742,7 @@ namespace AlignmentPI { } /*--------------------------------------------------------------------*/ - std::pair getTheRange(std::map values, const float nsigma) + inline std::pair getTheRange(std::map values, const float nsigma) /*--------------------------------------------------------------------*/ { float sum = std::accumulate( @@ -765,7 +767,7 @@ namespace AlignmentPI { } /*--------------------------------------------------------------------*/ - std::pair calculatePosition(TVirtualPad* myPad, int boundary) + inline std::pair calculatePosition(TVirtualPad* myPad, int boundary) /*--------------------------------------------------------------------*/ { int ix1; @@ -850,16 +852,16 @@ namespace AlignmentPI { }; /*--------------------------------------------------------------------*/ - GlobalPoint TkAlBarycenters::getPartitionAvg(AlignmentPI::PARTITION p) + inline GlobalPoint TkAlBarycenters::getPartitionAvg(AlignmentPI::PARTITION p) /*--------------------------------------------------------------------*/ { return GlobalPoint(Xbarycenters[p], Ybarycenters[p], Zbarycenters[p]); } /*--------------------------------------------------------------------*/ - void TkAlBarycenters::computeBarycenters(const std::vector& input, - const TrackerTopology& tTopo, - const std::map& GPR) + inline void TkAlBarycenters::computeBarycenters(const std::vector& input, + const TrackerTopology& tTopo, + const std::map& GPR) /*--------------------------------------------------------------------*/ { for (const auto& ali : input) { diff --git a/CondCore/BeamSpotPlugins/interface/BeamSpotPayloadInspectorHelper.h b/CondCore/BeamSpotPlugins/interface/BeamSpotPayloadInspectorHelper.h index 917a1d03043d6..23218face5385 100644 --- a/CondCore/BeamSpotPlugins/interface/BeamSpotPayloadInspectorHelper.h +++ b/CondCore/BeamSpotPlugins/interface/BeamSpotPayloadInspectorHelper.h @@ -20,7 +20,7 @@ namespace BeamSpotPI { - std::pair unpack(cond::Time_t since) { + inline std::pair unpack(cond::Time_t since) { auto kLowMask = 0XFFFFFFFF; auto run = (since >> 32); auto lumi = (since & kLowMask); @@ -46,7 +46,7 @@ namespace BeamSpotPI { }; /************************************************/ - std::string getStringFromParamEnum(const parameters& parameter) { + inline std::string getStringFromParamEnum(const parameters& parameter) { switch (parameter) { case X: return "X"; diff --git a/CondCore/EcalPlugins/plugins/ESDrawUtils.h b/CondCore/EcalPlugins/plugins/ESDrawUtils.h index 0531c44975194..8e74c5a7c2b57 100644 --- a/CondCore/EcalPlugins/plugins/ESDrawUtils.h +++ b/CondCore/EcalPlugins/plugins/ESDrawUtils.h @@ -1,7 +1,7 @@ #include "TH2F.h" #include "TLine.h" -void DrawES(int plane, int side) { +inline void DrawES(int plane, int side) { int ixF[172] = { 2, 2, 3, 3, 4, 4, 5, 5, 6, 6, 7, 7, 8, 8, 10, 10, 11, 11, 14, 14, // external upper crown (44) 16, 16, 26, 26, 28, 28, 31, 31, 32, 32, 34, 34, 35, 35, 36, 36, 37, 37, 38, 38, // external upper crown diff --git a/CondCore/EcalPlugins/plugins/EcalDrawUtils.h b/CondCore/EcalPlugins/plugins/EcalDrawUtils.h index 855cd7e09c7bc..8c2dcc9190441 100644 --- a/CondCore/EcalPlugins/plugins/EcalDrawUtils.h +++ b/CondCore/EcalPlugins/plugins/EcalDrawUtils.h @@ -1,7 +1,7 @@ #include "TH2F.h" #include "TLine.h" -void DrawEB(TH2F* ebmap, float min, float max) { +inline void DrawEB(TH2F* ebmap, float min, float max) { ebmap->SetXTitle("i#phi"); ebmap->SetYTitle("i#eta"); ebmap->GetXaxis()->SetNdivisions(-418, kFALSE); @@ -26,7 +26,7 @@ void DrawEB(TH2F* ebmap, float min, float max) { l->Draw(); } // DrawEB method -void DrawEE(TH2F* endc, float min, float max) { +inline void DrawEE(TH2F* endc, float min, float max) { int ixSectorsEE[202] = { 62, 62, 61, 61, 60, 60, 59, 59, 58, 58, 56, 56, 46, 46, 44, 44, 43, 43, 42, 42, 41, 41, 40, 40, 41, 41, 42, 42, 43, 43, 44, 44, 46, 46, 56, 56, 58, 58, 59, 59, 60, 60, 61, 61, 62, 62, 0, 101, 101, 98, 98, 96, @@ -62,7 +62,7 @@ void DrawEE(TH2F* endc, float min, float max) { } } // DrawEE method -void DrawEE_Tower(TH2F* endc, TLine* l, double minScale, double maxScale) { +inline void DrawEE_Tower(TH2F* endc, TLine* l, double minScale, double maxScale) { endc->SetStats(false); endc->SetMinimum(minScale); endc->SetMaximum(maxScale); @@ -88,7 +88,7 @@ void DrawEE_Tower(TH2F* endc, TLine* l, double minScale, double maxScale) { } //draw EE in case of a tower -void drawTable(int nbRows, int nbColumns) { +inline void drawTable(int nbRows, int nbColumns) { TLine* l = new TLine; l->SetLineWidth(1); for (int i = 1; i < nbRows; i++) { diff --git a/CondCore/EcalPlugins/plugins/EcalFloatCondObjectContainerUtils.h b/CondCore/EcalPlugins/plugins/EcalFloatCondObjectContainerUtils.h index 6ac667ddc0148..4e77f3d3844af 100644 --- a/CondCore/EcalPlugins/plugins/EcalFloatCondObjectContainerUtils.h +++ b/CondCore/EcalPlugins/plugins/EcalFloatCondObjectContainerUtils.h @@ -139,14 +139,14 @@ void fillEEMap_DiffIOV(std::shared_ptr payload, } // validDetId } -void fillTableWithSummary(TH2F*& align, - std::string title, - const float& mean_x_EB, - const float& rms_EB, - const int& num_x_EB, - const float& mean_x_EE, - const float& rms_EE, - const int& num_x_EE) { +inline void fillTableWithSummary(TH2F*& align, + std::string title, + const float& mean_x_EB, + const float& rms_EB, + const int& num_x_EB, + const float& mean_x_EE, + const float& rms_EE, + const int& num_x_EE) { int NbRows = 2; align = new TH2F(title.c_str(), "EB/EE mean_x rms num_x", 4, 0, 4, NbRows, 0, NbRows); diff --git a/CondCore/EcalPlugins/plugins/EcalFunctionParametersUtils.h b/CondCore/EcalPlugins/plugins/EcalFunctionParametersUtils.h index 35624944bbad5..36933eb47dffd 100644 --- a/CondCore/EcalPlugins/plugins/EcalFunctionParametersUtils.h +++ b/CondCore/EcalPlugins/plugins/EcalFunctionParametersUtils.h @@ -2,7 +2,7 @@ #include #include -int countEmptyRows(std::vector& vec) { +inline int countEmptyRows(std::vector& vec) { int cnt = 0; for (std::vector::const_iterator it = vec.begin(); it != vec.end(); it++) if ((*it) == 0.0f) @@ -11,7 +11,7 @@ int countEmptyRows(std::vector& vec) { return cnt; } -void fillFunctionParamsValues( +inline void fillFunctionParamsValues( TH2F*& align, std::vector& m_params, std::string title, int& gridRows, int& NbColumns) { const int maxInCol = 25; int NbRows = 0; diff --git a/CondCore/HcalPlugins/interface/HcalObjRepresent.h b/CondCore/HcalPlugins/interface/HcalObjRepresent.h index 489aab34c5b52..6f70e6f7a43ad 100644 --- a/CondCore/HcalPlugins/interface/HcalObjRepresent.h +++ b/CondCore/HcalPlugins/interface/HcalObjRepresent.h @@ -481,7 +481,7 @@ namespace HcalObjRepresent { } }; - void drawTable(int nbRows, int nbColumns) { + inline void drawTable(int nbRows, int nbColumns) { TLine* l = new TLine; l->SetLineWidth(1); for (int i = 1; i < nbRows; i++) { @@ -498,7 +498,7 @@ namespace HcalObjRepresent { } } - std::string SciNotatStr(float num) { + inline std::string SciNotatStr(float num) { // Create an output string stream std::ostringstream streamObj2; @@ -528,12 +528,12 @@ namespace HcalObjRepresent { return ss.str(); } - const bool isBitSet(unsigned int bitnumber, unsigned int status) { + inline const bool isBitSet(unsigned int bitnumber, unsigned int status) { unsigned int statadd = 0x1 << (bitnumber); return (status & statadd) ? (true) : (false); } - std::string getBitsSummary(uint32_t bits, std::string statusBitArray[], short unsigned int bitMap[]) { + inline std::string getBitsSummary(uint32_t bits, std::string statusBitArray[], short unsigned int bitMap[]) { std::stringstream ss; for (unsigned int i = 0; i < 9; ++i) { if (isBitSet(bitMap[i], bits)) { @@ -545,7 +545,7 @@ namespace HcalObjRepresent { } //functions for making plot: - void setBinLabels(std::vector& depth) { + inline void setBinLabels(std::vector& depth) { // Set labels for all depth histograms for (unsigned int i = 0; i < depth.size(); ++i) { depth[i].SetXTitle("i#eta"); @@ -1050,7 +1050,7 @@ namespace HcalObjRepresent { } // FillUnphysicalHEHFBins(std::vector &hh) // special fill call based on detid -- eventually will need special treatment - void Fill(HcalDetId& id, double val /*=1*/, std::vector& depth) { + inline void Fill(HcalDetId& id, double val /*=1*/, std::vector& depth) { // If in HF, need to shift by 1 bin (-1 bin lower in -HF, +1 bin higher in +HF) if (id.subdet() == HcalForward) depth[id.depth() - 1].Fill(id.ieta() < 0 ? id.ieta() - 1 : id.ieta() + 1, id.iphi(), val); @@ -1058,14 +1058,14 @@ namespace HcalObjRepresent { depth[id.depth() - 1].Fill(id.ieta(), id.iphi(), val); } - void Reset(std::vector& depth) { + inline void Reset(std::vector& depth) { for (unsigned int d = 0; d < depth.size(); d++) //BUG CAN BE HERE: //if(depth[d]) depth[d].Reset(); } // void Reset(void) - void setup(std::vector& depth, std::string name, std::string units = "") { + inline void setup(std::vector& depth, std::string name, std::string units = "") { std::string unittitle, unitname; if (units.empty()) { unitname = units; @@ -1132,11 +1132,11 @@ namespace HcalObjRepresent { setBinLabels(depth); // set axis titles, special bins } - void fillOneGain(std::vector& graphData, - HcalGains::tAllContWithNames& allContainers, - std::string name, - int id, - std::string units = "") { + inline void fillOneGain(std::vector& graphData, + HcalGains::tAllContWithNames& allContainers, + std::string name, + int id, + std::string units = "") { setup(graphData, name); std::stringstream x; diff --git a/CondCore/RunInfoPlugins/interface/RunInfoPayloadInspectoHelper.h b/CondCore/RunInfoPlugins/interface/RunInfoPayloadInspectoHelper.h index 04503b61c9c72..3ee96a6773ae2 100644 --- a/CondCore/RunInfoPlugins/interface/RunInfoPayloadInspectoHelper.h +++ b/CondCore/RunInfoPlugins/interface/RunInfoPayloadInspectoHelper.h @@ -36,7 +36,7 @@ namespace RunInfoPI { }; /************************************************/ - float theBField(const float current) { + inline float theBField(const float current) { // logic is taken from https://github.com/cms-sw/cmssw/blob/master/MagneticField/GeomBuilder/plugins/VolumeBasedMagneticFieldESProducerFromDB.cc#L156 int i = 0; @@ -49,7 +49,7 @@ namespace RunInfoPI { } /************************************************/ - float runDuration(const std::shared_ptr& payload) { + inline float runDuration(const std::shared_ptr& payload) { // calculation of the run duration in seconds time_t start_time = payload->m_start_time_ll; ctime(&start_time); @@ -59,19 +59,19 @@ namespace RunInfoPI { } /************************************************/ - std::string runStartTime(const std::shared_ptr& payload) { + inline std::string runStartTime(const std::shared_ptr& payload) { const time_t start_time = payload->m_start_time_ll / 1.0e+6; return std::asctime(std::gmtime(&start_time)); } /************************************************/ - std::string runEndTime(const std::shared_ptr& payload) { + inline std::string runEndTime(const std::shared_ptr& payload) { const time_t end_time = payload->m_stop_time_ll / 1.0e+6; return std::asctime(std::gmtime(&end_time)); } /************************************************/ - std::string getStringFromTypeEnum(const parameters& parameter) { + inline std::string getStringFromTypeEnum(const parameters& parameter) { switch (parameter) { case m_run: return "run number"; @@ -101,7 +101,7 @@ namespace RunInfoPI { } /************************************************/ - void reportSummaryMapPalette(TH2* obj) { + inline void reportSummaryMapPalette(TH2* obj) { static int pcol[20]; float rgb[20][3]; diff --git a/CondCore/SiPixelPlugins/interface/PixelRegionContainers.h b/CondCore/SiPixelPlugins/interface/PixelRegionContainers.h index 51f01e1502551..9965eb7c3d51a 100644 --- a/CondCore/SiPixelPlugins/interface/PixelRegionContainers.h +++ b/CondCore/SiPixelPlugins/interface/PixelRegionContainers.h @@ -15,7 +15,7 @@ namespace PixelRegions { - std::string itoa(int i) { + inline std::string itoa(int i) { char temp[20]; sprintf(temp, "%d", i); return ((std::string)temp); diff --git a/CondCore/SiPixelPlugins/interface/SiPixelPayloadInspectorHelper.h b/CondCore/SiPixelPlugins/interface/SiPixelPayloadInspectorHelper.h index b6f61b1168d07..5448fa3e09fff 100644 --- a/CondCore/SiPixelPlugins/interface/SiPixelPayloadInspectorHelper.h +++ b/CondCore/SiPixelPlugins/interface/SiPixelPayloadInspectorHelper.h @@ -111,7 +111,7 @@ namespace SiPixelPI { }; //============================================================================ - std::pair unpack(cond::Time_t since) { + inline std::pair unpack(cond::Time_t since) { auto kLowMask = 0XFFFFFFFF; auto run = (since >> 32); auto lumi = (since & kLowMask); @@ -121,7 +121,7 @@ namespace SiPixelPI { //============================================================================ // Taken from pixel naming classes // BmO (-z-x) = 1, BmI (-z+x) = 2 , BpO (+z-x) = 3 , BpI (+z+x) = 4 - int quadrant(const DetId& detid, const TrackerTopology* tTopo_, bool phase_) { + inline int quadrant(const DetId& detid, const TrackerTopology* tTopo_, bool phase_) { if (detid.subdetId() == PixelSubdetector::PixelBarrel) { return PixelBarrelName(detid, tTopo_, phase_).shell(); } else { @@ -132,7 +132,7 @@ namespace SiPixelPI { //============================================================================ // Online ladder convention taken from pixel naming class for barrel // Apply sign convention (- sign for BmO and BpO) - int signed_ladder(const DetId& detid, const TrackerTopology& tTopo_, bool phase_) { + inline int signed_ladder(const DetId& detid, const TrackerTopology& tTopo_, bool phase_) { if (detid.subdetId() != PixelSubdetector::PixelBarrel) return -9999; int signed_ladder = PixelBarrelName(detid, &tTopo_, phase_).ladderName(); @@ -144,7 +144,7 @@ namespace SiPixelPI { //============================================================================ // Online mdoule convention taken from pixel naming class for barrel // Apply sign convention (- sign for BmO and BmI) - int signed_module(const DetId& detid, const TrackerTopology& tTopo_, bool phase_) { + inline int signed_module(const DetId& detid, const TrackerTopology& tTopo_, bool phase_) { if (detid.subdetId() != PixelSubdetector::PixelBarrel) return -9999; int signed_module = PixelBarrelName(detid, &tTopo_, phase_).moduleName(); @@ -160,7 +160,7 @@ namespace SiPixelPI { // Panel 1 plq 1-2, Panel 2, plq 1 = Ring 1 // Panel 1 plq 3-4, Panel 2, plq 2-3 = Ring 2 // Phase 1: Using pixel naming class for endcap - int ring(const DetId& detid, const TrackerTopology& tTopo_, bool phase_) { + inline int ring(const DetId& detid, const TrackerTopology& tTopo_, bool phase_) { if (detid.subdetId() != PixelSubdetector::PixelEndcap) return -9999; int ring = -9999; @@ -175,7 +175,7 @@ namespace SiPixelPI { //============================================================================ // Online blade convention taken from pixel naming class for endcap // Apply sign convention (- sign for BmO and BpO) - int signed_blade(const DetId& detid, const TrackerTopology& tTopo_, bool phase_) { + inline int signed_blade(const DetId& detid, const TrackerTopology& tTopo_, bool phase_) { if (detid.subdetId() != PixelSubdetector::PixelEndcap) return -9999; int signed_blade = PixelEndcapName(detid, &tTopo_, phase_).bladeName(); @@ -185,7 +185,7 @@ namespace SiPixelPI { } //============================================================================ - int signed_blade_panel(const DetId& detid, const TrackerTopology& tTopo_, bool phase_) { + inline int signed_blade_panel(const DetId& detid, const TrackerTopology& tTopo_, bool phase_) { if (detid.subdetId() != PixelSubdetector::PixelEndcap) return -9999; int signed_blade_panel = signed_blade(detid, tTopo_, phase_) + (tTopo_.pxfPanel(detid) - 1); @@ -195,7 +195,7 @@ namespace SiPixelPI { //============================================================================ // Online disk convention // Apply sign convention (- sign for BmO and BmI) - int signed_disk(const DetId& detid, const TrackerTopology& tTopo_, bool phase_) { + inline int signed_disk(const DetId& detid, const TrackerTopology& tTopo_, bool phase_) { if (detid.subdetId() != PixelSubdetector::PixelEndcap) return -9999; int signed_disk = tTopo_.pxfDisk(DetId(detid)); @@ -205,7 +205,7 @@ namespace SiPixelPI { } //============================================================================ - void draw_line(double x1, double x2, double y1, double y2, int width = 2, int style = 1, int color = 1) { + inline void draw_line(double x1, double x2, double y1, double y2, int width = 2, int style = 1, int color = 1) { TLine* l = new TLine(x1, y1, x2, y2); l->SetBit(kCanDelete); l->SetLineWidth(width); @@ -215,14 +215,14 @@ namespace SiPixelPI { } //============================================================================ - void dress_occup_plot(TCanvas& canv, - TH2* h, - int lay, - int ring = 0, - int phase = 0, - bool half_shift = true, - bool mark_zero = true, - bool standard_palette = true) { + inline void dress_occup_plot(TCanvas& canv, + TH2* h, + int lay, + int ring = 0, + int phase = 0, + bool half_shift = true, + bool mark_zero = true, + bool standard_palette = true) { std::string s_title; if (lay > 0) { @@ -505,7 +505,7 @@ namespace SiPixelPI { } /*--------------------------------------------------------------------*/ - void adjustCanvasMargins(TVirtualPad* pad, float top, float bottom, float left, float right) + inline void adjustCanvasMargins(TVirtualPad* pad, float top, float bottom, float left, float right) /*--------------------------------------------------------------------*/ { if (top > 0) @@ -519,7 +519,7 @@ namespace SiPixelPI { } /*--------------------------------------------------------------------*/ - void adjustStats(TPaveStats* stats, float X1, float Y1, float X2, float Y2) + inline void adjustStats(TPaveStats* stats, float X1, float Y1, float X2, float Y2) /*--------------------------------------------------------------------*/ { stats->SetX1NDC(X1); //new x start position @@ -529,7 +529,7 @@ namespace SiPixelPI { } /*--------------------------------------------------------------------*/ - std::pair getExtrema(TH1* h1, TH1* h2) + inline std::pair getExtrema(TH1* h1, TH1* h2) /*--------------------------------------------------------------------*/ { float theMax(-9999.); @@ -545,7 +545,7 @@ namespace SiPixelPI { } /*--------------------------------------------------------------------*/ - void makeNicePlotStyle(TH1* hist) + inline void makeNicePlotStyle(TH1* hist) /*--------------------------------------------------------------------*/ { hist->SetStats(kFALSE); @@ -592,7 +592,7 @@ namespace SiPixelPI { }; /*--------------------------------------------------------------------*/ - std::string getStringFromRegionEnum(SiPixelPI::regions e) + inline std::string getStringFromRegionEnum(SiPixelPI::regions e) /*--------------------------------------------------------------------*/ { switch (e) { @@ -631,7 +631,7 @@ namespace SiPixelPI { } /*--------------------------------------------------------------------*/ - bool isBPixOuterLadder(const DetId& detid, const TrackerTopology& tTopo, bool isPhase0) + inline bool isBPixOuterLadder(const DetId& detid, const TrackerTopology& tTopo, bool isPhase0) /*--------------------------------------------------------------------*/ { bool isOuter = false; @@ -674,7 +674,7 @@ namespace SiPixelPI { }; /*--------------------------------------------------------------------*/ - void topolInfo::printAll() + inline void topolInfo::printAll() /*--------------------------------------------------------------------*/ { std::cout << " detId:" << m_rawid << " subdetid: " << m_subdetid << " layer: " << m_layer << " side: " << m_side @@ -682,7 +682,7 @@ namespace SiPixelPI { } /*--------------------------------------------------------------------*/ - void topolInfo::init() + inline void topolInfo::init() /*--------------------------------------------------------------------*/ { m_rawid = 0; @@ -694,7 +694,7 @@ namespace SiPixelPI { }; /*--------------------------------------------------------------------*/ - bool topolInfo::sanityCheck() + inline bool topolInfo::sanityCheck() /*--------------------------------------------------------------------*/ { if (m_layer == 0 || (m_subdetid == 1 && m_layer > 4) || (m_subdetid == 2 && m_layer > 3)) { @@ -704,7 +704,7 @@ namespace SiPixelPI { } } /*--------------------------------------------------------------------*/ - void topolInfo::fillGeometryInfo(const DetId& detId, const TrackerTopology& tTopo, const SiPixelPI::phase& ph) + inline void topolInfo::fillGeometryInfo(const DetId& detId, const TrackerTopology& tTopo, const SiPixelPI::phase& ph) /*--------------------------------------------------------------------*/ { // set the phase @@ -726,7 +726,7 @@ namespace SiPixelPI { // ------------ method to assign a partition based on the topology struct info --------------- /*--------------------------------------------------------------------*/ - SiPixelPI::regions topolInfo::filterThePartition() + inline SiPixelPI::regions topolInfo::filterThePartition() /*--------------------------------------------------------------------*/ { SiPixelPI::regions ret = SiPixelPI::NUM_OF_REGIONS; @@ -779,7 +779,7 @@ namespace SiPixelPI { // overloaded method: mask entire module /*--------------------------------------------------------------------*/ - std::vector> maskedBarrelRocsToBins(int layer, int ladder, int module) + inline std::vector> maskedBarrelRocsToBins(int layer, int ladder, int module) /*--------------------------------------------------------------------*/ { std::vector> rocsToMask; @@ -809,7 +809,7 @@ namespace SiPixelPI { // overloaded method: mask single ROCs /*--------------------------------------------------------------------*/ - std::vector> maskedBarrelRocsToBins( + inline std::vector> maskedBarrelRocsToBins( int layer, int ladder, int module, std::bitset<16> bad_rocs, bool isFlipped) /*--------------------------------------------------------------------*/ { @@ -885,7 +885,7 @@ namespace SiPixelPI { // overloaded method: mask entire module /*--------------------------------------------------------------------*/ - std::vector> maskedForwardRocsToBins(int ring, int blade, int panel, int disk) + inline std::vector> maskedForwardRocsToBins(int ring, int blade, int panel, int disk) /*--------------------------------------------------------------------*/ { std::vector> rocsToMask; @@ -915,7 +915,7 @@ namespace SiPixelPI { // overloaded method: mask single ROCs /*--------------------------------------------------------------------*/ - std::vector> maskedForwardRocsToBins( + inline std::vector> maskedForwardRocsToBins( int ring, int blade, int panel, int disk, std::bitset<16> bad_rocs, bool isFlipped) /*--------------------------------------------------------------------*/ { @@ -990,7 +990,7 @@ namespace SiPixelPI { } /*--------------------------------------------------------------------*/ - void displayNotSupported(TCanvas& canv, const unsigned int size) + inline void displayNotSupported(TCanvas& canv, const unsigned int size) /*--------------------------------------------------------------------*/ { std::string phase = (size < SiPixelPI::phase1size) ? "Phase-0" : "Phase-2"; @@ -1017,7 +1017,7 @@ namespace SiPixelPI { } /*--------------------------------------------------------------------*/ - bool checkAnswerOK(std::string& answer, bool& result) + inline bool checkAnswerOK(std::string& answer, bool& result) /*--------------------------------------------------------------------*/ { std::transform(answer.begin(), answer.end(), answer.begin(), [](unsigned char x) { return ::tolower(x); }); diff --git a/CondCore/SiStripPlugins/interface/SiStripPayloadInspectorHelper.h b/CondCore/SiStripPlugins/interface/SiStripPayloadInspectorHelper.h index a227de7772127..9c7c0165d99ef 100644 --- a/CondCore/SiStripPlugins/interface/SiStripPayloadInspectorHelper.h +++ b/CondCore/SiStripPlugins/interface/SiStripPayloadInspectorHelper.h @@ -169,7 +169,7 @@ namespace SiStripPI { enum estimator { min, max, mean, rms }; /*--------------------------------------------------------------------*/ - std::string estimatorType(SiStripPI::estimator e) + inline std::string estimatorType(SiStripPI::estimator e) /*--------------------------------------------------------------------*/ { switch (e) { @@ -187,7 +187,7 @@ namespace SiStripPI { } /*--------------------------------------------------------------------*/ - std::string getStringFromSubdet(StripSubdetector::SubDetector sub) + inline std::string getStringFromSubdet(StripSubdetector::SubDetector sub) /*-------------------------------------------------------------------*/ { switch (sub) { @@ -247,7 +247,7 @@ namespace SiStripPI { }; /*--------------------------------------------------------------------*/ - std::pair regionType(int index) + inline std::pair regionType(int index) /*--------------------------------------------------------------------*/ { auto region = static_cast>(index); @@ -337,7 +337,7 @@ namespace SiStripPI { } /*--------------------------------------------------------------------*/ - std::pair getTheRange(std::map values, const float nsigma) + inline std::pair getTheRange(std::map values, const float nsigma) /*--------------------------------------------------------------------*/ { float sum = std::accumulate( @@ -362,13 +362,13 @@ namespace SiStripPI { } /*--------------------------------------------------------------------*/ - void drawStatBox(std::map> histos, - std::map colormap, - std::vector legend, - double X = 0.15, - double Y = 0.93, - double W = 0.15, - double H = 0.10) + inline void drawStatBox(std::map> histos, + std::map colormap, + std::vector legend, + double X = 0.15, + double Y = 0.93, + double W = 0.15, + double H = 0.10) /*--------------------------------------------------------------------*/ { char buffer[255]; @@ -399,7 +399,7 @@ namespace SiStripPI { } /*--------------------------------------------------------------------*/ - std::pair getExtrema(TH1* h1, TH1* h2) + inline std::pair getExtrema(TH1* h1, TH1* h2) /*--------------------------------------------------------------------*/ { float theMax(-9999.); @@ -415,7 +415,7 @@ namespace SiStripPI { } /*--------------------------------------------------------------------*/ - void makeNicePlotStyle(TH1* hist) + inline void makeNicePlotStyle(TH1* hist) /*--------------------------------------------------------------------*/ { hist->SetStats(kFALSE); @@ -435,7 +435,7 @@ namespace SiStripPI { } /*--------------------------------------------------------------------*/ - void printSummary(const std::map& map) + inline void printSummary(const std::map& map) /*--------------------------------------------------------------------*/ { for (const auto& element : map) { @@ -476,7 +476,7 @@ namespace SiStripPI { // code is mutuated from CalibTracker/SiStripQuality/plugins/SiStripQualityStatistics /*--------------------------------------------------------------------*/ - void setBadComponents(int i, int component, const SiStripQuality::BadComponent& BC, int NBadComponent[4][19][4]) + inline void setBadComponents(int i, int component, const SiStripQuality::BadComponent& BC, int NBadComponent[4][19][4]) /*--------------------------------------------------------------------*/ { if (BC.BadApvs) { @@ -497,9 +497,9 @@ namespace SiStripPI { // generic code to fill a SiStripDetSummary with Noise payload info /*--------------------------------------------------------------------*/ - void fillNoiseDetSummary(SiStripDetSummary& summaryNoise, - std::shared_ptr payload, - SiStripPI::estimator est) + inline void fillNoiseDetSummary(SiStripDetSummary& summaryNoise, + std::shared_ptr payload, + SiStripPI::estimator est) /*--------------------------------------------------------------------*/ { SiStripNoises::RegistryIterator rit = payload->getRegistryVectorBegin(), erit = payload->getRegistryVectorEnd(); @@ -557,7 +557,7 @@ namespace SiStripPI { } /*--------------------------------------------------------------------*/ - void fillTotalComponents(int NTkComponents[4], int NComponents[4][19][4], const TrackerTopology m_trackerTopo) + inline void fillTotalComponents(int NTkComponents[4], int NComponents[4][19][4], const TrackerTopology m_trackerTopo) /*--------------------------------------------------------------------*/ { edm::FileInPath fp_ = edm::FileInPath("CalibTracker/SiStripCommon/data/SiStripDetInfo.dat"); @@ -609,10 +609,10 @@ namespace SiStripPI { // generic code to fill the vectors of bad components /*--------------------------------------------------------------------*/ - void fillBCArrays(const SiStripQuality* siStripQuality_, - int NTkBadComponent[4], - int NBadComponent[4][19][4], - const TrackerTopology m_trackerTopo) + inline void fillBCArrays(const SiStripQuality* siStripQuality_, + int NTkBadComponent[4], + int NBadComponent[4][19][4], + const TrackerTopology m_trackerTopo) /*--------------------------------------------------------------------*/ { std::vector BC = siStripQuality_->getBadComponentList(); @@ -731,7 +731,7 @@ namespace SiStripPI { } /*--------------------------------------------------------------------*/ - void printBCDebug(int NTkBadComponent[4], int NBadComponent[4][19][4]) + inline void printBCDebug(int NTkBadComponent[4], int NBadComponent[4][19][4]) /*--------------------------------------------------------------------*/ { //&&&&&&&&&&&&&&&&&& @@ -786,7 +786,7 @@ namespace SiStripPI { enum palette { HALFGRAY, GRAY, BLUES, REDS, ANTIGRAY, FIRE, ANTIFIRE, LOGREDBLUE, BLUERED, LOGBLUERED, DEFAULT }; /*--------------------------------------------------------------------*/ - void setPaletteStyle(SiStripPI::palette palette) + inline void setPaletteStyle(SiStripPI::palette palette) /*--------------------------------------------------------------------*/ { TStyle* palettestyle = new TStyle("palettestyle", "Style for P-TDR"); diff --git a/CondFormats/JetMETObjects/interface/Utilities.h b/CondFormats/JetMETObjects/interface/Utilities.h index 4396935368be0..3f64051bdadfa 100644 --- a/CondFormats/JetMETObjects/interface/Utilities.h +++ b/CondFormats/JetMETObjects/interface/Utilities.h @@ -107,7 +107,7 @@ namespace std { } // namespace std namespace { - void handleError(const std::string& fClass, const std::string& fMessage) { + inline void handleError(const std::string& fClass, const std::string& fMessage) { #ifdef STANDALONE std::stringstream sserr; sserr << fClass << " ERROR: " << fMessage; diff --git a/CondTools/Hcal/interface/HcalDbXml.h b/CondTools/Hcal/interface/HcalDbXml.h index 7e031501e10e0..be3b23cddd00c 100644 --- a/CondTools/Hcal/interface/HcalDbXml.h +++ b/CondTools/Hcal/interface/HcalDbXml.h @@ -29,12 +29,12 @@ namespace HcalDbXml { unsigned long fGMTIOVEnd, const std::string& fTag, const HcalPedestals& fObject); - bool dumpObject(std::ostream& fOutput, - unsigned fRun, - unsigned long fGMTIOVBegin, - unsigned long fGMTIOVEnd, - const std::string& fTag, - const HcalPedestalWidths& fObject) { + inline bool dumpObject(std::ostream& fOutput, + unsigned fRun, + unsigned long fGMTIOVBegin, + unsigned long fGMTIOVEnd, + const std::string& fTag, + const HcalPedestalWidths& fObject) { return false; } bool dumpObject(std::ostream& fOutput, diff --git a/DPGAnalysis/SiStripTools/interface/DigiCollectionProfiler.h b/DPGAnalysis/SiStripTools/interface/DigiCollectionProfiler.h index 1fb4178cf20b4..bac4482c1a961 100644 --- a/DPGAnalysis/SiStripTools/interface/DigiCollectionProfiler.h +++ b/DPGAnalysis/SiStripTools/interface/DigiCollectionProfiler.h @@ -64,10 +64,11 @@ void DigiCollectionProfiler::fill(edm::Handle digis, const std::vector& hist2d) const {} template <> -void DigiCollectionProfiler >::fill(edm::Handle > digis, - const std::vector& hist, - const std::vector& hprof, - const std::vector& hist2d) const { +inline void DigiCollectionProfiler >::fill( + edm::Handle > digis, + const std::vector& hist, + const std::vector& hprof, + const std::vector& hist2d) const { for (edm::DetSetVector::const_iterator mod = digis->begin(); mod != digis->end(); mod++) { for (unsigned int isel = 0; isel < m_selections.size(); ++isel) { if (m_selections[isel].isSelected(mod->detId())) { @@ -101,7 +102,7 @@ void DigiCollectionProfiler >::fill(edm::Handle -void DigiCollectionProfiler >::fill( +inline void DigiCollectionProfiler >::fill( edm::Handle > digis, const std::vector& hist, const std::vector& hprof, @@ -140,7 +141,7 @@ void DigiCollectionProfiler >::fill( } template <> -void DigiCollectionProfiler >::fill( +inline void DigiCollectionProfiler >::fill( edm::Handle > digis, const std::vector& hist, const std::vector& hprof, diff --git a/DQMOffline/CalibCalo/src/DQMSourcePi0.h b/DQMOffline/CalibCalo/src/DQMSourcePi0.h index c32d025d980cf..544f8f04a1811 100644 --- a/DQMOffline/CalibCalo/src/DQMSourcePi0.h +++ b/DQMOffline/CalibCalo/src/DQMSourcePi0.h @@ -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: diff --git a/DQMOffline/Trigger/interface/UtilFuncs.h b/DQMOffline/Trigger/interface/UtilFuncs.h index de6c91d51af69..da57948502459 100644 --- a/DQMOffline/Trigger/interface/UtilFuncs.h +++ b/DQMOffline/Trigger/interface/UtilFuncs.h @@ -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); @@ -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& filterNames, - bool orFilters, - const std::string& processName) { + inline bool passTrig(const float objEta, + float objPhi, + const trigger::TriggerEvent& trigEvt, + const std::vector& filterNames, + bool orFilters, + const std::string& processName) { if (orFilters) { if (filterNames.empty()) return true; //auto pass if empty filters @@ -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; diff --git a/DataFormats/Common/interface/getThinned_implementation.h b/DataFormats/Common/interface/getThinned_implementation.h index fe944b439f579..7bb45fe925a7b 100644 --- a/DataFormats/Common/interface/getThinned_implementation.h +++ b/DataFormats/Common/interface/getThinned_implementation.h @@ -139,9 +139,9 @@ namespace edm { return ThinnedOrSlimmedProduct(); } - auto makeThinnedIndexes(std::vector const& keys, - std::vector const& foundContainers, - ThinnedAssociation const* thinnedAssociation) { + inline auto makeThinnedIndexes(std::vector const& keys, + std::vector const& foundContainers, + ThinnedAssociation const* thinnedAssociation) { unsigned const nKeys = keys.size(); std::vector thinnedIndexes(nKeys, kThinningDoNotLookForThisIndex); bool hasAny = false; diff --git a/EventFilter/HcalRawToDigi/plugins/PackerHelp.h b/EventFilter/HcalRawToDigi/plugins/PackerHelp.h index ccf166ad0395b..b9d7dcd4803eb 100644 --- a/EventFilter/HcalRawToDigi/plugins/PackerHelp.h +++ b/EventFilter/HcalRawToDigi/plugins/PackerHelp.h @@ -617,10 +617,10 @@ class UHTRpacker { // converts HE QIE digies to HB data format -QIE11DataFrame convertHB(QIE11DataFrame qiehe, - std::vector const& tdc1, - std::vector const& tdc2, - const int tdcmax) { +inline QIE11DataFrame convertHB(QIE11DataFrame qiehe, + std::vector const& tdc1, + std::vector const& tdc2, + const int tdcmax) { QIE11DataFrame qiehb = qiehe; HcalDetId did = HcalDetId(qiehb.detid()); int adc, tdc; diff --git a/FastSimulation/TrackingRecHitProducer/interface/TrackerDetIdSelector.h b/FastSimulation/TrackingRecHitProducer/interface/TrackerDetIdSelector.h index 2492192e4a580..d7dccb00540c8 100644 --- a/FastSimulation/TrackingRecHitProducer/interface/TrackerDetIdSelector.h +++ b/FastSimulation/TrackingRecHitProducer/interface/TrackerDetIdSelector.h @@ -208,7 +208,7 @@ struct WalkAST { } }; -int ExpressionAST::evaluate(const DetId& detId, const TrackerTopology& trackerTopology) const { +inline int ExpressionAST::evaluate(const DetId& detId, const TrackerTopology& trackerTopology) const { return boost::apply_visitor(Accessor(detId, trackerTopology), this->expr); } diff --git a/GeneratorInterface/Core/interface/FortranCallback.h b/GeneratorInterface/Core/interface/FortranCallback.h index d6779cf150945..71766609f1a2e 100644 --- a/GeneratorInterface/Core/interface/FortranCallback.h +++ b/GeneratorInterface/Core/interface/FortranCallback.h @@ -45,17 +45,17 @@ namespace gen { FortranCallback* FortranCallback::fInstance = nullptr; - FortranCallback::FortranCallback() + inline FortranCallback::FortranCallback() // : fPartonLevel(0) : fRunBlock(nullptr), fEventBlock(nullptr), fIterationsPerEvent(0) {} - FortranCallback* FortranCallback::getInstance() { + inline FortranCallback* FortranCallback::getInstance() { if (fInstance == nullptr) fInstance = new FortranCallback; return fInstance; } - void FortranCallback::fillHeader() { + inline void FortranCallback::fillHeader() { if (fRunBlock == nullptr) return; @@ -67,7 +67,7 @@ namespace gen { return; } - void FortranCallback::fillEvent() { + inline void FortranCallback::fillEvent() { //if ( fPartonLevel == 0 ) return; //const lhef::HEPEUP* hepeup = fPartonLevel->getHEPEUP(); diff --git a/GeneratorInterface/CosmicMuonGenerator/interface/sim.h b/GeneratorInterface/CosmicMuonGenerator/interface/sim.h index 0ee34eaff334f..1733e9dbb24ef 100644 --- a/GeneratorInterface/CosmicMuonGenerator/interface/sim.h +++ b/GeneratorInterface/CosmicMuonGenerator/interface/sim.h @@ -172,7 +172,7 @@ class sim { #endif #ifdef sim_cxx -sim::sim(TTree *tree) { +inline sim::sim(TTree *tree) { // if parameter tree is not specified (or zero), connect the file // used to generate this class and read the Tree. if (tree == nullptr) { @@ -187,19 +187,19 @@ sim::sim(TTree *tree) { Init(tree); } -sim::~sim() { +inline sim::~sim() { if (!fChain) return; delete fChain->GetCurrentFile(); } -Int_t sim::GetEntry(Long64_t entry) { +inline Int_t sim::GetEntry(Long64_t entry) { // Read contents of entry. if (!fChain) return 0; return fChain->GetEntry(entry); } -Long64_t sim::LoadTree(Long64_t entry) { +inline Long64_t sim::LoadTree(Long64_t entry) { // Set the environment to read one entry std::cout << "sim::LoadTree: " << std::endl; if (fChain) @@ -221,7 +221,7 @@ Long64_t sim::LoadTree(Long64_t entry) { return centry; } -void sim::Init(TTree *tree) { +inline void sim::Init(TTree *tree) { // The Init() function is called when the selector needs to initialize // a new tree or chain. Typically here the branch addresses and branch // pointers of the tree will be set. @@ -307,7 +307,7 @@ void sim::Init(TTree *tree) { Notify(); } -Bool_t sim::Notify() { +inline Bool_t sim::Notify() { // The Notify() function is called when a new file is opened. This // can be either for a new TTree in a TChain or when when a new TTree // is started when using PROOF. It is normaly not necessary to make changes @@ -317,14 +317,14 @@ Bool_t sim::Notify() { return kTRUE; } -void sim::Show(Long64_t entry) { +inline void sim::Show(Long64_t entry) { // Print contents of entry. // If entry is not specified, print current entry if (!fChain) return; fChain->Show(entry); } -Int_t sim::Cut(Long64_t entry) { +inline Int_t sim::Cut(Long64_t entry) { // This function may be called from Loop. // returns 1 if entry is accepted. // returns -1 otherwise. diff --git a/GeneratorInterface/HijingInterface/interface/HijingPythiaWrapper.h b/GeneratorInterface/HijingInterface/interface/HijingPythiaWrapper.h index 9e2768e770d1a..b22d66afd48cd 100644 --- a/GeneratorInterface/HijingInterface/interface/HijingPythiaWrapper.h +++ b/GeneratorInterface/HijingInterface/interface/HijingPythiaWrapper.h @@ -50,7 +50,7 @@ extern "C" { } */ -float ranff_(unsigned int* iseed) { +inline float ranff_(unsigned int* iseed) { (*iseed) = (69069 * (*iseed) + 1) & 0xffffffffUL; return (*iseed) / 4294967296.0; } diff --git a/GeneratorInterface/HydjetInterface/interface/HydjetGeneratorFilter.h b/GeneratorInterface/HydjetInterface/interface/HydjetGeneratorFilter.h index f09eea7889dfc..0d33d7c575e04 100644 --- a/GeneratorInterface/HydjetInterface/interface/HydjetGeneratorFilter.h +++ b/GeneratorInterface/HydjetInterface/interface/HydjetGeneratorFilter.h @@ -7,7 +7,7 @@ namespace edm { template <> - GeneratorFilter::GeneratorFilter(ParameterSet const& ps) + inline GeneratorFilter::GeneratorFilter(ParameterSet const& ps) : hadronizer_(ps, consumesCollector()) { init(ps); } diff --git a/GeneratorInterface/PyquenInterface/interface/PyquenGeneratorFilter.h b/GeneratorInterface/PyquenInterface/interface/PyquenGeneratorFilter.h index 45ecb1b859ea5..0e0ad78187026 100644 --- a/GeneratorInterface/PyquenInterface/interface/PyquenGeneratorFilter.h +++ b/GeneratorInterface/PyquenInterface/interface/PyquenGeneratorFilter.h @@ -7,7 +7,7 @@ namespace edm { template <> - GeneratorFilter::GeneratorFilter(ParameterSet const& ps) + inline GeneratorFilter::GeneratorFilter(ParameterSet const& ps) : hadronizer_(ps, consumesCollector()) { init(ps); } diff --git a/Geometry/TrackerGeometryBuilder/interface/PixelTopologyMap.h b/Geometry/TrackerGeometryBuilder/interface/PixelTopologyMap.h index c080132a611cf..c3b55ed40a345 100644 --- a/Geometry/TrackerGeometryBuilder/interface/PixelTopologyMap.h +++ b/Geometry/TrackerGeometryBuilder/interface/PixelTopologyMap.h @@ -47,7 +47,7 @@ class PixelTopologyMap { std::map> m_pxfMap; }; -std::ostream& operator<<(std::ostream& os, PixelTopologyMap map) { +inline std::ostream& operator<<(std::ostream& os, PixelTopologyMap map) { std::stringstream ss; map.printAll(ss); os << ss.str(); diff --git a/HLTrigger/JetMET/interface/HLTCATopTagFilter.h b/HLTrigger/JetMET/interface/HLTCATopTagFilter.h index b10ceff80d787..a98aaff561baa 100644 --- a/HLTrigger/JetMET/interface/HLTCATopTagFilter.h +++ b/HLTrigger/JetMET/interface/HLTCATopTagFilter.h @@ -66,7 +66,7 @@ class HLTCATopTagFilter : public HLTFilter { double minMinMass_; }; -reco::CATopJetProperties CATopJetHelperUser::operator()(reco::Jet const& ihardJet) const { +inline reco::CATopJetProperties CATopJetHelperUser::operator()(reco::Jet const& ihardJet) const { reco::CATopJetProperties properties; // Get subjets reco::Jet::Constituents subjets = ihardJet.getJetConstituents(); diff --git a/HLTrigger/JetMET/interface/HLTCAWZTagFilter.h b/HLTrigger/JetMET/interface/HLTCAWZTagFilter.h index 4b64dcffba236..30935213425d5 100644 --- a/HLTrigger/JetMET/interface/HLTCAWZTagFilter.h +++ b/HLTrigger/JetMET/interface/HLTCAWZTagFilter.h @@ -57,7 +57,7 @@ class HLTCAWZTagFilter : public HLTFilter { double massdropcut_; }; -reco::CATopJetProperties CAWZJetHelperUser::operator()(reco::Jet const& ihardJet) const { +inline reco::CATopJetProperties CAWZJetHelperUser::operator()(reco::Jet const& ihardJet) const { reco::CATopJetProperties properties; // Get subjets reco::Jet::Constituents subjets = ihardJet.getJetConstituents(); diff --git a/HLTrigger/Muon/plugins/HLTTriMuonIsolation.h b/HLTrigger/Muon/plugins/HLTTriMuonIsolation.h index af689e5a9d7e4..2170e49507875 100644 --- a/HLTrigger/Muon/plugins/HLTTriMuonIsolation.h +++ b/HLTrigger/Muon/plugins/HLTTriMuonIsolation.h @@ -64,7 +64,7 @@ class HLTTriMuonIsolation : public edm::global::EDProducer<> { const bool EnableAbsIso_; }; -HLTTriMuonIsolation::HLTTriMuonIsolation(const edm::ParameterSet& iConfig) +inline HLTTriMuonIsolation::HLTTriMuonIsolation(const edm::ParameterSet& iConfig) : L3MuonsToken_(consumes(iConfig.getParameter("L3MuonsSrc"))), AllMuonsToken_( consumes(iConfig.getParameter("AllMuonsSrc"))), @@ -92,9 +92,9 @@ HLTTriMuonIsolation::HLTTriMuonIsolation(const edm::ParameterSet& iConfig) produces("SelectedTaus"); } -HLTTriMuonIsolation::~HLTTriMuonIsolation() {} +inline HLTTriMuonIsolation::~HLTTriMuonIsolation() {} -void HLTTriMuonIsolation::produce(edm::StreamID sid, edm::Event& iEvent, edm::EventSetup const& iSetup) const { +inline void HLTTriMuonIsolation::produce(edm::StreamID sid, edm::Event& iEvent, edm::EventSetup const& iSetup) const { std::unique_ptr Taus(new reco::CompositeCandidateCollection); std::unique_ptr SelectedTaus(new reco::CompositeCandidateCollection); @@ -268,7 +268,7 @@ void HLTTriMuonIsolation::produce(edm::StreamID sid, edm::Event& iEvent, edm::Ev iEvent.put(std::move(SelectedTaus), "SelectedTaus"); } -void HLTTriMuonIsolation::fillDescriptions(edm::ConfigurationDescriptions& descriptions) { +inline void HLTTriMuonIsolation::fillDescriptions(edm::ConfigurationDescriptions& descriptions) { edm::ParameterSetDescription desc; desc.add("L3MuonsSrc", edm::InputTag("hltIterL3FromL2MuonCandidates")); desc.add("AllMuonsSrc", edm::InputTag("hltGlbTrkMuonCands")); diff --git a/HLTriggerOffline/B2G/interface/B2GDoubleLeptonHLTValidation.h b/HLTriggerOffline/B2G/interface/B2GDoubleLeptonHLTValidation.h index 264970098b286..4be070c2ac647 100644 --- a/HLTriggerOffline/B2G/interface/B2GDoubleLeptonHLTValidation.h +++ b/HLTriggerOffline/B2G/interface/B2GDoubleLeptonHLTValidation.h @@ -118,7 +118,7 @@ inline void B2GDoubleLeptonHLTValidation::triggerBinLabels(const std::vector("sDir", "HLTValidation/B2G/Efficiencies/")), sElectrons_(iConfig.getUntrackedParameter("sElectrons", "gsfElectrons")), ptElectrons_(iConfig.getUntrackedParameter("ptElectrons", 0.)), @@ -143,7 +143,7 @@ B2GDoubleLeptonHLTValidation::B2GDoubleLeptonHLTValidation(const edm::ParameterS tokTrigger_ = consumes(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.) } diff --git a/HLTriggerOffline/B2G/interface/B2GHadronicHLTValidation.h b/HLTriggerOffline/B2G/interface/B2GHadronicHLTValidation.h index 1aa2535bb94e9..2be598961bdb7 100644 --- a/HLTriggerOffline/B2G/interface/B2GHadronicHLTValidation.h +++ b/HLTriggerOffline/B2G/interface/B2GHadronicHLTValidation.h @@ -108,7 +108,7 @@ inline void B2GHadronicHLTValidation::triggerBinLabels(const std::vector("sDir", "HLTValidation/B2G/Efficiencies/")), sJets_(iConfig.getUntrackedParameter("sJets", "ak5PFJets")), ptJets_(iConfig.getUntrackedParameter("ptJets", 0.)), @@ -127,7 +127,7 @@ B2GHadronicHLTValidation::B2GHadronicHLTValidation(const edm::ParameterSet &iCon tokTrigger_ = consumes(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.) } diff --git a/HLTriggerOffline/B2G/interface/B2GSingleLeptonHLTValidation.h b/HLTriggerOffline/B2G/interface/B2GSingleLeptonHLTValidation.h index 64771e5306c30..5066a8f6a509c 100644 --- a/HLTriggerOffline/B2G/interface/B2GSingleLeptonHLTValidation.h +++ b/HLTriggerOffline/B2G/interface/B2GSingleLeptonHLTValidation.h @@ -127,7 +127,7 @@ inline void B2GSingleLeptonHLTValidation::triggerBinLabels(const std::vector("sDir", "HLTValidation/B2G/Efficiencies/")), sElectrons_(iConfig.getUntrackedParameter("sElectrons", "gsfElectrons")), ptElectrons_(iConfig.getUntrackedParameter("ptElectrons", 0.)), @@ -159,7 +159,7 @@ B2GSingleLeptonHLTValidation::B2GSingleLeptonHLTValidation(const edm::ParameterS tokTrigger_ = consumes(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.) } diff --git a/JetMETCorrections/MCJet/plugins/JetUtilMC.h b/JetMETCorrections/MCJet/plugins/JetUtilMC.h index c82f1c8a801e6..fbaecf47563ef 100644 --- a/JetMETCorrections/MCJet/plugins/JetUtilMC.h +++ b/JetMETCorrections/MCJet/plugins/JetUtilMC.h @@ -12,7 +12,7 @@ namespace { } }; - double Phi_0_2pi(double x) { + inline double Phi_0_2pi(double x) { while (x >= 2 * M_PI) x -= 2 * M_PI; while (x < 0.) @@ -20,7 +20,7 @@ namespace { return x; } - double Phi_mpi_pi(double x) { + inline double Phi_mpi_pi(double x) { while (x >= M_PI) x -= 2 * M_PI; while (x < -M_PI) @@ -34,7 +34,7 @@ namespace { return Phi_mpi_pi(phi1 - phi2); } - double radius(double eta1, double phi1, double eta2, double phi2) { + inline double radius(double eta1, double phi1, double eta2, double phi2) { const double TWOPI = 2.0 * M_PI; phi1 = Phi_0_2pi(phi1); diff --git a/L1Trigger/L1TCommon/interface/ConvertToLUT.h b/L1Trigger/L1TCommon/interface/ConvertToLUT.h index 39a7ff04524d3..822cf8e31622d 100644 --- a/L1Trigger/L1TCommon/interface/ConvertToLUT.h +++ b/L1Trigger/L1TCommon/interface/ConvertToLUT.h @@ -7,7 +7,7 @@ namespace l1t { - l1t::LUT convertToLUT(const std::vector &v, int padding = -1) noexcept { + inline l1t::LUT convertToLUT(const std::vector &v, int padding = -1) noexcept { unsigned int addrWidth = (32 - __builtin_clz(uint32_t(v.size() - 1))); std::stringstream oss; oss << "#
V1 " << addrWidth << " 31
" << std::endl; // hardcode 32 bits for data @@ -24,28 +24,28 @@ namespace l1t { return lut; } - l1t::LUT convertToLUT(const std::vector &v, int padding = -1) noexcept { + inline l1t::LUT convertToLUT(const std::vector &v, int padding = -1) noexcept { return convertToLUT(std::vector(v.begin(), v.end()), padding); } - l1t::LUT convertToLUT(const std::vector &v, int padding = -1) noexcept { + inline l1t::LUT convertToLUT(const std::vector &v, int padding = -1) noexcept { return convertToLUT(std::vector(v.begin(), v.end()), padding); } - l1t::LUT convertToLUT(const std::vector &v, int padding = -1) noexcept { + inline l1t::LUT convertToLUT(const std::vector &v, int padding = -1) noexcept { return convertToLUT(std::vector(v.begin(), v.end()), padding); } - l1t::LUT convertToLUT(const std::vector &v, int padding = -1) noexcept { + inline l1t::LUT convertToLUT(const std::vector &v, int padding = -1) noexcept { return convertToLUT(std::vector(v.begin(), v.end()), padding); } - l1t::LUT convertToLUT(const std::vector &v, int padding = -1) noexcept { + inline l1t::LUT convertToLUT(const std::vector &v, int padding = -1) noexcept { return convertToLUT(std::vector(v.begin(), v.end()), padding); } - l1t::LUT convertToLUT(const std::vector &v, int padding = -1) noexcept { + inline l1t::LUT convertToLUT(const std::vector &v, int padding = -1) noexcept { return convertToLUT(std::vector(v.begin(), v.end()), padding); } - l1t::LUT convertToLUT(const std::vector &v, int padding = -1) noexcept { + inline l1t::LUT convertToLUT(const std::vector &v, int padding = -1) noexcept { return convertToLUT(std::vector(v.begin(), v.end()), padding); } - l1t::LUT convertToLUT(const std::vector &v, int padding = -1) noexcept { + inline l1t::LUT convertToLUT(const std::vector &v, int padding = -1) noexcept { return convertToLUT(std::vector(v.begin(), v.end()), padding); } } // namespace l1t diff --git a/L1Trigger/L1THGCal/interface/backend/HGCalClusteringImpl.h b/L1Trigger/L1THGCal/interface/backend/HGCalClusteringImpl.h index 61229e3d0da83..65dc53b0a8d4b 100644 --- a/L1Trigger/L1THGCal/interface/backend/HGCalClusteringImpl.h +++ b/L1Trigger/L1THGCal/interface/backend/HGCalClusteringImpl.h @@ -10,7 +10,8 @@ #include "FWCore/MessageLogger/interface/MessageLogger.h" #include "L1Trigger/L1THGCal/interface/HGCalTriggerTools.h" -bool distanceSorter(pair, float> i, pair, float> j) { +inline bool distanceSorter(pair, float> i, + pair, float> j) { return (i.second < j.second); } diff --git a/L1Trigger/L1TNtuples/interface/MuonID.h b/L1Trigger/L1TNtuples/interface/MuonID.h index 2eb85aba55816..0cdeafb802f04 100644 --- a/L1Trigger/L1TNtuples/interface/MuonID.h +++ b/L1Trigger/L1TNtuples/interface/MuonID.h @@ -16,7 +16,7 @@ //local data formats #include "L1Trigger/L1TNtuples/interface/L1AnalysisRecoVertexDataFormat.h" -bool isLooseMuonCustom(const reco::Muon& recoMu) { +inline bool isLooseMuonCustom(const reco::Muon& recoMu) { bool flag = false; if (recoMu.isPFMuon() && (recoMu.isGlobalMuon() || recoMu.isTrackerMuon())) flag = true; @@ -24,7 +24,7 @@ bool isLooseMuonCustom(const reco::Muon& recoMu) { return flag; } -bool isMediumMuonCustom(const reco::Muon& recoMu) { +inline bool isMediumMuonCustom(const reco::Muon& recoMu) { bool goodGlob = recoMu.isGlobalMuon() && recoMu.globalTrack()->normalizedChi2() < 3 && recoMu.combinedQuality().chi2LocalPosition < 12 && recoMu.combinedQuality().trkKink < 20; bool isMedium = isLooseMuonCustom(recoMu) && recoMu.innerTrack()->validFraction() > 0.49 && @@ -33,7 +33,7 @@ bool isMediumMuonCustom(const reco::Muon& recoMu) { return isMedium; } -bool isTightMuonCustom(const reco::Muon& recoMu, const reco::Vertex recoVtx) { +inline bool isTightMuonCustom(const reco::Muon& recoMu, const reco::Vertex recoVtx) { //bp bool isTight = recoMu.isGlobalMuon() && recoMu.isPFMuon() && recoMu.globalTrack()->normalizedChi2() < 10. && recoMu.globalTrack()->hitPattern().numberOfValidMuonHits() > 0 && diff --git a/L1Trigger/Phase2L1ParticleFlow/interface/DiscretePFInputsIO.h b/L1Trigger/Phase2L1ParticleFlow/interface/DiscretePFInputsIO.h index ddb8b4f526b57..11df865e31afc 100644 --- a/L1Trigger/Phase2L1ParticleFlow/interface/DiscretePFInputsIO.h +++ b/L1Trigger/Phase2L1ParticleFlow/interface/DiscretePFInputsIO.h @@ -8,7 +8,7 @@ #include "DiscretePFInputs.h" namespace l1tpf_impl { - void writeToFile(const CaloCluster &c, FILE *file) { + inline void writeToFile(const CaloCluster &c, FILE *file) { fwrite(&c.hwPt, 2, 1, file); fwrite(&c.hwEmPt, 2, 1, file); fwrite(&c.hwPtErr, 2, 1, file); @@ -19,7 +19,7 @@ namespace l1tpf_impl { // used is not written out // src is not written out } - void readFromFile(CaloCluster &c, FILE *file) { + inline void readFromFile(CaloCluster &c, FILE *file) { fread(&c.hwPt, 2, 1, file); fread(&c.hwEmPt, 2, 1, file); fread(&c.hwPtErr, 2, 1, file); @@ -31,7 +31,7 @@ namespace l1tpf_impl { c.src = nullptr; } - void writeToFile(const InputTrack &t, FILE *file) { + inline void writeToFile(const InputTrack &t, FILE *file) { fwrite(&t.hwInvpt, 2, 1, file); fwrite(&t.hwVtxEta, 4, 1, file); fwrite(&t.hwVtxPhi, 4, 1, file); @@ -42,7 +42,7 @@ namespace l1tpf_impl { fwrite(&t.hwFlags, 2, 1, file); // src is not written out } - void readFromFile(InputTrack &t, FILE *file) { + inline void readFromFile(InputTrack &t, FILE *file) { fread(&t.hwInvpt, 2, 1, file); fread(&t.hwVtxEta, 4, 1, file); fread(&t.hwVtxPhi, 4, 1, file); @@ -53,7 +53,7 @@ namespace l1tpf_impl { fread(&t.hwFlags, 2, 1, file); t.src = nullptr; } - void writeToFile(const PropagatedTrack &t, FILE *file) { + inline void writeToFile(const PropagatedTrack &t, FILE *file) { writeToFile(static_cast(t), file); fwrite(&t.hwPt, 2, 1, file); fwrite(&t.hwPtErr, 2, 1, file); @@ -62,7 +62,7 @@ namespace l1tpf_impl { fwrite(&t.hwPhi, 2, 1, file); // muonLink, used, fromPV are transient } - void readFromFile(PropagatedTrack &t, FILE *file) { + inline void readFromFile(PropagatedTrack &t, FILE *file) { readFromFile(static_cast(t), file); fread(&t.hwPt, 2, 1, file); fread(&t.hwPtErr, 2, 1, file); @@ -74,14 +74,14 @@ namespace l1tpf_impl { t.fromPV = false; } - void writeToFile(const Muon &m, FILE *file) { + inline void writeToFile(const Muon &m, FILE *file) { fwrite(&m.hwPt, 2, 1, file); fwrite(&m.hwEta, 2, 1, file); fwrite(&m.hwPhi, 2, 1, file); fwrite(&m.hwFlags, 2, 1, file); fwrite(&m.hwCharge, 1, 1, file); } - void readFromFile(Muon &m, FILE *file) { + inline void readFromFile(Muon &m, FILE *file) { fread(&m.hwPt, 2, 1, file); fread(&m.hwEta, 2, 1, file); fread(&m.hwPhi, 2, 1, file); @@ -90,8 +90,8 @@ namespace l1tpf_impl { m.src = nullptr; } - void writeToFile(const float &pug, FILE *file) { fwrite(&pug, sizeof(float), 1, file); } - void readFromFile(float &pug, FILE *file) { fread(&pug, sizeof(float), 1, file); } + inline void writeToFile(const float &pug, FILE *file) { fwrite(&pug, sizeof(float), 1, file); } + inline void readFromFile(float &pug, FILE *file) { fread(&pug, sizeof(float), 1, file); } template void writeManyToFile(const std::vector &objs, FILE *file) { @@ -110,7 +110,7 @@ namespace l1tpf_impl { readFromFile(objs[i], file); } - void writeToFile(const InputRegion &r, FILE *file) { + inline void writeToFile(const InputRegion &r, FILE *file) { assert(4 == sizeof(float)); fwrite(&r.etaCenter, 4, 1, file); fwrite(&r.etaMin, 4, 1, file); @@ -124,7 +124,7 @@ namespace l1tpf_impl { writeManyToFile(r.track, file); writeManyToFile(r.muon, file); } - void readFromFile(InputRegion &r, FILE *file) { + inline void readFromFile(InputRegion &r, FILE *file) { assert(4 == sizeof(float)); fread(&r.etaCenter, 4, 1, file); fread(&r.etaMin, 4, 1, file); diff --git a/L1Trigger/Phase2L1ParticleFlow/src/utils/DiscretePF2Firmware.h b/L1Trigger/Phase2L1ParticleFlow/src/utils/DiscretePF2Firmware.h index 0fbf23b86c8e8..4732a3aeaef8a 100644 --- a/L1Trigger/Phase2L1ParticleFlow/src/utils/DiscretePF2Firmware.h +++ b/L1Trigger/Phase2L1ParticleFlow/src/utils/DiscretePF2Firmware.h @@ -9,7 +9,7 @@ namespace dpf2fw { // convert inputs from discrete to firmware - void convert(const l1tpf_impl::PropagatedTrack &in, TkObj &out) { + inline void convert(const l1tpf_impl::PropagatedTrack &in, TkObj &out) { out.hwPt = in.hwPt; out.hwPtErr = in.hwCaloPtErr; out.hwEta = in.hwEta; // @calo @@ -18,26 +18,26 @@ namespace dpf2fw { out.hwTightQuality = (in.hwStubs >= 6 && in.hwChi2 < 500); } - TkObj transformConvert(const l1tpf_impl::PropagatedTrack &in) { + inline TkObj transformConvert(const l1tpf_impl::PropagatedTrack &in) { TkObj out; convert(in, out); return out; } - void convert(const l1tpf_impl::CaloCluster &in, HadCaloObj &out) { + inline void convert(const l1tpf_impl::CaloCluster &in, HadCaloObj &out) { out.hwPt = in.hwPt; out.hwEmPt = in.hwEmPt; out.hwEta = in.hwEta; out.hwPhi = in.hwPhi; out.hwIsEM = in.isEM; } - void convert(const l1tpf_impl::CaloCluster &in, EmCaloObj &out) { + inline void convert(const l1tpf_impl::CaloCluster &in, EmCaloObj &out) { out.hwPt = in.hwPt; out.hwPtErr = in.hwPtErr; out.hwEta = in.hwEta; out.hwPhi = in.hwPhi; } - void convert(const l1tpf_impl::Muon &in, MuObj &out) { + inline void convert(const l1tpf_impl::Muon &in, MuObj &out) { out.hwPt = in.hwPt; out.hwPtErr = 0; // does not exist in input out.hwEta = in.hwEta; // @calo diff --git a/PhysicsTools/PatUtils/interface/PATJetCorrExtractor.h b/PhysicsTools/PatUtils/interface/PATJetCorrExtractor.h index e1448ab80b670..36eab13e7c566 100644 --- a/PhysicsTools/PatUtils/interface/PATJetCorrExtractor.h +++ b/PhysicsTools/PatUtils/interface/PATJetCorrExtractor.h @@ -30,7 +30,7 @@ #include namespace { - std::string format_vstring(const std::vector& v) { + inline std::string format_vstring(const std::vector& v) { std::string retVal; retVal.append("{ "); diff --git a/RecoBTag/FeatureTools/interface/SeedingTracksConverter.h b/RecoBTag/FeatureTools/interface/SeedingTracksConverter.h index 9fed81b17c46c..d02407f6153c2 100644 --- a/RecoBTag/FeatureTools/interface/SeedingTracksConverter.h +++ b/RecoBTag/FeatureTools/interface/SeedingTracksConverter.h @@ -29,7 +29,7 @@ namespace btagbtvdeep { bool computeProbabilities, std::vector& seedingT_features_vector); - float logWithOffset(float v, float logOffset = 0) { + inline float logWithOffset(float v, float logOffset = 0) { if (v == 0.) return 0.; return logOffset + log(std::fabs(v)) * std::copysign(1.f, v); diff --git a/RecoBTag/ImpactParameter/plugins/IPProducer.h b/RecoBTag/ImpactParameter/plugins/IPProducer.h index 1acf7a42c9832..aa6ed5e8ddc5d 100644 --- a/RecoBTag/ImpactParameter/plugins/IPProducer.h +++ b/RecoBTag/ImpactParameter/plugins/IPProducer.h @@ -441,7 +441,7 @@ void IPProducer::checkEventSetup(const edm::EventSetup& // Specialized templates used to fill 'descriptions' // ------------ method fills 'descriptions' with the allowed parameters for the module ------------ template <> -void IPProducer::fillDescriptions( +inline void IPProducer::fillDescriptions( edm::ConfigurationDescriptions& descriptions) { edm::ParameterSetDescription desc; desc.add("maximumTransverseImpactParameter", 0.2); @@ -462,7 +462,8 @@ void IPProducer -void IPProducer, reco::JetTagInfo, IPProducerHelpers::FromJetAndCands>::fillDescriptions( +inline void +IPProducer, reco::JetTagInfo, IPProducerHelpers::FromJetAndCands>::fillDescriptions( edm::ConfigurationDescriptions& descriptions) { edm::ParameterSetDescription desc; desc.add("maximumTransverseImpactParameter", 0.2); diff --git a/RecoBTag/SecondaryVertex/interface/CombinedSVSoftLeptonComputer.h b/RecoBTag/SecondaryVertex/interface/CombinedSVSoftLeptonComputer.h index 42bcf34520458..20ac814dc35d6 100644 --- a/RecoBTag/SecondaryVertex/interface/CombinedSVSoftLeptonComputer.h +++ b/RecoBTag/SecondaryVertex/interface/CombinedSVSoftLeptonComputer.h @@ -27,7 +27,9 @@ class CombinedSVSoftLeptonComputer : public CombinedSVComputer { bool SoftLeptonFlip; }; -double CombinedSVSoftLeptonComputer::flipSoftLeptonValue(double value) const { return SoftLeptonFlip ? -value : value; } +inline double CombinedSVSoftLeptonComputer::flipSoftLeptonValue(double value) const { + return SoftLeptonFlip ? -value : value; +} template reco::TaggingVariableList CombinedSVSoftLeptonComputer::operator()(const IPTI &ipInfo, diff --git a/RecoEgamma/EgammaTools/interface/EGExtraInfoModifierFromValueMaps.h b/RecoEgamma/EgammaTools/interface/EGExtraInfoModifierFromValueMaps.h index 3465fe253b5bb..2cd2e3aa17d4e 100644 --- a/RecoEgamma/EgammaTools/interface/EGExtraInfoModifierFromValueMaps.h +++ b/RecoEgamma/EgammaTools/interface/EGExtraInfoModifierFromValueMaps.h @@ -281,7 +281,7 @@ void EGXtraModFromVMObjFiller::addValueToObject( template <> template <> -void EGXtraModFromVMObjFiller::addValuesToObject( +inline void EGXtraModFromVMObjFiller::addValuesToObject( pat::Electron& obj, const edm::Ptr& ptr, const std::unordered_map>>& vmaps_token, @@ -299,7 +299,7 @@ void EGXtraModFromVMObjFiller::addValuesToObject( template <> template <> -void EGXtraModFromVMObjFiller::addValuesToObject( +inline void EGXtraModFromVMObjFiller::addValuesToObject( pat::Photon& obj, const edm::Ptr& ptr, const std::unordered_map>>& vmaps_token, diff --git a/RecoEgamma/EgammaTools/interface/MVAValueMapProducer.h b/RecoEgamma/EgammaTools/interface/MVAValueMapProducer.h index 6f15997541252..8de161929592f 100644 --- a/RecoEgamma/EgammaTools/interface/MVAValueMapProducer.h +++ b/RecoEgamma/EgammaTools/interface/MVAValueMapProducer.h @@ -65,7 +65,7 @@ namespace { iEvent.put(std::move(valMap), label); } - auto getMVAEstimators(const edm::VParameterSet& vConfig) { + inline auto getMVAEstimators(const edm::VParameterSet& vConfig) { std::vector> mvaEstimators; // Loop over the list of MVA configurations passed here from python and @@ -85,7 +85,7 @@ namespace { return mvaEstimators; } - std::vector getValueMapNames(const edm::VParameterSet& vConfig, std::string&& suffix) { + inline std::vector getValueMapNames(const edm::VParameterSet& vConfig, std::string&& suffix) { std::vector names; for (auto& imva : vConfig) { names.push_back(imva.getParameter("mvaName") + imva.getParameter("mvaTag") + suffix); diff --git a/RecoMuon/MuonIdentification/plugins/MuonSelectionTypeValueMapProducer.h b/RecoMuon/MuonIdentification/plugins/MuonSelectionTypeValueMapProducer.h index 89d4ad05dd4c6..2f0e4208d2bcc 100644 --- a/RecoMuon/MuonIdentification/plugins/MuonSelectionTypeValueMapProducer.h +++ b/RecoMuon/MuonIdentification/plugins/MuonSelectionTypeValueMapProducer.h @@ -36,7 +36,7 @@ class MuonSelectionTypeValueMapProducer : public edm::stream::EDProducer<> { muon::SelectionType selectionType_; }; -void MuonSelectionTypeValueMapProducer::produce(edm::Event& iEvent, const edm::EventSetup& iSetup) { +inline void MuonSelectionTypeValueMapProducer::produce(edm::Event& iEvent, const edm::EventSetup& iSetup) { // input muon collection edm::Handle muonsH; iEvent.getByToken(muonToken_, muonsH); diff --git a/RecoParticleFlow/PFClusterProducer/plugins/SimMappers/RealisticHitToClusterAssociator.h b/RecoParticleFlow/PFClusterProducer/plugins/SimMappers/RealisticHitToClusterAssociator.h index f651657612e10..e7b159fb0b7b5 100644 --- a/RecoParticleFlow/PFClusterProducer/plugins/SimMappers/RealisticHitToClusterAssociator.h +++ b/RecoParticleFlow/PFClusterProducer/plugins/SimMappers/RealisticHitToClusterAssociator.h @@ -12,7 +12,7 @@ namespace { - float getDecayLength(unsigned int layer, unsigned int fhOffset, unsigned int bhOffset) { + inline float getDecayLength(unsigned int layer, unsigned int fhOffset, unsigned int bhOffset) { constexpr float eeDecayLengthInLayer = 2.f; constexpr float fhDecayLengthInLayer = 1.5f; constexpr float bhDecayLengthInLayer = 1.f; diff --git a/RecoPixelVertexing/PixelTriplets/plugins/CAHitNtupletGeneratorKernelsAlloc.h b/RecoPixelVertexing/PixelTriplets/plugins/CAHitNtupletGeneratorKernelsAlloc.h index 1d19aa43d6e1b..bc0dcf0b16fbe 100644 --- a/RecoPixelVertexing/PixelTriplets/plugins/CAHitNtupletGeneratorKernelsAlloc.h +++ b/RecoPixelVertexing/PixelTriplets/plugins/CAHitNtupletGeneratorKernelsAlloc.h @@ -6,7 +6,7 @@ template <> #ifdef __CUDACC__ void CAHitNtupletGeneratorKernelsGPU::allocateOnGPU(cudaStream_t stream) { #else -void CAHitNtupletGeneratorKernelsCPU::allocateOnGPU(cudaStream_t stream) { +inline void CAHitNtupletGeneratorKernelsCPU::allocateOnGPU(cudaStream_t stream) { #endif ////////////////////////////////////////////////////////// // ALLOCATIONS FOR THE INTERMEDIATE RESULTS (STAYS ON WORKER) diff --git a/RecoPixelVertexing/PixelVertexFinding/interface/FindPeakFastPV.h b/RecoPixelVertexing/PixelVertexFinding/interface/FindPeakFastPV.h index 75b3d496a638b..7a5cbe488d0f7 100644 --- a/RecoPixelVertexing/PixelVertexFinding/interface/FindPeakFastPV.h +++ b/RecoPixelVertexing/PixelVertexFinding/interface/FindPeakFastPV.h @@ -10,12 +10,12 @@ #include -float FindPeakFastPV(const std::vector &zProjections, - const std::vector &zWeights, - const float oldVertex, - const float m_zClusterWidth, - const float m_zClusterSearchArea, - const float m_weightCut) { +inline float FindPeakFastPV(const std::vector &zProjections, + const std::vector &zWeights, + const float oldVertex, + const float m_zClusterWidth, + const float m_zClusterSearchArea, + const float m_weightCut) { float centerWMax = oldVertex; if (m_zClusterWidth > 0 && m_zClusterSearchArea > 0) { std::vector::const_iterator itCenter = zProjections.begin(); diff --git a/RecoPixelVertexing/PixelVertexFinding/plugins/gpuVertexFinderImpl.h b/RecoPixelVertexing/PixelVertexFinding/plugins/gpuVertexFinderImpl.h index d685ced488233..75741e2e07c7d 100644 --- a/RecoPixelVertexing/PixelVertexFinding/plugins/gpuVertexFinderImpl.h +++ b/RecoPixelVertexing/PixelVertexFinding/plugins/gpuVertexFinderImpl.h @@ -102,7 +102,7 @@ namespace gpuVertexFinder { #endif // PIXVERTEX_DEBUG_PRODUCE ZVertexHeterogeneous vertices(cms::cuda::make_device_unique(stream)); #else - ZVertexHeterogeneous Producer::make(TkSoA const* tksoa, float ptMin) const { + inline ZVertexHeterogeneous Producer::make(TkSoA const* tksoa, float ptMin) const { #ifdef PIXVERTEX_DEBUG_PRODUCE std::cout << "producing Vertices on CPU" << std::endl; #endif // PIXVERTEX_DEBUG_PRODUCE diff --git a/RecoTracker/ConversionSeedGenerators/plugins/Conv4HitsReco.h b/RecoTracker/ConversionSeedGenerators/plugins/Conv4HitsReco.h index d7e258b54ec8f..8726c9400a338 100644 --- a/RecoTracker/ConversionSeedGenerators/plugins/Conv4HitsReco.h +++ b/RecoTracker/ConversionSeedGenerators/plugins/Conv4HitsReco.h @@ -96,7 +96,7 @@ class Conv4HitsReco { #endif #ifdef Conv4HitsReco_cxx -Conv4HitsReco::Conv4HitsReco(TVector3 &vPhotVertex, TVector3 &h1, TVector3 &h2, TVector3 &h3, TVector3 &h4) { +inline Conv4HitsReco::Conv4HitsReco(TVector3 &vPhotVertex, TVector3 &h1, TVector3 &h2, TVector3 &h3, TVector3 &h4) { vV = vPhotVertex; hit4 = h4; hit3 = h3; @@ -142,7 +142,7 @@ Conv4HitsReco::Conv4HitsReco(TVector3 &vPhotVertex, TVector3 &h1, TVector3 &h2, SetMaxVtxDistance(20.); } -Conv4HitsReco::~Conv4HitsReco() { +inline Conv4HitsReco::~Conv4HitsReco() { // std::cout << " Bye..." << std::endl; } diff --git a/RecoTracker/DebugTools/plugins/GluedDetFromDetUnit.h b/RecoTracker/DebugTools/plugins/GluedDetFromDetUnit.h index b0da7ce37a0f5..14a2300219260 100644 --- a/RecoTracker/DebugTools/plugins/GluedDetFromDetUnit.h +++ b/RecoTracker/DebugTools/plugins/GluedDetFromDetUnit.h @@ -1,6 +1,6 @@ #include "DataFormats/DetId/interface/DetId.h" -DetId gluedId(const DetId& du) { +inline DetId gluedId(const DetId& du) { unsigned int mask = ~3; // mask the last two bits return DetId(du.rawId() & mask); } diff --git a/RecoVertex/AdaptiveVertexFinder/interface/TrackVertexArbitration.h b/RecoVertex/AdaptiveVertexFinder/interface/TrackVertexArbitration.h index db6b491148052..85f079bb72daf 100644 --- a/RecoVertex/AdaptiveVertexFinder/interface/TrackVertexArbitration.h +++ b/RecoVertex/AdaptiveVertexFinder/interface/TrackVertexArbitration.h @@ -119,10 +119,10 @@ bool TrackVertexArbitration::trackFilterArbitrator(const reco::TransientTra return true; } -float trackWeight(const reco::Vertex &sv, const reco::TransientTrack &track) { +inline float trackWeight(const reco::Vertex &sv, const reco::TransientTrack &track) { return sv.trackWeight(track.trackBaseRef()); } -float trackWeight(const reco::VertexCompositePtrCandidate &sv, const reco::TransientTrack &tt) { +inline float trackWeight(const reco::VertexCompositePtrCandidate &sv, const reco::TransientTrack &tt) { const reco::CandidatePtrTransientTrack *cptt = dynamic_cast(tt.basicTransientTrack()); if (cptt == nullptr) diff --git a/RecoVertex/AdaptiveVertexFinder/plugins/TemplatedVertexArbitrator.h b/RecoVertex/AdaptiveVertexFinder/plugins/TemplatedVertexArbitrator.h index 00b9d08e9c918..6e948c1a7669d 100644 --- a/RecoVertex/AdaptiveVertexFinder/plugins/TemplatedVertexArbitrator.h +++ b/RecoVertex/AdaptiveVertexFinder/plugins/TemplatedVertexArbitrator.h @@ -42,8 +42,10 @@ //#define VTXDEBUG -const unsigned int nTracks(const reco::Vertex &sv) { return sv.nTracks(); } -const unsigned int nTracks(const reco::VertexCompositePtrCandidate &sv) { return sv.numberOfSourceCandidatePtrs(); } +inline const unsigned int nTracks(const reco::Vertex &sv) { return sv.nTracks(); } +inline const unsigned int nTracks(const reco::VertexCompositePtrCandidate &sv) { + return sv.numberOfSourceCandidatePtrs(); +} template class TemplatedVertexArbitrator : public edm::stream::EDProducer<> { diff --git a/RecoVertex/BeamSpotProducer/interface/BeamSpotWrite2Txt.h b/RecoVertex/BeamSpotProducer/interface/BeamSpotWrite2Txt.h index bd3dd5bb42359..7a1f2f12eb7c5 100644 --- a/RecoVertex/BeamSpotProducer/interface/BeamSpotWrite2Txt.h +++ b/RecoVertex/BeamSpotProducer/interface/BeamSpotWrite2Txt.h @@ -17,7 +17,7 @@ namespace beamspot { std::time_t reftime[2]; }; - void dumpBeamSpotTxt(std::ofstream& outFile, BeamSpotContainer const& bsContainer) { + inline void dumpBeamSpotTxt(std::ofstream& outFile, BeamSpotContainer const& bsContainer) { outFile << "Runnumber " << bsContainer.run << std::endl; outFile << "BeginTimeOfFit " << bsContainer.beginTimeOfFit << " " << bsContainer.reftime[0] << std::endl; outFile << "EndTimeOfFit " << bsContainer.endTimeOfFit << " " << bsContainer.reftime[1] << std::endl; diff --git a/SimCalorimetry/HGCalAssociatorProducers/interface/AssociatorTools.h b/SimCalorimetry/HGCalAssociatorProducers/interface/AssociatorTools.h index 5a0b2b04d0f1f..1efcded86f2b3 100644 --- a/SimCalorimetry/HGCalAssociatorProducers/interface/AssociatorTools.h +++ b/SimCalorimetry/HGCalAssociatorProducers/interface/AssociatorTools.h @@ -4,7 +4,7 @@ #include "SimDataFormats/CaloAnalysis/interface/CaloParticle.h" #include -void removeCPFromPU(const std::vector& caloParticles, std::vector& cPIndices) { +inline void removeCPFromPU(const std::vector& caloParticles, std::vector& cPIndices) { //Consider CaloParticles coming from the hard scatterer //excluding the PU contribution and save the indices. for (unsigned int cpId = 0; cpId < caloParticles.size(); ++cpId) { diff --git a/SimFastTiming/FastTimingCommon/interface/MTDDigitizer.h b/SimFastTiming/FastTimingCommon/interface/MTDDigitizer.h index e546279165f59..9c5db89f5d7a6 100644 --- a/SimFastTiming/FastTimingCommon/interface/MTDDigitizer.h +++ b/SimFastTiming/FastTimingCommon/interface/MTDDigitizer.h @@ -38,7 +38,7 @@ namespace mtd_digitizer { // index , det id, time typedef std::tuple MTDCaloHitTuple_t; - bool orderByDetIdThenTime(const MTDCaloHitTuple_t& a, const MTDCaloHitTuple_t& b) { + inline bool orderByDetIdThenTime(const MTDCaloHitTuple_t& a, const MTDCaloHitTuple_t& b) { unsigned int detId_a(std::get<1>(a)), detId_b(std::get<1>(b)); if (detId_a < detId_b) diff --git a/SimTracker/TrackAssociation/interface/trackHitsToClusterRefs.h b/SimTracker/TrackAssociation/interface/trackHitsToClusterRefs.h index 171a7eb6f2efe..89b2ed5733bc0 100644 --- a/SimTracker/TrackAssociation/interface/trackHitsToClusterRefs.h +++ b/SimTracker/TrackAssociation/interface/trackHitsToClusterRefs.h @@ -13,9 +13,9 @@ #include "FWCore/MessageLogger/interface/MessageLogger.h" namespace track_associator { - const TrackingRecHit *getHitFromIter(trackingRecHit_iterator iter) { return &(**iter); } + inline const TrackingRecHit *getHitFromIter(trackingRecHit_iterator iter) { return &(**iter); } - const TrackingRecHit *getHitFromIter(TrackingRecHitCollection::const_iterator iter) { return &(*iter); } + inline const TrackingRecHit *getHitFromIter(TrackingRecHitCollection::const_iterator iter) { return &(*iter); } template std::vector hitsToClusterRefs(iter begin, iter end) { diff --git a/SimTracker/TrackerMaterialAnalysis/plugins/ListGroupsMaterialDifference.h b/SimTracker/TrackerMaterialAnalysis/plugins/ListGroupsMaterialDifference.h index a775a8629c04f..5daa93969b5d4 100644 --- a/SimTracker/TrackerMaterialAnalysis/plugins/ListGroupsMaterialDifference.h +++ b/SimTracker/TrackerMaterialAnalysis/plugins/ListGroupsMaterialDifference.h @@ -3,6 +3,6 @@ #ifndef SIMTRACKER_TRACKERMATERIALANALYSIS_LISTGROUPS_MATERIALDIFFERENCE_H #define SIMTRACKER_TRACKERMATERIALANALYSIS_LISTGROUPS_MATERIALDIFFERENCE_H -void ListGroups::fillMaterialDifferences() {} +inline void ListGroups::fillMaterialDifferences() {} #endif // SIMTRACKER_TRACKERMATERIALANALYSIS_LISTGROUPS_MATERIALDIFFERENCE_H diff --git a/SimTracker/TrackerMaterialAnalysis/plugins/dd4hep/DD4hep_ListGroupsMaterialDifference.h b/SimTracker/TrackerMaterialAnalysis/plugins/dd4hep/DD4hep_ListGroupsMaterialDifference.h index 9a4ec5bd11cbc..20c69de826e8f 100644 --- a/SimTracker/TrackerMaterialAnalysis/plugins/dd4hep/DD4hep_ListGroupsMaterialDifference.h +++ b/SimTracker/TrackerMaterialAnalysis/plugins/dd4hep/DD4hep_ListGroupsMaterialDifference.h @@ -3,6 +3,6 @@ #ifndef DD4HEP_SIMTRACKER_TRACKERMATERIALANALYSIS_LISTGROUPS_MATERIALDIFFERENCE_H #define DD4HEP_SIMTRACKER_TRACKERMATERIALANALYSIS_LISTGROUPS_MATERIALDIFFERENCE_H -void DD4hep_ListGroups::fillMaterialDifferences() {} +inline void DD4hep_ListGroups::fillMaterialDifferences() {} #endif // DD4HEP_SIMTRACKER_TRACKERMATERIALANALYSIS_LISTGROUPS_MATERIALDIFFERENCE_H diff --git a/TopQuarkAnalysis/TopEventProducers/interface/TtEvtBuilder.h b/TopQuarkAnalysis/TopEventProducers/interface/TtEvtBuilder.h index 7304dc7427f3d..38b6064e239e8 100644 --- a/TopQuarkAnalysis/TopEventProducers/interface/TtEvtBuilder.h +++ b/TopQuarkAnalysis/TopEventProducers/interface/TtEvtBuilder.h @@ -248,10 +248,10 @@ void TtEvtBuilder::produce(edm::Event& evt, const edm::EventSetup& setup) { } template <> -void TtEvtBuilder::fillSpecific(TtFullHadronicEvent& ttEvent, const edm::Event& evt) {} +inline void TtEvtBuilder::fillSpecific(TtFullHadronicEvent& ttEvent, const edm::Event& evt) {} template <> -void TtEvtBuilder::fillSpecific(TtFullLeptonicEvent& ttEvent, const edm::Event& evt) { +inline void TtEvtBuilder::fillSpecific(TtFullLeptonicEvent& ttEvent, const edm::Event& evt) { // set kKinSolution extras if (ttEvent.isHypoAvailable(TtEvent::kKinSolution)) { edm::Handle > solWeight; @@ -265,7 +265,7 @@ void TtEvtBuilder::fillSpecific(TtFullLeptonicEvent& ttEven } template <> -void TtEvtBuilder::fillSpecific(TtSemiLeptonicEvent& ttEvent, const edm::Event& evt) { +inline void TtEvtBuilder::fillSpecific(TtSemiLeptonicEvent& ttEvent, const edm::Event& evt) { EventHypoIntToken hKey = hypKeyTokens_.begin(); EventHypoIntToken hNeutr = hypNeutrTokens_.begin(); EventHypoIntToken hJet = hypJetTokens_.begin(); diff --git a/TopQuarkAnalysis/TopKinFitter/plugins/TtFullLepKinSolutionProducer.h b/TopQuarkAnalysis/TopKinFitter/plugins/TtFullLepKinSolutionProducer.h index d3761e5ed7146..14777a64100a4 100644 --- a/TopQuarkAnalysis/TopKinFitter/plugins/TtFullLepKinSolutionProducer.h +++ b/TopQuarkAnalysis/TopKinFitter/plugins/TtFullLepKinSolutionProducer.h @@ -61,7 +61,7 @@ inline bool TtFullLepKinSolutionProducer::HasPositiveCharge(const reco::Candidat return (l->charge() > 0); } -TtFullLepKinSolutionProducer::TtFullLepKinSolutionProducer(const edm::ParameterSet& iConfig) { +inline TtFullLepKinSolutionProducer::TtFullLepKinSolutionProducer(const edm::ParameterSet& iConfig) { // configurables jetsToken_ = consumes >(iConfig.getParameter("jets")); electronsToken_ = consumes >(iConfig.getParameter("electrons")); @@ -87,15 +87,15 @@ TtFullLepKinSolutionProducer::TtFullLepKinSolutionProducer(const edm::ParameterS produces("isWrongCharge"); //true if leptons have the same charge } -TtFullLepKinSolutionProducer::~TtFullLepKinSolutionProducer() {} +inline TtFullLepKinSolutionProducer::~TtFullLepKinSolutionProducer() {} -void TtFullLepKinSolutionProducer::beginJob() { +inline void TtFullLepKinSolutionProducer::beginJob() { solver = new TtFullLepKinSolver(tmassbegin_, tmassend_, tmassstep_, nupars_); } -void TtFullLepKinSolutionProducer::endJob() { delete solver; } +inline void TtFullLepKinSolutionProducer::endJob() { delete solver; } -void TtFullLepKinSolutionProducer::produce(edm::Event& evt, const edm::EventSetup& iSetup) { +inline void TtFullLepKinSolutionProducer::produce(edm::Event& evt, const edm::EventSetup& iSetup) { //create vectors fo runsorted output std::vector > idcsV; std::vector nusV; diff --git a/TrackingTools/TrackFitters/plugins/KFFittingSmoother.h b/TrackingTools/TrackFitters/plugins/KFFittingSmoother.h index 8a3e89bb670a8..bdf36f70fab3b 100644 --- a/TrackingTools/TrackFitters/plugins/KFFittingSmoother.h +++ b/TrackingTools/TrackFitters/plugins/KFFittingSmoother.h @@ -126,13 +126,13 @@ namespace { #define PRINT LogTrace("") #endif - Trajectory KFFittingSmoother::fitOne(const Trajectory& t, fitType type) const { + inline Trajectory KFFittingSmoother::fitOne(const Trajectory& t, fitType type) const { if (!t.isValid()) return Trajectory(); return smoothingStep(theFitter->fitOne(t, type)); } - bool KFFittingSmoother::checkForNans(const Trajectory& theTraj) { + inline bool KFFittingSmoother::checkForNans(const Trajectory& theTraj) { if (edm::isNotFinite(theTraj.chiSquared())) return false; auto const& vtm = theTraj.measurements(); @@ -162,10 +162,10 @@ namespace { } } // namespace - Trajectory KFFittingSmoother::fitOne(const TrajectorySeed& aSeed, - const RecHitContainer& hits, - const TrajectoryStateOnSurface& firstPredTsos, - fitType type) const { + inline Trajectory KFFittingSmoother::fitOne(const TrajectorySeed& aSeed, + const RecHitContainer& hits, + const TrajectoryStateOnSurface& firstPredTsos, + fitType type) const { LogDebug("TrackFitters") << "In KFFittingSmoother::fit"; print("firstPred ", firstPredTsos); @@ -413,7 +413,9 @@ namespace { return smoothed; } - Trajectory KFFittingSmoother::fitOne(const TrajectorySeed& aSeed, const RecHitContainer& hits, fitType type) const { + inline Trajectory KFFittingSmoother::fitOne(const TrajectorySeed& aSeed, + const RecHitContainer& hits, + fitType type) const { throw cms::Exception("TrackFitters", "KFFittingSmoother::fit(TrajectorySeed, ) not implemented");