16 : folderName_(iConfig.getParameter<
std::
string>(
"FolderName")),
17 metInputTag_(iConfig.getParameter<
edm::
InputTag>(
"met")),
18 jetInputTag_(iConfig.getParameter<
edm::
InputTag>(
"jets")),
19 eleInputTag_(iConfig.getParameter<
edm::
InputTag>(
"electrons")),
20 muoInputTag_(iConfig.getParameter<
edm::
InputTag>(
"muons")),
21 vtxInputTag_(iConfig.getParameter<
edm::
InputTag>(
"vertices")),
27 met_variable_binning_(
28 iConfig.getParameter<
edm::
ParameterSet>(
"histoPSet").getParameter<
std::vector<double> >(
"metBinning")),
29 met_binning_(getHistoPSet(
34 iConfig.getParameter<
edm::
ParameterSet>(
"numGenericTriggerEventPSet"), consumesCollector(), *this)),
36 iConfig.getParameter<
edm::
ParameterSet>(
"denGenericTriggerEventPSet"), consumesCollector(), *this)),
37 metSelection_(iConfig.getParameter<
std::
string>(
"metSelection")),
38 jetSelection_(iConfig.getParameter<
std::
string>(
"jetSelection")),
39 eleSelection_(iConfig.getParameter<
std::
string>(
"eleSelection")),
40 muoSelection_(iConfig.getParameter<
std::
string>(
"muoSelection")),
41 njets_(iConfig.getParameter<unsigned>(
"njets")),
42 nelectrons_(iConfig.getParameter<unsigned>(
"nelectrons")),
43 nmuons_(iConfig.getParameter<unsigned>(
"nmuons")) {
80 me.
numerator = ibooker.
book1D(histname +
"_numerator", histtitle +
" (numerator)", nbins, min, max);
81 me.
denominator = ibooker.
book1D(histname +
"_denominator", histtitle +
" (denominator)", nbins, min, max);
87 const std::vector<double>&
binning) {
88 int nbins = binning.size() - 1;
89 std::vector<float> fbinning(binning.begin(), binning.end());
90 float* arr = &fbinning[0];
91 me.
numerator = ibooker.
book1D(histname +
"_numerator", histtitle +
" (numerator)", nbins, arr);
92 me.
denominator = ibooker.
book1D(histname +
"_denominator", histtitle +
" (denominator)", nbins, arr);
104 ibooker.
bookProfile(histname +
"_numerator", histtitle +
" (numerator)", nbinsX, xmin, xmax, ymin, ymax);
106 ibooker.
bookProfile(histname +
"_denominator", histtitle +
" (denominator)", nbinsX, xmin, xmax, ymin, ymax);
119 ibooker.
book2D(histname +
"_numerator", histtitle +
" (numerator)", nbinsX, xmin, xmax, nbinsY, ymin, ymax);
121 ibooker.
book2D(histname +
"_denominator", histtitle +
" (denominator)", nbinsX, xmin, xmax, nbinsY, ymin, ymax);
127 const std::vector<double>& binningX,
128 const std::vector<double>& binningY) {
129 int nbinsX = binningX.size() - 1;
130 std::vector<float> fbinningX(binningX.begin(), binningX.end());
131 float* arrX = &fbinningX[0];
132 int nbinsY = binningY.size() - 1;
133 std::vector<float> fbinningY(binningY.begin(), binningY.end());
134 float* arrY = &fbinningY[0];
136 me.
numerator = ibooker.
book2D(histname +
"_numerator", histtitle +
" (numerator)", nbinsX, arrX, nbinsY, arrY);
137 me.
denominator = ibooker.
book2D(histname +
"_denominator", histtitle +
" (denominator)", nbinsX, arrX, nbinsY, arrY);
146 histname =
"deltaphi_metjet1";
147 histtitle =
"DPHI_METJ1";
151 histname =
"deltaphi_jet1jet2";
152 histtitle =
"DPHI_J1J2";
161 histname =
"met_variable";
166 histname =
"metVsLS";
167 histtitle =
"PFMET vs LS";
180 histtitle =
"PFMET phi";
204 <<
" is not available";
213 float met = pfmet.
pt();
216 std::vector<reco::PFJet>
jets;
220 if (jetHandle->size() <
njets_)
222 for (
auto const&
j : *jetHandle) {
233 <<
" is not available";
240 float deltaPhi_met_j1 = 10.0;
241 float deltaPhi_j1_j2 = 10.0;
244 deltaPhi_met_j1 = fabs(
deltaPhi(pfmet.
phi(), jets[0].phi()));
245 if (jets.size() >= 2)
248 std::vector<reco::GsfElectron>
electrons;
254 for (
auto const&
e : *eleHandle) {
256 electrons.push_back(
e);
267 <<
" is not available";
277 for (
auto const&
v : *vtxHandle) {
278 bool isFake =
v.isFake();
292 <<
" is not available";
298 std::vector<reco::Muon>
muons;
302 if (muoHandle->size() <
nmuons_)
304 for (
auto const&
m : *muoHandle) {
305 bool pass =
m.isGlobalMuon() &&
m.isPFMuon() &&
m.globalTrack()->normalizedChi2() < 10. &&
306 m.globalTrack()->hitPattern().numberOfValidMuonHits() > 0 &&
m.numberOfMatchedStations() > 1 &&
307 fabs(
m.muonBestTrack()->dxy(vtx.
position())) < 0.2 &&
308 fabs(
m.muonBestTrack()->dz(vtx.
position())) < 0.5 &&
309 m.innerTrack()->hitPattern().numberOfValidPixelHits() > 0 &&
310 m.innerTrack()->hitPattern().trackerLayersWithMeasurement() > 5;
323 <<
" is not available";
352 pset.
add<
unsigned>(
"nbins");
353 pset.
add<
double>(
"xmin");
354 pset.
add<
double>(
"xmax");
358 pset.
add<
unsigned int>(
"nbins", 2500);
359 pset.
add<
double>(
"xmin", 0.);
360 pset.
add<
double>(
"xmax", 2500.);
376 desc.
add<
unsigned>(
"njets", 0);
377 desc.
add<
unsigned>(
"nelectrons", 0);
378 desc.
add<
unsigned>(
"nmuons", 0);
381 genericTriggerEventPSet.add<
bool>(
"andOr");
383 genericTriggerEventPSet.add<std::vector<int> >(
"dcsPartitions", {});
384 genericTriggerEventPSet.add<
bool>(
"andOrDcs",
false);
385 genericTriggerEventPSet.add<
bool>(
"errorReplyDcs",
true);
386 genericTriggerEventPSet.add<
std::string>(
"dbLabel",
"");
387 genericTriggerEventPSet.add<
bool>(
"andOrHlt",
true);
389 genericTriggerEventPSet.add<std::vector<std::string> >(
"hltPaths", {});
390 genericTriggerEventPSet.add<
std::string>(
"hltDBKey",
"");
391 genericTriggerEventPSet.add<
bool>(
"errorReplyHlt",
false);
392 genericTriggerEventPSet.add<
unsigned int>(
"verbosityLevel", 1);
401 std::vector<double>
bins = {0., 20., 40., 60., 80., 90., 100., 110., 120., 130., 140., 150., 160.,
402 170., 180., 190., 200., 220., 240., 260., 280., 300., 350., 400., 450., 1000.};
403 histoPSet.add<std::vector<double> >(
"metBinning",
bins);
411 descriptions.
add(
"metMonitoring", desc);
void setMETitle(METME &me, const std::string &titleX, const std::string &titleY)
StringCutObjectSelector< reco::PFJet, true > jetSelection_
MonitorElement * book1D(TString const &name, TString const &title, int const nchX, double const lowX, double const highX)
T getParameter(std::string const &) const
edm::InputTag vtxInputTag_
std::unique_ptr< GenericTriggerEventFlag > den_genTriggerEventFlag_
MonitorElement * numerator
StringCutObjectSelector< reco::GsfElectron, true > eleSelection_
static MEbinning getHistoPSet(const edm::ParameterSet &pset)
bool getByToken(EDGetToken token, Handle< PROD > &result) const
void setCurrentFolder(std::string const &fullpath)
edm::InputTag muoInputTag_
edm::EDGetTokenT< reco::VertexCollection > vtxToken_
double pt() const final
transverse momentum
std::vector< Vertex > VertexCollection
collection of Vertex objects
Provides a code based selection for trigger and DCS information in order to have no failing filters i...
std::unique_ptr< GenericTriggerEventFlag > num_genTriggerEventFlag_
edm::InputTag eleInputTag_
static MEbinning getHistoLSPSet(const edm::ParameterSet &pset)
LuminosityBlockNumber_t luminosityBlock() const
METME metME_variableBinning_
const Point & position() const
position
std::vector< GsfElectron > GsfElectronCollection
collection of GsfElectron objects
static void fillHistoPSetDescription(edm::ParameterSetDescription &pset)
std::vector< Muon > MuonCollection
collection of Muon objects
static void fillHistoLSPSetDescription(edm::ParameterSetDescription &pset)
#define DEFINE_FWK_MODULE(type)
edm::EDGetTokenT< reco::GsfElectronCollection > eleToken_
MonitorElement * denominator
edm::EDGetTokenT< reco::PFJetCollection > jetToken_
MonitorElement * bookProfile(TString const &name, TString const &title, int nchX, double lowX, double highX, int nchY, double lowY, double highY, char const *option="s")
edm::EDGetTokenT< reco::PFMETCollection > metToken_
StringCutObjectSelector< reco::Muon, true > muoSelection_
edm::EDGetTokenT< reco::MuonCollection > muoToken_
ParameterDescriptionBase * add(U const &iLabel, T const &value)
void bookME(DQMStore::IBooker &, METME &me, const std::string &histname, const std::string &histtitle, int nbins, double xmin, double xmax)
static MEbinning phi_binning_
void analyze(edm::Event const &iEvent, edm::EventSetup const &iSetup) override
std::vector< double > met_variable_binning_
void add(std::string const &label, ParameterSetDescription const &psetDescription)
edm::InputTag metInputTag_
StringCutObjectSelector< reco::MET, true > metSelection_
std::vector< PFJet > PFJetCollection
collection of PFJet objects
MonitorElement * book2D(TString const &name, TString const &title, int nchX, double lowX, double highX, int nchY, double lowY, double highY)
edm::InputTag jetInputTag_
METMonitor(const edm::ParameterSet &)
std::vector< bool > warningPrinted4token_
void bookHistograms(DQMStore::IBooker &, edm::Run const &, edm::EventSetup const &) override
double phi() const final
momentum azimuthal angle
static void fillDescriptions(edm::ConfigurationDescriptions &descriptions)
virtual void setAxisTitle(const std::string &title, int axis=1)
set x-, y- or z-axis title (axis=1, 2, 3 respectively)