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) {
73 std::ostringstream statusfilename;
74 statusfilename <<
"source_" << getpid();
81 std::string const defaultMode(
"RunsLumisAndEvents");
91 if (processingMode == runMode) {
93 }
else if (processingMode == runLumiMode) {
95 }
else if (processingMode != defaultMode) {
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).");
125 ->setComment(
"Write a status file. Intended for use by workflow management.");
138 "Calling InputSource::getNextItemType");
178 }
else if (newState ==
IsRun || oldState ==
IsFile) {
181 }
else if (newState ==
IsLumi || oldState ==
IsRun) {
198 return callWithTryCatchAndPrint<std::shared_ptr<LuminosityBlockAuxiliary> >(
203 return callWithTryCatchAndPrint<std::shared_ptr<RunAuxiliary> >([
this]() {
return readRunAuxiliary_(); },
204 "Calling InputSource::readRunAuxiliary_");
216 return std::pair<SharedResourcesAcquirer*, std::recursive_mutex*>(
nullptr,
nullptr);
225 return callWithTryCatchAndPrint<std::shared_ptr<FileBlock> >([
this]() {
return readFile_(); },
226 "Calling InputSource::readFile_");
232 callWithTryCatchAndPrint<void>(
233 [
this]() {
closeFile_(); },
"Calling InputSource::closeFile_", cleaningUpAfterException);
244 callWithTryCatchAndPrint<void>([
this, &runPrincipal]() {
readRun_(runPrincipal); },
245 "Calling InputSource::readRun_");
250 callWithTryCatchAndPrint<void>([
this, &rp]() {
readRun_(rp); },
"Calling InputSource::readRun_");
255 callWithTryCatchAndPrint<void>([
this, &lumiPrincipal]() {
readLuminosityBlock_(lumiPrincipal); },
256 "Calling InputSource::readLuminosityBlock_");
265 "Calling InputSource::readLuminosityBlock_");
279 callWithTryCatchAndPrint<void>([
this, &processBlockPrincipal]() {
readProcessBlock_(processBlockPrincipal); },
280 "Calling InputSource::readProcessBlock_");
308 callWithTryCatchAndPrint<void>([
this, &ep]() {
readEvent_(ep); },
"Calling InputSource::readEvent_");
326 result =
readIt(eventID, ep, streamContext);
339 callWithTryCatchAndPrint<void>([
this, &
offset]() {
skip(offset); },
"Calling InputSource::skip");
343 return callWithTryCatchAndPrint<bool>([
this, &eventID]() {
return goToEvent_(eventID); },
344 "Calling InputSource::goToEvent_");
353 callWithTryCatchAndPrint<void>([
this]() {
rewind_(); },
"Calling InputSource::rewind_");
359 << eventID.
run() <<
", Event " << eventID.
event() <<
", LumiSection "
365 statusFile << eventID <<
" time: " << std::setprecision(3) <<
TimeOfDay() <<
'\n';
374 <<
"Random access is not implemented for this type of Input Source\n"
375 <<
"Contact a Framework Developer\n";
380 <<
"Run number cannot be modified for this type of Input Source\n"
381 <<
"Contact a Framework Developer\n";
386 <<
"Luminosity Block ID cannot be modified for this type of Input Source\n"
387 <<
"Contact a Framework Developer\n";
392 <<
"Random access are not implemented for this type of Input Source\n"
393 <<
"Contact a Framework Developer\n";
398 <<
"Random access is not implemented for this type of Input Source\n"
399 <<
"Contact a Framework Developer\n";
405 <<
"Random access are not implemented for this type of Input Source\n"
406 <<
"Contact a Framework Developer\n";
425 return callWithTryCatchAndPrint<bool>([
this]() {
return randomAccess_(); },
"Calling InputSource::randomAccess_");
429 return callWithTryCatchAndPrint<ProcessingController::ForwardState>([
this]() {
return forwardState_(); },
430 "Calling InputSource::forwardState_");
434 return callWithTryCatchAndPrint<ProcessingController::ReverseState>([
this]() {
return reverseState_(); },
435 "Calling InputSource::reverseState__");
468 : source_(source), sc_(sc) {
475 : source_(source), index_(index) {
482 : source_(source), index_(index) {
490 : source_(source), processName_(processName) {
495 source_.actReg()->postSourceProcessBlockSignal_(processName_);
499 : post_(source.
actReg()->postOpenFileSignal_), lfn_(lfn), usedFallback_(usedFallback) {
500 source.
actReg()->preOpenFileSignal_(lfn, usedFallback);
506 : post_(source.
actReg()->postCloseFileSignal_), lfn_(lfn), usedFallback_(usedFallback) {
507 source.
actReg()->preCloseFileSignal_(lfn, usedFallback);
EventNumber_t event() const
T getUntrackedParameter(std::string const &, T const &) const
bool getMapped(ProcessHistoryID const &key, ProcessHistory &value) const
static std::string const source("source")
ParameterDescriptionBase * addUntracked(U const &iLabel, T const &value)
InputSource const & source_
void fillLuminosityBlockPrincipal(ProcessHistory const *processHistory, DelayedReader *reader=nullptr)
ProcessHistoryID const & processHistoryID() const
EventID const & id() const
LuminosityBlockAuxiliary const & aux() const
LuminosityBlockIndex index() const
LuminosityBlockNumber_t luminosityBlock() const
unsigned int LuminosityBlockNumber_t
Timestamp const & time() const
FileCloseSentry(InputSource const &source, std::string const &lfn, bool usedFallback)
EventSourceSentry(InputSource const &source, StreamContext &sc)
LuminosityBlockIndex index_
void addDefault(ParameterSetDescription const &psetDescription)
StreamID streamID() const
StreamID const & streamID() const
std::string createGlobalIdentifier(bool binary=false)
Log< level::FwkInfo, true > LogFwkVerbatim
unsigned int value() const
LumiSourceSentry(InputSource const &source, LuminosityBlockIndex id)
InputSource const & source_
~ProcessBlockSourceSentry()
static const std::string kBaseType("EDAnalyzer")
std::string const & processName() const
ProcessBlockSourceSentry(InputSource const &, std::string const &)
void fillRunPrincipal(ProcessHistoryRegistry const &processHistoryRegistry, DelayedReader *reader=nullptr)
FileOpenSentry(InputSource const &source, std::string const &lfn, bool usedFallback)
RunSourceSentry(InputSource const &source, RunIndex id)
InputSource const & source_