17 class BranchIDListHelper;
19 class LuminosityBlockPrincipal;
27 findFileForSpecifiedID_(
nullptr),
28 fileIterBegin_(fileCatalogItems().
begin()),
29 fileIterEnd_(fileCatalogItems().
end()),
30 fileIter_(fileIterEnd_),
31 fileIterLastOpened_(fileIterEnd_),
33 indexesIntoFiles_(fileCatalogItems().
size()) {}
41 return rootFile()->productRegistry();
46 return rootFile()->branchIDListHelper();
53 return rootFile()->readRunAuxiliary_();
58 return rootFile()->readLuminosityBlockAuxiliary_();
68 rootFile()->readLuminosityBlock_(lumiPrincipal);
86 rootFile()->readEvent(eventPrincipal);
94 return rootFile()->containsItem(run, lumi, event);
100 size_t fileNameHash) {
102 assert(fileNameHash != 0
U);
108 std::make_unique<std::unordered_multimap<size_t, size_t>>();
109 auto hasher = std::hash<std::string>();
116 for (
auto iter = range.first; iter != range.second; ++iter) {
161 if (*it && (*it)->containsItem(run, lumi, event)) {
163 std::vector<FileCatalogItem>::const_iterator currentIter =
fileIter_;
170 found =
rootFile()->setEntryAtItem(run, lumi, event);
187 if (deleteIndexIntoFile) {
207 throw cms::Exception(
"LogicalFileNameNotFound",
"RootFileSequenceBase::initTheFile()\n")
208 <<
"Logical file name '" <<
logicalFileName() <<
"' was not found in the file catalog.\n" 209 <<
"If you wanted a local file, you forgot the 'file:' prefix\n" 210 <<
"before the file name in your configuration file.\n";
213 <<
" was not found in the catalog, and will be skipped.\n";
225 std::shared_ptr<InputFile> filePtr;
226 std::list<std::string> originalInfo;
228 std::unique_ptr<InputSource::FileOpenSentry> sentry(
229 input ? std::make_unique<InputSource::FileOpenSentry>(*input,
lfn_,
usedFallback_) :
nullptr);
230 std::unique_ptr<char[]>
name(gSystem->ExpandPathName(
fileName().c_str()));
232 filePtr = std::make_shared<InputFile>(name.get(),
" Initiating request to open file ", inputType);
235 if (hasFallbackUrl) {
236 std::ostringstream
out;
246 ex.
addContext(
"Calling RootFileSequenceBase::initTheFile()");
247 std::ostringstream
out;
248 out <<
"Input file " <<
fileName() <<
" could not be opened.";
254 if (!filePtr && (hasFallbackUrl)) {
257 std::unique_ptr<InputSource::FileOpenSentry> sentry(
258 input ? std::make_unique<InputSource::FileOpenSentry>(*input,
lfn_,
usedFallback_) :
nullptr);
259 std::unique_ptr<char[]> fallbackFullName(gSystem->ExpandPathName(
fallbackFileName().c_str()));
260 filePtr.reset(
new InputFile(fallbackFullName.get(),
" Fallback request to file ", inputType));
265 ex.
addContext(
"Calling RootFileSequenceBase::initTheFile()");
266 std::ostringstream
out;
267 out <<
"Input file " <<
fileName() <<
" could not be opened.\n";
268 out <<
"Fallback Input file " <<
fallbackFileName() <<
" also could not be opened.";
269 if (!originalInfo.empty()) {
270 out << std::endl <<
"Original exception info is above; fallback exception info is below.";
272 for (
auto const&
s : originalInfo) {
296 <<
" was not found or could not be opened.\n";
298 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)