12 folderName_ ( iConfig.getParameter<
std::
string>(
"FolderName") )
14 , jetToken_ ( mayConsume<
reco::
JetView> (iConfig.getParameter<
edm::InputTag>(
"jets") ) )
18 , ht_variable_binning_ ( iConfig.getParameter<
edm::
ParameterSet>(
"histoPSet").getParameter<
std::vector<double> >(
"htBinning") )
23 , metSelection_ ( iConfig.getParameter<
std::
string>(
"metSelection") )
24 , jetSelection_ ( iConfig.getParameter<
std::
string>(
"jetSelection") )
25 , eleSelection_ ( iConfig.getParameter<
std::
string>(
"eleSelection") )
26 , muoSelection_ ( iConfig.getParameter<
std::
string>(
"muoSelection") )
27 , jetSelection_HT_ ( iConfig.getParameter<
std::
string>(
"jetSelection_HT") )
28 , njets_ ( iConfig.getParameter<unsigned>(
"njets" ) )
29 , nelectrons_ ( iConfig.getParameter<unsigned>(
"nelectrons" ) )
30 , nmuons_ ( iConfig.getParameter<unsigned>(
"nmuons" ) )
31 , dEtaCut_ ( iConfig.getParameter<double>(
"dEtaCut") )
38 else if(quantity ==
"Mjj")
42 else if(quantity ==
"softdrop")
48 throw cms::Exception(
"quantity not defined") <<
"the quantity '" << quantity <<
"' is undefined. Please check your config!" << std::endl;
83 me.
numerator = ibooker.
book1D(histname+
"_numerator", histtitle+
" (numerator)", nbins, min, max);
84 me.
denominator = ibooker.
book1D(histname+
"_denominator", histtitle+
" (denominator)", nbins, min, max);
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);
96 me.
numerator = ibooker.
bookProfile(histname+
"_numerator", histtitle+
" (numerator)", nbinsX, xmin, xmax, ymin, ymax);
97 me.
denominator = ibooker.
bookProfile(histname+
"_denominator", histtitle+
" (denominator)", nbinsX, xmin, xmax, ymin, ymax);
101 me.
numerator = ibooker.
book2D(histname+
"_numerator", histtitle+
" (numerator)", nbinsX, xmin, xmax, nbinsY, ymin, ymax);
102 me.
denominator = ibooker.
book2D(histname+
"_denominator", histtitle+
" (denominator)", nbinsX, xmin, xmax, nbinsY, ymin, ymax);
106 int nbinsX = binningX.size()-1;
107 std::vector<float> fbinningX(binningX.begin(),binningX.end());
108 float* arrX = &fbinningX[0];
109 int nbinsY = binningY.size()-1;
110 std::vector<float> fbinningY(binningY.begin(),binningY.end());
111 float* arrY = &fbinningY[0];
113 me.
numerator = ibooker.
book2D(histname+
"_numerator", histtitle+
" (numerator)", nbinsX, arrX, nbinsY, arrY);
114 me.
denominator = ibooker.
book2D(histname+
"_denominator", histtitle+
" (denominator)", nbinsX, arrX, nbinsY, arrY);
130 histname =
"ht_variable"; histtitle =
"HT";
134 histname =
"htVsLS"; histtitle =
"HT vs LS";
138 histname =
"deltaphi_metjet1"; histtitle =
"DPHI_METJ1";
142 histname =
"deltaphi_jet1jet2"; histtitle =
"DPHI_J1J2";
151 histname =
"mjj_variable"; histtitle =
"Mjj";
160 histname =
"softdrop_variable"; histtitle =
"softdropmass";
188 std::vector<reco::Jet>
jets;
190 for (
auto const & j : *jetHandle ) {
196 if ( jets.size() <
njets_ )
return;
198 float deltaPhi_met_j1 = 10.0;
199 float deltaPhi_j1_j2 = 10.0;
201 if (!jets.empty()) deltaPhi_met_j1 = fabs(
deltaPhi( pfmet.
phi(), jets[0].phi() ));
202 if (jets.size() >= 2) deltaPhi_j1_j2 = fabs(
deltaPhi( jets[0].
phi(), jets[1].
phi() ));
206 std::vector<reco::GsfElectron>
electrons;
208 for (
auto const &
e : *eleHandle ) {
217 for (
auto const &
v : *vtxHandle) {
218 bool isFake =
v.isFake() ;
228 if ( muoHandle->size() <
nmuons_ )
return;
229 std::vector<reco::Muon>
muons;
230 for (
auto const &
m : *muoHandle ) {
231 if (
muoSelection_(
m ) &&
m.isGlobalMuon() &&
m.isPFMuon() &&
m.globalTrack()->normalizedChi2() < 10. &&
m.globalTrack()->hitPattern().numberOfValidMuonHits() > 0 &&
m.numberOfMatchedStations() > 1 && fabs(
m.muonBestTrack()->dxy(vtx.
position())) < 0.2 && fabs(
m.muonBestTrack()->dz(vtx.
position())) < 0.5 &&
m.innerTrack()->hitPattern().numberOfValidPixelHits() > 0 &&
m.innerTrack()->hitPattern().trackerLayersWithMeasurement() > 5 ) muons.push_back(
m);
233 if ( muons.size() <
nmuons_ )
return;
241 for (
auto const & j : *jetHandle )
269 if (jets.size() < 2)
return;
273 float mjj = (jets[0].p4() + jets[1].p4()).M();
286 if (jets.size() < 2)
return;
291 float softdrop = jets[0].p4().M();
306 pset.
add<
unsigned int> (
"nbins");
307 pset.
add<
double>(
"xmin" );
308 pset.
add<
double>(
"xmax" );
313 pset.
add<
unsigned int> (
"nbins", 2500);
314 pset.
add<
double> (
"xmin", 0.);
315 pset.
add<
double> (
"xmax", 2500.);
335 desc.
add<
unsigned>(
"njets", 0);
336 desc.
add<
unsigned>(
"nelectrons", 0);
337 desc.
add<
unsigned>(
"nmuons", 0);
338 desc.
add<
double>(
"dEtaCut", 1.3);
341 genericTriggerEventPSet.
add<
bool>(
"andOr");
343 genericTriggerEventPSet.
add<std::vector<int> >(
"dcsPartitions",{});
344 genericTriggerEventPSet.
add<
bool>(
"andOrDcs",
false);
345 genericTriggerEventPSet.
add<
bool>(
"errorReplyDcs",
true);
347 genericTriggerEventPSet.
add<
bool>(
"andOrHlt",
true);
349 genericTriggerEventPSet.
add<std::vector<std::string> >(
"hltPaths",{});
351 genericTriggerEventPSet.
add<
bool>(
"errorReplyHlt",
false);
352 genericTriggerEventPSet.
add<
unsigned int>(
"verbosityLevel",1);
361 std::vector<double>
bins = {0.,20.,40.,60.,80.,90.,100.,110.,120.,130.,140.,150.,160.,170.,180.,190.,200.,220.,240.,260.,280.,300.,350.,400.,450.,500.,550.,600.,650.,700.,750.,800.,850.,900.,950.,1000.,1050.,1100.,1200.,1300.,1400.,1500.,2000.,2500.};
362 histoPSet.add<std::vector<double> >(
"htBinning",
bins);
370 descriptions.
add(
"htMonitoring", desc);
T getParameter(std::string const &) const
edm::EDGetTokenT< reco::MuonCollection > muoToken_
edm::EDGetTokenT< reco::JetView > jetToken_
MonitorElement * denominator
void setHTitle(HTME &me, const std::string &titleX, const std::string &titleY)
void bookME(DQMStore::IBooker &, HTME &me, const std::string &histname, const std::string &histtitle, int nbins, double xmin, double xmax)
MonitorElement * bookProfile(Args &&...args)
bool getByToken(EDGetToken token, Handle< PROD > &result) const
HTME qME_variableBinning_
#define DEFINE_FWK_MODULE(type)
StringCutObjectSelector< reco::Muon, true > muoSelection_
std::vector< double > ht_variable_binning_
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...
edm::EDGetTokenT< reco::VertexCollection > vtxToken_
static MEHTbinning getHistoPSet(const edm::ParameterSet &pset)
edm::View< Jet > JetView
edm references
LuminosityBlockNumber_t luminosityBlock() const
const Point & position() const
position
std::vector< GsfElectron > GsfElectronCollection
collection of GsfElectron objects
std::unique_ptr< GenericTriggerEventFlag > den_genTriggerEventFlag_
std::vector< Muon > MuonCollection
collection of Muon objects
StringCutObjectSelector< reco::MET, true > metSelection_
void Fill(HcalDetId &id, double val, std::vector< TH2F > &depth)
static void fillHistoLSPSetDescription(edm::ParameterSetDescription &pset)
MonitorElement * numerator
MonitorElement * book1D(Args &&...args)
HTMonitor(const edm::ParameterSet &)
static void fillHistoPSetDescription(edm::ParameterSetDescription &pset)
ParameterDescriptionBase * add(U const &iLabel, T const &value)
edm::EDGetTokenT< reco::GsfElectronCollection > eleToken_
void setCurrentFolder(const std::string &fullpath)
StringCutObjectSelector< reco::Jet, true > jetSelection_HT_
MonitorElement * book2D(Args &&...args)
StringCutObjectSelector< reco::GsfElectron, true > eleSelection_
StringCutObjectSelector< reco::Jet, true > jetSelection_
void add(std::string const &label, ParameterSetDescription const &psetDescription)
void analyze(edm::Event const &iEvent, edm::EventSetup const &iSetup) override
static void fillDescriptions(edm::ConfigurationDescriptions &descriptions)
static MEHTbinning getHistoLSPSet(const edm::ParameterSet &pset)
edm::EDGetTokenT< reco::PFMETCollection > metToken_
double phi() const final
momentum azimuthal angle
void setAxisTitle(const std::string &title, int axis=1)
set x-, y- or z-axis title (axis=1, 2, 3 respectively)
void bookHistograms(DQMStore::IBooker &, edm::Run const &, edm::EventSetup const &) override
static MEHTbinning phi_binning_
std::unique_ptr< GenericTriggerEventFlag > num_genTriggerEventFlag_