81 #include "TLorentzVector.h" 121 edm::LogInfo(
"HZZ4LeptonsDQM") <<
" Creating HZZ4LeptonsDQM " 124 typedef std::vector<edm::InputTag> vtag;
126 theElecTriggerPathToPass = ps.
getParameter<
string>(
"elecTriggerPathToPass");
127 theMuonTriggerPathToPass = ps.
getParameter<
string>(
"muonTriggerPathToPass");
130 theTriggerResultsCollection_ = consumes<edm::TriggerResults>(theTriggerResultsCollectionTag_);
131 theMuonCollectionToken_ = consumes<reco::MuonCollection>(ps.
getParameter<
InputTag>(
"muonCollection"));
132 theElectronCollectionToken_ = consumes<reco::GsfElectronCollection>(ps.
getParameter<
InputTag>(
"electronCollection"));
133 theCaloJetCollectionToken_ = consumes<reco::CaloJetCollection>(theCaloJetCollectionLabel_);
134 theCaloMETCollectionToken_ = consumes<reco::CaloMETCollection>(ps.
getParameter<
InputTag>(
"caloMETCollection"));
135 thePfMETCollectionToken_ = consumes<reco::PFMETCollection>(ps.
getParameter<
InputTag>(
"pfMETCollection"));
136 vertexToken_ = consumes<reco::VertexCollection>(
165 h_vertex_number = ibooker.
book1D(
"h_vertex_number",
"Number of event vertices in collection", 10, -0.5, 9.5);
166 h_vertex_chi2 = ibooker.
book1D(
"h_vertex_chi2",
"Event Vertex #chi^{2}/n.d.o.f.", 100, 0.0, 2.0);
167 h_vertex_numTrks = ibooker.
book1D(
"h_vertex_numTrks",
"Event Vertex, number of tracks", 100, -0.5, 99.5);
168 h_vertex_sumTrks = ibooker.
book1D(
"h_vertex_sumTrks",
"Event Vertex, sum of track pt", 100, 0.0, 100.0);
169 h_vertex_d0 = ibooker.
book1D(
"h_vertex_d0",
"Event Vertex d0", 100, -10.0, 10.0);
171 ibooker.
book1D(
"h_jet_et",
172 "Jet with highest E_{T} (from " + theCaloJetCollectionLabel_.label() +
");E_{T}(1^{st} jet) (GeV)",
176 h_jet2_et = ibooker.
book1D(
178 "Jet with 2^{nd} highest E_{T} (from " + theCaloJetCollectionLabel_.label() +
");E_{T}(2^{nd} jet) (GeV)",
182 h_jet_count = ibooker.
book1D(
"h_jet_count",
183 "Number of " + theCaloJetCollectionLabel_.label() +
" (E_{T} > 15 GeV);Number of Jets",
187 h_caloMet = ibooker.
book1D(
"h_caloMet",
"Calo Missing E_{T}; GeV", 20, 0.0, 100);
188 h_caloMet_phi = ibooker.
book1D(
"h_caloMet_phi",
"Calo Missing E_{T} #phi;#phi(MET)", 35, -3.5, 3.5);
189 h_pfMet = ibooker.
book1D(
"h_pfMet",
"Pf Missing E_{T}; GeV", 20, 0.0, 100);
190 h_pfMet_phi = ibooker.
book1D(
"h_pfMet_phi",
"Pf Missing E_{T} #phi;#phi(MET)", 35, -3.5, 3.5);
191 h_eMultiplicity = ibooker.
book1D(
"NElectrons",
"# of electrons per event", 10, 0., 10.);
192 h_mMultiplicity = ibooker.
book1D(
"NMuons",
"# of muons per event", 10, 0., 10.);
193 h_ePt = ibooker.
book1D(
"ElePt",
"Pt of electrons", 50, 0., 100.);
194 h_eEta = ibooker.
book1D(
"EleEta",
"Eta of electrons", 100, -5., 5.);
195 h_ePhi = ibooker.
book1D(
"ElePhi",
"Phi of electrons", 100, -3.5, 3.5);
196 h_mPt_GMTM = ibooker.
book1D(
"MuonPt_GMTM",
"Pt of global+tracker muons", 50, 0., 100.);
197 h_mEta_GMTM = ibooker.
book1D(
"MuonEta_GMTM",
"Eta of global+tracker muons", 60, -3., 3.);
198 h_mPhi_GMTM = ibooker.
book1D(
"MuonPhi_GMTM",
"Phi of global+tracker muons", 70, -3.5, 3.5);
199 h_mPt_GMPT = ibooker.
book1D(
"MuonPt_GMPT",
"Pt of global prompt-tight muons", 50, 0., 100.);
200 h_mEta_GMPT = ibooker.
book1D(
"MuonEta_GMPT",
"Eta of global prompt-tight muons", 60, -3., 3.);
201 h_mPhi_GMPT = ibooker.
book1D(
"MuonPhi_GMPT",
"Phi of global prompt-tight muons", 70, -3.5, 3.5);
202 h_mPt_GM = ibooker.
book1D(
"MuonPt_GM",
"Pt of global muons", 50, 0., 100.);
203 h_mEta_GM = ibooker.
book1D(
"MuonEta_GM",
"Eta of global muons", 60, -3., 3.);
204 h_mPhi_GM = ibooker.
book1D(
"MuonPhi_GM",
"Phi of global muons", 70, -3.5, 3.5);
205 h_mPt_TM = ibooker.
book1D(
"MuonPt_TM",
"Pt of tracker muons", 50, 0., 100.);
206 h_mEta_TM = ibooker.
book1D(
"MuonEta_TM",
"Eta of tracker muons", 60, -3., 3.);
207 h_mPhi_TM = ibooker.
book1D(
"MuonPhi_TM",
"Phi of tracker muons", 70, -3.5, 3.5);
208 h_mPt_STAM = ibooker.
book1D(
"MuonPt_STAM",
"Pt of STA muons", 50, 0., 100.);
209 h_mEta_STAM = ibooker.
book1D(
"MuonEta_STAM",
"Eta of STA muons", 60, -3., 3.);
210 h_mPhi_STAM = ibooker.
book1D(
"MuonPhi_STAM",
"Phi of STA muons", 70, -3.5, 3.5);
211 h_eCombIso = ibooker.
book1D(
"EleCombIso",
"CombIso of electrons", 100, 0., 10.);
212 h_mCombIso = ibooker.
book1D(
"MuonCombIso",
"CombIso of muons", 100, 0., 10.);
213 h_dimumass_GMGM = ibooker.
book1D(
"DimuMass_GMGM",
"Invariant mass of GMGM pairs", 100, 0., 200.);
214 h_dimumass_GMTM = ibooker.
book1D(
"DimuMass_GMTM",
"Invariant mass of GMTM pairs", 100, 0., 200.);
215 h_dimumass_TMTM = ibooker.
book1D(
"DimuMass_TMTM",
"Invariant mass of TMTM pairs", 100, 0., 200.);
216 h_dielemass = ibooker.
book1D(
"DieleMass",
"Invariant mass of EE pairs", 100, 0., 200.);
217 h_lepcounts = ibooker.
book1D(
"LeptonCounts",
"LeptonCounts for multi lepton events", 49, 0., 49.);
231 bool passed_electron_HLT =
true;
232 bool passed_muon_HLT =
true;
238 e.getByToken(vertexToken_, vertexHandle);
243 double vertex_chi2 =
v->normalizedChi2();
244 double vertex_d0 =
sqrt(
v->x() *
v->x() +
v->y() *
v->y());
246 double vertex_numTrks =
v->tracksSize();
247 double vertex_sumTrks = 0.0;
250 vertex_sumTrks += (*vertex_curTrack)->pt();
252 h_vertex_number->Fill(vertex_number);
253 h_vertex_chi2->Fill(vertex_chi2);
254 h_vertex_d0->Fill(vertex_d0);
255 h_vertex_numTrks->Fill(vertex_numTrks);
256 h_vertex_sumTrks->Fill(vertex_sumTrks);
266 int posEle = 0, negEle = 0;
269 if (passed_electron_HLT) {
270 for (reco::GsfElectronCollection::const_iterator recoElectron =
electronCollection->begin();
275 h_ePt->Fill(recoElectron->pt());
276 h_eEta->Fill(recoElectron->eta());
277 h_ePhi->Fill(recoElectron->phi());
278 if (recoElectron->charge() == 1) {
280 }
else if (recoElectron->charge() == -1) {
292 nEle = posEle + negEle;
295 h_eMultiplicity->Fill(nEle);
299 for (
unsigned int i = 0;
i < eleCollectionSize;
i++) {
301 double pt = ele.
pt();
302 if (
pt > ptThrMu1_) {
303 for (
unsigned int j =
i + 1;
j < eleCollectionSize;
j++) {
305 double pt2 = ele2.
pt();
306 if (
pt2 > ptThrMu2_) {
308 ele.
px() + ele2.
px(), ele.
py() + ele2.
py(), ele.
pz() + ele2.
pz(), ele.
p() + ele2.
p());
309 h_dielemass->Fill(ZRecoEE.mass());
324 int posMu = 0, negMu = 0;
325 TLorentzVector m1,
m2;
326 if (passed_muon_HLT) {
339 }
else if (
recoMuon->isGlobalMuon()) {
343 }
else if (
recoMuon->isTrackerMuon() &&
348 }
else if (
recoMuon->isStandAloneMuon()) {
355 }
else if (
recoMuon->charge() == -1) {
362 h_mMultiplicity->Fill(nMu);
367 for (
unsigned int i = 0;
i < muonCollectionSize;
i++) {
371 if (
pt > ptThrMu1_) {
372 for (
unsigned int j =
i + 1;
j < muonCollectionSize;
j++) {
374 double pt2 = mu2.
pt();
375 if (
pt2 > ptThrMu2_) {
379 mu.px() + mu2.
px(),
mu.py() + mu2.
py(),
mu.pz() + mu2.
pz(),
mu.p() + mu2.
p());
380 h_dimumass_GMGM->Fill(ZRecoGMGM.mass());
385 mu.px() + mu2.
px(),
mu.py() + mu2.
py(),
mu.pz() + mu2.
pz(),
mu.p() + mu2.
p());
386 h_dimumass_GMTM->Fill(ZRecoGMTM.mass());
391 mu.px() + mu2.
px(),
mu.py() + mu2.
py(),
mu.pz() + mu2.
pz(),
mu.p() + mu2.
p());
392 h_dimumass_TMTM->Fill(ZRecoTMTM.mass());
410 float jet2_et = -9.0;
416 float jet_current_et = i_calojet->et();
423 if (jet_current_et < 15)
426 if (jet_current_et > jet_et) {
430 jet_et = i_calojet->et();
434 }
else if (jet_current_et > jet2_et) {
435 jet2_et = i_calojet->et();
441 h_jet_et->Fill(jet_et);
442 h_jet_count->Fill(jet_count);
455 h_caloMet_phi->Fill(caloMet_phi);
462 h_pfMet->Fill(
pfMet);
463 h_pfMet_phi->Fill(pfMet_phi);
469 if (nMu + nEle > 2 && nMu + nEle < 10) {
470 if (nMu == 0 && nEle == 3)
471 h_lepcounts->Fill(0);
472 if (nMu == 0 && nEle == 4)
473 h_lepcounts->Fill(1);
474 if (nMu == 0 && nEle == 5)
475 h_lepcounts->Fill(2);
476 if (nMu == 0 && nEle == 6)
477 h_lepcounts->Fill(3);
478 if (nMu == 0 && nEle == 7)
479 h_lepcounts->Fill(4);
480 if (nMu == 0 && nEle == 8)
481 h_lepcounts->Fill(5);
482 if (nMu == 0 && nEle == 9)
483 h_lepcounts->Fill(6);
484 if (nMu == 1 && nEle == 2)
485 h_lepcounts->Fill(7);
486 if (nMu == 1 && nEle == 3)
487 h_lepcounts->Fill(8);
488 if (nMu == 1 && nEle == 4)
489 h_lepcounts->Fill(9);
490 if (nMu == 1 && nEle == 5)
491 h_lepcounts->Fill(10);
492 if (nMu == 1 && nEle == 6)
493 h_lepcounts->Fill(11);
494 if (nMu == 1 && nEle == 7)
495 h_lepcounts->Fill(12);
496 if (nMu == 1 && nEle == 8)
497 h_lepcounts->Fill(13);
498 if (nMu == 2 && nEle == 1)
499 h_lepcounts->Fill(14);
500 if (nMu == 2 && nEle == 2)
501 h_lepcounts->Fill(15);
502 if (nMu == 2 && nEle == 3)
503 h_lepcounts->Fill(16);
504 if (nMu == 2 && nEle == 4)
505 h_lepcounts->Fill(17);
506 if (nMu == 2 && nEle == 5)
507 h_lepcounts->Fill(18);
508 if (nMu == 2 && nEle == 6)
509 h_lepcounts->Fill(19);
510 if (nMu == 2 && nEle == 7)
511 h_lepcounts->Fill(20);
512 if (nMu == 3 && nEle == 0)
513 h_lepcounts->Fill(21);
514 if (nMu == 3 && nEle == 1)
515 h_lepcounts->Fill(22);
516 if (nMu == 3 && nEle == 2)
517 h_lepcounts->Fill(23);
518 if (nMu == 3 && nEle == 3)
519 h_lepcounts->Fill(24);
520 if (nMu == 3 && nEle == 4)
521 h_lepcounts->Fill(25);
522 if (nMu == 3 && nEle == 5)
523 h_lepcounts->Fill(26);
524 if (nMu == 3 && nEle == 6)
525 h_lepcounts->Fill(27);
526 if (nMu == 4 && nEle == 0)
527 h_lepcounts->Fill(28);
528 if (nMu == 4 && nEle == 1)
529 h_lepcounts->Fill(29);
530 if (nMu == 4 && nEle == 2)
531 h_lepcounts->Fill(30);
532 if (nMu == 4 && nEle == 3)
533 h_lepcounts->Fill(31);
534 if (nMu == 4 && nEle == 4)
535 h_lepcounts->Fill(32);
536 if (nMu == 4 && nEle == 5)
537 h_lepcounts->Fill(33);
538 if (nMu == 5 && nEle == 0)
539 h_lepcounts->Fill(34);
540 if (nMu == 5 && nEle == 1)
541 h_lepcounts->Fill(35);
542 if (nMu == 5 && nEle == 2)
543 h_lepcounts->Fill(36);
544 if (nMu == 5 && nEle == 3)
545 h_lepcounts->Fill(37);
546 if (nMu == 5 && nEle == 4)
547 h_lepcounts->Fill(38);
548 if (nMu == 6 && nEle == 0)
549 h_lepcounts->Fill(39);
550 if (nMu == 6 && nEle == 1)
551 h_lepcounts->Fill(40);
552 if (nMu == 6 && nEle == 2)
553 h_lepcounts->Fill(41);
554 if (nMu == 6 && nEle == 3)
555 h_lepcounts->Fill(42);
556 if (nMu == 7 && nEle == 0)
557 h_lepcounts->Fill(43);
558 if (nMu == 7 && nEle == 1)
559 h_lepcounts->Fill(44);
560 if (nMu == 7 && nEle == 2)
561 h_lepcounts->Fill(45);
562 if (nMu == 8 && nEle == 0)
563 h_lepcounts->Fill(46);
564 if (nMu == 8 && nEle == 1)
565 h_lepcounts->Fill(47);
566 if (nMu == 9 && nEle == 0)
567 h_lepcounts->Fill(48);
569 if ((nMu + nEle) >= 10)
570 LogDebug(
"HiggsDQM") <<
"WARNING: " << nMu + nEle <<
" leptons in this event: run=" <<
e.id().run()
571 <<
", event=" <<
e.id().event() <<
"\n";
T getParameter(std::string const &) const
double pz() const final
z coordinate of momentum vector
double pt() const final
transverse momentum
bool operator()(const Candidate &c1, const Candidate &c2) const
virtual void setCurrentFolder(std::string const &fullpath)
virtual double pt() const =0
transverse momentum
T const * product() const
std::vector< Vertex > VertexCollection
collection of Vertex objects
bool isTrackerMuon() const override
T getUntrackedParameter(std::string const &, T const &) const
XYZTLorentzVectorD XYZTLorentzVector
Lorentz vector with cylindrical internal representation using pseudorapidity.
double px() const final
x coordinate of momentum vector
double p() const final
magnitude of momentum vector
float segmentCompatibility(const reco::Muon &muon, reco::Muon::ArbitrationType arbitrationType=reco::Muon::SegmentAndTrackArbitration)
double py() const final
y coordinate of momentum vector
double Distance(const reco::Candidate &c1, const reco::Candidate &c2)
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
double calcDeltaPhi(double phi1, double phi2)
Log< level::Info, false > LogInfo
double DistancePhi(const reco::Candidate &c1, const reco::Candidate &c2)
HiggsDQM(const edm::ParameterSet &ps)
void bookHistograms(DQMStore::IBooker &, edm::Run const &, edm::EventSetup const &) override
MonitorElement * book1D(TString const &name, TString const &title, int const nchX, double const lowX, double const highX, FUNC onbooking=NOOP())
bool isGlobalMuon() const override
std::vector< TrackBaseRef >::const_iterator trackRef_iterator
The iteratator for the vector<TrackRef>
virtual const LorentzVector & p4() const =0
four-momentum Lorentz vector