/
githubmirror
/
cmssw
Обзор
Документация
Войти
/
githubmirror
/
cmssw
Код
Запросы
0
Пакеты
0
Релизы
0
Аналитика
Безопасность
master
FWIO/RNTupleTempInput/src/InputFile.h
64 строки
2 KB
Christopher Jones
Simplifying input code for RNTuple migration
03 дек 2025, 00:04
03 дек 2025, 00:04
b9c4d2c
Код
Авторство
О чём код?
#ifndef IOPool_Input_InputFile_h #define IOPool_Input_InputFile_h /*---------------------------------------------------------------------- Holder for an input TFile. ----------------------------------------------------------------------*/ #include "FWCore/MessageLogger/interface/JobReport.h" #include "FWCore/Utilities/interface/InputType.h" #include "FWCore/Utilities/interface/propagate_const.h" #include "TFile.h" #include "TTree.h" #include <map> #include <string> #include <vector> class TObject; namespace edm::rntuple_temp { class InputFile { public: explicit InputFile(char const* fileName, char const* msg, InputType inputType); ~InputFile(); InputFile(InputFile const&) = delete; // Disallow copying and moving InputFile& operator=(InputFile const&) = delete; // Disallow copying and moving void Close(); void inputFileOpened(std::string const& logicalFileName, std::string const& inputType, std::string const& moduleName, std::string const& label, std::string const& fid, std::vector<std::string> const& branchNames); void eventReadFromFile() const; void reportInputRunNumber(unsigned int run) const; void reportInputLumiSection(unsigned int run, unsigned int lumi) const; static void reportSkippedFile(std::string const& fileName, std::string const& logicalFileName); static void reportFallbackAttempt(std::string const& pfn, std::string const& logicalFileName, std::string const& errorMessage); // reportReadBranches is a per job report, rather than per file report. // Nevertheless, it is defined here for convenience. static void reportReadBranches(); static void reportReadBranch(InputType inputType, std::string const& branchname); TObject* Get(char const* name) { return file_->Get(name); } template <typename T> T* Get(char const* name) { return file_->Get<T>(name); } void logFileAction(char const* msg, char const* fileName) const; private: edm::propagate_const<std::unique_ptr<TFile>> file_; std::string fileName_; JobReport::Token reportToken_; InputType inputType_; }; } // namespace edm::rntuple_temp #endif