Skip to content

Commit 68f70c7

Browse files
committed
runMassFitter.C: nullPointerRedundantCheck
1 parent 6dc7be0 commit 68f70c7

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

PWGHF/D2H/Macros/runMassFitter.C

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -237,14 +237,14 @@ int runMassFitter(const TString& configFileName)
237237
hMass[iSliceVar] = inputFile->Get<TH1>(inputHistoName[iSliceVar].data());
238238
if (enableRefl) {
239239
hMassRefl[iSliceVar] = inputFileRefl->Get<TH1>(reflHistoName[iSliceVar].data());
240-
hMassSgn[iSliceVar] = inputFileRefl->Get<TH1>(fdHistoName[iSliceVar].data());
241-
hMassSgn[iSliceVar]->Add(inputFileRefl->Get<TH1>(promptHistoName[iSliceVar].data()));
242240
if (hMassRefl[iSliceVar] == nullptr) {
243241
throw std::runtime_error("ERROR: MC reflection histogram not found! Exit!");
244242
}
243+
hMassSgn[iSliceVar] = inputFileRefl->Get<TH1>(fdHistoName[iSliceVar].data());
245244
if (hMassSgn[iSliceVar] == nullptr) {
246245
throw std::runtime_error("ERROR: MC prompt or FD histogram not found! Exit!");
247246
}
247+
hMassSgn[iSliceVar]->Add(inputFileRefl->Get<TH1>(promptHistoName[iSliceVar].data()));
248248
}
249249
} else {
250250
hMass[iSliceVar] = inputFile->Get<TH1>(promptHistoName[iSliceVar].data());

0 commit comments

Comments
 (0)