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:
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());
36  ret->setProcessHistoryID(hist);
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 
RunNumber_t run() const
ret
prodAgent to be discontinued
OneLumiPoolSource(ParameterSet const &pset, InputSourceDescription const &desc)
void readLuminosityBlock_(LuminosityBlockPrincipal &lumiPrincipal) override
Definition: PoolSource.cc:205
std::shared_ptr< LuminosityBlockAuxiliary > readLuminosityBlockAuxiliary_() override
Definition: PoolSource.cc:169
void readEvent_(EventPrincipal &eventPrincipal) override
Definition: PoolSource.cc:227
#define DEFINE_FWK_INPUT_SOURCE(type)
ItemType getNextItemType() override
ItemType getNextItemType() override
Definition: PoolSource.cc:261
__shared__ Hist hist
HLT enums.
std::shared_ptr< LuminosityBlockAuxiliary > readLuminosityBlockAuxiliary_() override
void setRunAndLumiNumber(RunNumber_t run, LuminosityBlockNumber_t lumi)
void readEvent_(EventPrincipal &eventPrincipal) override