82 #include "TLorentzVector.h"
97 return c1.
pt() > c2.
pt();
114 if (deltaPhi < 0) deltaPhi = -
deltaPhi;
115 if (deltaPhi > 3.1415926) {
116 deltaPhi = 2 * 3.1415926 -
deltaPhi;
127 edm::LogInfo(
"HZZ4LeptonsDQM") <<
" Creating HZZ4LeptonsDQM "
130 typedef std::vector<edm::InputTag> vtag;
132 theElecTriggerPathToPass = ps.
getParameter<
string>(
"elecTriggerPathToPass");
133 theMuonTriggerPathToPass = ps.
getParameter<
string>(
"muonTriggerPathToPass");
134 theTriggerResultsCollectionTag_ =
137 theTriggerResultsCollection_ =
138 consumes<edm::TriggerResults>(theTriggerResultsCollectionTag_);
139 theMuonCollectionToken_ = consumes<reco::MuonCollection>(
141 theElectronCollectionToken_ = consumes<reco::GsfElectronCollection>(
143 theCaloJetCollectionToken_ =
144 consumes<reco::CaloJetCollection>(theCaloJetCollectionLabel_);
145 theCaloMETCollectionToken_ = consumes<reco::CaloMETCollection>(
147 thePfMETCollectionToken_ = consumes<reco::PFMETCollection>(
151 "vertexCollection",
InputTag(
"offlinePrimaryVertices")));
181 edm::LogInfo(
"HiggsDQM") <<
"[HiggsDQM]: Begin of LS transition";
192 h_vertex_number = ibooker.
book1D(
"h_vertex_number",
193 "Number of event vertices in collection", 10, -0.5, 9.5);
194 h_vertex_chi2 = ibooker.
book1D(
"h_vertex_chi2",
195 "Event Vertex #chi^{2}/n.d.o.f.", 100, 0.0, 2.0);
196 h_vertex_numTrks = ibooker.
book1D(
"h_vertex_numTrks",
197 "Event Vertex, number of tracks", 100, -0.5, 99.5);
198 h_vertex_sumTrks = ibooker.
book1D(
"h_vertex_sumTrks",
199 "Event Vertex, sum of track pt", 100, 0.0, 100.0);
200 h_vertex_d0 = ibooker.
book1D(
"h_vertex_d0",
"Event Vertex d0", 100, -10.0, 10.0);
201 h_jet_et = ibooker.
book1D(
"h_jet_et",
202 "Jet with highest E_{T} (from " + theCaloJetCollectionLabel_.label() +
203 ");E_{T}(1^{st} jet) (GeV)", 20, 0., 200.0);
204 h_jet2_et = ibooker.
book1D(
"h_jet2_et",
205 "Jet with 2^{nd} highest E_{T} (from " + theCaloJetCollectionLabel_.label() +
206 ");E_{T}(2^{nd} jet) (GeV)", 20, 0., 200.0);
207 h_jet_count = ibooker.
book1D(
"h_jet_count",
208 "Number of " + theCaloJetCollectionLabel_.label() +
209 " (E_{T} > 15 GeV);Number of Jets", 8, -0.5, 7.5);
210 h_caloMet = ibooker.
book1D(
"h_caloMet",
"Calo Missing E_{T}; GeV", 20, 0.0, 100);
211 h_caloMet_phi = ibooker.
book1D(
"h_caloMet_phi",
212 "Calo Missing E_{T} #phi;#phi(MET)", 35, -3.5, 3.5);
213 h_pfMet = ibooker.
book1D(
"h_pfMet",
"Pf Missing E_{T}; GeV", 20, 0.0, 100);
214 h_pfMet_phi = ibooker.
book1D(
"h_pfMet_phi",
"Pf Missing E_{T} #phi;#phi(MET)",
216 h_eMultiplicity = ibooker.
book1D(
"NElectrons",
217 "# of electrons per event", 10, 0., 10.);
218 h_mMultiplicity = ibooker.
book1D(
"NMuons",
"# of muons per event", 10, 0., 10.);
219 h_ePt = ibooker.
book1D(
"ElePt",
"Pt of electrons", 50, 0., 100.);
220 h_eEta = ibooker.
book1D(
"EleEta",
"Eta of electrons", 100, -5., 5.);
221 h_ePhi = ibooker.
book1D(
"ElePhi",
"Phi of electrons", 100, -3.5, 3.5);
222 h_mPt_GMTM = ibooker.
book1D(
"MuonPt_GMTM",
223 "Pt of global+tracker muons", 50, 0., 100.);
224 h_mEta_GMTM = ibooker.
book1D(
"MuonEta_GMTM",
225 "Eta of global+tracker muons", 60, -3., 3.);
226 h_mPhi_GMTM = ibooker.
book1D(
"MuonPhi_GMTM",
227 "Phi of global+tracker muons", 70, -3.5, 3.5);
228 h_mPt_GMPT = ibooker.
book1D(
"MuonPt_GMPT",
229 "Pt of global prompt-tight muons", 50, 0., 100.);
230 h_mEta_GMPT = ibooker.
book1D(
"MuonEta_GMPT",
231 "Eta of global prompt-tight muons", 60, -3., 3.);
232 h_mPhi_GMPT = ibooker.
book1D(
"MuonPhi_GMPT",
233 "Phi of global prompt-tight muons", 70, -3.5, 3.5);
234 h_mPt_GM = ibooker.
book1D(
"MuonPt_GM",
"Pt of global muons", 50, 0., 100.);
235 h_mEta_GM = ibooker.
book1D(
"MuonEta_GM",
"Eta of global muons", 60, -3., 3.);
236 h_mPhi_GM = ibooker.
book1D(
"MuonPhi_GM",
"Phi of global muons", 70, -3.5, 3.5);
237 h_mPt_TM = ibooker.
book1D(
"MuonPt_TM",
"Pt of tracker muons", 50, 0., 100.);
238 h_mEta_TM = ibooker.
book1D(
"MuonEta_TM",
"Eta of tracker muons", 60, -3., 3.);
239 h_mPhi_TM = ibooker.
book1D(
"MuonPhi_TM",
"Phi of tracker muons", 70, -3.5, 3.5);
240 h_mPt_STAM = ibooker.
book1D(
"MuonPt_STAM",
"Pt of STA muons", 50, 0., 100.);
241 h_mEta_STAM = ibooker.
book1D(
"MuonEta_STAM",
"Eta of STA muons", 60, -3., 3.);
242 h_mPhi_STAM = ibooker.
book1D(
"MuonPhi_STAM",
"Phi of STA muons", 70, -3.5, 3.5);
243 h_eCombIso = ibooker.
book1D(
"EleCombIso",
"CombIso of electrons", 100, 0., 10.);
244 h_mCombIso = ibooker.
book1D(
"MuonCombIso",
"CombIso of muons", 100, 0., 10.);
245 h_dimumass_GMGM = ibooker.
book1D(
"DimuMass_GMGM",
"Invariant mass of GMGM pairs",
247 h_dimumass_GMTM = ibooker.
book1D(
"DimuMass_GMTM",
248 "Invariant mass of GMTM pairs", 100, 0., 200.);
249 h_dimumass_TMTM = ibooker.
book1D(
"DimuMass_TMTM",
250 "Invariant mass of TMTM pairs", 100, 0., 200.);
251 h_dielemass = ibooker.
book1D(
"DieleMass",
252 "Invariant mass of EE pairs", 100, 0., 200.);
253 h_lepcounts = ibooker.
book1D(
"LeptonCounts",
254 "LeptonCounts for multi lepton events", 49, 0., 49.);
268 bool passed_electron_HLT =
true;
269 bool passed_muon_HLT =
true;
278 int vertex_number = vertexCollection.size();
279 VertexCollection::const_iterator
v = vertexCollection.begin();
280 double vertex_chi2 = v->normalizedChi2();
281 double vertex_d0 =
sqrt(v->x() * v->x() + v->y() * v->y());
283 double vertex_numTrks = v->tracksSize();
284 double vertex_sumTrks = 0.0;
286 vertex_curTrack != v->tracks_end(); vertex_curTrack++) {
287 vertex_sumTrks += (*vertex_curTrack)->pt();
289 h_vertex_number->Fill(vertex_number);
290 h_vertex_chi2->Fill(vertex_chi2);
291 h_vertex_d0->Fill(vertex_d0);
292 h_vertex_numTrks->Fill(vertex_numTrks);
293 h_vertex_sumTrks->Fill(vertex_sumTrks);
301 e.
getByToken(theElectronCollectionToken_, electronCollection);
302 if (electronCollection.
isValid()) {
303 int posEle = 0, negEle = 0;
306 if (passed_electron_HLT) {
307 for (reco::GsfElectronCollection::const_iterator recoElectron =
308 electronCollection->begin();
309 recoElectron != electronCollection->end(); recoElectron++) {
312 h_ePt->Fill(recoElectron->pt());
313 h_eEta->Fill(recoElectron->eta());
314 h_ePhi->Fill(recoElectron->phi());
315 if (recoElectron->charge() == 1) {
317 }
else if (recoElectron->charge() == -1) {
329 nEle = posEle + negEle;
330 if (nEle > 9.) nEle = 9.;
331 h_eMultiplicity->Fill(nEle);
334 unsigned int eleCollectionSize = electronCollection->size();
335 for (
unsigned int i = 0;
i < eleCollectionSize;
i++) {
337 double pt = ele.
pt();
338 if (pt > ptThrMu1_) {
339 for (
unsigned int j =
i + 1;
j < eleCollectionSize;
j++) {
341 double pt2 = ele2.
pt();
342 if (pt2 > ptThrMu2_) {
344 ele.
px() + ele2.
px(), ele.
py() + ele2.
py(),
345 ele.
pz() + ele2.
pz(), ele.
p() + ele2.
p());
346 h_dielemass->Fill(ZRecoEE.mass());
358 e.
getByToken(theMuonCollectionToken_, muonCollection);
359 if (muonCollection.
isValid()) {
361 int posMu = 0, negMu = 0;
362 TLorentzVector m1, m2;
363 if (passed_muon_HLT) {
364 for (reco::MuonCollection::const_iterator recoMuon =
365 muonCollection->begin();
366 recoMuon != muonCollection->end(); recoMuon++) {
369 if (recoMuon->isGlobalMuon() && recoMuon->isTrackerMuon()) {
370 h_mPt_GMTM->Fill(recoMuon->pt());
371 h_mEta_GMTM->Fill(recoMuon->eta());
372 h_mPhi_GMTM->Fill(recoMuon->phi());
373 }
else if (recoMuon->isGlobalMuon() &&
376 h_mPt_GMPT->Fill(recoMuon->pt());
377 h_mEta_GMPT->Fill(recoMuon->eta());
378 h_mPhi_GMPT->Fill(recoMuon->phi());
379 }
else if (recoMuon->isGlobalMuon()) {
380 h_mPt_GM->Fill(recoMuon->pt());
381 h_mEta_GM->Fill(recoMuon->eta());
382 h_mPhi_GM->Fill(recoMuon->phi());
383 }
else if (recoMuon->isTrackerMuon() &&
386 h_mPt_TM->Fill(recoMuon->pt());
387 h_mEta_TM->Fill(recoMuon->eta());
388 h_mPhi_TM->Fill(recoMuon->phi());
389 }
else if (recoMuon->isStandAloneMuon()) {
390 h_mPt_STAM->Fill(recoMuon->pt());
391 h_mEta_STAM->Fill(recoMuon->eta());
392 h_mPhi_STAM->Fill(recoMuon->phi());
394 if (recoMuon->charge() == 1) {
396 }
else if (recoMuon->charge() == -1) {
401 if (nMu > 9.) nMu = 9.;
402 h_mMultiplicity->Fill(nMu);
406 unsigned int muonCollectionSize = muonCollection->size();
407 for (
unsigned int i = 0;
i < muonCollectionSize;
i++) {
408 const Muon&
mu = muonCollection->at(
i);
411 if (pt > ptThrMu1_) {
412 for (
unsigned int j =
i + 1;
j < muonCollectionSize;
j++) {
413 const Muon& mu2 = muonCollection->at(
j);
414 double pt2 = mu2.
pt();
415 if (pt2 > ptThrMu2_) {
419 mu.
px() + mu2.
px(), mu.
py() + mu2.
py(), mu.
pz() + mu2.
pz(),
421 h_dimumass_GMGM->Fill(ZRecoGMGM.mass());
426 mu.
px() + mu2.
px(), mu.
py() + mu2.
py(), mu.
pz() + mu2.
pz(),
428 h_dimumass_GMTM->Fill(ZRecoGMTM.mass());
433 mu.
px() + mu2.
px(), mu.
py() + mu2.
py(), mu.
pz() + mu2.
pz(),
435 h_dimumass_TMTM->Fill(ZRecoTMTM.mass());
447 e.
getByToken(theCaloJetCollectionToken_, caloJetCollection);
448 if (caloJetCollection.
isValid()) {
453 float jet2_et = -9.0;
456 for (CaloJetCollection::const_iterator i_calojet =
457 caloJetCollection->begin();
458 i_calojet != caloJetCollection->end(); i_calojet++) {
459 float jet_current_et = i_calojet->et();
466 if (jet_current_et < 15)
continue;
468 if (jet_current_et > jet_et) {
472 jet_et = i_calojet->et();
476 }
else if (jet_current_et > jet2_et) {
477 jet2_et = i_calojet->et();
483 h_jet_et->Fill(jet_et);
484 h_jet_count->Fill(jet_count);
492 e.
getByToken(theCaloMETCollectionToken_, caloMETCollection);
493 if (caloMETCollection.
isValid()) {
494 float caloMet = caloMETCollection->begin()->et();
495 float caloMet_phi = caloMETCollection->begin()->phi();
496 h_caloMet->Fill(caloMet);
497 h_caloMet_phi->Fill(caloMet_phi);
500 e.
getByToken(thePfMETCollectionToken_, pfMETCollection);
501 if (pfMETCollection.
isValid()) {
502 float pfMet = pfMETCollection->begin()->et();
503 float pfMet_phi = pfMETCollection->begin()->phi();
504 h_pfMet->Fill(pfMet);
505 h_pfMet_phi->Fill(pfMet_phi);
511 if (nMu + nEle > 2 && nMu + nEle < 10) {
512 if (nMu == 0 && nEle == 3) h_lepcounts->Fill(0);
513 if (nMu == 0 && nEle == 4) h_lepcounts->Fill(1);
514 if (nMu == 0 && nEle == 5) h_lepcounts->Fill(2);
515 if (nMu == 0 && nEle == 6) h_lepcounts->Fill(3);
516 if (nMu == 0 && nEle == 7) h_lepcounts->Fill(4);
517 if (nMu == 0 && nEle == 8) h_lepcounts->Fill(5);
518 if (nMu == 0 && nEle == 9) h_lepcounts->Fill(6);
519 if (nMu == 1 && nEle == 2) h_lepcounts->Fill(7);
520 if (nMu == 1 && nEle == 3) h_lepcounts->Fill(8);
521 if (nMu == 1 && nEle == 4) h_lepcounts->Fill(9);
522 if (nMu == 1 && nEle == 5) h_lepcounts->Fill(10);
523 if (nMu == 1 && nEle == 6) h_lepcounts->Fill(11);
524 if (nMu == 1 && nEle == 7) h_lepcounts->Fill(12);
525 if (nMu == 1 && nEle == 8) h_lepcounts->Fill(13);
526 if (nMu == 2 && nEle == 1) h_lepcounts->Fill(14);
527 if (nMu == 2 && nEle == 2) h_lepcounts->Fill(15);
528 if (nMu == 2 && nEle == 3) h_lepcounts->Fill(16);
529 if (nMu == 2 && nEle == 4) h_lepcounts->Fill(17);
530 if (nMu == 2 && nEle == 5) h_lepcounts->Fill(18);
531 if (nMu == 2 && nEle == 6) h_lepcounts->Fill(19);
532 if (nMu == 2 && nEle == 7) h_lepcounts->Fill(20);
533 if (nMu == 3 && nEle == 0) h_lepcounts->Fill(21);
534 if (nMu == 3 && nEle == 1) h_lepcounts->Fill(22);
535 if (nMu == 3 && nEle == 2) h_lepcounts->Fill(23);
536 if (nMu == 3 && nEle == 3) h_lepcounts->Fill(24);
537 if (nMu == 3 && nEle == 4) h_lepcounts->Fill(25);
538 if (nMu == 3 && nEle == 5) h_lepcounts->Fill(26);
539 if (nMu == 3 && nEle == 6) h_lepcounts->Fill(27);
540 if (nMu == 4 && nEle == 0) h_lepcounts->Fill(28);
541 if (nMu == 4 && nEle == 1) h_lepcounts->Fill(29);
542 if (nMu == 4 && nEle == 2) h_lepcounts->Fill(30);
543 if (nMu == 4 && nEle == 3) h_lepcounts->Fill(31);
544 if (nMu == 4 && nEle == 4) h_lepcounts->Fill(32);
545 if (nMu == 4 && nEle == 5) h_lepcounts->Fill(33);
546 if (nMu == 5 && nEle == 0) h_lepcounts->Fill(34);
547 if (nMu == 5 && nEle == 1) h_lepcounts->Fill(35);
548 if (nMu == 5 && nEle == 2) h_lepcounts->Fill(36);
549 if (nMu == 5 && nEle == 3) h_lepcounts->Fill(37);
550 if (nMu == 5 && nEle == 4) h_lepcounts->Fill(38);
551 if (nMu == 6 && nEle == 0) h_lepcounts->Fill(39);
552 if (nMu == 6 && nEle == 1) h_lepcounts->Fill(40);
553 if (nMu == 6 && nEle == 2) h_lepcounts->Fill(41);
554 if (nMu == 6 && nEle == 3) h_lepcounts->Fill(42);
555 if (nMu == 7 && nEle == 0) h_lepcounts->Fill(43);
556 if (nMu == 7 && nEle == 1) h_lepcounts->Fill(44);
557 if (nMu == 7 && nEle == 2) h_lepcounts->Fill(45);
558 if (nMu == 8 && nEle == 0) h_lepcounts->Fill(46);
559 if (nMu == 8 && nEle == 1) h_lepcounts->Fill(47);
560 if (nMu == 9 && nEle == 0) h_lepcounts->Fill(48);
562 if ((nMu + nEle) >= 10)
563 LogDebug(
"HiggsDQM") <<
"WARNING: " << nMu + nEle
564 <<
" leptons in this event: run=" << e.
id().
run()
565 <<
", event=" << e.
id().
event() <<
"\n";
574 edm::LogInfo(
"HiggsDQM") <<
"[HiggsDQM]: End of LS transition, performing "
575 "the DQM client operation";
581 <<
"====================================================== " << endl
582 <<
" ===> Iteration # " << nLumiSecs_ <<
" " << lumiSeg.
luminosityBlock()
584 <<
"====================================================== " << endl;
T getParameter(std::string const &) const
EventNumber_t event() const
T getUntrackedParameter(std::string const &, T const &) const
tuple caloMet
____________________________________________________________________________||
bool getByToken(EDGetToken token, Handle< PROD > &result) const
virtual double pt() const =0
transverse momentum
bool isTrackerMuon() const
bool isGlobalMuon() const
std::vector< Vertex > VertexCollection
collection of Vertex objects
void beginLuminosityBlock(edm::LuminosityBlock const &lumiSeg, edm::EventSetup const &context)
void endRun(edm::Run const &run, edm::EventSetup const &eSetup)
LuminosityBlockNumber_t luminosityBlock() const
XYZTLorentzVectorD XYZTLorentzVector
Lorentz vector with cylindrical internal representation using pseudorapidity.
tuple pfMet
____________________________________________________________________________||
void analyze(edm::Event const &e, edm::EventSetup const &eSetup)
MonitorElement * book1D(Args &&...args)
float segmentCompatibility(const reco::Muon &muon, reco::Muon::ArbitrationType arbitrationType=reco::Muon::SegmentAndTrackArbitration)
virtual double py() const final
y coordinate of momentum vector
void endLuminosityBlock(edm::LuminosityBlock const &lumiSeg, edm::EventSetup const &c)
double Distance(const reco::Candidate &c1, const reco::Candidate &c2)
virtual double pz() const final
z coordinate of momentum vector
bool isGoodMuon(const reco::Muon &muon, SelectionType type, reco::Muon::ArbitrationType arbitrationType=reco::Muon::SegmentAndTrackArbitration)
main GoodMuon wrapper call
double deltaR(double eta1, double eta2, double phi1, double phi2)
double calcDeltaPhi(double phi1, double phi2)
double DistancePhi(const reco::Candidate &c1, const reco::Candidate &c2)
void setCurrentFolder(const std::string &fullpath)
T const * product() const
virtual double p() const final
magnitude of momentum vector
HiggsDQM(const edm::ParameterSet &ps)
std::vector< TrackBaseRef >::const_iterator trackRef_iterator
The iteratator for the vector<TrackRef>
virtual double px() const final
x coordinate of momentum vector
bool operator()(const Candidate &c1, const Candidate &c2) const
void bookHistograms(DQMStore::IBooker &, edm::Run const &, edm::EventSetup const &) override
virtual double pt() const final
transverse momentum
virtual const LorentzVector & p4() const =0
four-momentum Lorentz vector