33 using namespace isodeposit;
46 metIncludesMuons_(
cfg.getUntrackedParameter<
bool>(
"METIncludesMuons")),
53 ptMuCut_(
cfg.getUntrackedParameter<double>(
"ptMuCut")),
54 etaMuCut_(
cfg.getUntrackedParameter<double>(
"etaMuCut")),
55 isRelativeIso_(
cfg.getUntrackedParameter<
bool>(
"IsRelativeIso")),
56 isCombinedIso_(
cfg.getUntrackedParameter<
bool>(
"IsCombinedIso")),
57 isoCut03_(
cfg.getUntrackedParameter<double>(
"IsoCut03")),
59 ptThreshold_(
cfg.getUntrackedParameter<double>(
"ptThreshold")),
61 maxDPtRel_(
cfg.getUntrackedParameter<double>(
"maxDPtRel")),
62 maxDeltaR_(
cfg.getUntrackedParameter<double>(
"maxDeltaR")),
63 mtMin_(
cfg.getUntrackedParameter<double>(
"mtMin")),
64 mtMax_(
cfg.getUntrackedParameter<double>(
"mtMax")),
65 acopCut_(
cfg.getUntrackedParameter<double>(
"acopCut")),
66 dxyCut_(
cfg.getUntrackedParameter<double>(
"DxyCut")) {
87 bool isConfigChanged =
false;
98 mass2HLT_ = ibooker.
book1D(
"Z_2HLT_MASS",
"Z mass [GeV/c^{2}]", 200, 0., 200.);
99 mass1HLT_ = ibooker.
book1D(
"Z_1HLT_MASS",
"Z mass [GeV/c^{2}]", 200, 0., 200.);
100 massNotIso_ = ibooker.
book1D(
"Z_NOTISO_MASS",
"Z mass [GeV/c^{2}]", 200, 0., 200.);
101 massGlbSta_ = ibooker.
book1D(
"Z_GLBSTA_MASS",
"Z mass [GeV/c^{2}]", 200, 0., 200.);
102 massGlbTrk_ = ibooker.
book1D(
"Z_GLBTRK_MASS",
"Z mass [GeV/c^{2}]", 200, 0., 200.);
105 highMass2HLT_ = ibooker.
book1D(
"Z_2HLT_HIGHMASS",
"Z high mass [GeV/c^{2}]", 2000, 0., 2000.);
106 highMass1HLT_ = ibooker.
book1D(
"Z_1HLT_HIGHMASS",
"Z high mass [GeV/c^{2}]", 2000, 0., 2000.);
111 ibooker.
book1D(
"Z_ISBOTHGLBTRKTHANW_HIGHMASS",
"Z high mass [GeV/c^{2}]", 2000, 0., 2000.);
113 TMass_ = ibooker.
book1D(
"TMASS",
"Transverse mass [GeV]", 300, 0., 300.);
117 double isovar =
mu.isolationR03().sumPt;
119 isovar +=
mu.isolationR03().emEt;
120 isovar +=
mu.isolationR03().hadEt;
131 for (
size_t i = 0;
i <
tracks->size(); ++
i) {
133 double elemPt = elem.
pt();
136 double elemVx = elem.
vx();
137 double elemVy = elem.
vy();
138 double elemD0 =
sqrt(elemVx * elemVx + elemVy * elemVy);
141 double dz = fabs(elem.
vz() - tk.
vz());
149 if ((
dR < 0.01) || (
dR > 0.3))
158 if ((
dR < 0.1) || (
dR > 0.3))
160 ptSum += it->emEnergy();
161 ptSum += it->hadEnergy();
170 const std::vector<reco::Particle>& HLTMu,
173 size_t dim = HLTMu.size();
177 for (
size_t k = 0;
k < dim;
k++) {
178 if ((
deltaR(HLTMu[
k],
mu) < DR) && (fabs(HLTMu[
k].
pt() -
mu.pt()) / HLTMu[
k].
pt() < DPtRel)) {
187 bool hlt_sel =
false;
190 bool isMu1Iso =
false;
191 bool isMu2Iso =
false;
192 bool singleTrigFlag1 =
false;
193 bool singleTrigFlag2 =
false;
201 bool trigger_fired =
false;
225 string lowestMuonUnprescaledTrig =
"";
226 bool lowestMuonUnprescaledTrigFound =
false;
230 size_t f =
trig.find(
"HLT_Mu");
231 if ((
f != std::string::npos)) {
235 bool prescaled =
false;
237 for (
unsigned int ps = 0; ps < prescaleSize; ps++) {
239 if (prescaleValue != 1)
247 for (
unsigned int n = 9;
n < 100;
n++) {
248 string lowestTrig =
"HLT_Mu";
249 string lowestTrigv0 =
"copy";
250 std::stringstream
out;
253 lowestTrig.append(
s);
254 lowestTrigv0 = lowestTrig;
255 for (
unsigned int v = 1;
v < 10;
v++) {
256 lowestTrig.append(
"_v");
257 std::stringstream oout;
260 lowestTrig.append(
ss);
261 if (
trig == lowestTrig)
262 lowestMuonUnprescaledTrig =
trig;
263 if (
trig == lowestTrig)
264 lowestMuonUnprescaledTrigFound =
true;
265 if (
trig == lowestTrig)
268 if (lowestMuonUnprescaledTrigFound)
271 lowestTrig = lowestTrigv0;
272 if (
trig == lowestTrig)
273 lowestMuonUnprescaledTrig =
trig;
277 if (
trig == lowestTrig)
278 lowestMuonUnprescaledTrigFound =
true;
279 if (
trig == lowestTrig)
282 if (lowestMuonUnprescaledTrigFound)
289 unsigned int triggerIndex;
295 if (triggerIndex < triggerResults->
size())
305 size_t moduleLabsSizeMinus2 = moduleLabs.size() - 2;
309 L3FilterName_ = moduleLabs[moduleLabsSizeMinus2];
313 LogTrace(
"") <<
">>> Trigger bit: " << trigger_fired <<
" (" << hltPath_ <<
")";
322 std::vector<reco::Particle> HLTMuMatched;
323 for (
size_t ia = 0; ia < handleTriggerEvent->
sizeFilters(); ++ia) {
327 size_t p = fullname.find_first_of(
':');
328 if (
p != std::string::npos) {
329 name = fullname.substr(0,
p);
335 for (trigger::Keys::const_iterator ki =
k.begin(); ki !=
k.end(); ++ki) {
338 if (
name == L3FilterName_) {
342 HLTMuMatched.push_back(toc[*ki].particle());
365 std::vector<reco::Muon> highPtGlbMuons;
366 std::vector<reco::Muon> highPtStaMuons;
368 for (
size_t i = 0;
i <
muons->size();
i++) {
371 double eta =
mu.eta();
373 if (
mu.isGlobalMuon()) {
375 double dxy =
mu.innerTrack()->dxy(beamSpotHandle->
position());
378 highPtGlbMuons.push_back(
mu);
380 if (
mu.isGlobalMuon())
383 if (
mu.isStandAloneMuon())
384 highPtStaMuons.push_back(
mu);
388 size_t nHighPtGlbMu = highPtGlbMuons.size();
389 size_t nHighPtStaMu = highPtStaMuons.size();
390 if (hlt_sel && (nHighPtGlbMu > 0)) {
394 (nHighPtGlbMu > 10) ? nHighPtGlbMu = 10 : 1;
396 if (nHighPtGlbMu > 1) {
397 for (
unsigned int i = 0;
i < nHighPtGlbMu;
i++) {
401 for (
unsigned int j =
i + 1;
j < nHighPtGlbMu; ++
j) {
408 double mass = pair.M();
416 if (singleTrigFlag1 && singleTrigFlag2)
418 if ((singleTrigFlag1 && !singleTrigFlag2) || (!singleTrigFlag1 && singleTrigFlag2))
427 highPtGlbMuons.erase(highPtGlbMuons.begin() +
i);
428 highPtGlbMuons.erase(highPtGlbMuons.begin() +
j);
430 nHighPtGlbMu = highPtGlbMuons.size();
432 if (isMu1Iso && isMu2Iso) {
498 for (
unsigned int i = 0;
i < nHighPtGlbMu;
i++) {
518 if (!singleTrigFlag1)
523 double met_px =
met.px();
524 double met_py =
met.py();
527 for (
unsigned int i = 0;
i < nHighPtGlbMu;
i++) {
529 met_px -= muon1.
px();
530 met_py -= muon1.
py();
533 double met_et =
met.pt();
534 LogTrace(
"") <<
">>> MET, MET_px, MET_py: " << met_et <<
", " << met_px <<
", " << met_py <<
" [GeV]";
535 double w_et = met_et + muon1.
pt();
536 double w_px = met_px + muon1.
px();
537 double w_py = met_py + muon1.
py();
538 double massT = w_et * w_et - w_px * w_px - w_py * w_py;
539 massT = (massT > 0) ?
sqrt(massT) : 0;
542 double acop =
M_PI - fabs(deltaphi.value());
548 if (massT < mtMin_ || massT >
mtMax_)
561 for (
unsigned int i = 0;
i < nHighPtGlbMu; ++
i) {
567 if (!singleTrigFlag1)
571 iso1 =
muIso(glbMuon);
577 (nHighPtStaMu > 10) ? nHighPtStaMu = 10 : 1;
578 for (
unsigned int j = 0;
j < nHighPtStaMu; ++
j) {
585 double mass = pair.M();
586 iso2 =
muIso(staMuon);
588 LogTrace(
"") <<
"\t... isolation value" << iso1 <<
", isolated? " << isMu1Iso;
589 LogTrace(
"") <<
"\t... isolation value" << iso2 <<
", isolated? " << isMu2Iso;
622 size_t nTrk =
tracks->size();
623 (nTrk > 5000) ? nTrk = 5000 : 1;
624 for (
unsigned int j = 0;
j < nTrk;
j++) {
628 double pt2 = tk.
pt();
636 double mass = pair.M();
667 LogTrace(
"") <<
">>>> Event ACCEPTED";
669 LogTrace(
"") <<
">>>> Event REJECTED";
MonitorElement * highMass1HLT_
const Keys & filterKeys(trigger::size_type index) const
edm::EDGetTokenT< edm::View< reco::Muon > > muonToken_
unsigned int prescaleSize() const
double pt() const final
transverse momentum
const Point & position() const
position
virtual void setCurrentFolder(std::string const &fullpath)
double vx() const
x coordinate of the reference point on track
double outerEta() const
pseudorapidity of the momentum vector at the outermost hit position
unsigned int nEvWithHighPtMu
double px() const
x coordinate of momentum vector
double p() const
momentum vector magnitude
trigger::size_type sizeFilters() const
std::vector< Track > TrackCollection
collection of Tracks
std::vector< CaloTower >::const_iterator const_iterator
MonitorElement * highMassIsBothGlbTrkThanW_
double py() const
y coordinate of momentum vector
MonitorElement * highMassGlbTrk_
edm::EDGetTokenT< edm::View< reco::MET > > metToken_
MonitorElement * massNotIso_
MonitorElement * highMassGlbSta_
EwkMuLumiMonitorDQM(const edm::ParameterSet &)
edm::EDGetTokenT< edm::TriggerResults > trigToken_
const edm::InputTag filterTag(trigger::size_type index) const
const LorentzVector & p4() const final
four-momentum Lorentz vector
T prescaleValue(unsigned int set, const std::string &trigger) const
HLT prescale value in specific prescale set for a specific trigger path.
MonitorElement * mass1HLT_
XYZTLorentzVectorD XYZTLorentzVector
Lorentz vector with cylindrical internal representation using pseudorapidity.
double pt() const
track transverse momentum
void analyze(const edm::Event &, const edm::EventSetup &) override
double px() const final
x coordinate of momentum vector
int charge() const
track electric charge
MonitorElement * massIsBothGlbTrkThanW_
MonitorElement * massGlbTrk_
bool IsMuMatchedToHLTMu(const reco::Muon &, const std::vector< reco::Particle > &, double, double)
double vz() const
z coordinate of the reference point on track
double tkIso(const reco::Track &, edm::Handle< reco::TrackCollection >, edm::Handle< CaloTowerCollection >)
const std::vector< std::string > & moduleLabels(unsigned int trigger) const
label(s) of module(s) on a trigger path
edm::EDGetTokenT< CaloTowerCollection > caloTowerToken_
MonitorElement * highMassNotIso_
const TriggerObjectCollection & getObjects() const
double phi() const
azimuthal angle of momentum vector
unsigned int triggerIndex(const std::string &triggerName) const
slot position of trigger path in trigger table (0 to size-1)
edm::EDGetTokenT< reco::TrackCollection > trackToken_
void bookHistograms(DQMStore::IBooker &, edm::Run const &, edm::EventSetup const &) override
static std::string const triggerResults
double py() const final
y coordinate of momentum vector
edm::EDGetTokenT< reco::BeamSpot > beamSpotToken_
double outerPhi() const
azimuthal angle of the momentum vector at the outermost hit position
std::vector< TriggerObject > TriggerObjectCollection
collection of trigger physics objects (e.g., all isolated muons)
double eta() const
pseudorapidity of momentum vector
MonitorElement * massGlbSta_
auto const & tracks
cannot be loose
double muIso(const reco::Muon &)
std::vector< size_type > Keys
bool init(const edm::Run &iRun, const edm::EventSetup &iSetup, const std::string &processName, bool &changed)
d'tor
double pz() const
z coordinate of momentum vector
void dqmBeginRun(const edm::Run &, const edm::EventSetup &) override
const std::vector< std::string > & triggerNames() const
names of trigger paths
HLTConfigProvider hltConfigProvider_
MonitorElement * mass2HLT_
double vy() const
y coordinate of the reference point on track
edm::EDGetTokenT< trigger::TriggerEvent > trigEvToken_
MonitorElement * highMass2HLT_
MonitorElement * book1D(TString const &name, TString const &title, int const nchX, double const lowX, double const highX, FUNC onbooking=NOOP())
double phi() const final
momentum azimuthal angle
int charge() const final
electric charge
double dxy() const
dxy parameter. (This is the transverse impact parameter w.r.t. to (0,0,0) ONLY if refPoint is close t...