37 int lastDigit =
count % 10;
38 if (lastDigit >= 4 || lastDigit == 0)
41 if (
count % 100 - lastDigit == 10)
43 return (lastDigit == 1 ? st : (lastDigit == 2 ? nd : rd));
48 : actReg_(
desc.actReg_),
49 maxEvents_(
desc.maxEvents_),
50 remainingEvents_(maxEvents_),
51 maxLumis_(
desc.maxLumis_),
52 remainingLumis_(maxLumis_),
54 maxSecondsUntilRampdown_(
desc.maxSecondsUntilRampdown_),
55 processingMode_(RunsLumisAndEvents),
56 moduleDescription_(
desc.moduleDescription_),
57 productRegistry_(
desc.productRegistry_),
59 branchIDListHelper_(
desc.branchIDListHelper_),
60 processBlockHelper_(
desc.processBlockHelper_),
61 thinnedAssociationsHelper_(
desc.thinnedAssociationsHelper_),
71 numberOfEventsBeforeBigSkip_(0) {
72 if (
pset.getUntrackedParameter<
bool>(
"writeStatusFile",
false)) {
73 std::ostringstream statusfilename;
74 statusfilename <<
"source_" << getpid();
81 std::string const defaultMode(
"RunsLumisAndEvents");
97 <<
"InputSource::InputSource()\n" 98 <<
"The 'processingMode' parameter for sources has an illegal value '" <<
processingMode <<
"'\n" 99 <<
"Legal values are '" << defaultMode <<
"', '" << runLumiMode <<
"', or '" <<
runMode <<
"'.\n";
121 "'RunsLumisAndEvents': process runs, lumis, and events.\n" 122 "'RunsAndLumis': process runs and lumis (not events).\n" 123 "'Runs': process runs (not lumis or events).");
124 desc.addUntracked<
bool>(
"writeStatusFile",
false)
125 ->setComment(
"Write a status file. Intended for use by workflow management.");
138 "Calling InputSource::getNextItemType");
199 return callWithTryCatchAndPrint<std::shared_ptr<LuminosityBlockAuxiliary> >(
204 return callWithTryCatchAndPrint<std::shared_ptr<RunAuxiliary> >([
this]() {
return readRunAuxiliary_(); },
205 "Calling InputSource::readRunAuxiliary_");
217 return std::pair<SharedResourcesAcquirer*, std::recursive_mutex*>(
nullptr,
nullptr);
226 return callWithTryCatchAndPrint<std::shared_ptr<FileBlock> >([
this]() {
return readFile_(); },
227 "Calling InputSource::readFile_");
233 callWithTryCatchAndPrint<void>(
234 [
this]() {
closeFile_(); },
"Calling InputSource::closeFile_", cleaningUpAfterException);
245 callWithTryCatchAndPrint<void>([
this, &runPrincipal]() {
readRun_(runPrincipal); },
246 "Calling InputSource::readRun_");
251 callWithTryCatchAndPrint<void>([
this, &rp]() {
readRun_(rp); },
"Calling InputSource::readRun_");
256 callWithTryCatchAndPrint<void>([
this, &lumiPrincipal]() {
readLuminosityBlock_(lumiPrincipal); },
257 "Calling InputSource::readLuminosityBlock_");
266 "Calling InputSource::readLuminosityBlock_");
280 callWithTryCatchAndPrint<void>([
this, &processBlockPrincipal]() {
readProcessBlock_(processBlockPrincipal); },
281 "Calling InputSource::readProcessBlock_");
309 callWithTryCatchAndPrint<void>([
this, &
ep]() {
readEvent_(
ep); },
"Calling InputSource::readEvent_");
340 callWithTryCatchAndPrint<void>([
this, &
offset]() {
skip(
offset); },
"Calling InputSource::skip");
344 return callWithTryCatchAndPrint<bool>([
this, &eventID]() {
return goToEvent_(eventID); },
345 "Calling InputSource::goToEvent_");
354 callWithTryCatchAndPrint<void>([
this]() {
rewind_(); },
"Calling InputSource::rewind_");
360 << eventID.
run() <<
", Event " << eventID.
event() <<
", LumiSection " 366 statusFile << eventID <<
" time: " << std::setprecision(3) <<
TimeOfDay() <<
'\n';
375 <<
"Random access is not implemented for this type of Input Source\n" 376 <<
"Contact a Framework Developer\n";
381 <<
"Run number cannot be modified for this type of Input Source\n" 382 <<
"Contact a Framework Developer\n";
387 <<
"Luminosity Block ID cannot be modified for this type of Input Source\n" 388 <<
"Contact a Framework Developer\n";
393 <<
"Random access are not implemented for this type of Input Source\n" 394 <<
"Contact a Framework Developer\n";
399 <<
"Random access is not implemented for this type of Input Source\n" 400 <<
"Contact a Framework Developer\n";
406 <<
"Random access are not implemented for this type of Input Source\n" 407 <<
"Contact a Framework Developer\n";
426 return callWithTryCatchAndPrint<bool>([
this]() {
return randomAccess_(); },
"Calling InputSource::randomAccess_");
430 return callWithTryCatchAndPrint<ProcessingController::ForwardState>([
this]() {
return forwardState_(); },
431 "Calling InputSource::forwardState_");
435 return callWithTryCatchAndPrint<ProcessingController::ReverseState>([
this]() {
return reverseState_(); },
436 "Calling InputSource::reverseState__");
469 : source_(
source), sc_(sc) {
496 source_.actReg()->postSourceProcessBlockSignal_(processName_);
500 : post_(
source.
actReg()->postOpenFileSignal_), lfn_(lfn) {
501 source.actReg()->preOpenFileSignal_(lfn);
507 : post_(
source.
actReg()->postCloseFileSignal_), lfn_(lfn) {
508 source.actReg()->preCloseFileSignal_(lfn);
static std::string const source("source")
InputSource const & source_
void fillLuminosityBlockPrincipal(ProcessHistory const *processHistory, DelayedReader *reader=nullptr)
ProcessHistoryID const & processHistoryID() const
Guid const & processGUID()
unsigned int LuminosityBlockNumber_t
LuminosityBlockNumber_t luminosityBlock() const
EventSourceSentry(InputSource const &source, StreamContext &sc)
LuminosityBlockIndex index_
void addDefault(ParameterSetDescription const &psetDescription)
StreamID const & streamID() const
FileOpenSentry(InputSource const &source, std::string const &lfn)
Log< level::FwkInfo, true > LogFwkVerbatim
std::string const & processName() const
LumiSourceSentry(InputSource const &source, LuminosityBlockIndex id)
InputSource const & source_
bool getMapped(ProcessHistoryID const &key, ProcessHistory &value) const
~ProcessBlockSourceSentry()
ProcessBlockSourceSentry(InputSource const &, std::string const &)
LuminosityBlockIndex index() const
static std::string const kBaseType("Source")
LuminosityBlockAuxiliary const & aux() const
void fillRunPrincipal(ProcessHistoryRegistry const &processHistoryRegistry, DelayedReader *reader=nullptr)
unsigned int value() const
RunSourceSentry(InputSource const &source, RunIndex id)
InputSource const & source_
EventNumber_t event() const
FileCloseSentry(InputSource const &source, std::string const &lfn)