20 void checkFirstLumiForRuns(std::vector<edm::LuminosityBlockID>
const& iFirstLumis) {
21 if (iFirstLumis.empty())
24 auto previous = iFirstLumis[0].luminosityBlock();
25 for (
auto it = iFirstLumis.begin() + 1; it != iFirstLumis.end(); ++it) {
26 if (not(it->luminosityBlock() > previous)) {
28 <<
"Incorrect ordering of LuminosityBlock numbers in parameter 'firstLuminosityBlockForEachRun'";
42 numberEventsInRun_(pset.getUntrackedParameter<unsigned
int>(
"numberEventsInRun", remainingEvents())),
44 pset.getUntrackedParameter<unsigned
int>(
"numberEventsInLuminosityBlock", remainingEvents())),
45 presentTime_(pset.getUntrackedParameter<unsigned long long>(
"firstTime", 1ULL)),
46 origTime_(presentTime_),
48 pset.getUntrackedParameter<unsigned long long>(
"timeBetweenEvents", kNanoSecPerSec / kAveEventPerSec)),
49 eventCreationDelay_(pset.getUntrackedParameter<unsigned
int>(
"eventCreationDelay", 0)),
50 numberEventsInThisRun_(0),
51 numberEventsInThisLumi_(0),
52 zerothEvent_(pset.existsAs<unsigned
int>(
"firstEvent",
false)
53 ? pset.getUntrackedParameter<unsigned
int>(
"firstEvent", 1) - 1
54 : pset.getUntrackedParameter<unsigned long long>(
"firstEvent", 1) - 1),
55 eventID_(pset.getUntrackedParameter<unsigned
int>(
"firstRun", 1),
56 pset.getUntrackedParameter<unsigned
int>(
"firstLuminosityBlock", 1),
58 origEventID_(eventID_),
59 isRealData_(realData),
79 return std::shared_ptr<LuminosityBlockAuxiliary>();
82 return std::make_shared<LuminosityBlockAuxiliary>(
93 e.
commit_(std::vector<ProductResolverIndex>());
99 for (; offset < 0; ++
offset) {
102 for (; offset > 0; --
offset) {
190 if (
run != eventID.
run()) {
211 if (numberEventsInRun_ < 1 || numberEventsInThisRun_ > 0) {
215 if (!(numberEventsInLumi_ < 1 || numberEventsInThisLumi_ > 0)) {
222 if (
run != eventID.
run()) {
244 return iV.luminosityBlock() <= iLumi;
259 ->setComment(
"Number of events to generate in each run.");
261 ->setComment(
"Number of events to generate in each lumi.");
262 desc.
addUntracked<
unsigned long long>(
"firstTime", 1)->setComment(
"Time before first event (ns) (for timestamp).");
264 ->setComment(
"Time between consecutive events (ns) (for timestamp).");
265 desc.
addUntracked<
unsigned int>(
"eventCreationDelay", 0)
266 ->setComment(
"Real time delay between generation of consecutive events (ms).");
271 "'firstEvent' is an XOR group because it can have type uint32 or uint64, default:1\n" 272 "Event number of first event to generate.");
274 desc.
addUntracked<
unsigned int>(
"firstLuminosityBlock", 1)
275 ->setComment(
"Luminosity block number of first lumi to generate.");
276 desc.
addUntracked<
unsigned int>(
"firstRun", 1)->setComment(
"Run number of first run to generate.");
277 desc.
addUntracked<std::vector<edm::LuminosityBlockID>>(
"firstLuminosityBlockForEachRun", {})
279 "When the source makes a new LuminosityBlock, this list is checked to see what Run number should be used. " 280 "The LuminosityBlock numbers are required to be in ascending order.");
EventNumber_t event() const
void setComment(std::string const &value)
std::shared_ptr< LuminosityBlockAuxiliary > readLuminosityBlockAuxiliary_() override
unsigned int numberEventsInLumi_
std::shared_ptr< RunAuxiliary > readRunAuxiliary_() override
EventNumber_t const zerothEvent_
ParameterDescriptionBase * addUntracked(U const &iLabel, T const &value)
static Timestamp invalidTimestamp()
void readEvent_(EventPrincipal &eventPrincipal) override
unsigned int eventCreationDelay_
unsigned int numberEventsInThisLumi_
ParameterDescriptionNode * addNode(ParameterDescriptionNode const &node)
~ProducerSourceBase() noexcept(false) override
LuminosityBlockNumber_t luminosityBlock() const
ItemType getNextItemType() final
unsigned int LuminosityBlockNumber_t
EventID previous(LuminosityBlockNumber_t const &lumi) const
static unsigned long long kAveEventPerSec
EventID next(LuminosityBlockNumber_t const &lumi) const
std::vector< edm::LuminosityBlockID > firstLumiForRuns_
virtual size_t fileIndex() const
virtual bool setRunAndEventInfo(EventID &id, TimeValue_t &time, EventAuxiliary::ExperimentType &etype)=0
ProducerSourceBase(ParameterSet const &pset, InputSourceDescription const &desc, bool realData)
void commit_(std::vector< edm::ProductResolverIndex > const &iShouldPut, ParentageID *previousParentageId=0)
static unsigned long long kNanoSecPerSec
static void fillDescription(ParameterSetDescription &desc)
unsigned long long TimeValue_t
RunNumber_t runForLumi(LuminosityBlockNumber_t) const
void setProducer(ProducerBase const *iProd, std::vector< BranchID > *previousParentage, std::vector< BranchID > *gotBranchIDsFromAcquire=0)
TimeValue_t timeBetweenEvents_
EventAuxiliary::ExperimentType eType_
unsigned int numberEventsInThisRun_
void fillEventPrincipal(EventAuxiliary const &aux, ProcessHistoryRegistry const &processHistoryRegistry, DelayedReader *reader=0)
EventID const & eventID() const
virtual bool noFiles() const
virtual void produce(Event &e)=0
EventID nextRunFirstEvent(LuminosityBlockNumber_t const &lumi) const
void advanceToNext(EventID &eventID, TimeValue_t &time)
ParameterDescriptionBase * addOptionalUntracked(U const &iLabel, T const &value)
void skip(int offset) override
EventID previousRunLastEvent(LuminosityBlockNumber_t const &lumi) const
unsigned int numberEventsInRun_
void retreatToPrevious(EventID &eventID, TimeValue_t &time)
virtual void initialize(EventID &id, TimeValue_t &time, TimeValue_t &interval)