35 static std::string
const st(
"st");
36 static std::string
const nd(
"nd");
37 static std::string
const rd(
"rd");
38 static std::string
const th(
"th");
40 int lastDigit = count % 10;
41 if(lastDigit >= 4 || lastDigit == 0)
return th;
43 if(count % 100 - lastDigit == 10)
return th;
44 return (lastDigit == 1 ? st : (lastDigit == 2 ? nd : rd));
47 boost::shared_ptr<T> createSharedPtrToStatic(
T* ptr) {
48 return boost::shared_ptr<T>(ptr, do_nothing_deleter());
52 deleteFromProcessHistory(
ProcessHistoryID const& phid, std::string
const& processName) {
63 newPH.reserve(ph.size());
65 if(processName != it->processName()) {
76 actReg_(desc.actReg_),
77 principalCache_(desc.principalCache_),
78 maxEvents_(desc.maxEvents_),
79 remainingEvents_(maxEvents_),
80 maxLumis_(desc.maxLumis_),
81 remainingLumis_(maxLumis_),
83 processingMode_(RunsLumisAndEvents),
84 moduleDescription_(desc.moduleDescription_),
86 primary_(pset.getParameter<std::string>(
"@module_label") == std::string(
"@main_input")),
89 doneReadAhead_(
false),
93 runPrematurelyRead_(
false),
94 lumiPrematurelyRead_(
false),
98 std::ostringstream statusfilename;
99 statusfilename <<
"source_" << getpid();
107 std::string
const defaultMode(
"RunsLumisAndEvents");
108 std::string
const runMode(
"Runs");
109 std::string
const runLumiMode(
"RunsAndLumis");
117 if(processingMode == runMode) {
119 }
else if(processingMode == runLumiMode) {
121 }
else if(processingMode != defaultMode) {
123 <<
"InputSource::InputSource()\n"
124 <<
"The 'processingMode' parameter for sources has an illegal value '" << processingMode <<
"'\n"
125 <<
"Legal values are '" << defaultMode <<
"', '" << runLumiMode <<
"', or '" << runMode <<
"'.\n";
138 static std::string
const kBaseType(
"Source");
147 std::string defaultString(
"RunsLumisAndEvents");
148 desc.
addUntracked<std::string>(
"processingMode", defaultString)->setComment(
149 "'RunsLumisAndEvents': process runs, lumis, and events.\n"
150 "'RunsAndLumis': process runs and lumis (not events).\n"
151 "'Runs': process runs (not lumis or events).");
152 desc.
addUntracked<
bool>(
"writeStatusFile",
false)->setComment(
"Write a status file. Intended for use by workflow management.");
212 }
else if(newState ==
IsRun || oldState ==
IsFile) {
215 }
else if(newState ==
IsLumi || oldState ==
IsRun) {
249 boost::shared_ptr<FileBlock>
269 boost::shared_ptr<FileBlock>
271 return boost::shared_ptr<FileBlock>(
new FileBlock);
274 boost::shared_ptr<RunPrincipal>
const
279 boost::shared_ptr<LuminosityBlockPrincipal>
const
317 boost::shared_ptr<LuminosityBlockPrincipal> lb(
338 boost::shared_ptr<RunPrincipal>
343 rpCache->fillRunPrincipal();
347 boost::shared_ptr<LuminosityBlockPrincipal>
349 lbCache->fillLuminosityBlockPrincipal();
362 assert(lbCache->run() == result->
run());
408 <<
", Event " << eventID.
event()
410 <<
" at " << std::setprecision(3) <<
TimeOfDay();
414 statusFile << eventID <<
" time: " << std::setprecision(3) <<
TimeOfDay() <<
'\n';
424 <<
"InputSource::readIt()\n"
425 <<
"Random access is not implemented for this type of Input Source\n"
426 <<
"Contact a Framework Developer\n";
432 <<
"InputSource::setRun()\n"
433 <<
"Run number cannot be modified for this type of Input Source\n"
434 <<
"Contact a Framework Developer\n";
440 <<
"InputSource::setLumi()\n"
441 <<
"Luminosity Block ID cannot be modified for this type of Input Source\n"
442 <<
"Contact a Framework Developer\n";
448 <<
"InputSource::skip()\n"
449 <<
"Random access is not implemented for this type of Input Source\n"
450 <<
"Contact a Framework Developer\n";
456 <<
"InputSource::goToEvent_()\n"
457 <<
"Random access is not implemented for this type of Input Source\n"
458 <<
"Contact a Framework Developer\n";
466 <<
"InputSource::rewind()\n"
467 <<
"Rewind is not implemented for this type of Input Source\n"
468 <<
"Contact a Framework Developer\n";
487 rng->postEventRead(event);
602 sentry_(source.
actReg()->preSourceSignal_, source.
actReg()->postSourceSignal_) {
606 sentry_(source.
actReg()->preSourceLumiSignal_, source.
actReg()->postSourceLumiSignal_) {
610 sentry_(source.
actReg()->preSourceRunSignal_, source.
actReg()->postSourceRunSignal_) {
614 sentry_(source.
actReg()->preOpenFileSignal_, source.
actReg()->postOpenFileSignal_) {
618 sentry_(source.
actReg()->preCloseFileSignal_, source.
actReg()->postCloseFileSignal_) {
collection_type::const_iterator const_iterator
EventNumber_t event() const
T getUntrackedParameter(std::string const &, T const &) const
RunPrincipal & runPrincipal(ProcessHistoryID const &phid, int run)
ParameterDescriptionBase * addUntracked(U const &iLabel, T const &value)
RunSourceSentry(InputSource const &source)
EventID const & id() const
bool getMapped(key_type const &k, value_type &result) const
FileCloseSentry(InputSource const &source)
boost::shared_ptr< LuminosityBlockPrincipal > lumiPrincipalPtr(ProcessHistoryID const &phid, int run, int lumi)
LuminosityBlockNumber_t luminosityBlock() const
LuminosityBlockNumber_t luminosityBlock() const
bool insertMapped(value_type const &v)
unsigned int LuminosityBlockNumber_t
void setEndTime(Timestamp const &time)
Timestamp const & time() const
TypeLabelList & typeLabelList()
used by the fwk to register the list of products of this module
void addDefault(ParameterSetDescription const &psetDescription)
boost::shared_ptr< RunPrincipal > runPrincipalPtr(ProcessHistoryID const &phid, int run)
LuminosityBlockNumber_t luminosityBlock() const
void setEndTime(Timestamp const &time)
EventSourceSentry(InputSource const &source)
EventPrincipal & eventPrincipal()
SourceSentry(Sig &pre, Sig &post)
unsigned int offset(bool)
How EventSelector::AcceptEvent() decides whether to accept an event for output otherwise it is excluding the probing of A single or multiple positive and the trigger will pass if any such matching triggers are PASS or EXCEPTION[A criterion thatmatches no triggers at all is detected and causes a throw.] A single negative with an expectation of appropriate bit checking in the decision and the trigger will pass if any such matching triggers are FAIL or EXCEPTION A wildcarded negative criterion that matches more than one trigger in the trigger but the state exists so we define the behavior If all triggers are the negative crieriion will lead to accepting the event(this again matches the behavior of"!*"before the partial wildcard feature was incorporated).The per-event"cost"of each negative criterion with multiple relevant triggers is about the same as!*was in the past
Hash< ProcessHistoryType > ProcessHistoryID
LuminosityBlockPrincipal & lumiPrincipal(ProcessHistoryID const &phid, int run, int lumi)
bool merge(boost::shared_ptr< RunAuxiliary > aux, boost::shared_ptr< ProductRegistry const > reg)
static const std::string kBaseType("EDAnalyzer")
author Stefano ARGIRO author Bill Tanenbaum
bool insert(boost::shared_ptr< RunPrincipal > rp)
static ThreadSafeRegistry * instance()
static void addToRegistry(TypeLabelList::const_iterator const &iBegin, TypeLabelList::const_iterator const &iEnd, ModuleDescription const &iDesc, ProductRegistry &iReg, bool iIsListener=false)
LumiSourceSentry(InputSource const &source)
std::string createGlobalIdentifier()
FileOpenSentry(InputSource const &source)