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  }
33 
34  std::shared_ptr<LuminosityBlockAuxiliary>
37  auto hist = ret->processHistoryID();
38  *ret = LuminosityBlockAuxiliary(ret->run(), 1, ret->beginTime(), ret->endTime());
40  return ret;
41  }
42 
46  if(type==IsLumi) {
47  if(seenFirstLumi_) {
48  do {
49  edm::HistoryAppender historyAppender;
50  auto prodReg = std::make_shared<edm::ProductRegistry>();
51  prodReg->setFrozen();
52  edm::ProcessConfiguration procConfig;
53 
54  LuminosityBlockPrincipal temp(prodReg, procConfig, &historyAppender,0);
57  } while(type == IsLumi);
58  } else {
59  seenFirstLumi_ = true;
60  }
61  }
62  return type;
63  }
64 }
65 using namespace edm;
66 
68 
type
Definition: HCALResponse.h:21
RunNumber_t run() const
OneLumiPoolSource(ParameterSet const &pset, InputSourceDescription const &desc)
void readLuminosityBlock_(LuminosityBlockPrincipal &lumiPrincipal) override
Definition: PoolSource.cc:206
std::shared_ptr< LuminosityBlockAuxiliary > readLuminosityBlockAuxiliary_() override
Definition: PoolSource.cc:177
void readEvent_(EventPrincipal &eventPrincipal) override
Definition: PoolSource.cc:232
#define DEFINE_FWK_INPUT_SOURCE(type)
void setProcessHistoryID(ProcessHistoryID const &phid)
ItemType getNextItemType() override
ItemType getNextItemType() override
Definition: PoolSource.cc:266
HLT enums.
std::shared_ptr< LuminosityBlockAuxiliary > readLuminosityBlockAuxiliary_() override
void setRunAndLumiNumber(RunNumber_t run, LuminosityBlockNumber_t lumi)
void readEvent_(EventPrincipal &eventPrincipal) override