81 #include "TLorentzVector.h"
96 return c1.
pt() > c2.
pt();
112 if (deltaPhi < 0) deltaPhi = -
deltaPhi;
113 if (deltaPhi > 3.1415926) {
114 deltaPhi = 2 * 3.1415926 -
deltaPhi;
125 edm::LogInfo(
"HZZ4LeptonsDQM") <<
" Creating HZZ4LeptonsDQM " <<
"\n" ;
128 bei_->setCurrentFolder(
"Physics/Higgs");
131 typedef std::vector<edm::InputTag> vtag;
133 theElecTriggerPathToPass = ps.
getParameter<
string>(
"elecTriggerPathToPass");
134 theMuonTriggerPathToPass = ps.
getParameter<
string>(
"muonTriggerPathToPass");
137 theTriggerResultsCollection_ = consumes<edm::TriggerResults>(
138 theTriggerResultsCollectionTag_);
139 theMuonCollectionToken_ = consumes<reco::MuonCollection>(
141 theElectronCollectionToken_ = consumes<reco::GsfElectronCollection>(
143 theCaloJetCollectionToken_ = consumes<reco::CaloJetCollection>(
144 theCaloJetCollectionLabel_);
145 theCaloMETCollectionToken_ = consumes<reco::CaloMETCollection>(
147 thePfMETCollectionToken_ = consumes<reco::PFMETCollection>(
149 vertexToken_ = consumes<reco::VertexCollection>(
153 isValidHltConfig_ =
false;
168 edm::LogInfo(
"HiggsDQM") <<
" Deleting HiggsDQM " <<
"\n" ;
189 edm::LogInfo (
"HiggsDQM") <<
"[HiggsDQM]: Begining of Run";
191 bool isConfigChanged =
false;
195 const std::string hltProcessName = theTriggerResultsCollectionTag_.process();
196 isValidHltConfig_ = hltConfigProvider_.init( run, eSetup, hltProcessName, isConfigChanged );
206 edm::LogInfo (
"HiggsDQM") <<
"[HiggsDQM]: Begin of LS transition";
216 h_vertex_number = bei->
book1D(
"h_vertex_number",
"Number of event vertices in collection", 10,-0.5, 9.5 );
217 h_vertex_chi2 = bei->
book1D(
"h_vertex_chi2" ,
"Event Vertex #chi^{2}/n.d.o.f." , 100, 0.0, 2.0 );
218 h_vertex_numTrks = bei->
book1D(
"h_vertex_numTrks",
"Event Vertex, number of tracks" , 100, -0.5, 99.5 );
219 h_vertex_sumTrks = bei->
book1D(
"h_vertex_sumTrks",
"Event Vertex, sum of track pt" , 100, 0.0, 100.0 );
220 h_vertex_d0 = bei->
book1D(
"h_vertex_d0" ,
"Event Vertex d0" , 100, -10.0, 10.0);
221 h_jet_et = bei->
book1D(
"h_jet_et",
"Jet with highest E_{T} (from "+theCaloJetCollectionLabel_.label()+
");E_{T}(1^{st} jet) (GeV)", 20, 0., 200.0);
222 h_jet2_et = bei->
book1D(
"h_jet2_et",
"Jet with 2^{nd} highest E_{T} (from "+theCaloJetCollectionLabel_.label()+
");E_{T}(2^{nd} jet) (GeV)", 20, 0., 200.0);
223 h_jet_count = bei->
book1D(
"h_jet_count",
"Number of "+theCaloJetCollectionLabel_.label()+
" (E_{T} > 15 GeV);Number of Jets", 8, -0.5, 7.5);
224 h_caloMet = bei->
book1D(
"h_caloMet",
"Calo Missing E_{T}; GeV" , 20, 0.0 , 100);
225 h_caloMet_phi = bei->
book1D(
"h_caloMet_phi",
"Calo Missing E_{T} #phi;#phi(MET)", 35, -3.5, 3.5 );
226 h_pfMet = bei->
book1D(
"h_pfMet",
"Pf Missing E_{T}; GeV" , 20, 0.0 , 100);
227 h_pfMet_phi = bei->
book1D(
"h_pfMet_phi",
"Pf Missing E_{T} #phi;#phi(MET)", 35, -3.5, 3.5 );
228 h_eMultiplicity = bei_->book1D(
"NElectrons",
"# of electrons per event",10,0.,10.);
229 h_mMultiplicity = bei_->book1D(
"NMuons",
"# of muons per event",10,0.,10.);
230 h_ePt = bei_->book1D(
"ElePt",
"Pt of electrons",50,0.,100.);
231 h_eEta = bei_->book1D(
"EleEta",
"Eta of electrons",100,-5.,5.);
232 h_ePhi = bei_->book1D(
"ElePhi",
"Phi of electrons",100,-3.5,3.5);
233 h_mPt_GMTM = bei_->book1D(
"MuonPt_GMTM",
"Pt of global+tracker muons",50,0.,100.);
234 h_mEta_GMTM = bei_->book1D(
"MuonEta_GMTM",
"Eta of global+tracker muons",60,-3.,3.);
235 h_mPhi_GMTM = bei_->book1D(
"MuonPhi_GMTM",
"Phi of global+tracker muons",70,-3.5,3.5);
236 h_mPt_GMPT = bei_->book1D(
"MuonPt_GMPT",
"Pt of global prompt-tight muons",50,0.,100.);
237 h_mEta_GMPT = bei_->book1D(
"MuonEta_GMPT",
"Eta of global prompt-tight muons",60,-3.,3.);
238 h_mPhi_GMPT = bei_->book1D(
"MuonPhi_GMPT",
"Phi of global prompt-tight muons",70,-3.5,3.5);
239 h_mPt_GM = bei_->book1D(
"MuonPt_GM",
"Pt of global muons",50,0.,100.);
240 h_mEta_GM = bei_->book1D(
"MuonEta_GM",
"Eta of global muons",60,-3.,3.);
241 h_mPhi_GM = bei_->book1D(
"MuonPhi_GM",
"Phi of global muons",70,-3.5,3.5);
242 h_mPt_TM = bei_->book1D(
"MuonPt_TM",
"Pt of tracker muons",50,0.,100.);
243 h_mEta_TM = bei_->book1D(
"MuonEta_TM",
"Eta of tracker muons",60,-3.,3.);
244 h_mPhi_TM = bei_->book1D(
"MuonPhi_TM",
"Phi of tracker muons",70,-3.5,3.5);
245 h_mPt_STAM = bei_->book1D(
"MuonPt_STAM",
"Pt of STA muons",50,0.,100.);
246 h_mEta_STAM = bei_->book1D(
"MuonEta_STAM",
"Eta of STA muons",60,-3.,3.);
247 h_mPhi_STAM = bei_->book1D(
"MuonPhi_STAM",
"Phi of STA muons",70,-3.5,3.5);
248 h_eCombIso = bei_->book1D(
"EleCombIso",
"CombIso of electrons",100,0.,10.);
249 h_mCombIso = bei_->book1D(
"MuonCombIso",
"CombIso of muons",100,0.,10.);
250 h_dimumass_GMGM = bei->
book1D(
"DimuMass_GMGM",
"Invariant mass of GMGM pairs",100,0.,200.);
251 h_dimumass_GMTM = bei->
book1D(
"DimuMass_GMTM",
"Invariant mass of GMTM pairs",100,0.,200.);
252 h_dimumass_TMTM = bei->
book1D(
"DimuMass_TMTM",
"Invariant mass of TMTM pairs",100,0.,200.);
253 h_dielemass = bei->
book1D(
"DieleMass",
"Invariant mass of EE pairs",100,0.,200.);
254 h_lepcounts = bei->
book1D(
"LeptonCounts",
"LeptonCounts for multi lepton events",49,0.,49.);
269 if( ! isValidHltConfig_ )
return;
272 e.
getByToken(theTriggerResultsCollection_, HLTresults);
273 if ( !HLTresults.
isValid() )
return;
276 bool passed_electron_HLT =
true;
277 bool passed_muon_HLT =
true;
289 int vertex_number = vertexCollection.size();
290 VertexCollection::const_iterator
v = vertexCollection.begin();
291 double vertex_chi2 = v->normalizedChi2();
292 double vertex_d0 =
sqrt(v->x()*v->x()+v->y()*v->y());
294 double vertex_numTrks = v->tracksSize();
295 double vertex_sumTrks = 0.0;
296 for (
Vertex::trackRef_iterator vertex_curTrack = v->tracks_begin(); vertex_curTrack!=v->tracks_end(); vertex_curTrack++) {
297 vertex_sumTrks += (*vertex_curTrack)->pt();
299 h_vertex_number->Fill(vertex_number);
300 h_vertex_chi2->Fill(vertex_chi2);
301 h_vertex_d0 ->Fill(vertex_d0);
302 h_vertex_numTrks->Fill(vertex_numTrks);
303 h_vertex_sumTrks->Fill(vertex_sumTrks);
311 e.
getByToken(theElectronCollectionToken_, electronCollection);
312 if ( electronCollection.
isValid() ){
313 int posEle=0,negEle=0;
315 if( passed_electron_HLT ) {
316 for (reco::GsfElectronCollection::const_iterator recoElectron=electronCollection->begin(); recoElectron!=electronCollection->end(); recoElectron++){
318 h_ePt->Fill(recoElectron->pt());
319 h_eEta->Fill(recoElectron->eta());
320 h_ePhi->Fill(recoElectron->phi());
321 if(recoElectron->charge()==1){
323 }
else if(recoElectron->charge()==-1){
334 nEle = posEle+negEle;
if(nEle>9.) nEle=9.;
335 h_eMultiplicity->Fill(nEle);
338 unsigned int eleCollectionSize = electronCollection->size();
339 for(
unsigned int i=0;
i<eleCollectionSize;
i++) {
341 double pt = ele.
pt();
343 for(
unsigned int j=
i+1;
j<eleCollectionSize;
j++) {
345 double pt2 = ele2.
pt();
348 h_dielemass->Fill(ZRecoEE.mass());
362 e.
getByToken(theMuonCollectionToken_, muonCollection);
363 if ( muonCollection.
isValid() ){
366 TLorentzVector m1, m2;
367 if( passed_muon_HLT ) {
368 for (reco::MuonCollection::const_iterator recoMuon=muonCollection->begin(); recoMuon!=muonCollection->end(); recoMuon++){
370 if(recoMuon->isGlobalMuon()&&recoMuon->isTrackerMuon()){
371 h_mPt_GMTM->Fill(recoMuon->pt());
372 h_mEta_GMTM->Fill(recoMuon->eta());
373 h_mPhi_GMTM->Fill(recoMuon->phi());
375 h_mPt_GMPT->Fill(recoMuon->pt());
376 h_mEta_GMPT->Fill(recoMuon->eta());
377 h_mPhi_GMPT->Fill(recoMuon->phi());
378 }
else if(recoMuon->isGlobalMuon()){
379 h_mPt_GM->Fill(recoMuon->pt());
380 h_mEta_GM->Fill(recoMuon->eta());
381 h_mPhi_GM->Fill(recoMuon->phi());
383 h_mPt_TM->Fill(recoMuon->pt());
384 h_mEta_TM->Fill(recoMuon->eta());
385 h_mPhi_TM->Fill(recoMuon->phi());
386 }
else if(recoMuon->isStandAloneMuon()){
387 h_mPt_STAM->Fill(recoMuon->pt());
388 h_mEta_STAM->Fill(recoMuon->eta());
389 h_mPhi_STAM->Fill(recoMuon->phi());
391 if ( recoMuon->charge()==1 ){
393 }
else if ( recoMuon->charge()==-1 ){
397 nMu = posMu+negMu;
if(nMu>9.) nMu=9.;
398 h_mMultiplicity->Fill(nMu);
402 unsigned int muonCollectionSize = muonCollection->size();
403 for(
unsigned int i=0;
i<muonCollectionSize;
i++) {
404 const Muon&
mu = muonCollection->at(
i);
408 for(
unsigned int j=
i+1;
j<muonCollectionSize;
j++) {
409 const Muon& mu2 = muonCollection->at(
j);
410 double pt2 = mu2.
pt();
415 h_dimumass_GMGM->Fill(ZRecoGMGM.mass());
420 h_dimumass_GMTM->Fill(ZRecoGMTM.mass());
425 h_dimumass_TMTM->Fill(ZRecoTMTM.mass());
437 e.
getByToken(theCaloJetCollectionToken_, caloJetCollection);
438 if ( caloJetCollection.
isValid() ){
443 float jet2_et = -9.0;
446 for (CaloJetCollection::const_iterator i_calojet = caloJetCollection->begin(); i_calojet != caloJetCollection->end(); i_calojet++) {
447 float jet_current_et = i_calojet->et();
452 if (jet_current_et < 15)
continue;
454 if (jet_current_et > jet_et) {
458 jet_et = i_calojet->et();
461 }
else if (jet_current_et > jet2_et) {
462 jet2_et = i_calojet->et();
468 h_jet_et ->Fill(jet_et);
469 h_jet_count->Fill(jet_count);
477 e.
getByToken(theCaloMETCollectionToken_, caloMETCollection);
478 if ( caloMETCollection.
isValid() ){
479 float caloMet = caloMETCollection->begin()->et();
480 float caloMet_phi = caloMETCollection->begin()->phi();
481 h_caloMet ->Fill(caloMet);
482 h_caloMet_phi ->Fill(caloMet_phi);
485 e.
getByToken(thePfMETCollectionToken_, pfMETCollection);
486 if ( pfMETCollection.
isValid() ){
487 float pfMet = pfMETCollection->begin()->et();
488 float pfMet_phi = pfMETCollection->begin()->phi();
489 h_pfMet ->Fill(pfMet);
490 h_pfMet_phi ->Fill(pfMet_phi);
496 if(nMu+nEle > 2 && nMu+nEle < 10){
497 if(nMu==0 && nEle==3) h_lepcounts->Fill(0);
498 if(nMu==0 && nEle==4) h_lepcounts->Fill(1);
499 if(nMu==0 && nEle==5) h_lepcounts->Fill(2);
500 if(nMu==0 && nEle==6) h_lepcounts->Fill(3);
501 if(nMu==0 && nEle==7) h_lepcounts->Fill(4);
502 if(nMu==0 && nEle==8) h_lepcounts->Fill(5);
503 if(nMu==0 && nEle==9) h_lepcounts->Fill(6);
504 if(nMu==1 && nEle==2) h_lepcounts->Fill(7);
505 if(nMu==1 && nEle==3) h_lepcounts->Fill(8);
506 if(nMu==1 && nEle==4) h_lepcounts->Fill(9);
507 if(nMu==1 && nEle==5) h_lepcounts->Fill(10);
508 if(nMu==1 && nEle==6) h_lepcounts->Fill(11);
509 if(nMu==1 && nEle==7) h_lepcounts->Fill(12);
510 if(nMu==1 && nEle==8) h_lepcounts->Fill(13);
511 if(nMu==2 && nEle==1) h_lepcounts->Fill(14);
512 if(nMu==2 && nEle==2) h_lepcounts->Fill(15);
513 if(nMu==2 && nEle==3) h_lepcounts->Fill(16);
514 if(nMu==2 && nEle==4) h_lepcounts->Fill(17);
515 if(nMu==2 && nEle==5) h_lepcounts->Fill(18);
516 if(nMu==2 && nEle==6) h_lepcounts->Fill(19);
517 if(nMu==2 && nEle==7) h_lepcounts->Fill(20);
518 if(nMu==3 && nEle==0) h_lepcounts->Fill(21);
519 if(nMu==3 && nEle==1) h_lepcounts->Fill(22);
520 if(nMu==3 && nEle==2) h_lepcounts->Fill(23);
521 if(nMu==3 && nEle==3) h_lepcounts->Fill(24);
522 if(nMu==3 && nEle==4) h_lepcounts->Fill(25);
523 if(nMu==3 && nEle==5) h_lepcounts->Fill(26);
524 if(nMu==3 && nEle==6) h_lepcounts->Fill(27);
525 if(nMu==4 && nEle==0) h_lepcounts->Fill(28);
526 if(nMu==4 && nEle==1) h_lepcounts->Fill(29);
527 if(nMu==4 && nEle==2) h_lepcounts->Fill(30);
528 if(nMu==4 && nEle==3) h_lepcounts->Fill(31);
529 if(nMu==4 && nEle==4) h_lepcounts->Fill(32);
530 if(nMu==4 && nEle==5) h_lepcounts->Fill(33);
531 if(nMu==5 && nEle==0) h_lepcounts->Fill(34);
532 if(nMu==5 && nEle==1) h_lepcounts->Fill(35);
533 if(nMu==5 && nEle==2) h_lepcounts->Fill(36);
534 if(nMu==5 && nEle==3) h_lepcounts->Fill(37);
535 if(nMu==5 && nEle==4) h_lepcounts->Fill(38);
536 if(nMu==6 && nEle==0) h_lepcounts->Fill(39);
537 if(nMu==6 && nEle==1) h_lepcounts->Fill(40);
538 if(nMu==6 && nEle==2) h_lepcounts->Fill(41);
539 if(nMu==6 && nEle==3) h_lepcounts->Fill(42);
540 if(nMu==7 && nEle==0) h_lepcounts->Fill(43);
541 if(nMu==7 && nEle==1) h_lepcounts->Fill(44);
542 if(nMu==7 && nEle==2) h_lepcounts->Fill(45);
543 if(nMu==8 && nEle==0) h_lepcounts->Fill(46);
544 if(nMu==8 && nEle==1) h_lepcounts->Fill(47);
545 if(nMu==9 && nEle==0) h_lepcounts->Fill(48);
549 if ((nMu+nEle) >= 10)
550 LogDebug(
"HiggsDQM") <<
"WARNING: "<<nMu+nEle<<
" leptons in this event: run="<<e.
id().
run()<<
", event="<<e.
id().
event()<<
"\n";
558 edm::LogInfo (
"HiggsDQM") <<
"[HiggsDQM]: End of LS transition, performing the DQM client operation";
563 edm::LogInfo(
"HiggsDQM") <<
"====================================================== " << endl <<
" ===> Iteration # " << nLumiSecs_ <<
" " << lumiSeg.
luminosityBlock() << endl <<
"====================================================== " << endl;
584 edm::LogInfo(
"HiggsDQM") <<
"[HiggsDQM]: endjob called!";
T getParameter(std::string const &) const
EventNumber_t event() const
T getUntrackedParameter(std::string const &, T const &) const
virtual double p() const
magnitude of momentum vector
void beginRun(edm::Run const &run, edm::EventSetup const &eSetup)
virtual float pt() const
transverse momentum
MonitorElement * book1D(const char *name, const char *title, int nchX, double lowX, double highX)
Book 1D histogram.
bool getByToken(EDGetToken token, Handle< PROD > &result) const
void cd(void)
go to top directory (ie. root)
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.
virtual float pt() const =0
transverse momentum
tuple pfMet
____________________________________________________________________________||
void analyze(edm::Event const &e, edm::EventSetup const &eSetup)
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)
virtual double px() const
x coordinate of momentum vector
T const * product() const
virtual double pz() const
z coordinate of momentum vector
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 double py() const
y coordinate of momentum vector
void setCurrentFolder(const std::string &fullpath)
virtual const LorentzVector & p4() const =0
four-momentum Lorentz vector