11 #include <TLorentzVector.h> 21 : triggerResultsInputTag_(iConfig.getParameter<
edm::
InputTag>(
"TriggerResults")),
23 iConfig.getUntrackedParameter<
std::
string>(
"edmPVName",
"offlinePrimaryVertices"))),
28 PtCutL1_(iConfig.getUntrackedParameter<double>(
"PtCutL1")),
29 PtCutL2_(iConfig.getUntrackedParameter<double>(
"PtCutL2")),
30 EtaCutL1_(iConfig.getUntrackedParameter<double>(
"EtaCutL1")),
31 EtaCutL2_(iConfig.getUntrackedParameter<double>(
"EtaCutL2")),
33 MassBin_(iConfig.getUntrackedParameter<
int>(
"MassBin")),
34 MassMin_(iConfig.getUntrackedParameter<double>(
"MassMin")),
35 MassMax_(iConfig.getUntrackedParameter<double>(
"MassMax")),
37 LumiBin_(iConfig.getUntrackedParameter<
int>(
"LumiBin")),
38 LumiMin_(iConfig.getUntrackedParameter<double>(
"LumiMin")),
39 LumiMax_(iConfig.getUntrackedParameter<double>(
"LumiMax")),
41 PVBin_(iConfig.getUntrackedParameter<
int>(
"PVBin")),
42 PVMin_(iConfig.getUntrackedParameter<double>(
"PVMin")),
43 PVMax_(iConfig.getUntrackedParameter<double>(
"PVMax")),
45 VtxNTracksFitCut_(iConfig.getUntrackedParameter<double>(
"VtxNTracksFitMin")),
46 VtxNdofCut_(iConfig.getUntrackedParameter<double>(
"VtxNdofMin")),
47 VtxAbsZCut_(iConfig.getUntrackedParameter<double>(
"VtxAbsZMax")),
48 VtxRhoCut_(iConfig.getUntrackedParameter<double>(
"VtxRhoMax")),
50 IDTypestr_(iConfig.getUntrackedParameter<
std::
string>(
"IDType")),
51 IsoTypestr_(iConfig.getUntrackedParameter<
std::
string>(
"IsoType")),
52 IsoCut_(iConfig.getUntrackedParameter<double>(
"IsoCut")) {
53 edm::LogInfo(
"ZCounting") <<
"Constructor ZCounting::ZCounting " << std::endl;
62 const std::vector<std::string> patterns_ = iConfig.
getParameter<std::vector<std::string>>(
"MuonTriggerNames");
95 edm::LogInfo(
"ZCounting") <<
"ZCounting::beginRun" << std::endl;
100 bool hltChanged_ =
true;
102 edm::LogVerbatim(
"ZCounting") <<
"ZCounting::dqmBeginRun [TriggerObjMatchValueMapsProducer::beginRun] " 103 "HLTConfigProvider initialized [processName() = \"" 108 edm::LogError(
"ZCounting") <<
"ZCounting::dqmBeginRun Initialization of HLTConfigProvider failed for Run=" 110 <<
"\") -> plugin will not produce outputs for this Run";
121 edm::LogInfo(
"ZCounting") <<
"ZCounting::bookHistograms" << std::endl;
127 "Both muon pass HLT in barrel-barrel",
135 "Both muon pass HLT passing in barrel-endcap",
143 "Both muon pass HLT passing in endcap-endcap",
151 "One muon pass HLT in barrel-barrel",
159 "One muon pass HLT passing in barrel-endcap",
167 "One muon pass HLT passing in endcap-endcap",
176 "Muon SIT failing barrel-barrel",
184 "Muon SIT failing barrel-endcap",
193 "Muon SIT failing endcap-endcap",
202 "Muon Glo failing barrel-barrel",
210 "Muon Glo failing barrel-endcap",
219 "Muon Glo failing endcap-endcap",
264 edm::LogInfo(
"ZCounting") <<
"ZCounting::analyze" << std::endl;
271 if (!hVertexProduct.
isValid()) {
272 edm::LogWarning(
"ZCounting") <<
"ZCounting::analyze - no valid primary vertex product found" << std::endl;
279 for (
auto const& itVtx : *hVertexProduct) {
321 TLorentzVector vTag(0., 0., 0., 0.);
322 TLorentzVector vProbe(0., 0., 0., 0.);
323 TLorentzVector vTrack(0., 0., 0., 0.);
326 for (
auto const& itMu1 : *hMuonProduct) {
327 const float pt1 = itMu1.muonBestTrack()->pt();
328 const float eta1 = itMu1.muonBestTrack()->eta();
329 const float phi1 = itMu1.muonBestTrack()->phi();
330 const float q1 = itMu1.muonBestTrack()->charge();
344 bool isTagCentral =
false;
349 for (
auto const& itMu2 : *hMuonProduct) {
350 if (&itMu2 == &itMu1)
353 const float pt2 = itMu2.muonBestTrack()->pt();
354 const float eta2 = itMu2.muonBestTrack()->eta();
355 const float phi2 = itMu2.muonBestTrack()->phi();
356 const float q2 = itMu2.muonBestTrack()->charge();
369 TLorentzVector vDilep = vTag + vProbe;
370 float dilepMass = vDilep.M();
374 bool isProbeCentral =
false;
376 isProbeCentral =
true;
385 if (isTagCentral && isProbeCentral) {
387 }
else if (!isTagCentral && !isProbeCentral) {
394 if (isTagCentral && isProbeCentral) {
396 }
else if (!isTagCentral && !isProbeCentral) {
402 }
else if (itMu2.isGlobalMuon()) {
404 if (isTagCentral && isProbeCentral) {
406 }
else if (!isTagCentral && !isProbeCentral) {
411 }
else if (itMu2.isStandAloneMuon()) {
413 if (isTagCentral && isProbeCentral) {
415 }
else if (!isTagCentral && !isProbeCentral) {
420 }
else if (itMu2.innerTrack()->hitPattern().trackerLayersWithMeasurement() >= 6 &&
421 itMu2.innerTrack()->hitPattern().numberOfValidPixelHits() >= 1) {
423 if (isTagCentral && isProbeCentral) {
425 }
else if (!isTagCentral && !isProbeCentral) {
434 for (
auto const& itTrk : *hTrackProduct) {
437 for (
auto const& itMu : *hMuonProduct) {
438 if (itMu.innerTrack().isNonnull() && itMu.innerTrack().get() == &itTrk) {
446 const float pt2 = itTrk.pt();
447 const float eta2 = itTrk.eta();
448 const float phi2 = itTrk.phi();
449 const float q2 = itTrk.charge();
461 TLorentzVector vDilep = vTag + vTrack;
462 float dilepMass = vDilep.M();
466 bool isTrackCentral =
false;
468 isTrackCentral =
true;
470 if (itTrk.hitPattern().trackerLayersWithMeasurement() >= 6 && itTrk.hitPattern().numberOfValidPixelHits() >= 1) {
471 if (isTagCentral && isTrackCentral) {
473 }
else if (!isTagCentral && !isTrackCentral) {
490 if (!
muon.isPFMuon() || !
muon.isGlobalMuon())
495 bool muIdAndHits = muID &&
muon.innerTrack()->hitPattern().trackerLayersWithMeasurement() > 5 &&
496 muon.innerTrack()->hitPattern().numberOfValidPixelHits() > 0;
526 return muon.pfIsolationR04().sumChargedHadronPt +
528 muon.pfIsolationR04().sumNeutralHadronEt +
muon.pfIsolationR04().sumPhotonEt -
529 0.5 *
muon.pfIsolationR04().sumPUPt) <
ZCounting(const edm::ParameterSet &ps)
Log< level::Info, true > LogVerbatim
MonitorElement * h_mass_SIT_fail_BE
T getParameter(std::string const &) const
bool isMuon(const Candidate &part)
bool passMuonIso(const reco::Muon &muon)
virtual void setCurrentFolder(std::string const &fullpath)
bool isMediumMuon(const reco::Muon &, bool run2016_hip_mitigation=false)
const double VtxNTracksFitCut_
const edm::InputTag triggerResultsInputTag_
MonitorElement * h_mass_1HLT_BE
std::vector< Track > TrackCollection
collection of Tracks
const std::string IDTypestr_
MonitorElement * h_mass_2HLT_BE
Log< level::Error, false > LogError
MonitorElement * h_mass_SIT_fail_BB
std::vector< Vertex > VertexCollection
std::vector< Muon > MuonCollection
collection of Muon objects
MonitorElement * h_mass_Glo_fail_BE
bool isLooseMuon(const reco::Muon &)
HLTConfigProvider hltConfigProvider_
edm::EDGetTokenT< reco::TrackCollection > fTrackName_token
bool isCustomTightMuon(const reco::Muon &muon)
bool passMuonID(const reco::Muon &muon, const reco::Vertex *vtx)
edm::EDGetTokenT< reco::MuonCollection > fMuonName_token
unsigned int size() const
number of trigger paths in trigger table
edm::EDGetTokenT< reco::VertexCollection > fPVName_token
#define DEFINE_FWK_MODULE(type)
void bookHistograms(DQMStore::IBooker &, edm::Run const &, edm::EventSetup const &) override
const std::string IsoTypestr_
void analyze(edm::Event const &e, edm::EventSetup const &eSetup) override
bool isGoodMuon(const reco::Muon &muon, SelectionType type, reco::Muon::ArbitrationType arbitrationType=reco::Muon::SegmentAndTrackArbitration)
main GoodMuon wrapper call
MonitorElement * h_mass_2HLT_EE
MonitorElement * h_mass_2HLT_BB
Log< level::Info, false > LogInfo
const std::string & processName() const
process name
bool init(const edm::Run &iRun, const edm::EventSetup &iSetup, const std::string &processName, bool &changed)
d'tor
MonitorElement * book2D(TString const &name, TString const &title, int nchX, double lowX, double highX, int nchY, double lowY, double highY, FUNC onbooking=NOOP())
MonitorElement * h_mass_Glo_fail_BB
const std::string & tableName() const
HLT ConfDB table name.
void dqmBeginRun(edm::Run const &, edm::EventSetup const &) override
MonitorElement * h_mass_1HLT_EE
Log< level::Warning, false > LogWarning
bool isTightMuon(const reco::Muon &, const reco::Vertex &)
MonitorElement * h_mass_SIT_fail_EE
MonitorElement * h_mass_1HLT_BB
MonitorElement * h_mass_Glo_fail_EE
virtual void setAxisTitle(const std::string &title, int axis=1)
set x-, y- or z-axis title (axis=1, 2, 3 respectively)