CMS 3D CMS Logo

ConditionDumperInEdm.cc
Go to the documentation of this file.
2 #include <memory>
3 
5 
8 
11 
12 //
13 // constructors and destructor
14 //
16  : gtEvmDigisLabel_{iConfig.getParameter<edm::InputTag>("gtEvmDigisLabel")},
17  gtEvmDigisLabelToken_{consumes<L1GlobalTriggerEvmReadoutRecord>(gtEvmDigisLabel_)},
18  //per LUMI products
19  lumiToken_{produces<edm::ConditionsInLumiBlock, edm::Transition::EndLuminosityBlock>()},
20  //per RUN products
21  runToken_{produces<edm::ConditionsInRunBlock, edm::Transition::EndRun>()},
22  //per EVENT products
23  eventToken_{produces<edm::ConditionsInEventBlock>()} {}
24 
26 
27 //
28 // member functions
29 //
30 std::shared_ptr<edm::ConditionsInLumiBlock> ConditionDumperInEdm::globalBeginLuminosityBlock(
31  edm::LuminosityBlock const&, edm::EventSetup const&) const {
32  return std::make_shared<edm::ConditionsInLumiBlock>();
33 }
34 
36  lumi.emplace(lumiToken_, std::move(*luminosityBlockCache(lumi.index())));
37 }
38 
39 std::shared_ptr<edm::ConditionsInRunBlock> ConditionDumperInEdm::globalBeginRun(edm::Run const&,
40  const edm::EventSetup&) const {
41  return std::make_shared<edm::ConditionsInRunBlock>();
42 }
43 
45  //dump of RunInfo
46  auto& runBlock = *(runCache(run.index()));
47  {
49  setup.get<RunInfoRcd>().get(sum);
50  runBlock.BStartCurrent = sum->m_start_current;
51  runBlock.BStopCurrent = sum->m_stop_current;
52  runBlock.BAvgCurrent = sum->m_avg_current;
53  }
54 
55  run.emplace(runToken_, std::move(runBlock));
56 }
57 
58 // ------------ method called to produce the data ------------
60  //get the L1 object
62  iEvent.getByToken(gtEvmDigisLabelToken_, gtReadoutRecordData);
63 
64  if (!gtReadoutRecordData.isValid()) {
65  LogDebug("ConditionDumperInEdm") << "\nWarning: L1GlobalTriggerEvmReadoutRecord with input tag " << gtEvmDigisLabel_
66  << "\nrequested in configuration, but not found in the event."
67  << "\nNo BST quantities retrieved." << std::endl;
68 
69  iEvent.emplace(eventToken_, eventBlock_);
70 
71  return;
72  }
73 
74  const L1GtfeExtWord& gtfeBlockData = gtReadoutRecordData->gtfeWord();
75 
76  //lumi info
77  auto& lumiBlock = *luminosityBlockCache(iEvent.getLuminosityBlock().index());
78  lumiBlock.totalIntensityBeam1 = gtfeBlockData.totalIntensityBeam1();
79  lumiBlock.totalIntensityBeam2 = gtfeBlockData.totalIntensityBeam2();
80 
81  //run info
82  auto& runBlock = *runCache(iEvent.getRun().index());
83  runBlock.beamMomentum = gtfeBlockData.beamMomentum();
84  runBlock.beamMode = gtfeBlockData.beamMode();
85  runBlock.lhcFillNumber = gtfeBlockData.lhcFillNumber();
86 
87  //event info
90 
91  iEvent.emplace(eventToken_, eventBlock_);
92 }
edm::ConditionsInEventBlock::turnCountNumber
uint32_t turnCountNumber
Definition: ConditionsInEdm.h:36
MessageLogger.h
RunSummaryRcd.h
edm::LuminosityBlock
Definition: LuminosityBlock.h:50
edm::Run
Definition: Run.h:45
L1GtfeExtWord.h
L1GtfeExtWord::turnCountNumber
const cms_uint32_t turnCountNumber() const
Definition: L1GtfeExtWord.cc:175
L1GlobalTriggerEvmReadoutRecord::gtfeWord
const L1GtfeExtWord gtfeWord() const
get / set GTFE word (record) in the GT readout record
Definition: L1GlobalTriggerEvmReadoutRecord.cc:249
ConditionDumperInEdm::endLuminosityBlockProduce
void endLuminosityBlockProduce(edm::LuminosityBlock &, edm::EventSetup const &) final
Definition: ConditionDumperInEdm.cc:35
ConditionDumperInEdm::gtEvmDigisLabel_
const edm::InputTag gtEvmDigisLabel_
Definition: ConditionDumperInEdm.h:74
L1GtfeExtWord::totalIntensityBeam1
const cms_uint32_t totalIntensityBeam1() const
Definition: L1GtfeExtWord.cc:295
edm::Handle
Definition: AssociativeIterator.h:50
singleTopDQM_cfi.setup
setup
Definition: singleTopDQM_cfi.py:37
ConditionDumperInEdm::globalBeginLuminosityBlock
std::shared_ptr< edm::ConditionsInLumiBlock > globalBeginLuminosityBlock(edm::LuminosityBlock const &, edm::EventSetup const &) const final
Definition: ConditionDumperInEdm.cc:30
L1GtfeExtWord::bstMasterStatus
const cms_uint16_t bstMasterStatus() const
Definition: L1GtfeExtWord.cc:155
RunInfo::m_stop_current
float m_stop_current
Definition: RunInfo.h:27
L1GlobalTriggerEvmReadoutRecord.h
ConditionDumperInEdm::endRunProduce
void endRunProduce(edm::Run &, const edm::EventSetup &) final
Definition: ConditionDumperInEdm.cc:44
edm::ESHandle
Definition: DTSurvey.h:22
ConditionDumperInEdm::eventToken_
const edm::EDPutTokenT< edm::ConditionsInEventBlock > eventToken_
Definition: ConditionDumperInEdm.h:81
L1GtfeExtWord::beamMomentum
const cms_uint16_t beamMomentum() const
Definition: L1GtfeExtWord.cc:275
RunInfoRcd
Definition: RunSummaryRcd.h:26
LogDebug
#define LogDebug(id)
Definition: MessageLogger.h:670
edm::ParameterSet
Definition: ParameterSet.h:36
L1GtfeExtWord::lhcFillNumber
const cms_uint32_t lhcFillNumber() const
Definition: L1GtfeExtWord.cc:195
RunInfo::m_start_current
float m_start_current
Definition: RunInfo.h:26
ConditionDumperInEdm::ConditionDumperInEdm
ConditionDumperInEdm(const edm::ParameterSet &)
Definition: ConditionDumperInEdm.cc:15
ConditionDumperInEdm::eventBlock_
edm::ConditionsInEventBlock eventBlock_
Definition: ConditionDumperInEdm.h:76
iEvent
int iEvent
Definition: GenABIO.cc:224
ConditionDumperInEdm::produce
void produce(edm::Event &, const edm::EventSetup &) final
Definition: ConditionDumperInEdm.cc:59
edm::EventSetup
Definition: EventSetup.h:57
ConditionDumperInEdm::gtEvmDigisLabelToken_
const edm::EDGetTokenT< L1GlobalTriggerEvmReadoutRecord > gtEvmDigisLabelToken_
Definition: ConditionDumperInEdm.h:78
ConditionDumperInEdm.h
L1GtfeExtWord
Definition: L1GtfeExtWord.h:31
ConditionDumperInEdm::~ConditionDumperInEdm
~ConditionDumperInEdm() override
Definition: ConditionDumperInEdm.cc:25
edm::ParameterSet::getParameter
T getParameter(std::string const &) const
edm::ConditionsInEventBlock::bstMasterStatus
uint16_t bstMasterStatus
Definition: ConditionsInEdm.h:35
RunInfo.h
L1GtfeExtWord::totalIntensityBeam2
const cms_uint32_t totalIntensityBeam2() const
Definition: L1GtfeExtWord.cc:315
eostools.move
def move(src, dest)
Definition: eostools.py:511
writedatasetfile.run
run
Definition: writedatasetfile.py:27
ConditionDumperInEdm::runToken_
const edm::EDPutTokenT< edm::ConditionsInRunBlock > runToken_
Definition: ConditionDumperInEdm.h:80
ConditionDumperInEdm::get
const T * get(const edm::EventSetup &setup)
Definition: ConditionDumperInEdm.h:66
ConditionDumperInEdm::lumiToken_
const edm::EDPutTokenT< edm::ConditionsInLumiBlock > lumiToken_
Definition: ConditionDumperInEdm.h:79
edm::HandleBase::isValid
bool isValid() const
Definition: HandleBase.h:70
RunInfo::m_avg_current
float m_avg_current
Definition: RunInfo.h:28
edm::Event
Definition: Event.h:73
lumi
Definition: LumiSectionData.h:20
ConditionDumperInEdm::globalBeginRun
std::shared_ptr< edm::ConditionsInRunBlock > globalBeginRun(edm::Run const &, const edm::EventSetup &) const final
Definition: ConditionDumperInEdm.cc:39
L1GtfeExtWord::beamMode
const cms_uint16_t beamMode() const
Definition: L1GtfeExtWord.cc:215
edm::InputTag
Definition: InputTag.h:15