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 "
131 bei_->setCurrentFolder(
"Physics/Higgs");
134 typedef std::vector<edm::InputTag> vtag;
136 theElecTriggerPathToPass = ps.
getParameter<
string>(
"elecTriggerPathToPass");
137 theMuonTriggerPathToPass = ps.
getParameter<
string>(
"muonTriggerPathToPass");
138 theTriggerResultsCollectionTag_ =
141 theTriggerResultsCollection_ =
142 consumes<edm::TriggerResults>(theTriggerResultsCollectionTag_);
143 theMuonCollectionToken_ = consumes<reco::MuonCollection>(
145 theElectronCollectionToken_ = consumes<reco::GsfElectronCollection>(
147 theCaloJetCollectionToken_ =
148 consumes<reco::CaloJetCollection>(theCaloJetCollectionLabel_);
149 theCaloMETCollectionToken_ = consumes<reco::CaloMETCollection>(
151 thePfMETCollectionToken_ = consumes<reco::PFMETCollection>(
155 "vertexCollection",
InputTag(
"offlinePrimaryVertices")));
158 isValidHltConfig_ =
false;
192 edm::LogInfo(
"HiggsDQM") <<
"[HiggsDQM]: Begining of Run";
194 bool isConfigChanged =
false;
198 const std::string hltProcessName = theTriggerResultsCollectionTag_.process();
200 hltConfigProvider_.init(run, eSetup, hltProcessName, isConfigChanged);
209 edm::LogInfo(
"HiggsDQM") <<
"[HiggsDQM]: Begin of LS transition";
218 bei->setCurrentFolder(
"Physics/Higgs");
220 bei->book1D(
"h_vertex_number",
"Number of event vertices in collection",
222 h_vertex_chi2 = bei->book1D(
"h_vertex_chi2",
"Event Vertex #chi^{2}/n.d.o.f.",
224 h_vertex_numTrks = bei->book1D(
225 "h_vertex_numTrks",
"Event Vertex, number of tracks", 100, -0.5, 99.5);
226 h_vertex_sumTrks = bei->book1D(
227 "h_vertex_sumTrks",
"Event Vertex, sum of track pt", 100, 0.0, 100.0);
228 h_vertex_d0 = bei->book1D(
"h_vertex_d0",
"Event Vertex d0", 100, -10.0, 10.0);
229 h_jet_et = bei->book1D(
"h_jet_et",
"Jet with highest E_{T} (from " +
230 theCaloJetCollectionLabel_.label() +
231 ");E_{T}(1^{st} jet) (GeV)",
233 h_jet2_et = bei->book1D(
"h_jet2_et",
"Jet with 2^{nd} highest E_{T} (from " +
234 theCaloJetCollectionLabel_.label() +
235 ");E_{T}(2^{nd} jet) (GeV)",
237 h_jet_count = bei->book1D(
"h_jet_count",
238 "Number of " + theCaloJetCollectionLabel_.label() +
239 " (E_{T} > 15 GeV);Number of Jets",
241 h_caloMet = bei->book1D(
"h_caloMet",
"Calo Missing E_{T}; GeV", 20, 0.0, 100);
242 h_caloMet_phi = bei->book1D(
243 "h_caloMet_phi",
"Calo Missing E_{T} #phi;#phi(MET)", 35, -3.5, 3.5);
244 h_pfMet = bei->book1D(
"h_pfMet",
"Pf Missing E_{T}; GeV", 20, 0.0, 100);
245 h_pfMet_phi = bei->book1D(
"h_pfMet_phi",
"Pf Missing E_{T} #phi;#phi(MET)",
248 bei_->book1D(
"NElectrons",
"# of electrons per event", 10, 0., 10.);
249 h_mMultiplicity = bei_->book1D(
"NMuons",
"# of muons per event", 10, 0., 10.);
250 h_ePt = bei_->book1D(
"ElePt",
"Pt of electrons", 50, 0., 100.);
251 h_eEta = bei_->book1D(
"EleEta",
"Eta of electrons", 100, -5., 5.);
252 h_ePhi = bei_->book1D(
"ElePhi",
"Phi of electrons", 100, -3.5, 3.5);
254 bei_->book1D(
"MuonPt_GMTM",
"Pt of global+tracker muons", 50, 0., 100.);
256 bei_->book1D(
"MuonEta_GMTM",
"Eta of global+tracker muons", 60, -3., 3.);
257 h_mPhi_GMTM = bei_->book1D(
"MuonPhi_GMTM",
"Phi of global+tracker muons", 70,
259 h_mPt_GMPT = bei_->book1D(
"MuonPt_GMPT",
"Pt of global prompt-tight muons",
261 h_mEta_GMPT = bei_->book1D(
"MuonEta_GMPT",
"Eta of global prompt-tight muons",
263 h_mPhi_GMPT = bei_->book1D(
"MuonPhi_GMPT",
"Phi of global prompt-tight muons",
265 h_mPt_GM = bei_->book1D(
"MuonPt_GM",
"Pt of global muons", 50, 0., 100.);
266 h_mEta_GM = bei_->book1D(
"MuonEta_GM",
"Eta of global muons", 60, -3., 3.);
267 h_mPhi_GM = bei_->book1D(
"MuonPhi_GM",
"Phi of global muons", 70, -3.5, 3.5);
268 h_mPt_TM = bei_->book1D(
"MuonPt_TM",
"Pt of tracker muons", 50, 0., 100.);
269 h_mEta_TM = bei_->book1D(
"MuonEta_TM",
"Eta of tracker muons", 60, -3., 3.);
270 h_mPhi_TM = bei_->book1D(
"MuonPhi_TM",
"Phi of tracker muons", 70, -3.5, 3.5);
271 h_mPt_STAM = bei_->book1D(
"MuonPt_STAM",
"Pt of STA muons", 50, 0., 100.);
272 h_mEta_STAM = bei_->book1D(
"MuonEta_STAM",
"Eta of STA muons", 60, -3., 3.);
273 h_mPhi_STAM = bei_->book1D(
"MuonPhi_STAM",
"Phi of STA muons", 70, -3.5, 3.5);
274 h_eCombIso = bei_->book1D(
"EleCombIso",
"CombIso of electrons", 100, 0., 10.);
275 h_mCombIso = bei_->book1D(
"MuonCombIso",
"CombIso of muons", 100, 0., 10.);
276 h_dimumass_GMGM = bei->book1D(
"DimuMass_GMGM",
"Invariant mass of GMGM pairs",
278 h_dimumass_GMTM = bei->book1D(
"DimuMass_GMTM",
"Invariant mass of GMTM pairs",
280 h_dimumass_TMTM = bei->book1D(
"DimuMass_TMTM",
"Invariant mass of TMTM pairs",
283 bei->book1D(
"DieleMass",
"Invariant mass of EE pairs", 100, 0., 200.);
284 h_lepcounts = bei->book1D(
285 "LeptonCounts",
"LeptonCounts for multi lepton events", 49, 0., 49.);
299 if (!isValidHltConfig_)
return;
302 e.
getByToken(theTriggerResultsCollection_, HLTresults);
303 if (!HLTresults.
isValid())
return;
308 bool passed_electron_HLT =
true;
309 bool passed_muon_HLT =
true;
323 int vertex_number = vertexCollection.size();
324 VertexCollection::const_iterator
v = vertexCollection.begin();
325 double vertex_chi2 = v->normalizedChi2();
326 double vertex_d0 =
sqrt(v->x() * v->x() + v->y() * v->y());
328 double vertex_numTrks = v->tracksSize();
329 double vertex_sumTrks = 0.0;
331 vertex_curTrack != v->tracks_end(); vertex_curTrack++) {
332 vertex_sumTrks += (*vertex_curTrack)->pt();
334 h_vertex_number->Fill(vertex_number);
335 h_vertex_chi2->Fill(vertex_chi2);
336 h_vertex_d0->Fill(vertex_d0);
337 h_vertex_numTrks->Fill(vertex_numTrks);
338 h_vertex_sumTrks->Fill(vertex_sumTrks);
346 e.
getByToken(theElectronCollectionToken_, electronCollection);
347 if (electronCollection.
isValid()) {
348 int posEle = 0, negEle = 0;
351 if (passed_electron_HLT) {
352 for (reco::GsfElectronCollection::const_iterator recoElectron =
353 electronCollection->begin();
354 recoElectron != electronCollection->end(); recoElectron++) {
357 h_ePt->Fill(recoElectron->pt());
358 h_eEta->Fill(recoElectron->eta());
359 h_ePhi->Fill(recoElectron->phi());
360 if (recoElectron->charge() == 1) {
362 }
else if (recoElectron->charge() == -1) {
374 nEle = posEle + negEle;
375 if (nEle > 9.) nEle = 9.;
376 h_eMultiplicity->Fill(nEle);
379 unsigned int eleCollectionSize = electronCollection->size();
380 for (
unsigned int i = 0;
i < eleCollectionSize;
i++) {
382 double pt = ele.
pt();
383 if (pt > ptThrMu1_) {
384 for (
unsigned int j =
i + 1;
j < eleCollectionSize;
j++) {
386 double pt2 = ele2.
pt();
387 if (pt2 > ptThrMu2_) {
389 ele.
px() + ele2.
px(), ele.
py() + ele2.
py(),
390 ele.
pz() + ele2.
pz(), ele.
p() + ele2.
p());
391 h_dielemass->Fill(ZRecoEE.mass());
403 e.
getByToken(theMuonCollectionToken_, muonCollection);
404 if (muonCollection.
isValid()) {
406 int posMu = 0, negMu = 0;
407 TLorentzVector m1, m2;
408 if (passed_muon_HLT) {
409 for (reco::MuonCollection::const_iterator recoMuon =
410 muonCollection->begin();
411 recoMuon != muonCollection->end(); recoMuon++) {
414 if (recoMuon->isGlobalMuon() && recoMuon->isTrackerMuon()) {
415 h_mPt_GMTM->Fill(recoMuon->pt());
416 h_mEta_GMTM->Fill(recoMuon->eta());
417 h_mPhi_GMTM->Fill(recoMuon->phi());
418 }
else if (recoMuon->isGlobalMuon() &&
421 h_mPt_GMPT->Fill(recoMuon->pt());
422 h_mEta_GMPT->Fill(recoMuon->eta());
423 h_mPhi_GMPT->Fill(recoMuon->phi());
424 }
else if (recoMuon->isGlobalMuon()) {
425 h_mPt_GM->Fill(recoMuon->pt());
426 h_mEta_GM->Fill(recoMuon->eta());
427 h_mPhi_GM->Fill(recoMuon->phi());
428 }
else if (recoMuon->isTrackerMuon() &&
431 h_mPt_TM->Fill(recoMuon->pt());
432 h_mEta_TM->Fill(recoMuon->eta());
433 h_mPhi_TM->Fill(recoMuon->phi());
434 }
else if (recoMuon->isStandAloneMuon()) {
435 h_mPt_STAM->Fill(recoMuon->pt());
436 h_mEta_STAM->Fill(recoMuon->eta());
437 h_mPhi_STAM->Fill(recoMuon->phi());
439 if (recoMuon->charge() == 1) {
441 }
else if (recoMuon->charge() == -1) {
446 if (nMu > 9.) nMu = 9.;
447 h_mMultiplicity->Fill(nMu);
451 unsigned int muonCollectionSize = muonCollection->size();
452 for (
unsigned int i = 0;
i < muonCollectionSize;
i++) {
453 const Muon&
mu = muonCollection->at(
i);
456 if (pt > ptThrMu1_) {
457 for (
unsigned int j =
i + 1;
j < muonCollectionSize;
j++) {
458 const Muon& mu2 = muonCollection->at(
j);
459 double pt2 = mu2.
pt();
460 if (pt2 > ptThrMu2_) {
464 mu.
px() + mu2.
px(), mu.
py() + mu2.
py(), mu.
pz() + mu2.
pz(),
466 h_dimumass_GMGM->Fill(ZRecoGMGM.mass());
471 mu.
px() + mu2.
px(), mu.
py() + mu2.
py(), mu.
pz() + mu2.
pz(),
473 h_dimumass_GMTM->Fill(ZRecoGMTM.mass());
478 mu.
px() + mu2.
px(), mu.
py() + mu2.
py(), mu.
pz() + mu2.
pz(),
480 h_dimumass_TMTM->Fill(ZRecoTMTM.mass());
492 e.
getByToken(theCaloJetCollectionToken_, caloJetCollection);
493 if (caloJetCollection.
isValid()) {
498 float jet2_et = -9.0;
501 for (CaloJetCollection::const_iterator i_calojet =
502 caloJetCollection->begin();
503 i_calojet != caloJetCollection->end(); i_calojet++) {
504 float jet_current_et = i_calojet->et();
511 if (jet_current_et < 15)
continue;
513 if (jet_current_et > jet_et) {
517 jet_et = i_calojet->et();
521 }
else if (jet_current_et > jet2_et) {
522 jet2_et = i_calojet->et();
528 h_jet_et->Fill(jet_et);
529 h_jet_count->Fill(jet_count);
537 e.
getByToken(theCaloMETCollectionToken_, caloMETCollection);
538 if (caloMETCollection.
isValid()) {
539 float caloMet = caloMETCollection->begin()->et();
540 float caloMet_phi = caloMETCollection->begin()->phi();
541 h_caloMet->Fill(caloMet);
542 h_caloMet_phi->Fill(caloMet_phi);
545 e.
getByToken(thePfMETCollectionToken_, pfMETCollection);
546 if (pfMETCollection.
isValid()) {
547 float pfMet = pfMETCollection->begin()->et();
548 float pfMet_phi = pfMETCollection->begin()->phi();
549 h_pfMet->Fill(pfMet);
550 h_pfMet_phi->Fill(pfMet_phi);
556 if (nMu + nEle > 2 && nMu + nEle < 10) {
557 if (nMu == 0 && nEle == 3) h_lepcounts->Fill(0);
558 if (nMu == 0 && nEle == 4) h_lepcounts->Fill(1);
559 if (nMu == 0 && nEle == 5) h_lepcounts->Fill(2);
560 if (nMu == 0 && nEle == 6) h_lepcounts->Fill(3);
561 if (nMu == 0 && nEle == 7) h_lepcounts->Fill(4);
562 if (nMu == 0 && nEle == 8) h_lepcounts->Fill(5);
563 if (nMu == 0 && nEle == 9) h_lepcounts->Fill(6);
564 if (nMu == 1 && nEle == 2) h_lepcounts->Fill(7);
565 if (nMu == 1 && nEle == 3) h_lepcounts->Fill(8);
566 if (nMu == 1 && nEle == 4) h_lepcounts->Fill(9);
567 if (nMu == 1 && nEle == 5) h_lepcounts->Fill(10);
568 if (nMu == 1 && nEle == 6) h_lepcounts->Fill(11);
569 if (nMu == 1 && nEle == 7) h_lepcounts->Fill(12);
570 if (nMu == 1 && nEle == 8) h_lepcounts->Fill(13);
571 if (nMu == 2 && nEle == 1) h_lepcounts->Fill(14);
572 if (nMu == 2 && nEle == 2) h_lepcounts->Fill(15);
573 if (nMu == 2 && nEle == 3) h_lepcounts->Fill(16);
574 if (nMu == 2 && nEle == 4) h_lepcounts->Fill(17);
575 if (nMu == 2 && nEle == 5) h_lepcounts->Fill(18);
576 if (nMu == 2 && nEle == 6) h_lepcounts->Fill(19);
577 if (nMu == 2 && nEle == 7) h_lepcounts->Fill(20);
578 if (nMu == 3 && nEle == 0) h_lepcounts->Fill(21);
579 if (nMu == 3 && nEle == 1) h_lepcounts->Fill(22);
580 if (nMu == 3 && nEle == 2) h_lepcounts->Fill(23);
581 if (nMu == 3 && nEle == 3) h_lepcounts->Fill(24);
582 if (nMu == 3 && nEle == 4) h_lepcounts->Fill(25);
583 if (nMu == 3 && nEle == 5) h_lepcounts->Fill(26);
584 if (nMu == 3 && nEle == 6) h_lepcounts->Fill(27);
585 if (nMu == 4 && nEle == 0) h_lepcounts->Fill(28);
586 if (nMu == 4 && nEle == 1) h_lepcounts->Fill(29);
587 if (nMu == 4 && nEle == 2) h_lepcounts->Fill(30);
588 if (nMu == 4 && nEle == 3) h_lepcounts->Fill(31);
589 if (nMu == 4 && nEle == 4) h_lepcounts->Fill(32);
590 if (nMu == 4 && nEle == 5) h_lepcounts->Fill(33);
591 if (nMu == 5 && nEle == 0) h_lepcounts->Fill(34);
592 if (nMu == 5 && nEle == 1) h_lepcounts->Fill(35);
593 if (nMu == 5 && nEle == 2) h_lepcounts->Fill(36);
594 if (nMu == 5 && nEle == 3) h_lepcounts->Fill(37);
595 if (nMu == 5 && nEle == 4) h_lepcounts->Fill(38);
596 if (nMu == 6 && nEle == 0) h_lepcounts->Fill(39);
597 if (nMu == 6 && nEle == 1) h_lepcounts->Fill(40);
598 if (nMu == 6 && nEle == 2) h_lepcounts->Fill(41);
599 if (nMu == 6 && nEle == 3) h_lepcounts->Fill(42);
600 if (nMu == 7 && nEle == 0) h_lepcounts->Fill(43);
601 if (nMu == 7 && nEle == 1) h_lepcounts->Fill(44);
602 if (nMu == 7 && nEle == 2) h_lepcounts->Fill(45);
603 if (nMu == 8 && nEle == 0) h_lepcounts->Fill(46);
604 if (nMu == 8 && nEle == 1) h_lepcounts->Fill(47);
605 if (nMu == 9 && nEle == 0) h_lepcounts->Fill(48);
607 if ((nMu + nEle) >= 10)
608 LogDebug(
"HiggsDQM") <<
"WARNING: " << nMu + nEle
609 <<
" leptons in this event: run=" << e.
id().
run()
610 <<
", event=" << e.
id().
event() <<
"\n";
619 edm::LogInfo(
"HiggsDQM") <<
"[HiggsDQM]: End of LS transition, performing "
620 "the DQM client operation";
626 <<
"====================================================== " << endl
627 <<
" ===> Iteration # " << nLumiSecs_ <<
" " << lumiSeg.
luminosityBlock()
629 <<
"====================================================== " << endl;
651 edm::LogInfo(
"HiggsDQM") <<
"[HiggsDQM]: endjob called!";
T getParameter(std::string const &) const
EventNumber_t event() const
T getUntrackedParameter(std::string const &, T const &) const
void beginRun(edm::Run const &run, edm::EventSetup const &eSetup)
virtual double p() const GCC11_FINAL
magnitude of momentum vector
tuple caloMet
____________________________________________________________________________||
bool getByToken(EDGetToken token, Handle< PROD > &result) const
bool isTrackerMuon() const
bool isGlobalMuon() const
std::vector< Vertex > VertexCollection
collection of Vertex objects
virtual double pz() const GCC11_FINAL
z coordinate of momentum vector
virtual double py() const GCC11_FINAL
y coordinate of momentum vector
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.
virtual float pt() const =0
transverse momentum
tuple pfMet
____________________________________________________________________________||
void analyze(edm::Event const &e, edm::EventSetup const &eSetup)
virtual double px() const GCC11_FINAL
x coordinate of momentum vector
float segmentCompatibility(const reco::Muon &muon, reco::Muon::ArbitrationType arbitrationType=reco::Muon::SegmentAndTrackArbitration)
void endLuminosityBlock(edm::LuminosityBlock const &lumiSeg, edm::EventSetup const &c)
double Distance(const reco::Candidate &c1, const reco::Candidate &c2)
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)
T const * product() const
HiggsDQM(const edm::ParameterSet &ps)
std::vector< TrackBaseRef >::const_iterator trackRef_iterator
The iteratator for the vector<TrackRef>
void bookHistos(DQMStore *bei)
bool operator()(const Candidate &c1, const Candidate &c2) const
virtual float pt() const GCC11_FINAL
transverse momentum
virtual const LorentzVector & p4() const =0
four-momentum Lorentz vector