36 int lastDigit = count % 10;
37 if (lastDigit >= 4 || lastDigit == 0)
40 if (count % 100 - lastDigit == 10)
42 return (lastDigit == 1 ? st : (lastDigit == 2 ? nd : rd));
47 : actReg_(desc.actReg_),
48 maxEvents_(desc.maxEvents_),
49 remainingEvents_(maxEvents_),
50 maxLumis_(desc.maxLumis_),
51 remainingLumis_(maxLumis_),
53 maxSecondsUntilRampdown_(desc.maxSecondsUntilRampdown_),
54 processingMode_(RunsLumisAndEvents),
55 moduleDescription_(desc.moduleDescription_),
56 productRegistry_(desc.productRegistry_),
58 branchIDListHelper_(desc.branchIDListHelper_),
59 thinnedAssociationsHelper_(desc.thinnedAssociationsHelper_),
69 numberOfEventsBeforeBigSkip_(0) {
71 std::ostringstream statusfilename;
72 statusfilename <<
"source_" << getpid();
79 std::string const defaultMode(
"RunsLumisAndEvents");
89 if (processingMode == runMode) {
91 }
else if (processingMode == runLumiMode) {
93 }
else if (processingMode != defaultMode) {
95 <<
"InputSource::InputSource()\n" 96 <<
"The 'processingMode' parameter for sources has an illegal value '" << processingMode <<
"'\n" 97 <<
"Legal values are '" << defaultMode <<
"', '" << runLumiMode <<
"', or '" << runMode <<
"'.\n";
119 "'RunsLumisAndEvents': process runs, lumis, and events.\n" 120 "'RunsAndLumis': process runs and lumis (not events).\n" 121 "'Runs': process runs (not lumis or events).");
123 ->setComment(
"Write a status file. Intended for use by workflow management.");
136 "Calling InputSource::getNextItemType");
176 }
else if (newState ==
IsRun || oldState ==
IsFile) {
179 }
else if (newState ==
IsLumi || oldState ==
IsRun) {
196 return callWithTryCatchAndPrint<std::shared_ptr<LuminosityBlockAuxiliary> >(
201 return callWithTryCatchAndPrint<std::shared_ptr<RunAuxiliary> >([
this]() {
return readRunAuxiliary_(); },
202 "Calling InputSource::readRunAuxiliary_");
214 return std::pair<SharedResourcesAcquirer*, std::recursive_mutex*>(
nullptr,
nullptr);
223 return callWithTryCatchAndPrint<std::unique_ptr<FileBlock> >([
this]() {
return readFile_(); },
224 "Calling InputSource::readFile_");
230 callWithTryCatchAndPrint<void>(
231 [
this]() {
closeFile_(); },
"Calling InputSource::closeFile_", cleaningUpAfterException);
242 callWithTryCatchAndPrint<void>([
this, &runPrincipal]() {
readRun_(runPrincipal); },
243 "Calling InputSource::readRun_");
248 callWithTryCatchAndPrint<void>([
this, &rp]() {
readRun_(rp); },
"Calling InputSource::readRun_");
253 callWithTryCatchAndPrint<void>([
this, &lumiPrincipal]() {
readLuminosityBlock_(lumiPrincipal); },
254 "Calling InputSource::readLuminosityBlock_");
263 "Calling InputSource::readLuminosityBlock_");
287 callWithTryCatchAndPrint<void>([
this, &ep]() {
readEvent_(ep); },
"Calling InputSource::readEvent_");
305 result =
readIt(eventID, ep, streamContext);
318 callWithTryCatchAndPrint<void>([
this, &
offset]() {
skip(offset); },
"Calling InputSource::skip");
322 return callWithTryCatchAndPrint<bool>([
this, &eventID]() {
return goToEvent_(eventID); },
323 "Calling InputSource::goToEvent_");
332 callWithTryCatchAndPrint<void>([
this]() {
rewind_(); },
"Calling InputSource::rewind_");
338 << eventID.
run() <<
", Event " << eventID.
event() <<
", LumiSection " 344 statusFile << eventID <<
" time: " << std::setprecision(3) <<
TimeOfDay() <<
'\n';
353 <<
"Random access is not implemented for this type of Input Source\n" 354 <<
"Contact a Framework Developer\n";
359 <<
"Run number cannot be modified for this type of Input Source\n" 360 <<
"Contact a Framework Developer\n";
365 <<
"Luminosity Block ID cannot be modified for this type of Input Source\n" 366 <<
"Contact a Framework Developer\n";
371 <<
"Random access are not implemented for this type of Input Source\n" 372 <<
"Contact a Framework Developer\n";
377 <<
"Random access is not implemented for this type of Input Source\n" 378 <<
"Contact a Framework Developer\n";
384 <<
"Random access are not implemented for this type of Input Source\n" 385 <<
"Contact a Framework Developer\n";
404 return callWithTryCatchAndPrint<bool>([
this]() {
return randomAccess_(); },
"Calling InputSource::randomAccess_");
408 return callWithTryCatchAndPrint<ProcessingController::ForwardState>([
this]() {
return forwardState_(); },
409 "Calling InputSource::forwardState_");
413 return callWithTryCatchAndPrint<ProcessingController::ReverseState>([
this]() {
return reverseState_(); },
414 "Calling InputSource::reverseState__");
447 : source_(source), sc_(sc) {
454 :
source_(source), index_(index) {
468 : post_(source.
actReg()->postOpenFileSignal_), lfn_(lfn), usedFallback_(usedFallback) {
469 source.
actReg()->preOpenFileSignal_(lfn, usedFallback);
476 source.
actReg()->preCloseFileSignal_(lfn, usedFallback);
EventNumber_t event() const
T getUntrackedParameter(std::string const &, T const &) const
static std::string const source("source")
ParameterDescriptionBase * addUntracked(U const &iLabel, T const &value)
EventID const & id() const
LuminosityBlockIndex index() const
void fillRunPrincipal(ProcessHistoryRegistry const &processHistoryRegistry, DelayedReader *reader=0)
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 fillLuminosityBlockPrincipal(ProcessHistoryRegistry const &processHistoryRegistry, DelayedReader *reader=0)
void addDefault(ParameterSetDescription const &psetDescription)
StreamID streamID() const
InputSource const & source_
StreamID const & streamID() const
unsigned int value() const
LumiSourceSentry(InputSource const &source, LuminosityBlockIndex id)
InputSource const & source_
static const std::string kBaseType("EDAnalyzer")
FileOpenSentry(InputSource const &source, std::string const &lfn, bool usedFallback)
RunSourceSentry(InputSource const &source, RunIndex id)
InputSource const & source_
std::string createGlobalIdentifier()