CMS 3D CMS Logo

IDGeneratorSourceBase.h
Go to the documentation of this file.
1 #ifndef Framework_Sources_IDGeneratorSourceBase_h
2 #define Framework_Sources_IDGeneratorSourceBase_h
3 
4 /*----------------------------------------------------------------------
5 ----------------------------------------------------------------------*/
6 
16 
17 #include <memory>
18 #include <vector>
19 
20 namespace edm {
21  class ParameterSet;
23  template <typename BASE>
24  class IDGeneratorSourceBase : public BASE {
25  public:
26  explicit IDGeneratorSourceBase(ParameterSet const& pset, InputSourceDescription const& desc, bool realData);
27  ~IDGeneratorSourceBase() noexcept(false) override;
28 
29  unsigned int numberEventsInRun() const { return numberEventsInRun_; }
30  unsigned int numberEventsInLumi() const { return numberEventsInLumi_; }
31  TimeValue_t presentTime() const { return presentTime_; }
32  unsigned int timeBetweenEvents() const { return timeBetweenEvents_; }
33  unsigned int eventCreationDelay() const { return eventCreationDelay_; }
34  unsigned int numberEventsInThisRun() const { return numberEventsInThisRun_; }
35  unsigned int numberEventsInThisLumi() const { return numberEventsInThisLumi_; }
36  EventID const& eventID() const { return eventID_; }
37  RunNumber_t run() const { return eventID_.run(); }
38  EventNumber_t event() const { return eventID_.event(); }
40 
42 
43  protected:
44  template <typename F>
45  void doReadEvent(EventPrincipal& eventPrincipal, F&& f) {
46  assert(BASE::eventCached() || BASE::processingMode() != BASE::RunsLumisAndEvents);
48  auto history = BASE::processHistoryRegistry().getMapped(aux.processHistoryID());
49  eventPrincipal.fillEventPrincipal(aux, history);
50  f(eventPrincipal);
51  BASE::resetEventCached();
52  }
53 
54  private:
55  typename BASE::ItemType getNextItemType() final;
56  virtual void initialize(EventID& id, TimeValue_t& time, TimeValue_t& interval);
57  virtual bool setRunAndEventInfo(EventID& id, TimeValue_t& time, EventAuxiliary::ExperimentType& etype) = 0;
58  virtual bool noFiles() const;
59  virtual size_t fileIndex() const;
60  void beginJob() override;
61 
63  std::shared_ptr<RunAuxiliary> readRunAuxiliary_() override;
64  void skip(int offset) override;
65  void rewind_() override;
66 
70 
72  unsigned int numberEventsInRun_;
73  unsigned int numberEventsInLumi_;
77  unsigned int eventCreationDelay_; /* microseconds */
78 
79  unsigned int numberEventsInThisRun_;
85  EventAuxiliary::ExperimentType eType_;
86  };
87 } // namespace edm
88 #endif
edm::RunNumber_t
unsigned int RunNumber_t
Definition: RunLumiEventNumber.h:14
f
double f[11][100]
Definition: MuScleFitUtils.cc:78
edm::IDGeneratorSourceBase::origTime_
TimeValue_t origTime_
Definition: IDGeneratorSourceBase.h:75
edm::IDGeneratorSourceBase::run
RunNumber_t run() const
Definition: IDGeneratorSourceBase.h:37
edm
HLT enums.
Definition: AlignableModifier.h:19
edm::IDGeneratorSourceBase::eventCreationDelay
unsigned int eventCreationDelay() const
Definition: IDGeneratorSourceBase.h:33
edm::IDGeneratorSourceBase::eventID_
EventID eventID_
Definition: IDGeneratorSourceBase.h:82
RunLumiEventNumber.h
edm::ParameterSetDescription
Definition: ParameterSetDescription.h:52
edm::InputSourceDescription
Definition: InputSourceDescription.h:20
cms::cuda::assert
assert(be >=bs)
protons_cff.time
time
Definition: protons_cff.py:39
edm::IDGeneratorSourceBase
Definition: IDGeneratorSourceBase.h:24
ProcessHistoryRegistry.h
edm::IDGeneratorSourceBase::numberEventsInThisRun
unsigned int numberEventsInThisRun() const
Definition: IDGeneratorSourceBase.h:34
edm::IDGeneratorSourceBase::getNextItemType
BASE::ItemType getNextItemType() final
Definition: IDGeneratorSourceBase.cc:136
edm::IDGeneratorSourceBase::presentTime_
TimeValue_t presentTime_
Definition: IDGeneratorSourceBase.h:74
edm::IDGeneratorSourceBase::luminosityBlock
LuminosityBlockNumber_t luminosityBlock() const
Definition: IDGeneratorSourceBase.h:39
edm::IDGeneratorSourceBase::numberEventsInThisLumi
unsigned int numberEventsInThisLumi() const
Definition: IDGeneratorSourceBase.h:35
edm::EventID::luminosityBlock
LuminosityBlockNumber_t luminosityBlock() const
Definition: EventID.h:39
watchdog.const
const
Definition: watchdog.py:83
edm::LuminosityBlockNumber_t
unsigned int LuminosityBlockNumber_t
Definition: RunLumiEventNumber.h:13
edm::IDGeneratorSourceBase::numberEventsInLumi
unsigned int numberEventsInLumi() const
Definition: IDGeneratorSourceBase.h:30
LuminosityBlockID.h
F
static uInt32 F(BLOWFISH_CTX *ctx, uInt32 x)
Definition: blowfish.cc:163
edm::LuminosityBlockAuxiliary
Definition: LuminosityBlockAuxiliary.h:15
edm::IDGeneratorSourceBase::setRunAndEventInfo
virtual bool setRunAndEventInfo(EventID &id, TimeValue_t &time, EventAuxiliary::ExperimentType &etype)=0
edm::IDGeneratorSourceBase::zerothEvent_
const EventNumber_t zerothEvent_
Definition: IDGeneratorSourceBase.h:81
edm::EventPrincipal
Definition: EventPrincipal.h:46
edm::IDGeneratorSourceBase::numberEventsInRun
unsigned int numberEventsInRun() const
Definition: IDGeneratorSourceBase.h:29
edm::IDGeneratorSourceBase::runForLumi
RunNumber_t runForLumi(LuminosityBlockNumber_t) const
Definition: IDGeneratorSourceBase.cc:241
edm::IDGeneratorSourceBase::doReadEvent
void doReadEvent(EventPrincipal &eventPrincipal, F &&f)
Definition: IDGeneratorSourceBase.h:45
EventPrincipal.h
edm::IDGeneratorSourceBase::IDGeneratorSourceBase
IDGeneratorSourceBase(ParameterSet const &pset, InputSourceDescription const &desc, bool realData)
Definition: IDGeneratorSourceBase.cc:41
EventID.h
edm::IDGeneratorSourceBase::readLuminosityBlockAuxiliary_
std::shared_ptr< LuminosityBlockAuxiliary > readLuminosityBlockAuxiliary_() override
Definition: IDGeneratorSourceBase.cc:85
edm::IDGeneratorSourceBase::beginJob
void beginJob() override
Definition: IDGeneratorSourceBase.cc:115
edm::IDGeneratorSourceBase::event
EventNumber_t event() const
Definition: IDGeneratorSourceBase.h:38
edm::EventNumber_t
unsigned long long EventNumber_t
Definition: RunLumiEventNumber.h:12
edm::LuminosityBlockID
Definition: LuminosityBlockID.h:31
edm::EventID::run
RunNumber_t run() const
Definition: EventID.h:38
edm::EventAuxiliary
Definition: EventAuxiliary.h:14
edm::IDGeneratorSourceBase::advanceToNext
void advanceToNext(EventID &eventID, TimeValue_t &time)
Definition: IDGeneratorSourceBase.cc:177
edm::IDGeneratorSourceBase::firstLumiForRuns_
std::vector< edm::LuminosityBlockID > firstLumiForRuns_
Definition: IDGeneratorSourceBase.h:71
edm::IDGeneratorSourceBase::eventID
EventID const & eventID() const
Definition: IDGeneratorSourceBase.h:36
edm::IDGeneratorSourceBase::numberEventsInLumi_
unsigned int numberEventsInLumi_
Definition: IDGeneratorSourceBase.h:73
edm::ParameterSet
Definition: ParameterSet.h:47
edm::IDGeneratorSourceBase::retreatToPrevious
void retreatToPrevious(EventID &eventID, TimeValue_t &time)
Definition: IDGeneratorSourceBase.cc:208
Timestamp.h
ParameterSet
Definition: Functions.h:16
edm::IDGeneratorSourceBase::numberEventsInRun_
unsigned int numberEventsInRun_
Definition: IDGeneratorSourceBase.h:72
edm::IDGeneratorSourceBase::skip
void skip(int offset) override
Definition: IDGeneratorSourceBase.cc:95
printConversionInfo.aux
aux
Definition: printConversionInfo.py:19
edm::EventID::event
EventNumber_t event() const
Definition: EventID.h:40
edm::IDGeneratorSourceBase::eType_
EventAuxiliary::ExperimentType eType_
Definition: IDGeneratorSourceBase.h:85
edm::IDGeneratorSourceBase::numberEventsInThisRun_
unsigned int numberEventsInThisRun_
Definition: IDGeneratorSourceBase.h:79
trackerHitRTTI::vector
Definition: trackerHitRTTI.h:21
readEcalDQMStatus.interval
interval
Definition: readEcalDQMStatus.py:18
edm::IDGeneratorSourceBase::eventCreationDelay_
unsigned int eventCreationDelay_
Definition: IDGeneratorSourceBase.h:77
edm::IDGeneratorSourceBase::timeBetweenEvents
unsigned int timeBetweenEvents() const
Definition: IDGeneratorSourceBase.h:32
edm::IDGeneratorSourceBase::fileIndex
virtual size_t fileIndex() const
Definition: IDGeneratorSourceBase.cc:258
edm::EventPrincipal::fillEventPrincipal
void fillEventPrincipal(EventAuxiliary const &aux, ProcessHistory const *processHistory, DelayedReader *reader=nullptr)
Definition: EventPrincipal.cc:105
edm::IDGeneratorSourceBase::noFiles
virtual bool noFiles() const
Definition: IDGeneratorSourceBase.cc:253
edm::IDGeneratorSourceBase::presentTime
TimeValue_t presentTime() const
Definition: IDGeneratorSourceBase.h:31
submitPVResolutionJobs.desc
string desc
Definition: submitPVResolutionJobs.py:251
std
Definition: JetResolutionObject.h:76
edm::IDGeneratorSourceBase::timeBetweenEvents_
TimeValue_t timeBetweenEvents_
Definition: IDGeneratorSourceBase.h:76
Frameworkfwd.h
EventAuxiliary.h
edm::IDGeneratorSourceBase::rewind_
void rewind_() override
Definition: IDGeneratorSourceBase.cc:126
ParameterSetDescription
edm::IDGeneratorSourceBase::numberEventsInThisLumi_
unsigned int numberEventsInThisLumi_
Definition: IDGeneratorSourceBase.h:80
edm::IDGeneratorSourceBase::isRealData_
bool isRealData_
Definition: IDGeneratorSourceBase.h:84
DTskim_cfg.processingMode
processingMode
Definition: DTskim_cfg.py:82
edm::IDGeneratorSourceBase::readRunAuxiliary_
std::shared_ptr< RunAuxiliary > readRunAuxiliary_() override
Definition: IDGeneratorSourceBase.cc:78
edm::IDGeneratorSourceBase::origEventID_
EventID origEventID_
Definition: IDGeneratorSourceBase.h:83
edm::IDGeneratorSourceBase::initialize
virtual void initialize(EventID &id, TimeValue_t &time, TimeValue_t &interval)
Definition: IDGeneratorSourceBase.cc:123
edm::EventID
Definition: EventID.h:31
hltrates_dqm_sourceclient-live_cfg.offset
offset
Definition: hltrates_dqm_sourceclient-live_cfg.py:82
edm::IDGeneratorSourceBase::~IDGeneratorSourceBase
~IDGeneratorSourceBase() noexcept(false) override
Definition: IDGeneratorSourceBase.cc:75
edm::IDGeneratorSourceBase::fillDescription
static void fillDescription(ParameterSetDescription &desc)
Definition: IDGeneratorSourceBase.cc:263
RunID.h
edm::TimeValue_t
unsigned long long TimeValue_t
Definition: Timestamp.h:28
muonDTDigis_cfi.pset
pset
Definition: muonDTDigis_cfi.py:27
edm::RunAuxiliary
Definition: RunAuxiliary.h:15
edm::Timestamp
Definition: Timestamp.h:30