43 int lastDigit = count % 10;
44 if(lastDigit >= 4 || lastDigit == 0)
return th;
46 if(count % 100 - lastDigit == 10)
return th;
47 return (lastDigit == 1 ? st : (lastDigit == 2 ? nd : rd));
50 boost::shared_ptr<T> createSharedPtrToStatic(
T* ptr) {
51 return boost::shared_ptr<T>(ptr, do_nothing_deleter());
57 actReg_(desc.actReg_),
58 maxEvents_(desc.maxEvents_),
59 remainingEvents_(maxEvents_),
60 maxLumis_(desc.maxLumis_),
61 remainingLumis_(maxLumis_),
63 processingMode_(RunsLumisAndEvents),
64 moduleDescription_(desc.moduleDescription_),
66 branchIDListHelper_(desc.branchIDListHelper_),
67 primary_(pset.getParameter<std::
string>(
"@module_label") == std::
string(
"@main_input")),
78 numberOfEventsBeforeBigSkip_(0) {
81 std::ostringstream statusfilename;
82 statusfilename <<
"source_" << getpid();
90 std::string const defaultMode(
"RunsLumisAndEvents");
100 if(processingMode == runMode) {
102 }
else if(processingMode == runLumiMode) {
104 }
else if(processingMode != defaultMode) {
106 <<
"InputSource::InputSource()\n"
107 <<
"The 'processingMode' parameter for sources has an illegal value '" << processingMode <<
"'\n"
108 <<
"Legal values are '" << defaultMode <<
"', '" << runLumiMode <<
"', or '" << runMode <<
"'.\n";
137 "'RunsLumisAndEvents': process runs, lumis, and events.\n"
138 "'RunsAndLumis': process runs and lumis (not events).\n"
139 "'Runs': process runs (not lumis or events).");
140 desc.
addUntracked<
bool>(
"writeStatusFile",
false)->setComment(
"Write a status file. Intended for use by workflow management.");
150 unsigned long toSkip =
receiver_->numberToSkip();
173 ItemType itemType = callWithTryCatchAndPrint<ItemType>( [
this](){
return getNextItemType(); },
"Calling InputSource::getNextItemType" );
212 }
else if(newState ==
IsRun || oldState ==
IsFile) {
215 }
else if(newState ==
IsLumi || oldState ==
IsRun) {
231 boost::shared_ptr<LuminosityBlockAuxiliary>
234 "Calling InputSource::readLuminosityBlockAuxiliary_" );
237 boost::shared_ptr<RunAuxiliary>
239 return callWithTryCatchAndPrint<boost::shared_ptr<RunAuxiliary> >( [
this](){
return readRunAuxiliary_(); },
240 "Calling InputSource::readRunAuxiliary_" );
261 std::unique_ptr<FileBlock>
265 return callWithTryCatchAndPrint<std::unique_ptr<FileBlock> >( [
this](){
return readFile_(); },
266 "Calling InputSource::readFile_" );
271 if(fb !=
nullptr) fb->
close();
272 callWithTryCatchAndPrint<void>( [
this](){
closeFile_(); },
273 "Calling InputSource::closeFile_",
274 cleaningUpAfterException );
281 std::unique_ptr<FileBlock>
283 return std::unique_ptr<FileBlock>(
new FileBlock);
286 boost::shared_ptr<RunPrincipal>
290 callWithTryCatchAndPrint<boost::shared_ptr<RunPrincipal> >( [
this,&rp](){
return readRun_(rp); },
"Calling InputSource::readRun_" );
297 callWithTryCatchAndPrint<boost::shared_ptr<RunPrincipal> >( [
this,&rp](){
return readRun_(rp); },
"Calling InputSource::readRun_" );
300 boost::shared_ptr<LuminosityBlockPrincipal>
303 boost::shared_ptr<LuminosityBlockPrincipal> lbp(
308 callWithTryCatchAndPrint<boost::shared_ptr<LuminosityBlockPrincipal> >( [
this,&lbp](){
return readLuminosityBlock_(lbp); },
309 "Calling InputSource::readLuminosityBlock_" );
319 callWithTryCatchAndPrint<boost::shared_ptr<LuminosityBlockPrincipal> >( [
this,&lbp](){
return readLuminosityBlock_(lbp); },
320 "Calling InputSource::readLuminosityBlock_" );
326 boost::shared_ptr<RunPrincipal>
331 runPrincipal->fillRunPrincipal();
335 boost::shared_ptr<LuminosityBlockPrincipal>
337 lumiPrincipal->fillLuminosityBlockPrincipal();
338 return lumiPrincipal;
368 result =
readIt(eventID, ep);
383 callWithTryCatchAndPrint<void>( [
this,&
offset](){
skip(offset); },
"Calling InputSource::skip" );
388 return callWithTryCatchAndPrint<bool>( [
this,&eventID](){
return goToEvent_(eventID); },
"Calling InputSource::goToEvent_" );
398 callWithTryCatchAndPrint<void>( [
this](){
rewind_(); },
"Calling InputSource::rewind_" );
400 unsigned int numberToSkip =
receiver_->numberToSkip();
411 <<
", Event " << eventID.
event()
413 <<
" at " << std::setprecision(3) <<
TimeOfDay();
417 statusFile << eventID <<
" time: " << std::setprecision(3) <<
TimeOfDay() <<
'\n';
427 <<
"InputSource::readIt()\n"
428 <<
"Random access is not implemented for this type of Input Source\n"
429 <<
"Contact a Framework Developer\n";
435 <<
"InputSource::setRun()\n"
436 <<
"Run number cannot be modified for this type of Input Source\n"
437 <<
"Contact a Framework Developer\n";
443 <<
"InputSource::setLumi()\n"
444 <<
"Luminosity Block ID cannot be modified for this type of Input Source\n"
445 <<
"Contact a Framework Developer\n";
451 <<
"InputSource::skip()\n"
452 <<
"Forking and random access are not implemented for this type of Input Source\n"
453 <<
"Contact a Framework Developer\n";
459 <<
"InputSource::goToEvent_()\n"
460 <<
"Random access is not implemented for this type of Input Source\n"
461 <<
"Contact a Framework Developer\n";
468 <<
"InputSource::rewind()\n"
469 <<
"Forking and random access are not implemented for this type of Input Source\n"
470 <<
"Contact a Framework Developer\n";
489 rng->postEventRead(event);
496 callWithTryCatchAndPrint<void>( [
this,&
run](){
beginRun(run); },
"Calling InputSource::beginRun" );
505 callWithTryCatchAndPrint<void>( [
this,&
run](){
endRun(run); },
"Calling InputSource::endRun", cleaningUpAfterException );
512 callWithTryCatchAndPrint<void>( [
this,&lb](){
beginLuminosityBlock(lb); },
"Calling InputSource::beginLuminosityBlock" );
521 callWithTryCatchAndPrint<void>( [
this,&lb](){
endLuminosityBlock(lb); },
"Calling InputSource::endLuminosityBlock", cleaningUpAfterException );
527 callWithTryCatchAndPrint<void>( [
this](){
preForkReleaseResources(); },
"Calling InputSource::preForkReleaseResources" );
533 "Calling InputSource::postForkReacquireResources" );
538 return callWithTryCatchAndPrint<bool>( [
this](){
return randomAccess_(); },
539 "Calling InputSource::randomAccess_" );
544 return callWithTryCatchAndPrint<ProcessingController::ForwardState>( [
this](){
return forwardState_(); },
545 "Calling InputSource::forwardState_" );
550 return callWithTryCatchAndPrint<ProcessingController::ReverseState>( [
this](){
return reverseState_(); },
551 "Calling InputSource::reverseState__" );
625 sentry_(source.
actReg()->preSourceSignal_, source.
actReg()->postSourceSignal_) {
629 sentry_(source.
actReg()->preSourceLumiSignal_, source.
actReg()->postSourceLumiSignal_) {
633 sentry_(source.
actReg()->preSourceRunSignal_, source.
actReg()->postSourceRunSignal_) {
637 sentry_(source.
actReg()->preOpenFileSignal_, source.
actReg()->postOpenFileSignal_) {
641 post_(source.
actReg()->postCloseFileSignal_) {
642 source.
actReg()->preCloseFileSignal_(
"",
false);
646 post_(source.
actReg()->postCloseFileSignal_) {
647 source.
actReg()->preCloseFileSignal_(lfn, usedFallback);
EventNumber_t event() const
T getUntrackedParameter(std::string const &, T const &) const
ParameterDescriptionBase * addUntracked(U const &iLabel, T const &value)
The Signals That Services Can Subscribe To This is based on ActivityRegistry and is current per Services can connect to the signals distributed by the ActivityRegistry in order to monitor the activity of the application Each possible callback has some defined which we here list in angle e< void, edm::EventIDconst &, edm::Timestampconst & > We also list in braces which AR_WATCH_USING_METHOD_ is used for those or
RunSourceSentry(InputSource const &source)
static ThreadSafeRegistry * instance()
EventID const & id() const
FileCloseSentry(InputSource const &source)
LuminosityBlockNumber_t luminosityBlock() const
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)
void setEndTime(Timestamp const &time)
EventSourceSentry(InputSource const &source)
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
static const std::string kBaseType("EDAnalyzer")
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)