CMS 3D CMS Logo

OneLumiPoolSource.cc
Go to the documentation of this file.
1 /*----------------------------------------------------------------------
2 ----------------------------------------------------------------------*/
3 #include "PoolSource.h"
7 
10 
11 namespace edm {
12 
13  class OneLumiPoolSource : public PoolSource {
14  public:
15  explicit OneLumiPoolSource(ParameterSet const& pset, InputSourceDescription const& desc);
16 
17  private:
18  ItemType getNextItemType() override;
19  std::shared_ptr<LuminosityBlockAuxiliary> readLuminosityBlockAuxiliary_() override;
20 
21  void readEvent_(EventPrincipal& eventPrincipal) override {
22  PoolSource::readEvent_(eventPrincipal);
23  eventPrincipal.setRunAndLumiNumber(eventPrincipal.run(), 1);
24  }
25 
26  bool seenFirstLumi_ = false;
27  };
28 
30  : PoolSource(pset, desc) {}
31 
32  std::shared_ptr<LuminosityBlockAuxiliary> OneLumiPoolSource::readLuminosityBlockAuxiliary_() {
34  auto hist = ret->processHistoryID();
35  *ret = LuminosityBlockAuxiliary(ret->run(), 1, ret->beginTime(), ret->endTime());
37  return ret;
38  }
39 
42  if (type == IsLumi) {
43  if (seenFirstLumi_) {
44  do {
45  edm::HistoryAppender historyAppender;
46  auto prodReg = std::make_shared<edm::ProductRegistry>();
47  prodReg->setFrozen();
48  edm::ProcessConfiguration procConfig;
49 
50  LuminosityBlockPrincipal temp(prodReg, procConfig, &historyAppender, 0);
53  } while (type == IsLumi);
54  } else {
55  seenFirstLumi_ = true;
56  }
57  }
58  return type;
59  }
60 } // namespace edm
61 using namespace edm;
62 
type
Definition: HCALResponse.h:21
RunNumber_t run() const
OneLumiPoolSource(ParameterSet const &pset, InputSourceDescription const &desc)
void readLuminosityBlock_(LuminosityBlockPrincipal &lumiPrincipal) override
Definition: PoolSource.cc:195
std::shared_ptr< LuminosityBlockAuxiliary > readLuminosityBlockAuxiliary_() override
Definition: PoolSource.cc:169
#define DEFINE_FWK_INPUT_SOURCE(type)
void readEvent_(EventPrincipal &eventPrincipal) override
Definition: PoolSource.cc:217
void setProcessHistoryID(ProcessHistoryID const &phid)
ItemType getNextItemType() override
ItemType getNextItemType() override
Definition: PoolSource.cc:249
HLT enums.
std::shared_ptr< LuminosityBlockAuxiliary > readLuminosityBlockAuxiliary_() override
void setRunAndLumiNumber(RunNumber_t run, LuminosityBlockNumber_t lumi)
void readEvent_(EventPrincipal &eventPrincipal) override