Skip to content

Commit 7843207

Browse files
committed
DhCorrelationExtraction.cxx: nullPointerRedundantCheck
1 parent 68f70c7 commit 7843207

File tree

1 file changed

+3
-4
lines changed

1 file changed

+3
-4
lines changed

PWGHF/HFC/Macros/DhCorrelationExtraction.cxx

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -945,13 +945,12 @@ TH1D* DhCorrelationExtraction::evaluateMcClosModulations(Double_t ptCandMin, Dou
945945
TH1D* hModul = new TH1D();
946946

947947
fFilePromptMc = TFile::Open(fFilePromptMcRecName.Data());
948-
fFileNonPromptMc = TFile::Open(fFileNonPromptMcRecName.Data());
949-
950948
if (fFilePromptMc == nullptr) {
951-
std::cout << "[ERROR] File prompt MC rec cannot be opened! check your file path!" << std::endl;
949+
throw std::runtime_error("[ERROR] File prompt MC rec cannot be opened! check your file path!");
952950
}
951+
fFileNonPromptMc = TFile::Open(fFileNonPromptMcRecName.Data());
953952
if (fFileNonPromptMc == nullptr) {
954-
std::cout << "[ERROR] File non-prompt MC rec cannot be opened! check your file path!" << std::endl;
953+
throw std::runtime_error("[ERROR] File non-prompt MC rec cannot be opened! check your file path!");
955954
}
956955

957956
// TODO: generalise this part

0 commit comments

Comments
 (0)