Skip to content

Commit c08a0c1

Browse files
committed
Some code modernization in CMSHistFunc and CMSHistErrorPropagator
1 parent 332843b commit c08a0c1

File tree

4 files changed

+5
-19
lines changed

4 files changed

+5
-19
lines changed

interface/CMSHistErrorPropagator.h

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ class CMSHistErrorPropagator : public RooAbsReal {
3333
std::vector<RooRealVar*> push_res;
3434
};
3535
public:
36-
CMSHistErrorPropagator();
36+
CMSHistErrorPropagator() = default;
3737

3838
CMSHistErrorPropagator(const char* name, const char* title, RooRealVar& x,
3939
RooArgList const& funcs, RooArgList const& coeffs);
@@ -44,8 +44,6 @@ class CMSHistErrorPropagator : public RooAbsReal {
4444
return new CMSHistErrorPropagator(*this, newname);
4545
}
4646

47-
~CMSHistErrorPropagator() override {;}
48-
4947
void applyErrorShifts(unsigned idx, FastHisto const& nominal, FastHisto & result);
5048

5149
Double_t evaluate() const override;
@@ -101,7 +99,7 @@ class CMSHistErrorPropagator : public RooAbsReal {
10199

102100
mutable BarlowBeeston bb_; //!
103101

104-
mutable bool initialized_; //! not to be serialized
102+
mutable bool initialized_ = false; //! not to be serialized
105103

106104
mutable int last_eval_; //! not to be serialized
107105

interface/CMSHistFunc.h

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -175,8 +175,8 @@ class CMSHistFunc : public RooAbsReal {
175175
mutable std::vector<Cache> mcache_; //! not to be serialized
176176

177177
unsigned morph_strategy_;
178-
mutable bool initialized_; //! not to be serialized
179-
bool rebin_;
178+
mutable bool initialized_ = false; //! not to be serialized
179+
bool rebin_ = false;
180180
std::vector<unsigned> rebin_scheme_;
181181
HorizontalType htype_;
182182
MomentSetting mtype_;
@@ -186,7 +186,7 @@ class CMSHistFunc : public RooAbsReal {
186186

187187
double vsmooth_par_;
188188

189-
mutable bool fast_vertical_; //! not to be serialized
189+
mutable bool fast_vertical_ = false; //! not to be serialized
190190
mutable std::vector<double> vertical_prev_vals_; //! not to be serialized
191191
mutable std::vector<RooAbsReal*> vmorphs_vec_; //! not to be serialized
192192

src/CMSHistErrorPropagator.cc

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -17,8 +17,6 @@
1717

1818
#define HFVERBOSE 0
1919

20-
CMSHistErrorPropagator::CMSHistErrorPropagator() : initialized_(false) {}
21-
2220
CMSHistErrorPropagator::CMSHistErrorPropagator(const char* name,
2321
const char* title,
2422
RooRealVar& x,
@@ -31,7 +29,6 @@ CMSHistErrorPropagator::CMSHistErrorPropagator(const char* name,
3129
binpars_("binpars", "", this),
3230
sentry_(TString(name) + "_sentry", ""),
3331
binsentry_(TString(name) + "_binsentry", ""),
34-
initialized_(false),
3532
last_eval_(-1) {
3633
funcs_.add(funcs);
3734
coeffs_.add(coeffs);
@@ -47,7 +44,6 @@ CMSHistErrorPropagator::CMSHistErrorPropagator(
4744
bintypes_(other.bintypes_),
4845
sentry_(name ? TString(name) + "_sentry" : TString(other.GetName())+"_sentry", ""),
4946
binsentry_(name ? TString(name) + "_binsentry" : TString(other.GetName())+"_binsentry", ""),
50-
initialized_(false),
5147
last_eval_(-1) {
5248
}
5349

src/CMSHistFunc.cc

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -20,14 +20,11 @@ bool CMSHistFunc::enable_fast_vertical_ = false;
2020

2121
CMSHistFunc::CMSHistFunc() {
2222
morph_strategy_ = 0;
23-
initialized_ = false;
2423
htype_ = HorizontalType::Integral;
2524
mtype_ = MomentSetting::NonLinearPosFractions;
2625
vtype_ = VerticalSetting::QuadLinear;
2726
divide_by_width_ = true;
28-
rebin_ = false;
2927
vsmooth_par_ = 1.0;
30-
fast_vertical_ = false;
3128
}
3229

3330
CMSHistFunc::CMSHistFunc(const char* name, const char* title, RooRealVar& x,
@@ -41,14 +38,11 @@ CMSHistFunc::CMSHistFunc(const char* name, const char* title, RooRealVar& x,
4138
cache_(hist),
4239
binerrors_(FastTemplate(hist.GetNbinsX())),
4340
morph_strategy_(0),
44-
initialized_(false),
45-
rebin_(false),
4641
htype_(HorizontalType::Integral),
4742
mtype_(MomentSetting::Linear),
4843
vtype_(VerticalSetting::QuadLinear),
4944
divide_by_width_(divide_by_width),
5045
vsmooth_par_(1.0),
51-
fast_vertical_(false),
5246
external_morph_("external_morph", "", this) {
5347
if (divide_by_width_) {
5448
for (unsigned i = 0; i < cache_.size(); ++i) {
@@ -113,15 +107,13 @@ CMSHistFunc::CMSHistFunc(CMSHistFunc const& other, const char* name)
113107
binerrors_(other.binerrors_),
114108
storage_(other.storage_),
115109
morph_strategy_(other.morph_strategy_),
116-
initialized_(false),
117110
rebin_(other.rebin_),
118111
rebin_scheme_(other.rebin_scheme_),
119112
htype_(other.htype_),
120113
mtype_(other.mtype_),
121114
vtype_(other.vtype_),
122115
divide_by_width_(other.divide_by_width_),
123116
vsmooth_par_(other.vsmooth_par_),
124-
fast_vertical_(false),
125117
external_morph_("external_morph", this, other.external_morph_)
126118
{
127119
// initialize();

0 commit comments

Comments
 (0)