88 #include "TLorentzVector.h"
103 return c1.
pt() > c2.
pt();
119 if (deltaPhi < 0) deltaPhi = -
deltaPhi;
120 if (deltaPhi > 3.1415926) {
121 deltaPhi = 2 * 3.1415926 -
deltaPhi;
132 edm::LogInfo(
"HZZ4LeptonsDQM") <<
" Creating HZZ4LeptonsDQM " <<
"\n" ;
134 typedef std::vector<edm::InputTag> vtag;
136 theElecTriggerPathToPass = ps.
getParameter<
string>(
"elecTriggerPathToPass");
137 theMuonTriggerPathToPass = ps.
getParameter<
string>(
"muonTriggerPathToPass");
145 isValidHltConfig_ =
false;
160 edm::LogInfo(
"HiggsDQM") <<
" Deleting HiggsDQM " <<
"\n" ;
172 bei_->setCurrentFolder(
"Physics/Higgs");
183 edm::LogInfo (
"HiggsDQM") <<
"[HiggsDQM]: Begining of Run";
185 bool isConfigChanged =
false;
189 const std::string hltProcessName = theTriggerResultsCollection.process();
190 isValidHltConfig_ = hltConfigProvider_.init( run, eSetup, hltProcessName, isConfigChanged );
200 edm::LogInfo (
"HiggsDQM") <<
"[HiggsDQM]: Begin of LS transition";
210 h_vertex_number = bei->
book1D(
"h_vertex_number",
"Number of event vertices in collection", 10,-0.5, 9.5 );
211 h_vertex_chi2 = bei->
book1D(
"h_vertex_chi2" ,
"Event Vertex #chi^{2}/n.d.o.f." , 100, 0.0, 2.0 );
212 h_vertex_numTrks = bei->
book1D(
"h_vertex_numTrks",
"Event Vertex, number of tracks" , 100, -0.5, 99.5 );
213 h_vertex_sumTrks = bei->
book1D(
"h_vertex_sumTrks",
"Event Vertex, sum of track pt" , 100, 0.0, 100.0 );
214 h_vertex_d0 = bei->
book1D(
"h_vertex_d0" ,
"Event Vertex d0" , 100, -10.0, 10.0);
215 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);
216 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);
217 h_jet_count = bei->
book1D(
"h_jet_count",
"Number of "+theCaloJetCollectionLabel.label()+
" (E_{T} > 15 GeV);Number of Jets", 8, -0.5, 7.5);
218 h_caloMet = bei->
book1D(
"h_caloMet",
"Calo Missing E_{T}; GeV" , 20, 0.0 , 100);
219 h_caloMet_phi = bei->
book1D(
"h_caloMet_phi",
"Calo Missing E_{T} #phi;#phi(MET)", 35, -3.5, 3.5 );
220 h_pfMet = bei->
book1D(
"h_pfMet",
"Pf Missing E_{T}; GeV" , 20, 0.0 , 100);
221 h_pfMet_phi = bei->
book1D(
"h_pfMet_phi",
"Pf Missing E_{T} #phi;#phi(MET)", 35, -3.5, 3.5 );
222 h_eMultiplicity = bei_->book1D(
"NElectrons",
"# of electrons per event",10,0.,10.);
223 h_mMultiplicity = bei_->book1D(
"NMuons",
"# of muons per event",10,0.,10.);
224 h_ePt = bei_->book1D(
"ElePt",
"Pt of electrons",50,0.,100.);
225 h_eEta = bei_->book1D(
"EleEta",
"Eta of electrons",100,-5.,5.);
226 h_ePhi = bei_->book1D(
"ElePhi",
"Phi of electrons",100,-3.5,3.5);
227 h_mPt_GMTM = bei_->book1D(
"MuonPt_GMTM",
"Pt of global+tracker muons",50,0.,100.);
228 h_mEta_GMTM = bei_->book1D(
"MuonEta_GMTM",
"Eta of global+tracker muons",60,-3.,3.);
229 h_mPhi_GMTM = bei_->book1D(
"MuonPhi_GMTM",
"Phi of global+tracker muons",70,-3.5,3.5);
230 h_mPt_GMPT = bei_->book1D(
"MuonPt_GMPT",
"Pt of global prompt-tight muons",50,0.,100.);
231 h_mEta_GMPT = bei_->book1D(
"MuonEta_GMPT",
"Eta of global prompt-tight muons",60,-3.,3.);
232 h_mPhi_GMPT = bei_->book1D(
"MuonPhi_GMPT",
"Phi of global prompt-tight muons",70,-3.5,3.5);
233 h_mPt_GM = bei_->book1D(
"MuonPt_GM",
"Pt of global muons",50,0.,100.);
234 h_mEta_GM = bei_->book1D(
"MuonEta_GM",
"Eta of global muons",60,-3.,3.);
235 h_mPhi_GM = bei_->book1D(
"MuonPhi_GM",
"Phi of global muons",70,-3.5,3.5);
236 h_mPt_TM = bei_->book1D(
"MuonPt_TM",
"Pt of tracker muons",50,0.,100.);
237 h_mEta_TM = bei_->book1D(
"MuonEta_TM",
"Eta of tracker muons",60,-3.,3.);
238 h_mPhi_TM = bei_->book1D(
"MuonPhi_TM",
"Phi of tracker muons",70,-3.5,3.5);
239 h_mPt_STAM = bei_->book1D(
"MuonPt_STAM",
"Pt of STA muons",50,0.,100.);
240 h_mEta_STAM = bei_->book1D(
"MuonEta_STAM",
"Eta of STA muons",60,-3.,3.);
241 h_mPhi_STAM = bei_->book1D(
"MuonPhi_STAM",
"Phi of STA muons",70,-3.5,3.5);
242 h_eCombIso = bei_->book1D(
"EleCombIso",
"CombIso of electrons",100,0.,10.);
243 h_mCombIso = bei_->book1D(
"MuonCombIso",
"CombIso of muons",100,0.,10.);
244 h_dimumass_GMGM = bei->
book1D(
"DimuMass_GMGM",
"Invariant mass of GMGM pairs",100,0.,200.);
245 h_dimumass_GMTM = bei->
book1D(
"DimuMass_GMTM",
"Invariant mass of GMTM pairs",100,0.,200.);
246 h_dimumass_TMTM = bei->
book1D(
"DimuMass_TMTM",
"Invariant mass of TMTM pairs",100,0.,200.);
247 h_dielemass = bei->
book1D(
"DieleMass",
"Invariant mass of EE pairs",100,0.,200.);
248 h_lepcounts = bei->
book1D(
"LeptonCounts",
"LeptonCounts for multi lepton events",49,0.,49.);
263 if( ! isValidHltConfig_ )
return;
266 e.
getByLabel(theTriggerResultsCollection, HLTresults);
267 if ( !HLTresults.
isValid() )
return;
270 bool passed_electron_HLT =
true;
271 bool passed_muon_HLT =
true;
280 e.
getByLabel(
"offlinePrimaryVertices", vertexHandle);
283 int vertex_number = vertexCollection.size();
284 VertexCollection::const_iterator
v = vertexCollection.begin();
285 double vertex_chi2 = v->normalizedChi2();
286 double vertex_d0 =
sqrt(v->x()*v->x()+v->y()*v->y());
288 double vertex_numTrks = v->tracksSize();
289 double vertex_sumTrks = 0.0;
290 for (
Vertex::trackRef_iterator vertex_curTrack = v->tracks_begin(); vertex_curTrack!=v->tracks_end(); vertex_curTrack++) {
291 vertex_sumTrks += (*vertex_curTrack)->pt();
293 h_vertex_number->Fill(vertex_number);
294 h_vertex_chi2->Fill(vertex_chi2);
295 h_vertex_d0 ->Fill(vertex_d0);
296 h_vertex_numTrks->Fill(vertex_numTrks);
297 h_vertex_sumTrks->Fill(vertex_sumTrks);
305 e.
getByLabel(theElectronCollectionLabel, electronCollection);
306 if ( electronCollection.
isValid() ){
307 int posEle=0,negEle=0;
309 if( passed_electron_HLT ) {
310 for (reco::GsfElectronCollection::const_iterator recoElectron=electronCollection->begin(); 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){
328 nEle = posEle+negEle;
if(nEle>9.) nEle=9.;
329 h_eMultiplicity->Fill(nEle);
332 unsigned int eleCollectionSize = electronCollection->size();
333 for(
unsigned int i=0;
i<eleCollectionSize;
i++) {
335 double pt = ele.
pt();
337 for(
unsigned int j=
i+1;
j<eleCollectionSize;
j++) {
339 double pt2 = ele2.
pt();
342 h_dielemass->Fill(ZRecoEE.mass());
356 e.
getByLabel(theMuonCollectionLabel,muonCollection);
357 if ( muonCollection.
isValid() ){
360 TLorentzVector m1, m2;
361 if( passed_muon_HLT ) {
362 for (reco::MuonCollection::const_iterator recoMuon=muonCollection->begin(); recoMuon!=muonCollection->end(); recoMuon++){
364 if(recoMuon->isGlobalMuon()&&recoMuon->isTrackerMuon()){
365 h_mPt_GMTM->Fill(recoMuon->pt());
366 h_mEta_GMTM->Fill(recoMuon->eta());
367 h_mPhi_GMTM->Fill(recoMuon->phi());
369 h_mPt_GMPT->Fill(recoMuon->pt());
370 h_mEta_GMPT->Fill(recoMuon->eta());
371 h_mPhi_GMPT->Fill(recoMuon->phi());
372 }
else if(recoMuon->isGlobalMuon()){
373 h_mPt_GM->Fill(recoMuon->pt());
374 h_mEta_GM->Fill(recoMuon->eta());
375 h_mPhi_GM->Fill(recoMuon->phi());
377 h_mPt_TM->Fill(recoMuon->pt());
378 h_mEta_TM->Fill(recoMuon->eta());
379 h_mPhi_TM->Fill(recoMuon->phi());
380 }
else if(recoMuon->isStandAloneMuon()){
381 h_mPt_STAM->Fill(recoMuon->pt());
382 h_mEta_STAM->Fill(recoMuon->eta());
383 h_mPhi_STAM->Fill(recoMuon->phi());
385 if ( recoMuon->charge()==1 ){
387 }
else if ( recoMuon->charge()==-1 ){
391 nMu = posMu+negMu;
if(nMu>9.) nMu=9.;
392 h_mMultiplicity->Fill(nMu);
396 unsigned int muonCollectionSize = muonCollection->size();
397 for(
unsigned int i=0;
i<muonCollectionSize;
i++) {
398 const Muon& mu = muonCollection->at(
i);
402 for(
unsigned int j=
i+1;
j<muonCollectionSize;
j++) {
403 const Muon& mu2 = muonCollection->at(
j);
404 double pt2 = mu2.
pt();
409 h_dimumass_GMGM->Fill(ZRecoGMGM.mass());
414 h_dimumass_GMTM->Fill(ZRecoGMTM.mass());
419 h_dimumass_TMTM->Fill(ZRecoTMTM.mass());
431 e.
getByLabel (theCaloJetCollectionLabel,caloJetCollection);
432 if ( caloJetCollection.
isValid() ){
434 float jet_eta = -8.0;
435 float jet_phi = -8.0;
437 float jet2_et = -9.0;
438 float jet2_eta = -9.0;
439 float jet2_phi = -9.0;
440 for (CaloJetCollection::const_iterator i_calojet = caloJetCollection->begin(); i_calojet != caloJetCollection->end(); i_calojet++) {
441 float jet_current_et = i_calojet->et();
446 if (jet_current_et < 15)
continue;
448 if (jet_current_et > jet_et) {
452 jet_et = i_calojet->et();
453 jet_eta = i_calojet->eta();
454 jet_phi = i_calojet->phi();
455 }
else if (jet_current_et > jet2_et) {
456 jet2_et = i_calojet->et();
457 jet2_eta = i_calojet->eta();
458 jet2_phi = i_calojet->phi();
462 h_jet_et ->Fill(jet_et);
463 h_jet_count->Fill(jet_count);
471 e.
getByLabel(theCaloMETCollectionLabel, caloMETCollection);
472 if ( caloMETCollection.
isValid() ){
473 float caloMet = caloMETCollection->begin()->et();
474 float caloMet_phi = caloMETCollection->begin()->phi();
475 h_caloMet ->Fill(caloMet);
476 h_caloMet_phi ->Fill(caloMet_phi);
479 e.
getByLabel(thePfMETCollectionLabel, pfMETCollection);
480 if ( pfMETCollection.
isValid() ){
481 float pfMet = pfMETCollection->begin()->et();
482 float pfMet_phi = pfMETCollection->begin()->phi();
483 h_pfMet ->Fill(pfMet);
484 h_pfMet_phi ->Fill(pfMet_phi);
490 if(nMu+nEle > 2 && nMu+nEle < 10){
491 if(nMu==0 && nEle==3) h_lepcounts->Fill(0);
492 if(nMu==0 && nEle==4) h_lepcounts->Fill(1);
493 if(nMu==0 && nEle==5) h_lepcounts->Fill(2);
494 if(nMu==0 && nEle==6) h_lepcounts->Fill(3);
495 if(nMu==0 && nEle==7) h_lepcounts->Fill(4);
496 if(nMu==0 && nEle==8) h_lepcounts->Fill(5);
497 if(nMu==0 && nEle==9) h_lepcounts->Fill(6);
498 if(nMu==1 && nEle==2) h_lepcounts->Fill(7);
499 if(nMu==1 && nEle==3) h_lepcounts->Fill(8);
500 if(nMu==1 && nEle==4) h_lepcounts->Fill(9);
501 if(nMu==1 && nEle==5) h_lepcounts->Fill(10);
502 if(nMu==1 && nEle==6) h_lepcounts->Fill(11);
503 if(nMu==1 && nEle==7) h_lepcounts->Fill(12);
504 if(nMu==1 && nEle==8) h_lepcounts->Fill(13);
505 if(nMu==2 && nEle==1) h_lepcounts->Fill(14);
506 if(nMu==2 && nEle==2) h_lepcounts->Fill(15);
507 if(nMu==2 && nEle==3) h_lepcounts->Fill(16);
508 if(nMu==2 && nEle==4) h_lepcounts->Fill(17);
509 if(nMu==2 && nEle==5) h_lepcounts->Fill(18);
510 if(nMu==2 && nEle==6) h_lepcounts->Fill(19);
511 if(nMu==2 && nEle==7) h_lepcounts->Fill(20);
512 if(nMu==3 && nEle==0) h_lepcounts->Fill(21);
513 if(nMu==3 && nEle==1) h_lepcounts->Fill(22);
514 if(nMu==3 && nEle==2) h_lepcounts->Fill(23);
515 if(nMu==3 && nEle==3) h_lepcounts->Fill(24);
516 if(nMu==3 && nEle==4) h_lepcounts->Fill(25);
517 if(nMu==3 && nEle==5) h_lepcounts->Fill(26);
518 if(nMu==3 && nEle==6) h_lepcounts->Fill(27);
519 if(nMu==4 && nEle==0) h_lepcounts->Fill(28);
520 if(nMu==4 && nEle==1) h_lepcounts->Fill(29);
521 if(nMu==4 && nEle==2) h_lepcounts->Fill(30);
522 if(nMu==4 && nEle==3) h_lepcounts->Fill(31);
523 if(nMu==4 && nEle==4) h_lepcounts->Fill(32);
524 if(nMu==4 && nEle==5) h_lepcounts->Fill(33);
525 if(nMu==5 && nEle==0) h_lepcounts->Fill(34);
526 if(nMu==5 && nEle==1) h_lepcounts->Fill(35);
527 if(nMu==5 && nEle==2) h_lepcounts->Fill(36);
528 if(nMu==5 && nEle==3) h_lepcounts->Fill(37);
529 if(nMu==5 && nEle==4) h_lepcounts->Fill(38);
530 if(nMu==6 && nEle==0) h_lepcounts->Fill(39);
531 if(nMu==6 && nEle==1) h_lepcounts->Fill(40);
532 if(nMu==6 && nEle==2) h_lepcounts->Fill(41);
533 if(nMu==6 && nEle==3) h_lepcounts->Fill(42);
534 if(nMu==7 && nEle==0) h_lepcounts->Fill(43);
535 if(nMu==7 && nEle==1) h_lepcounts->Fill(44);
536 if(nMu==7 && nEle==2) h_lepcounts->Fill(45);
537 if(nMu==8 && nEle==0) h_lepcounts->Fill(46);
538 if(nMu==8 && nEle==1) h_lepcounts->Fill(47);
539 if(nMu==9 && nEle==0) h_lepcounts->Fill(48);
543 if ((nMu+nEle) >= 10)
544 LogDebug(
"HiggsDQM") <<
"WARNING: "<<nMu+nEle<<
" leptons in this event: run="<<e.
id().
run()<<
", event="<<e.
id().
event()<<
"\n";
639 edm::LogInfo (
"HiggsDQM") <<
"[HiggsDQM]: End of LS transition, performing the DQM client operation";
644 edm::LogInfo(
"HiggsDQM") <<
"====================================================== " << endl <<
" ===> Iteration # " << nLumiSecs_ <<
" " << lumiSeg.
luminosityBlock() << endl <<
"====================================================== " << endl;
665 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)
MonitorElement * book1D(const char *name, const char *title, int nchX, double lowX, double highX)
Book 1D histogram.
double deltaPhi(float phi1, float phi2)
virtual double pt() const =0
transverse momentum
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.
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 getByLabel(InputTag const &tag, Handle< PROD > &result) const
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
virtual double pt() const
transverse momentum
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