13 folderName_ ( iConfig.getParameter<
std::
string>(
"FolderName") )
14 , metInputTag_ ( iConfig.getParameter<
edm::InputTag> (
"met") )
15 , jetInputTag_ ( iConfig.getParameter<
edm::InputTag> (
"jets") )
16 , eleInputTag_ ( iConfig.getParameter<
edm::InputTag> (
"electrons") )
17 , muoInputTag_ ( iConfig.getParameter<
edm::InputTag> (
"muons") )
18 , vtxInputTag_ ( iConfig.getParameter<
edm::InputTag> (
"vertices") )
20 , jetToken_ ( mayConsume<
reco::
JetView> ( jetInputTag_ ) )
24 , ht_variable_binning_ ( iConfig.getParameter<
edm::
ParameterSet>(
"histoPSet").getParameter<
std::vector<double> >(
"htBinning") )
29 , metSelection_ ( iConfig.getParameter<
std::
string>(
"metSelection") )
30 , jetSelection_ ( iConfig.getParameter<
std::
string>(
"jetSelection") )
31 , eleSelection_ ( iConfig.getParameter<
std::
string>(
"eleSelection") )
32 , muoSelection_ ( iConfig.getParameter<
std::
string>(
"muoSelection") )
33 , jetSelection_HT_ ( iConfig.getParameter<
std::
string>(
"jetSelection_HT") )
34 , njets_ ( iConfig.getParameter<unsigned>(
"njets" ) )
35 , nelectrons_ ( iConfig.getParameter<unsigned>(
"nelectrons" ) )
36 , nmuons_ ( iConfig.getParameter<unsigned>(
"nmuons" ) )
37 , dEtaCut_ ( iConfig.getParameter<double>(
"dEtaCut") )
45 else if(quantity ==
"Mjj")
49 else if(quantity ==
"softdrop")
55 throw cms::Exception(
"quantity not defined") <<
"the quantity '" << quantity <<
"' is undefined. Please check your config!" << std::endl;
97 me.
numerator = ibooker.
book1D(histname+
"_numerator", histtitle+
" (numerator)", nbins, min, max);
98 me.
denominator = ibooker.
book1D(histname+
"_denominator", histtitle+
" (denominator)", nbins, min, max);
102 int nbins = binning.size()-1;
103 std::vector<float> fbinning(binning.begin(),binning.end());
104 float* arr = &fbinning[0];
105 me.
numerator = ibooker.
book1D(histname+
"_numerator", histtitle+
" (numerator)", nbins, arr);
106 me.
denominator = ibooker.
book1D(histname+
"_denominator", histtitle+
" (denominator)", nbins, arr);
110 me.
numerator = ibooker.
bookProfile(histname+
"_numerator", histtitle+
" (numerator)", nbinsX, xmin, xmax, ymin, ymax);
111 me.
denominator = ibooker.
bookProfile(histname+
"_denominator", histtitle+
" (denominator)", nbinsX, xmin, xmax, ymin, ymax);
115 me.
numerator = ibooker.
book2D(histname+
"_numerator", histtitle+
" (numerator)", nbinsX, xmin, xmax, nbinsY, ymin, ymax);
116 me.
denominator = ibooker.
book2D(histname+
"_denominator", histtitle+
" (denominator)", nbinsX, xmin, xmax, nbinsY, ymin, ymax);
120 int nbinsX = binningX.size()-1;
121 std::vector<float> fbinningX(binningX.begin(),binningX.end());
122 float* arrX = &fbinningX[0];
123 int nbinsY = binningY.size()-1;
124 std::vector<float> fbinningY(binningY.begin(),binningY.end());
125 float* arrY = &fbinningY[0];
127 me.
numerator = ibooker.
book2D(histname+
"_numerator", histtitle+
" (numerator)", nbinsX, arrX, nbinsY, arrY);
128 me.
denominator = ibooker.
book2D(histname+
"_denominator", histtitle+
" (denominator)", nbinsX, arrX, nbinsY, arrY);
144 histname =
"ht_variable"; histtitle =
"HT";
148 histname =
"htVsLS"; histtitle =
"HT vs LS";
152 histname =
"deltaphi_metjet1"; histtitle =
"DPHI_METJ1";
156 histname =
"deltaphi_jet1jet2"; histtitle =
"DPHI_J1J2";
165 histname =
"mjj_variable"; histtitle =
"Mjj";
174 histname =
"softdrop_variable"; histtitle =
"softdropmass";
216 std::vector<reco::Jet>
jets;
218 for (
auto const & j : *jetHandle ) {
224 if ( jets.size() <
njets_ )
return;
226 float deltaPhi_met_j1 = 10.0;
227 float deltaPhi_j1_j2 = 10.0;
229 if (!jets.empty()) deltaPhi_met_j1 = fabs(
deltaPhi( pfmet.
phi(), jets[0].phi() ));
230 if (jets.size() >= 2) deltaPhi_j1_j2 = fabs(
deltaPhi( jets[0].
phi(), jets[1].
phi() ));
232 std::vector<reco::GsfElectron>
electrons;
237 for (
auto const &
e : *eleHandle ) {
257 for (
auto const &
v : *vtxHandle) {
258 bool isFake =
v.isFake() ;
276 std::vector<reco::Muon>
muons;
280 if ( muoHandle->size() <
nmuons_ )
return;
281 for (
auto const &
m : *muoHandle ) {
282 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);
284 if ( muons.size() <
nmuons_ )
return;
302 for (
auto const & j : *jetHandle )
330 if (jets.size() < 2)
return;
334 float mjj = (jets[0].p4() + jets[1].p4()).M();
347 if (jets.size() < 2)
return;
352 float softdrop = jets[0].p4().M();
367 pset.
add<
unsigned int> (
"nbins");
368 pset.
add<
double>(
"xmin" );
369 pset.
add<
double>(
"xmax" );
374 pset.
add<
unsigned int> (
"nbins", 2500);
375 pset.
add<
double> (
"xmin", 0.);
376 pset.
add<
double> (
"xmax", 2500.);
396 desc.
add<
unsigned>(
"njets", 0);
397 desc.
add<
unsigned>(
"nelectrons", 0);
398 desc.
add<
unsigned>(
"nmuons", 0);
399 desc.
add<
double>(
"dEtaCut", 1.3);
402 genericTriggerEventPSet.
add<
bool>(
"andOr");
404 genericTriggerEventPSet.
add<std::vector<int> >(
"dcsPartitions",{});
405 genericTriggerEventPSet.
add<
bool>(
"andOrDcs",
false);
406 genericTriggerEventPSet.
add<
bool>(
"errorReplyDcs",
true);
408 genericTriggerEventPSet.
add<
bool>(
"andOrHlt",
true);
410 genericTriggerEventPSet.
add<std::vector<std::string> >(
"hltPaths",{});
412 genericTriggerEventPSet.
add<
bool>(
"errorReplyHlt",
false);
413 genericTriggerEventPSet.
add<
unsigned int>(
"verbosityLevel",1);
422 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.};
423 histoPSet.add<std::vector<double> >(
"htBinning",
bins);
431 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)
edm::InputTag muoInputTag_
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
edm::InputTag jetInputTag_
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_
std::vector< bool > warningPrinted4token_
edm::InputTag eleInputTag_
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_
edm::InputTag vtxInputTag_
edm::InputTag metInputTag_
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_