CMS 3D CMS Logo

ConditionDumperInEdm.cc
Go to the documentation of this file.
2 #include <memory>
3 
5 
8 
11 
12 
13 //
14 // constructors and destructor
15 //
17  gtEvmDigisLabel_{iConfig.getParameter<edm::InputTag>("gtEvmDigisLabel")},
18  gtEvmDigisLabelToken_{consumes<L1GlobalTriggerEvmReadoutRecord>(gtEvmDigisLabel_)},
19  //per LUMI products
20  lumiToken_{produces<edm::ConditionsInLumiBlock,edm::Transition::EndLuminosityBlock>()},
21  //per RUN products
22  runToken_{produces<edm::ConditionsInRunBlock,edm::Transition::EndRun>()},
23  //per EVENT products
24  eventToken_{produces<edm::ConditionsInEventBlock>()}
25 {
26 }
27 
28 
30 {
31 }
32 
33 
34 //
35 // member functions
36 //
37 std::shared_ptr<edm::ConditionsInLumiBlock>
39  return std::make_shared<edm::ConditionsInLumiBlock>();
40 }
41 
43  lumi.emplace(lumiToken_,std::move(*luminosityBlockCache(lumi.index())));
44 }
45 
46 std::shared_ptr<edm::ConditionsInRunBlock>
48  return std::make_shared<edm::ConditionsInRunBlock>();
49 }
50 
52  //dump of RunInfo
53  auto& runBlock = *(runCache(run.index()));
54  {
56  setup.get<RunInfoRcd>().get(sum);
57  runBlock.BStartCurrent=sum->m_start_current;
58  runBlock.BStopCurrent=sum->m_stop_current;
59  runBlock.BAvgCurrent=sum->m_avg_current;
60  }
61 
62  run.emplace(runToken_,std::move(runBlock));
63 }
64 
65 // ------------ method called to produce the data ------------
66 void
68 {
69 
70  //get the L1 object
72  iEvent.getByToken(gtEvmDigisLabelToken_, gtReadoutRecordData);
73 
74  if (!gtReadoutRecordData.isValid()) {
75  LogDebug("ConditionDumperInEdm")
76  << "\nWarning: L1GlobalTriggerEvmReadoutRecord with input tag " << gtEvmDigisLabel_
77  << "\nrequested in configuration, but not found in the event."
78  << "\nNo BST quantities retrieved." << std::endl;
79 
81 
82  return;
83  }
84 
85  const L1GtfeExtWord& gtfeBlockData = gtReadoutRecordData->gtfeWord();
86 
87  //lumi info
88  auto& lumiBlock = *luminosityBlockCache(iEvent.getLuminosityBlock().index());
89  lumiBlock.totalIntensityBeam1=gtfeBlockData.totalIntensityBeam1();
90  lumiBlock.totalIntensityBeam2=gtfeBlockData.totalIntensityBeam2();
91 
92  //run info
93  auto& runBlock = *runCache(iEvent.getRun().index());
94  runBlock.beamMomentum=gtfeBlockData.beamMomentum();
95  runBlock.beamMode=gtfeBlockData.beamMode();
96  runBlock.lhcFillNumber=gtfeBlockData.lhcFillNumber();
97 
98  //event info
99  eventBlock_. bstMasterStatus= gtfeBlockData.bstMasterStatus() ;
100  eventBlock_.turnCountNumber = gtfeBlockData.turnCountNumber();
101 
103 }
104 
105 
#define LogDebug(id)
T getParameter(std::string const &) const
LuminosityBlockIndex index() const
const edm::EDGetTokenT< L1GlobalTriggerEvmReadoutRecord > gtEvmDigisLabelToken_
const edm::InputTag gtEvmDigisLabel_
bool getByToken(EDGetToken token, Handle< PROD > &result) const
Definition: Event.h:517
void emplace(EDPutTokenT< PROD > token, Args &&...args)
puts a new product
Definition: Run.h:245
const L1GtfeExtWord gtfeWord() const
get / set GTFE word (record) in the GT readout record
std::shared_ptr< edm::ConditionsInRunBlock > globalBeginRun(edm::Run const &, const edm::EventSetup &) const final
def setup(process, global_tag, zero_tesla=False)
Definition: GeneralSetup.py:2
const edm::EDPutTokenT< edm::ConditionsInEventBlock > eventToken_
Run const & getRun() const
Definition: Event.cc:99
void emplace(EDPutTokenT< PROD > token, Args &&...args)
puts a new product
const cms_uint16_t bstMasterStatus() const
const cms_uint16_t beamMomentum() const
int iEvent
Definition: GenABIO.cc:224
void endRunProduce(edm::Run &, const edm::EventSetup &) final
RunIndex index() const
Definition: Run.cc:21
const edm::EDPutTokenT< edm::ConditionsInLumiBlock > lumiToken_
LuminosityBlock const & getLuminosityBlock() const
Definition: Event.h:97
std::shared_ptr< edm::ConditionsInLumiBlock > globalBeginLuminosityBlock(edm::LuminosityBlock const &, edm::EventSetup const &) const final
ConditionDumperInEdm(const edm::ParameterSet &)
bool isValid() const
Definition: HandleBase.h:74
float m_stop_current
Definition: RunInfo.h:28
const cms_uint32_t totalIntensityBeam2() const
const cms_uint32_t totalIntensityBeam1() const
OrphanHandle< PROD > emplace(EDPutTokenT< PROD > token, Args &&...args)
puts a new product
Definition: Event.h:413
edm::ConditionsInEventBlock eventBlock_
const cms_uint32_t lhcFillNumber() const
float m_avg_current
Definition: RunInfo.h:29
boost::uint32_t turnCountNumber
float m_start_current
Definition: RunInfo.h:27
T get() const
Definition: EventSetup.h:71
void produce(edm::Event &, const edm::EventSetup &) final
void endLuminosityBlockProduce(edm::LuminosityBlock &, edm::EventSetup const &) final
const cms_uint32_t turnCountNumber() const
const cms_uint16_t beamMode() const
const edm::EDPutTokenT< edm::ConditionsInRunBlock > runToken_
def move(src, dest)
Definition: eostools.py:511
Definition: Run.h:45