Skip to content

Commit 072f5a1

Browse files
committed
rm unused readJsonVectorHistogram(); UpperCamelCase json fields
1 parent ca1ed2c commit 072f5a1

File tree

1 file changed

+3
-26
lines changed

1 file changed

+3
-26
lines changed

PWGHF/D2H/Macros/runMassFitter.C

Lines changed: 3 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -68,8 +68,6 @@ T readJsonField(const Document& config, const std::string& fieldName);
6868
template <typename T>
6969
void readJsonVector(std::vector<T>& vec, const Document& config, const std::string& fieldName, bool isRequired = false);
7070

71-
void readJsonVectorHistogram(std::vector<double>& vec, const Document& config, const std::string& fileNameFieldName, const std::string& histoNameFieldName);
72-
7371
void divideCanvas(TCanvas* c, int nSliceVarBins);
7472

7573
void setHistoStyle(TH1* histo, Color_t color = kBlack, Size_t markerSize = 1);
@@ -155,8 +153,8 @@ void runMassFitter(const std::string& configFileName)
155153
readJsonVector(sgnFunc, config, "SgnFunc", true);
156154

157155
const bool enableRefl = readJsonField<bool>(config, "EnableRefl", false);
158-
const bool drawBgPrefit = readJsonField<bool>(config, "drawBgPrefit", true);
159-
const bool highlightPeakRegion = readJsonField<bool>(config, "highlightPeakRegion", true);
156+
const bool drawBgPrefit = readJsonField<bool>(config, "DrawBgPrefit", true);
157+
const bool highlightPeakRegion = readJsonField<bool>(config, "HighlightPeakRegion", true);
160158

161159
const int nSliceVarBins = static_cast<int>(sliceVarMin.size());
162160
std::vector<double> sliceVarLimits(nSliceVarBins + 1);
@@ -229,10 +227,7 @@ void runMassFitter(const std::string& configFileName)
229227
// load inv-mass histograms
230228
auto* inputFile = openFileWithNullptrCheck(inputFileName);
231229

232-
TFile* inputFileRefl = nullptr;
233-
if (enableRefl) {
234-
inputFileRefl = openFileWithNullptrCheck(reflFileName);
235-
}
230+
TFile* inputFileRefl = enableRefl ? openFileWithNullptrCheck(reflFileName) : nullptr;
236231

237232
std::vector<TH1*> hMassSgn(nSliceVarBins);
238233
std::vector<TH1*> hMassRefl(nSliceVarBins);
@@ -632,24 +627,6 @@ void readJsonVector(std::vector<T>& vec, const Document& config, const std::stri
632627
}
633628
}
634629

635-
void readJsonVectorHistogram(std::vector<double>& vec, const Document& config, const std::string& fileNameFieldName, const std::string& histoNameFieldName)
636-
{
637-
if (!vec.empty()) {
638-
throw std::runtime_error("readJsonVectorHistogram(): vector is not empty!");
639-
}
640-
const auto fileName = readJsonField<std::string>(config, fileNameFieldName);
641-
const auto histoName = readJsonField<std::string>(config, histoNameFieldName);
642-
if (fileName.empty() || histoName.empty()) {
643-
return;
644-
}
645-
TFile* inputFile = openFileWithNullptrCheck(fileName);
646-
TH1* histo = getObjectWithNullPtrCheck<TH1>(inputFile, histoName);
647-
for (int iBin = 1; iBin <= histo->GetNbinsX(); iBin++) {
648-
vec.push_back(histo->GetBinContent(iBin));
649-
}
650-
inputFile->Close();
651-
}
652-
653630
int main(int argc, const char* argv[])
654631
{
655632
if (argc == 1) {

0 commit comments

Comments
 (0)