Skip to content

Commit 49ebb8a

Browse files
committed
[RF][HF] Some code cleanup for measurement classes
* delete commented-out obsolete code * use more range-based loops * inline definitions where appropriate * initialize `Measurement` data member in class declaration
1 parent f4fe5df commit 49ebb8a

File tree

2 files changed

+28
-212
lines changed

2 files changed

+28
-212
lines changed

roofit/histfactory/inc/RooStats/HistFactory/Measurement.h

Lines changed: 9 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -650,9 +650,9 @@ extern Channel BadChannel;
650650
class Measurement : public TNamed {
651651

652652
public:
653-
Measurement();
654-
/// Measurement( const Measurement& other ); // Copy
655-
Measurement(const char *Name, const char *Title = "");
653+
Measurement() = default;
654+
/// Constructor specifying name and title of measurement
655+
Measurement(const char *Name, const char *Title = "") : TNamed(Name, Title) {}
656656

657657
/// set output prefix
658658
void SetOutputFilePrefix(const std::string &prefix) { fOutputFilePrefix = prefix; }
@@ -724,7 +724,8 @@ class Measurement : public TNamed {
724724
std::vector<RooStats::HistFactory::Channel> &GetChannels() { return fChannels; }
725725
const std::vector<RooStats::HistFactory::Channel> &GetChannels() const { return fChannels; }
726726
RooStats::HistFactory::Channel &GetChannel(std::string);
727-
void AddChannel(RooStats::HistFactory::Channel chan);
727+
/// Add a completely configured channel.
728+
void AddChannel(RooStats::HistFactory::Channel chan) { fChannels.push_back(chan); }
728729

729730
bool HasChannel(std::string);
730731
void writeToFile(TFile *file);
@@ -752,10 +753,10 @@ class Measurement : public TNamed {
752753
/// Configurables of this measurement
753754
std::string fOutputFilePrefix;
754755
std::vector<std::string> fPOI;
755-
double fLumi;
756-
double fLumiRelErr;
757-
int fBinLow;
758-
int fBinHigh;
756+
double fLumi = 1.0;
757+
double fLumiRelErr = 0.1;
758+
int fBinLow = 0;
759+
int fBinHigh = 1;
759760
bool fExportOnly = true;
760761
std::string fInterpolationScheme;
761762

0 commit comments

Comments
 (0)