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++) {
244 for (
unsigned int n = 9;
n < 100;
n++) {
245 string lowestTrig =
"HLT_Mu";
246 string lowestTrigv0 =
"copy";
247 std::stringstream
out;
250 lowestTrig.append(
s);
251 lowestTrigv0 = lowestTrig;
252 for (
unsigned int v = 1;
v < 10;
v++) {
253 lowestTrig.append(
"_v");
254 std::stringstream oout;
257 lowestTrig.append(
ss);
258 if (
trig == lowestTrig)
259 lowestMuonUnprescaledTrig =
trig;
260 if (
trig == lowestTrig)
261 lowestMuonUnprescaledTrigFound =
true;
262 if (
trig == lowestTrig)
265 if (lowestMuonUnprescaledTrigFound)
268 lowestTrig = lowestTrigv0;
269 if (
trig == lowestTrig)
270 lowestMuonUnprescaledTrig =
trig;
274 if (
trig == lowestTrig)
275 lowestMuonUnprescaledTrigFound =
true;
276 if (
trig == lowestTrig)
279 if (lowestMuonUnprescaledTrigFound)
286 unsigned int triggerIndex;
292 if (triggerIndex < triggerResults->
size())
302 size_t moduleLabsSizeMinus2 = moduleLabs.size() - 2;
306 L3FilterName_ = moduleLabs[moduleLabsSizeMinus2];
310 LogTrace(
"") <<
">>> Trigger bit: " << trigger_fired <<
" (" << hltPath_ <<
")";
318 std::vector<reco::Particle> HLTMuMatched;
319 for (
size_t ia = 0; ia < handleTriggerEvent->
sizeFilters(); ++ia) {
323 size_t p = fullname.find_first_of(
':');
324 if (
p != std::string::npos) {
325 name = fullname.substr(0,
p);
331 for (trigger::Keys::const_iterator ki =
k.begin(); ki !=
k.end(); ++ki) {
334 if (
name == L3FilterName_) {
338 HLTMuMatched.push_back(toc[*ki].particle());
360 std::vector<reco::Muon> highPtGlbMuons;
361 std::vector<reco::Muon> highPtStaMuons;
363 for (
size_t i = 0;
i <
muons->size();
i++) {
366 double eta =
mu.eta();
368 if (
mu.isGlobalMuon()) {
370 double dxy =
mu.innerTrack()->dxy(beamSpotHandle->
position());
373 highPtGlbMuons.push_back(
mu);
375 if (
mu.isGlobalMuon())
378 if (
mu.isStandAloneMuon())
379 highPtStaMuons.push_back(
mu);
383 size_t nHighPtGlbMu = highPtGlbMuons.size();
384 size_t nHighPtStaMu = highPtStaMuons.size();
385 if (hlt_sel && (nHighPtGlbMu > 0)) {
389 (nHighPtGlbMu > 10) ? nHighPtGlbMu = 10 : 1;
391 if (nHighPtGlbMu > 1) {
392 for (
unsigned int i = 0;
i < nHighPtGlbMu;
i++) {
396 for (
unsigned int j =
i + 1;
j < nHighPtGlbMu; ++
j) {
403 double mass = pair.M();
411 if (singleTrigFlag1 && singleTrigFlag2)
413 if ((singleTrigFlag1 && !singleTrigFlag2) || (!singleTrigFlag1 && singleTrigFlag2))
422 highPtGlbMuons.erase(highPtGlbMuons.begin() +
i);
423 highPtGlbMuons.erase(highPtGlbMuons.begin() +
j);
425 nHighPtGlbMu = highPtGlbMuons.size();
427 if (isMu1Iso && isMu2Iso) {
493 for (
unsigned int i = 0;
i < nHighPtGlbMu;
i++) {
513 if (!singleTrigFlag1)
518 double met_px =
met.px();
519 double met_py =
met.py();
522 for (
unsigned int i = 0;
i < nHighPtGlbMu;
i++) {
524 met_px -= muon1.
px();
525 met_py -= muon1.
py();
528 double met_et =
met.pt();
529 LogTrace(
"") <<
">>> MET, MET_px, MET_py: " << met_et <<
", " << met_px <<
", " << met_py <<
" [GeV]";
530 double w_et = met_et + muon1.
pt();
531 double w_px = met_px + muon1.
px();
532 double w_py = met_py + muon1.
py();
533 double massT = w_et * w_et - w_px * w_px - w_py * w_py;
534 massT = (massT > 0) ?
sqrt(massT) : 0;
537 double acop =
M_PI - fabs(deltaphi.value());
543 if (massT < mtMin_ || massT >
mtMax_)
556 for (
unsigned int i = 0;
i < nHighPtGlbMu; ++
i) {
562 if (!singleTrigFlag1)
566 iso1 =
muIso(glbMuon);
572 (nHighPtStaMu > 10) ? nHighPtStaMu = 10 : 1;
573 for (
unsigned int j = 0;
j < nHighPtStaMu; ++
j) {
580 double mass = pair.M();
581 iso2 =
muIso(staMuon);
583 LogTrace(
"") <<
"\t... isolation value" << iso1 <<
", isolated? " << isMu1Iso;
584 LogTrace(
"") <<
"\t... isolation value" << iso2 <<
", isolated? " << isMu2Iso;
617 size_t nTrk =
tracks->size();
618 (nTrk > 5000) ? nTrk = 5000 : 1;
619 for (
unsigned int j = 0;
j < nTrk;
j++) {
623 double pt2 = tk.
pt();
631 double mass = pair.M();
662 LogTrace(
"") <<
">>>> Event ACCEPTED";
664 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_
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...