Skip to content
New issue

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

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

Already on GitHub? Sign in to your account

[JetMETCorrections][clang-tidy] make deleted function public #34687

Merged
merged 2 commits into from
Jul 29, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,8 @@ namespace edm {
class JetCorrectorImplMakerBase {
public:
JetCorrectorImplMakerBase(edm::ParameterSet const&);
JetCorrectorImplMakerBase(const JetCorrectorImplMakerBase&) = delete; // stop default
const JetCorrectorImplMakerBase& operator=(const JetCorrectorImplMakerBase&) = delete; // stop default
virtual ~JetCorrectorImplMakerBase();

// ---------- const member functions ---------------------
Expand All @@ -50,10 +52,6 @@ class JetCorrectorImplMakerBase {
edm::EventSetup const&, std::function<void(std::string const&)> levelCheck);

private:
JetCorrectorImplMakerBase(const JetCorrectorImplMakerBase&) = delete; // stop default

const JetCorrectorImplMakerBase& operator=(const JetCorrectorImplMakerBase&) = delete; // stop default

// ---------- member data --------------------------------
std::string level_;
std::string algo_;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -45,13 +45,12 @@
class FFTJetCorrectorDBReader : public edm::EDAnalyzer {
public:
explicit FFTJetCorrectorDBReader(const edm::ParameterSet&);
~FFTJetCorrectorDBReader() override {}

private:
FFTJetCorrectorDBReader() = delete;
FFTJetCorrectorDBReader(const FFTJetCorrectorDBReader&) = delete;
FFTJetCorrectorDBReader& operator=(const FFTJetCorrectorDBReader&) = delete;
~FFTJetCorrectorDBReader() override {}

private:
void analyze(const edm::Event&, const edm::EventSetup&) override;

std::string record;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -42,13 +42,12 @@
class FFTJetCorrectorDBWriter : public edm::EDAnalyzer {
public:
explicit FFTJetCorrectorDBWriter(const edm::ParameterSet&);
~FFTJetCorrectorDBWriter() override {}

private:
FFTJetCorrectorDBWriter() = delete;
FFTJetCorrectorDBWriter(const FFTJetCorrectorDBWriter&) = delete;
FFTJetCorrectorDBWriter& operator=(const FFTJetCorrectorDBWriter&) = delete;
~FFTJetCorrectorDBWriter() override {}

private:
void analyze(const edm::Event&, const edm::EventSetup&) override;

std::string inputFile;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ class AbsFFTJetScaleCalculator {

inline explicit AbsFFTJetScaleCalculator(std::shared_ptr<npstat::AbsMultivariateFunctor> f)
: functor(f), buffer_(f->minDim()) {}
AbsFFTJetScaleCalculator() = delete;

inline virtual ~AbsFFTJetScaleCalculator() {}

Expand All @@ -25,8 +26,6 @@ class AbsFFTJetScaleCalculator {
}

private:
AbsFFTJetScaleCalculator() = delete;

virtual void map(const Jet& jet, const Adjustable& current, double* buf, unsigned dim) const = 0;

std::shared_ptr<npstat::AbsMultivariateFunctor> functor;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ class FFTJetCorrectorResult {

inline FFTJetCorrectorResult(const LorentzVector& v, const double correctionScale, const double systematicUncertainty)
: vec_(v), scale_(correctionScale), sigma_(systematicUncertainty) {}
FFTJetCorrectorResult() = delete;

inline const LorentzVector& vec() const { return vec_; }
inline double scale() const { return scale_; }
Expand All @@ -26,8 +27,6 @@ class FFTJetCorrectorResult {
inline void setSigma(const double s) { sigma_ = s; }

private:
FFTJetCorrectorResult() = delete;

LorentzVector vec_;
double scale_;
double sigma_;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ class FFTJetCorrectorTransient {
const double initialScale = 1.0,
const double initialSigma = 0.0)
: vec_(v), scale_(initialScale), variance_(initialSigma * initialSigma) {}
FFTJetCorrectorTransient() = delete;

inline const LorentzVector& vec() const { return vec_; }
inline double scale() const { return scale_; }
Expand All @@ -39,8 +40,6 @@ class FFTJetCorrectorTransient {
}

private:
FFTJetCorrectorTransient() = delete;

LorentzVector vec_;
double scale_;
double variance_;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,6 @@ struct DefaultFFTJetObjectFactory : public std::map<std::string, AbsFFTJetObject
return it->second->create(ps);
}

private:
DefaultFFTJetObjectFactory(const DefaultFFTJetObjectFactory&) = delete;
DefaultFFTJetObjectFactory& operator=(const DefaultFFTJetObjectFactory&) = delete;
};
Expand All @@ -67,7 +66,6 @@ class StaticFFTJetObjectFactory {
rd[className] = new ConcreteFFTJetObjectFactory<base_type, T>();
}

private:
StaticFFTJetObjectFactory() = delete;
};

Expand Down
2 changes: 0 additions & 2 deletions JetMETCorrections/FFTJetObjects/interface/FFTJetRcdMapper.h
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,6 @@ struct DefaultFFTJetRcdMapper : public std::map<std::string, AbsFFTJetRcdMapper<
it->second->load(iSetup, label, handle);
}

private:
DefaultFFTJetRcdMapper(const DefaultFFTJetRcdMapper&) = delete;
DefaultFFTJetRcdMapper& operator=(const DefaultFFTJetRcdMapper&) = delete;
};
Expand All @@ -95,7 +94,6 @@ class StaticFFTJetRcdMapper {
rd[record] = new ConcreteFFTJetRcdMapper<data_type, Record>();
}

private:
StaticFFTJetRcdMapper() = delete;
};

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,8 @@ namespace npstat {
inline explicit ArrayNDScanner(const std::vector<unsigned>& shape) {
initialize(shape.empty() ? static_cast<unsigned*>(nullptr) : &shape[0], shape.size());
}

ArrayNDScanner() = delete;
//@}

/** Dimensionality of the scan */
Expand Down Expand Up @@ -79,8 +81,6 @@ namespace npstat {
inline void setState(const unsigned long state) { state_ = state <= maxState_ ? state : maxState_; }

private:
ArrayNDScanner() = delete;

void initialize(const unsigned* shape, unsigned lenShape);

unsigned long strides_[CHAR_BIT * sizeof(unsigned long)];
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,8 @@ namespace npstat {
public:
inline explicit CoordinateSelector(const unsigned i) : index_(i) {}

CoordinateSelector() = delete;

inline ~CoordinateSelector() override {}

inline double operator()(const double* point, const unsigned dim) const override {
Expand All @@ -39,7 +41,6 @@ namespace npstat {
inline unsigned maxDim() const override { return UINT_MAX; }

private:
CoordinateSelector() = delete;
unsigned index_;
};
} // namespace npstat
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,6 @@ namespace npstat {
EquidistantInLinearSpace(double minScale, double maxScale, unsigned nScales);
virtual ~EquidistantInLinearSpace() {}

private:
EquidistantInLinearSpace() = delete;
};

Expand All @@ -38,7 +37,6 @@ namespace npstat {
EquidistantInLogSpace(double minScale, double maxScale, unsigned nScales);
virtual ~EquidistantInLogSpace() {}

private:
EquidistantInLogSpace() = delete;
};
} // namespace npstat
Expand Down
5 changes: 3 additions & 2 deletions JetMETCorrections/InterpolationTables/interface/HistoND.h
Original file line number Diff line number Diff line change
Expand Up @@ -166,6 +166,9 @@ namespace npstat {
*/
HistoND& operator=(const HistoND&);

/** Default constructor not implemented **/
HistoND() = delete;

/** Histogram dimensionality */
inline unsigned dim() const { return dim_; }

Expand Down Expand Up @@ -927,8 +930,6 @@ namespace npstat {
static HistoND* read(const gs::ClassId& id, std::istream& in);

private:
HistoND() = delete;

// Special constructor which speeds up the "transpose" operation.
// Does not do full error checking (some of it is done in transpose).
HistoND(const HistoND& r, unsigned ax1, unsigned ax2);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -118,6 +118,9 @@ namespace npstat {
template <class Num2>
LinInterpolatedTableND(const LinInterpolatedTableND<Num2, Axis>&);

/** Default constructor not implemented **/
LinInterpolatedTableND() = delete;

/**
// Basic interpolation result. Argument point dimensionality must be
// compatible with the interpolator dimensionality.
Expand Down Expand Up @@ -230,8 +233,6 @@ namespace npstat {
static LinInterpolatedTableND* read(const gs::ClassId& id, std::istream& in);

private:
LinInterpolatedTableND() = delete;

LinInterpolatedTableND(const ArrayND<Numeric>& data,
const std::vector<Axis>& axes,
const char* leftInterpolation,
Expand Down
24 changes: 16 additions & 8 deletions JetMETCorrections/InterpolationTables/interface/SimpleFunctors.h
Original file line number Diff line number Diff line change
Expand Up @@ -122,8 +122,9 @@ namespace npstat {

inline Result operator()() const { return fcn_(); }

private:
FcnFunctor0() = delete;

private:
Result (*fcn_)();
};

Expand All @@ -137,8 +138,9 @@ namespace npstat {

inline Result operator()(const Arg1& a) const { return fcn_(a); }

private:
FcnFunctor1() = delete;

private:
Result (*fcn_)(Arg1);
};

Expand All @@ -152,8 +154,9 @@ namespace npstat {

inline Result operator()(const Arg1& x, const Arg2& y) const { return fcn_(x, y); }

private:
FcnFunctor2() = delete;

private:
Result (*fcn_)(Arg1, Arg2);
};

Expand All @@ -167,8 +170,9 @@ namespace npstat {

inline Result operator()(const Arg1& x, const Arg2& y, const Arg3& z) const { return fcn_(x, y, z); }

private:
FcnFunctor3() = delete;

private:
Result (*fcn_)(Arg1, Arg2, Arg3);
};

Expand All @@ -182,8 +186,9 @@ namespace npstat {

inline Result operator()(const Container& c) const { return c[idx]; }

private:
Element1D() = delete;

private:
unsigned long idx;
};

Expand All @@ -197,8 +202,9 @@ namespace npstat {

inline Result operator()(const Container& c) const { return c.at(idx); }

private:
Element1DAt() = delete;

private:
unsigned long idx;
};

Expand Down Expand Up @@ -242,8 +248,9 @@ namespace npstat {

inline T1& operator()(T1& left, const T2& right) const { return left += w_ * right; }

private:
addmul_left() = delete;

private:
double w_;
};

Expand All @@ -257,8 +264,9 @@ namespace npstat {

inline T1& operator()(T1& left, const T2& right) const { return right += w_ * left; }

private:
addmul_right() = delete;

private:
double w_;
};

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,9 @@ namespace npstat {
table_(tab.table_, Same<Num2>(), tab.title().c_str(), tab.accumulatedDataLabel().c_str()),
deg_(tab.deg_) {}

/** Default constructor not implemented **/
StorableHistoNDFunctor() = delete;

~StorableHistoNDFunctor() override {}

unsigned minDim() const override { return table_.dim(); };
Expand Down Expand Up @@ -104,8 +107,6 @@ namespace npstat {
}

private:
StorableHistoNDFunctor() = delete;

Table table_;
unsigned deg_;
Converter conv_;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -133,6 +133,9 @@ namespace npstat {
functionLabel) {}
//@}

/** Default constructor not implemented **/
StorableInterpolationFunctor() = delete;

~StorableInterpolationFunctor() override {}

unsigned minDim() const override { return table_.dim(); };
Expand Down Expand Up @@ -174,8 +177,6 @@ namespace npstat {
}

private:
StorableInterpolationFunctor() = delete;

Table table_;
Converter conv_;
};
Expand Down
6 changes: 2 additions & 4 deletions JetMETCorrections/JetCorrector/interface/JetCorrector.h
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,8 @@ namespace reco {
JetCorrector(std::unique_ptr<JetCorrectorImpl const> fImpl) : impl_(std::move(fImpl)) {}
JetCorrector(JetCorrector&&) = default;
JetCorrector& operator=(JetCorrector&&) = default;
JetCorrector(const JetCorrector&) = delete;
JetCorrector& operator=(const JetCorrector&) = delete;

typedef reco::Particle::LorentzVector LorentzVector;

Expand Down Expand Up @@ -67,10 +69,6 @@ namespace reco {
// ---------- member functions ---------------------------

private:
JetCorrector(const JetCorrector&) = delete;

JetCorrector& operator=(const JetCorrector&) = delete;

// ---------- member data --------------------------------
std::unique_ptr<JetCorrectorImpl const> impl_;
};
Expand Down
7 changes: 3 additions & 4 deletions JetMETCorrections/JetCorrector/interface/JetCorrectorImpl.h
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,9 @@ namespace reco {
class JetCorrectorImpl {
public:
JetCorrectorImpl();
JetCorrectorImpl(const JetCorrectorImpl&) = delete;
const JetCorrectorImpl& operator=(const JetCorrectorImpl&) = delete;

virtual ~JetCorrectorImpl();

typedef reco::Particle::LorentzVector LorentzVector;
Expand Down Expand Up @@ -61,10 +64,6 @@ namespace reco {
// ---------- member functions ---------------------------

private:
JetCorrectorImpl(const JetCorrectorImpl&) = delete;

const JetCorrectorImpl& operator=(const JetCorrectorImpl&) = delete;

// ---------- member data --------------------------------
};
} // namespace reco
Expand Down