21 if (inFileName.empty())
throw std::invalid_argument(
"fileName arguments must be non empty");
22 if (histName.empty())
throw std::invalid_argument(
"histName arguments must be non empty");
26 std::unique_ptr<TFile> fmc{TFile::Open(fileName.c_str(),
"READ")};
27 if (!fmc || !fmc->IsOpen())
29 throw std::invalid_argument(
"Cannot open file " + fileName);
33 fmc->GetObject(histName.c_str(), hist);
35 if (histName.find(
"ptExtra") != std::string::npos) {
39 throw std::invalid_argument(
"Cannot find hist ("+histName+
") in file " + fileName);
42 hist->SetDirectory(
nullptr);