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.);
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)) {
186 LogVerbatim(
"") <<
"\n>>>>>> Z/W SELECTION SUMMARY BEGIN >>>>>>>>>>>>>>>";
187 LogVerbatim(
"") <<
"Total numer of events analyzed: " <<
nall <<
" [events]";
188 LogVerbatim(
"") <<
"Total numer of events selected: " <<
nsel <<
" [events]";
191 LogVerbatim(
"") <<
"Passing 2 HLT match criteria: " <<
n2hlt <<
" [events] ";
192 LogVerbatim(
"") <<
"Passing 1 HLT match criteria: " <<
n1hlt <<
" [events] ";
196 LogVerbatim(
"") <<
">>>>>> Z/W SELECTION SUMMARY END >>>>>>>>>>>>>>>\n";
201 bool hlt_sel =
false;
204 bool isMu1Iso =
false;
205 bool isMu2Iso =
false;
206 bool singleTrigFlag1 =
false;
207 bool singleTrigFlag2 =
false;
215 bool trigger_fired =
false;
239 string lowestMuonUnprescaledTrig =
"";
240 bool lowestMuonUnprescaledTrigFound =
false;
242 for (
size_t ts = 0; ts < triggerNames.size(); ts++) {
243 string trig = triggerNames[ts];
244 size_t f = trig.find(
"HLT_Mu");
245 if ((f != std::string::npos)) {
249 bool prescaled =
false;
251 for (
unsigned int ps = 0; ps < prescaleSize; ps++) {
253 if (prescaleValue != 1)
261 for (
unsigned int n = 9;
n < 100;
n++) {
262 string lowestTrig =
"HLT_Mu";
263 string lowestTrigv0 =
"copy";
264 std::stringstream
out;
267 lowestTrig.append(s);
268 lowestTrigv0 = lowestTrig;
269 for (
unsigned int v = 1;
v < 10;
v++) {
270 lowestTrig.append(
"_v");
271 std::stringstream oout;
274 lowestTrig.append(ss);
275 if (trig == lowestTrig)
276 lowestMuonUnprescaledTrig =
trig;
277 if (trig == lowestTrig)
278 lowestMuonUnprescaledTrigFound =
true;
279 if (trig == lowestTrig)
282 if (lowestMuonUnprescaledTrigFound)
285 lowestTrig = lowestTrigv0;
286 if (trig == lowestTrig)
287 lowestMuonUnprescaledTrig =
trig;
291 if (trig == lowestTrig)
292 lowestMuonUnprescaledTrigFound =
true;
293 if (trig == lowestTrig)
296 if (lowestMuonUnprescaledTrigFound)
303 unsigned int triggerIndex;
309 if (triggerIndex < triggerResults->
size())
310 trigger_fired = triggerResults->
accept(triggerIndex);
319 size_t moduleLabsSizeMinus2 = moduleLabs.size() - 2;
323 L3FilterName_ = moduleLabs[moduleLabsSizeMinus2];
327 LogTrace(
"") <<
">>> Trigger bit: " << trigger_fired <<
" (" << hltPath_ <<
")";
336 std::vector<reco::Particle> HLTMuMatched;
337 for (
size_t ia = 0; ia < handleTriggerEvent->
sizeFilters(); ++ia) {
341 size_t p = fullname.find_first_of(
':');
342 if (p != std::string::npos) {
343 name = fullname.substr(0, p);
349 for (trigger::Keys::const_iterator ki = k.begin(); ki != k.end(); ++ki) {
352 if (name == L3FilterName_) {
356 HLTMuMatched.push_back(toc[*ki].particle());
379 std::vector<reco::Muon> highPtGlbMuons;
380 std::vector<reco::Muon> highPtStaMuons;
382 for (
size_t i = 0;
i < muons->size();
i++) {
392 highPtGlbMuons.push_back(mu);
398 highPtStaMuons.push_back(mu);
402 size_t nHighPtGlbMu = highPtGlbMuons.size();
403 size_t nHighPtStaMu = highPtStaMuons.size();
404 if (hlt_sel && (nHighPtGlbMu > 0)) {
408 (nHighPtGlbMu > 10) ? nHighPtGlbMu = 10 : 1;
410 if (nHighPtGlbMu > 1) {
411 for (
unsigned int i = 0;
i < nHighPtGlbMu;
i++) {
415 for (
unsigned int j =
i + 1;
j < nHighPtGlbMu; ++
j) {
422 double mass = pair.M();
430 if (singleTrigFlag1 && singleTrigFlag2)
432 if ((singleTrigFlag1 && !singleTrigFlag2) || (!singleTrigFlag1 && singleTrigFlag2))
441 highPtGlbMuons.erase(highPtGlbMuons.begin() +
i);
442 highPtGlbMuons.erase(highPtGlbMuons.begin() +
j);
444 nHighPtGlbMu = highPtGlbMuons.size();
446 if (isMu1Iso && isMu2Iso) {
510 const MET&
met = metCollection->at(0);
512 for (
unsigned int i = 0;
i < nHighPtGlbMu;
i++) {
532 if (!singleTrigFlag1)
537 double met_px = met.
px();
538 double met_py = met.
py();
541 for (
unsigned int i = 0;
i < nHighPtGlbMu;
i++) {
543 met_px -= muon1.
px();
544 met_py -= muon1.
py();
547 double met_et = met.
pt();
548 LogTrace(
"") <<
">>> MET, MET_px, MET_py: " << met_et <<
", " << met_px <<
", " << met_py <<
" [GeV]";
549 double w_et = met_et + muon1.
pt();
550 double w_px = met_px + muon1.
px();
551 double w_py = met_py + muon1.
py();
552 double massT = w_et * w_et - w_px * w_px - w_py * w_py;
553 massT = (massT > 0) ?
sqrt(massT) : 0;
556 double acop =
M_PI - fabs(deltaphi.value());
562 if (massT < mtMin_ || massT >
mtMax_)
575 for (
unsigned int i = 0;
i < nHighPtGlbMu; ++
i) {
581 if (!singleTrigFlag1)
585 iso1 =
muIso(glbMuon);
591 (nHighPtStaMu > 10) ? nHighPtStaMu = 10 : 1;
592 for (
unsigned int j = 0;
j < nHighPtStaMu; ++
j) {
599 double mass = pair.M();
600 iso2 =
muIso(staMuon);
602 LogTrace(
"") <<
"\t... isolation value" << iso1 <<
", isolated? " << isMu1Iso;
603 LogTrace(
"") <<
"\t... isolation value" << iso2 <<
", isolated? " << isMu2Iso;
636 size_t nTrk = tracks->size();
637 (nTrk > 5000) ? nTrk = 5000 : 1;
638 for (
unsigned int j = 0;
j < nTrk;
j++) {
642 double pt2 = tk.
pt();
650 double mass = pair.M();
652 iso2 =
tkIso(tk, tracks, calotower);
681 LogTrace(
"") <<
">>>> Event ACCEPTED";
683 LogTrace(
"") <<
">>>> Event REJECTED";
MonitorElement * highMass1HLT_
double p() const
momentum vector magnitude
MonitorElement * book1D(TString const &name, TString const &title, int const nchX, double const lowX, double const highX)
double eta() const final
momentum pseudorapidity
bool isStandAloneMuon() const override
edm::EDGetTokenT< edm::View< reco::Muon > > muonToken_
float sumPt
sum-pt of tracks
trigger::size_type sizeFilters() const
void dqmEndRun(const edm::Run &, const edm::EventSetup &) override
virtual TrackRef innerTrack() const
bool getByToken(EDGetToken token, Handle< PROD > &result) const
void setCurrentFolder(std::string const &fullpath)
unsigned int nEvWithHighPtMu
double px() const final
x coordinate of momentum vector
bool accept() const
Has at least one path accepted the event?
const std::vector< std::string > & triggerNames() const
names of trigger paths
const Keys & filterKeys(trigger::size_type index) const
std::vector< Track > TrackCollection
collection of Tracks
std::vector< CaloTower >::const_iterator const_iterator
MonitorElement * highMassIsBothGlbTrkThanW_
double phi() const
azimuthal angle of momentum vector
double pt() const final
transverse momentum
MonitorElement * highMassGlbTrk_
int charge() const final
electric charge
edm::EDGetTokenT< edm::View< reco::MET > > metToken_
MonitorElement * massNotIso_
double px() const
x coordinate of momentum vector
MonitorElement * highMassGlbSta_
EwkMuLumiMonitorDQM(const edm::ParameterSet &)
edm::EDGetTokenT< edm::TriggerResults > trigToken_
unsigned int triggerIndex(const std::string &triggerName) const
slot position of trigger path in trigger table (0 to size-1)
MonitorElement * mass1HLT_
XYZTLorentzVectorD XYZTLorentzVector
Lorentz vector with cylindrical internal representation using pseudorapidity.
void analyze(const edm::Event &, const edm::EventSetup &) override
unsigned int prescaleValue(unsigned int set, const std::string &trigger) const
HLT prescale value in specific prescale set for a specific trigger path.
double eta() const
pseudorapidity of momentum vector
MonitorElement * massIsBothGlbTrkThanW_
MonitorElement * massGlbTrk_
bool IsMuMatchedToHLTMu(const reco::Muon &, const std::vector< reco::Particle > &, double, double)
double tkIso(const reco::Track &, edm::Handle< reco::TrackCollection >, edm::Handle< CaloTowerCollection >)
bool isGlobalMuon() const override
const TriggerObjectCollection & getObjects() const
double pt() const
track transverse momentum
edm::EDGetTokenT< CaloTowerCollection > caloTowerToken_
MonitorElement * highMassNotIso_
const LorentzVector & p4() const final
four-momentum Lorentz vector
edm::EDGetTokenT< reco::TrackCollection > trackToken_
void bookHistograms(DQMStore::IBooker &, edm::Run const &, edm::EventSetup const &) override
static std::string const triggerResults
edm::EDGetTokenT< reco::BeamSpot > beamSpotToken_
def elem(elemtype, innerHTML='', html_class='', kwargs)
double pz() const
z coordinate of momentum vector
const std::vector< std::string > & moduleLabels(unsigned int trigger) const
label(s) of module(s) on a trigger path
const_iterator end() const
std::vector< TriggerObject > TriggerObjectCollection
collection of trigger physics objects (e.g., all isolated muons)
double vz() const
z coordinate of the reference point on track
const edm::InputTag filterTag(trigger::size_type index) const
double outerEta() const
pseudorapidity of the momentum vector at the outermost hit position
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
void dqmBeginRun(const edm::Run &, const edm::EventSetup &) override
double py() const final
y coordinate of momentum vector
HLTConfigProvider hltConfigProvider_
double vy() const
y coordinate of the reference point on track
MonitorElement * mass2HLT_
edm::EDGetTokenT< trigger::TriggerEvent > trigEvToken_
unsigned int prescaleSize() const
MonitorElement * highMass2HLT_
int charge() const
track electric charge
const Point & position() const
position
double dxy() const
dxy parameter. (This is the transverse impact parameter w.r.t. to (0,0,0) ONLY if refPoint is close t...
double phi() const final
momentum azimuthal angle
double outerPhi() const
azimuthal angle of the momentum vector at the outermost hit position
const_iterator begin() const
double py() const
y coordinate of momentum vector
const MuonIsolation & isolationR03() const
double vx() const
x coordinate of the reference point on track