17 class BranchIDListHelper;
19 class LuminosityBlockPrincipal;
29 findFileForSpecifiedID_(
nullptr),
30 fileIterBegin_(fileCatalogItems().
begin()),
31 fileIterEnd_(fileCatalogItems().
end()),
32 fileIter_(fileIterEnd_),
33 fileIterLastOpened_(fileIterEnd_),
35 indexesIntoFiles_(fileCatalogItems().
size()) {
38 std::vector<FileCatalogItem>
const&
43 std::shared_ptr<ProductRegistry const>
46 return rootFile()->productRegistry();
49 std::shared_ptr<BranchIDListHelper const>
52 return rootFile()->branchIDListHelper();
58 std::shared_ptr<RunAuxiliary>
61 return rootFile()->readRunAuxiliary_();
64 std::shared_ptr<LuminosityBlockAuxiliary>
67 return rootFile()->readLuminosityBlockAuxiliary_();
79 rootFile()->readLuminosityBlock_(lumiPrincipal);
98 rootFile()->readEvent(eventPrincipal);
104 return rootFile()->containsItem(run, lumi, event);
110 assert(fileNameHash != 0
U);
116 auto hasher = std::hash<std::string>();
123 for(
auto iter = range.first; iter != range.second; ++iter) {
169 if(*it && (*it)->containsItem(run, lumi, event)) {
171 std::vector<FileCatalogItem>::const_iterator currentIter =
fileIter_;
178 found =
rootFile()->setEntryAtItem(run, lumi, event);
190 bool deleteIndexIntoFile,
192 char const* inputTypeName,
198 if(deleteIndexIntoFile) {
217 throw cms::Exception(
"LogicalFileNameNotFound",
"RootFileSequenceBase::initTheFile()\n")
218 <<
"Logical file name '" <<
logicalFileName() <<
"' was not found in the file catalog.\n" 219 <<
"If you wanted a local file, you forgot the 'file:' prefix\n" 220 <<
"before the file name in your configuration file.\n";
222 LogWarning(
"") <<
"Input logical file: " <<
logicalFileName() <<
" was not found in the catalog, and will be skipped.\n";
234 std::shared_ptr<InputFile> filePtr;
235 std::list<std::string> originalInfo;
237 std::unique_ptr<InputSource::FileOpenSentry> sentry(input ? std::make_unique<InputSource::FileOpenSentry>(*input,
lfn_,
usedFallback_) :
nullptr);
238 std::unique_ptr<char[]>
name(gSystem->ExpandPathName(
fileName().c_str()));;
239 filePtr = std::make_shared<InputFile>(name.get(),
" Initiating request to open file ", inputType);
244 std::ostringstream
out;
254 ex.
addContext(
"Calling RootFileSequenceBase::initTheFile()");
255 std::ostringstream
out;
256 out <<
"Input file " <<
fileName() <<
" could not be opened.";
262 if(!filePtr && (hasFallbackUrl)) {
265 std::unique_ptr<InputSource::FileOpenSentry> sentry(input ? std::make_unique<InputSource::FileOpenSentry>(*input,
lfn_,
usedFallback_) :
nullptr);
266 std::unique_ptr<char[]> fallbackFullName(gSystem->ExpandPathName(
fallbackFileName().c_str()));
267 filePtr.reset(
new InputFile(fallbackFullName.get(),
" Fallback request to file ", inputType));
273 ex.
addContext(
"Calling RootFileSequenceBase::initTheFile()");
274 std::ostringstream
out;
275 out <<
"Input file " <<
fileName() <<
" could not be opened.\n";
276 out <<
"Fallback Input file " <<
fallbackFileName() <<
" also could not be opened.";
277 if (!originalInfo.empty()) {
278 out << std::endl <<
"Original exception info is above; fallback exception info is below.";
280 for (
auto const &
s : originalInfo) {
304 "RootFileSequenceBase::initTheFile(): Input file " <<
fileName() <<
" was not found or could not be opened.\n";
306 LogWarning(
"") <<
"Input file: " <<
fileName() <<
" was not found or could not be opened, and will be skipped.\n";
virtual std::string explainSelf() const
unsigned long long EventNumber_t
unsigned int LuminosityBlockNumber_t
std::list< std::string > const & additionalInfo() const
static std::string const input
void addAdditionalInfo(std::string const &info)
void addContext(std::string const &context)