19 class BranchIDListHelper;
21 class LuminosityBlockPrincipal;
29 findFileForSpecifiedID_(nullptr),
30 fileIterBegin_(fileCatalogItems().begin()),
31 fileIterEnd_(fileCatalogItems().
end()),
32 fileIter_(fileIterEnd_),
33 fileIterLastOpened_(fileIterEnd_),
35 indexesIntoFiles_(fileCatalogItems().
size()) {}
43 return rootFile()->productRegistry();
48 return rootFile()->branchIDListHelper();
55 return rootFile()->readRunAuxiliary_();
60 return rootFile()->readLuminosityBlockAuxiliary_();
65 return rootFile()->readRun_(runPrincipal);
70 return rootFile()->fillProcessBlockHelper_();
75 return rootFile()->nextProcessBlock_(processBlockPrincipal);
80 rootFile()->readProcessBlock_(processBlockPrincipal);
85 return rootFile()->readLuminosityBlock_(lumiPrincipal);
103 return rootFile()->readEvent(eventPrincipal);
117 size_t fileNameHash) {
125 std::make_unique<std::unordered_multimap<size_t, size_t>>();
126 auto hasher = std::hash<std::string>();
133 for (
auto iter =
range.first; iter !=
range.second; ++iter) {
180 std::vector<FileCatalogItem>::const_iterator currentIter =
fileIter_;
205 if (deleteIndexIntoFile) {
225 throw cms::Exception(
"LogicalFileNameNotFound",
"RootFileSequenceBase::initTheFile()\n")
226 <<
"Logical file name '" <<
logicalFileName() <<
"' was not found in the file catalog.\n" 227 <<
"If you wanted a local file, you forgot the 'file:' prefix\n" 228 <<
"before the file name in your configuration file.\n";
231 <<
" was not found in the catalog, and will be skipped.\n";
239 std::shared_ptr<InputFile> filePtr;
240 std::list<std::string> originalInfo;
242 std::vector<std::string>
const& fNames =
fileNames();
246 std::list<std::string> exInfo;
247 std::list<std::string> additionalMessage;
248 std::unique_ptr<InputSource::FileOpenSentry> sentry(
249 input ? std::make_unique<InputSource::FileOpenSentry>(*
input,
lfn_) :
nullptr);
254 for (std::vector<std::string>::const_iterator
it = fNames.begin();
it != fNames.end(); ++
it) {
257 std::unique_ptr<char[]>
name(gSystem->ExpandPathName(
it->c_str()));
258 filePtr = std::make_shared<InputFile>(
name.get(),
" Initiating request to open file ", inputType);
265 ex.
addContext(
"Calling RootInputFileSequence::initTheFile()");
266 std::ostringstream
out;
267 out <<
"Input file " << (*it) <<
" could not be opened.";
270 for (
auto const&
s : exInfo)
273 if (not additionalMessage.empty()) {
275 for (
auto const&
msg : additionalMessage) {
281 exInfo.push_back(
"Calling RootInputFileSequence::initTheFile(): fail to open the file with name " + (*
it));
283 "Input file {} could not be opened, and fallback was attempted.\nAdditional information:", *
it));
285 for (
auto const& ai :
e.additionalInfo()) {
286 additionalMessage.push_back(
fmt::format(
" [{}] {}",
c, ai));
298 rootFile_->setSignals(&(
input->preEventReadFromSourceSignal_), &(
input->postEventReadFromSourceSignal_));
308 <<
" was not found or could not be opened.\n";
311 <<
"Input file: " <<
fName <<
" was not found or could not be opened, and will be skipped.\n";
unsigned long long EventNumber_t
unsigned int LuminosityBlockNumber_t
static std::string const input
void addAdditionalInfo(std::string const &info)
void addContext(std::string const &context)
Log< level::Warning, false > LogWarning