PhysicsTools
NanoAOD
plugins
LHCInfoProducer.cc
Go to the documentation of this file.
1
// -*- C++ -*-
2
//
3
// Package: PhysicsTools/NanoAOD
4
// Class: LHCInfoProducer
5
//
11
//
12
// Original Author: Justin Williams
13
// Created: 05 Jul 2019 14:06:12 GMT
14
//
15
//
16
17
// System include files
18
#include <memory>
19
#include <map>
20
#include <string>
21
#include <vector>
22
#include <iostream>
23
24
// user include files
25
#include "
FWCore/Framework/interface/Frameworkfwd.h
"
26
#include "
FWCore/Framework/interface/global/EDProducer.h
"
27
28
#include "
FWCore/Framework/interface/Event.h
"
29
#include "
FWCore/Framework/interface/MakerMacros.h
"
30
31
#include "
FWCore/Framework/interface/ESHandle.h
"
32
#include "
FWCore/Framework/interface/ESProducer.h
"
33
#include "
FWCore/Framework/interface/EventSetup.h
"
34
#include "
FWCore/Framework/interface/EventSetupRecordIntervalFinder.h
"
35
#include "
FWCore/Framework/interface/SourceFactory.h
"
36
37
#include "
FWCore/ParameterSet/interface/ParameterSet.h
"
38
#include "
FWCore/Utilities/interface/StreamID.h
"
39
40
#include "
CommonTools/Egamma/interface/EffectiveAreas.h
"
41
42
#include "
DataFormats/NanoAOD/interface/FlatTable.h
"
43
#include "
DataFormats/Common/interface/ValueMap.h
"
44
#include "
DataFormats/NanoAOD/interface/MergeableCounterTable.h
"
45
46
#include "
FWCore/Utilities/interface/transform.h
"
47
48
#include "
CondFormats/RunInfo/interface/LHCInfo.h
"
49
#include "
CondFormats/DataRecord/interface/LHCInfoRcd.h
"
50
51
class
LHCInfoProducer
:
public
edm::global::EDProducer
<edm::BeginLuminosityBlockProducer> {
52
public
:
53
LHCInfoProducer
(
edm::ParameterSet
const
&) :
lhcinfoToken_
(
esConsumes
<
edm
::
Transition
::BeginLuminosityBlock>()) {
54
produces<nanoaod::MergeableCounterTable, edm::Transition::BeginLuminosityBlock>();
55
}
56
~LHCInfoProducer
()
override
{}
57
58
// ------------ method called to produce the data ------------
59
void
produce
(
edm::StreamID
id
,
edm::Event
&
iEvent
,
const
edm::EventSetup
& iSetup)
const override
{}
60
61
void
globalBeginLuminosityBlockProduce
(
edm::LuminosityBlock
& iLumi,
edm::EventSetup
const
& iSetup)
const override
{
62
const
auto
&
info
= iSetup.
getData
(
lhcinfoToken_
);
63
auto
out
= std::make_unique<nanoaod::MergeableCounterTable>();
64
out
->addFloat(
"crossingAngle"
,
"LHC crossing angle"
,
info
.crossingAngle());
65
out
->addFloat(
"betaStar"
,
"LHC beta star"
,
info
.betaStar());
66
out
->addFloat(
"energy"
,
"LHC beam energy"
,
info
.energy());
67
iLumi.
put
(
std::move
(
out
));
68
}
69
70
// ------------ method fills 'descriptions' with the allowed parameters for the module ------------
71
static
void
fillDescriptions
(
edm::ConfigurationDescriptions
& descriptions) {
72
edm::ParameterSetDescription
desc
;
73
desc
.setUnknown();
74
descriptions.
addDefault
(
desc
);
75
}
76
edm::ESGetToken<LHCInfo, LHCInfoRcd>
lhcinfoToken_
;
77
};
78
79
DEFINE_FWK_MODULE
(
LHCInfoProducer
);
edm::StreamID
Definition:
StreamID.h:30
LHCInfoProducer::produce
void produce(edm::StreamID id, edm::Event &iEvent, const edm::EventSetup &iSetup) const override
Definition:
LHCInfoProducer.cc:59
LHCInfoProducer::fillDescriptions
static void fillDescriptions(edm::ConfigurationDescriptions &descriptions)
Definition:
LHCInfoProducer.cc:71
ESHandle.h
edm::LuminosityBlock
Definition:
LuminosityBlock.h:50
edm
HLT enums.
Definition:
AlignableModifier.h:19
edm::ParameterSetDescription
Definition:
ParameterSetDescription.h:52
LHCInfo.h
ESProducer.h
info
static const TGPicture * info(bool iBackgroundIsBlack)
Definition:
FWCollectionSummaryWidget.cc:153
EffectiveAreas.h
LHCInfoProducer::globalBeginLuminosityBlockProduce
void globalBeginLuminosityBlockProduce(edm::LuminosityBlock &iLumi, edm::EventSetup const &iSetup) const override
Definition:
LHCInfoProducer.cc:61
MakerMacros.h
DEFINE_FWK_MODULE
#define DEFINE_FWK_MODULE(type)
Definition:
MakerMacros.h:16
MergeableCounterTable.h
LHCInfoProducer::~LHCInfoProducer
~LHCInfoProducer() override
Definition:
LHCInfoProducer.cc:56
EventSetupRecordIntervalFinder.h
edm::global::EDProducer
Definition:
EDProducer.h:32
edm::ConfigurationDescriptions
Definition:
ConfigurationDescriptions.h:28
SourceFactory.h
edm::ParameterSet
Definition:
ParameterSet.h:47
edm::Transition
Transition
Definition:
Transition.h:12
Event.h
LHCInfoProducer::lhcinfoToken_
edm::ESGetToken< LHCInfo, LHCInfoRcd > lhcinfoToken_
Definition:
LHCInfoProducer.cc:76
iEvent
int iEvent
Definition:
GenABIO.cc:224
edm::EventSetup
Definition:
EventSetup.h:58
edm::LuminosityBlock::put
void put(std::unique_ptr< PROD > product)
Put a new product.
Definition:
LuminosityBlock.h:116
edm::ESGetToken< LHCInfo, LHCInfoRcd >
FlatTable.h
edm::EventSetup::getData
bool getData(T &iHolder) const
Definition:
EventSetup.h:127
ValueMap.h
submitPVResolutionJobs.desc
string desc
Definition:
submitPVResolutionJobs.py:251
eostools.move
def move(src, dest)
Definition:
eostools.py:511
Frameworkfwd.h
transform.h
EventSetup.h
LHCInfoProducer
Definition:
LHCInfoProducer.cc:51
edm::EDConsumerBase::esConsumes
auto esConsumes()
Definition:
EDConsumerBase.h:206
MillePedeFileConverter_cfg.out
out
Definition:
MillePedeFileConverter_cfg.py:31
LHCInfoProducer::LHCInfoProducer
LHCInfoProducer(edm::ParameterSet const &)
Definition:
LHCInfoProducer.cc:53
ParameterSet.h
LHCInfoRcd.h
EDProducer.h
edm::Event
Definition:
Event.h:73
edm::ConfigurationDescriptions::addDefault
void addDefault(ParameterSetDescription const &psetDescription)
Definition:
ConfigurationDescriptions.cc:99
StreamID.h
Generated for CMSSW Reference Manual by
1.8.16