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" ;
135 bei_->setCurrentFolder(
"Physics/Higgs");
138 typedef std::vector<edm::InputTag> vtag;
140 theElecTriggerPathToPass = ps.
getParameter<
string>(
"elecTriggerPathToPass");
141 theMuonTriggerPathToPass = ps.
getParameter<
string>(
"muonTriggerPathToPass");
149 isValidHltConfig_ =
false;
164 edm::LogInfo(
"HiggsDQM") <<
" Deleting HiggsDQM " <<
"\n" ;
185 edm::LogInfo (
"HiggsDQM") <<
"[HiggsDQM]: Begining of Run";
187 bool isConfigChanged =
false;
191 const std::string hltProcessName = theTriggerResultsCollection.process();
192 isValidHltConfig_ = hltConfigProvider_.init( run, eSetup, hltProcessName, isConfigChanged );
202 edm::LogInfo (
"HiggsDQM") <<
"[HiggsDQM]: Begin of LS transition";
212 h_vertex_number = bei->
book1D(
"h_vertex_number",
"Number of event vertices in collection", 10,-0.5, 9.5 );
213 h_vertex_chi2 = bei->
book1D(
"h_vertex_chi2" ,
"Event Vertex #chi^{2}/n.d.o.f." , 100, 0.0, 2.0 );
214 h_vertex_numTrks = bei->
book1D(
"h_vertex_numTrks",
"Event Vertex, number of tracks" , 100, -0.5, 99.5 );
215 h_vertex_sumTrks = bei->
book1D(
"h_vertex_sumTrks",
"Event Vertex, sum of track pt" , 100, 0.0, 100.0 );
216 h_vertex_d0 = bei->
book1D(
"h_vertex_d0" ,
"Event Vertex d0" , 100, -10.0, 10.0);
217 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);
218 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);
219 h_jet_count = bei->
book1D(
"h_jet_count",
"Number of "+theCaloJetCollectionLabel.label()+
" (E_{T} > 15 GeV);Number of Jets", 8, -0.5, 7.5);
220 h_caloMet = bei->
book1D(
"h_caloMet",
"Calo Missing E_{T}; GeV" , 20, 0.0 , 100);
221 h_caloMet_phi = bei->
book1D(
"h_caloMet_phi",
"Calo Missing E_{T} #phi;#phi(MET)", 35, -3.5, 3.5 );
222 h_pfMet = bei->
book1D(
"h_pfMet",
"Pf Missing E_{T}; GeV" , 20, 0.0 , 100);
223 h_pfMet_phi = bei->
book1D(
"h_pfMet_phi",
"Pf Missing E_{T} #phi;#phi(MET)", 35, -3.5, 3.5 );
224 h_eMultiplicity = bei_->book1D(
"NElectrons",
"# of electrons per event",10,0.,10.);
225 h_mMultiplicity = bei_->book1D(
"NMuons",
"# of muons per event",10,0.,10.);
226 h_ePt = bei_->book1D(
"ElePt",
"Pt of electrons",50,0.,100.);
227 h_eEta = bei_->book1D(
"EleEta",
"Eta of electrons",100,-5.,5.);
228 h_ePhi = bei_->book1D(
"ElePhi",
"Phi of electrons",100,-3.5,3.5);
229 h_mPt_GMTM = bei_->book1D(
"MuonPt_GMTM",
"Pt of global+tracker muons",50,0.,100.);
230 h_mEta_GMTM = bei_->book1D(
"MuonEta_GMTM",
"Eta of global+tracker muons",60,-3.,3.);
231 h_mPhi_GMTM = bei_->book1D(
"MuonPhi_GMTM",
"Phi of global+tracker muons",70,-3.5,3.5);
232 h_mPt_GMPT = bei_->book1D(
"MuonPt_GMPT",
"Pt of global prompt-tight muons",50,0.,100.);
233 h_mEta_GMPT = bei_->book1D(
"MuonEta_GMPT",
"Eta of global prompt-tight muons",60,-3.,3.);
234 h_mPhi_GMPT = bei_->book1D(
"MuonPhi_GMPT",
"Phi of global prompt-tight muons",70,-3.5,3.5);
235 h_mPt_GM = bei_->book1D(
"MuonPt_GM",
"Pt of global muons",50,0.,100.);
236 h_mEta_GM = bei_->book1D(
"MuonEta_GM",
"Eta of global muons",60,-3.,3.);
237 h_mPhi_GM = bei_->book1D(
"MuonPhi_GM",
"Phi of global muons",70,-3.5,3.5);
238 h_mPt_TM = bei_->book1D(
"MuonPt_TM",
"Pt of tracker muons",50,0.,100.);
239 h_mEta_TM = bei_->book1D(
"MuonEta_TM",
"Eta of tracker muons",60,-3.,3.);
240 h_mPhi_TM = bei_->book1D(
"MuonPhi_TM",
"Phi of tracker muons",70,-3.5,3.5);
241 h_mPt_STAM = bei_->book1D(
"MuonPt_STAM",
"Pt of STA muons",50,0.,100.);
242 h_mEta_STAM = bei_->book1D(
"MuonEta_STAM",
"Eta of STA muons",60,-3.,3.);
243 h_mPhi_STAM = bei_->book1D(
"MuonPhi_STAM",
"Phi of STA muons",70,-3.5,3.5);
244 h_eCombIso = bei_->book1D(
"EleCombIso",
"CombIso of electrons",100,0.,10.);
245 h_mCombIso = bei_->book1D(
"MuonCombIso",
"CombIso of muons",100,0.,10.);
246 h_dimumass_GMGM = bei->
book1D(
"DimuMass_GMGM",
"Invariant mass of GMGM pairs",100,0.,200.);
247 h_dimumass_GMTM = bei->
book1D(
"DimuMass_GMTM",
"Invariant mass of GMTM pairs",100,0.,200.);
248 h_dimumass_TMTM = bei->
book1D(
"DimuMass_TMTM",
"Invariant mass of TMTM pairs",100,0.,200.);
249 h_dielemass = bei->
book1D(
"DieleMass",
"Invariant mass of EE pairs",100,0.,200.);
250 h_lepcounts = bei->
book1D(
"LeptonCounts",
"LeptonCounts for multi lepton events",49,0.,49.);
265 if( ! isValidHltConfig_ )
return;
268 e.
getByLabel(theTriggerResultsCollection, HLTresults);
269 if ( !HLTresults.
isValid() )
return;
272 bool passed_electron_HLT =
true;
273 bool passed_muon_HLT =
true;
282 e.
getByLabel(
"offlinePrimaryVertices", vertexHandle);
285 int vertex_number = vertexCollection.size();
286 VertexCollection::const_iterator
v = vertexCollection.begin();
287 double vertex_chi2 = v->normalizedChi2();
288 double vertex_d0 =
sqrt(v->x()*v->x()+v->y()*v->y());
290 double vertex_numTrks = v->tracksSize();
291 double vertex_sumTrks = 0.0;
292 for (
Vertex::trackRef_iterator vertex_curTrack = v->tracks_begin(); vertex_curTrack!=v->tracks_end(); vertex_curTrack++) {
293 vertex_sumTrks += (*vertex_curTrack)->pt();
295 h_vertex_number->Fill(vertex_number);
296 h_vertex_chi2->Fill(vertex_chi2);
297 h_vertex_d0 ->Fill(vertex_d0);
298 h_vertex_numTrks->Fill(vertex_numTrks);
299 h_vertex_sumTrks->Fill(vertex_sumTrks);
307 e.
getByLabel(theElectronCollectionLabel, electronCollection);
308 if ( electronCollection.
isValid() ){
309 int posEle=0,negEle=0;
311 if( passed_electron_HLT ) {
312 for (reco::GsfElectronCollection::const_iterator recoElectron=electronCollection->begin(); recoElectron!=electronCollection->end(); recoElectron++){
314 h_ePt->Fill(recoElectron->pt());
315 h_eEta->Fill(recoElectron->eta());
316 h_ePhi->Fill(recoElectron->phi());
317 if(recoElectron->charge()==1){
319 }
else if(recoElectron->charge()==-1){
330 nEle = posEle+negEle;
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();
339 for(
unsigned int j=
i+1;
j<eleCollectionSize;
j++) {
341 double pt2 = ele2.
pt();
344 h_dielemass->Fill(ZRecoEE.mass());
358 e.
getByLabel(theMuonCollectionLabel,muonCollection);
359 if ( muonCollection.
isValid() ){
362 TLorentzVector m1, m2;
363 if( passed_muon_HLT ) {
364 for (reco::MuonCollection::const_iterator recoMuon=muonCollection->begin(); recoMuon!=muonCollection->end(); recoMuon++){
366 if(recoMuon->isGlobalMuon()&&recoMuon->isTrackerMuon()){
367 h_mPt_GMTM->Fill(recoMuon->pt());
368 h_mEta_GMTM->Fill(recoMuon->eta());
369 h_mPhi_GMTM->Fill(recoMuon->phi());
371 h_mPt_GMPT->Fill(recoMuon->pt());
372 h_mEta_GMPT->Fill(recoMuon->eta());
373 h_mPhi_GMPT->Fill(recoMuon->phi());
374 }
else if(recoMuon->isGlobalMuon()){
375 h_mPt_GM->Fill(recoMuon->pt());
376 h_mEta_GM->Fill(recoMuon->eta());
377 h_mPhi_GM->Fill(recoMuon->phi());
379 h_mPt_TM->Fill(recoMuon->pt());
380 h_mEta_TM->Fill(recoMuon->eta());
381 h_mPhi_TM->Fill(recoMuon->phi());
382 }
else if(recoMuon->isStandAloneMuon()){
383 h_mPt_STAM->Fill(recoMuon->pt());
384 h_mEta_STAM->Fill(recoMuon->eta());
385 h_mPhi_STAM->Fill(recoMuon->phi());
387 if ( recoMuon->charge()==1 ){
389 }
else if ( recoMuon->charge()==-1 ){
393 nMu = posMu+negMu;
if(nMu>9.) nMu=9.;
394 h_mMultiplicity->Fill(nMu);
398 unsigned int muonCollectionSize = muonCollection->size();
399 for(
unsigned int i=0;
i<muonCollectionSize;
i++) {
400 const Muon&
mu = muonCollection->at(
i);
404 for(
unsigned int j=
i+1;
j<muonCollectionSize;
j++) {
405 const Muon& mu2 = muonCollection->at(
j);
406 double pt2 = mu2.
pt();
411 h_dimumass_GMGM->Fill(ZRecoGMGM.mass());
416 h_dimumass_GMTM->Fill(ZRecoGMTM.mass());
421 h_dimumass_TMTM->Fill(ZRecoTMTM.mass());
433 e.
getByLabel (theCaloJetCollectionLabel,caloJetCollection);
434 if ( caloJetCollection.
isValid() ){
439 float jet2_et = -9.0;
442 for (CaloJetCollection::const_iterator i_calojet = caloJetCollection->begin(); i_calojet != caloJetCollection->end(); i_calojet++) {
443 float jet_current_et = i_calojet->et();
448 if (jet_current_et < 15)
continue;
450 if (jet_current_et > jet_et) {
454 jet_et = i_calojet->et();
457 }
else if (jet_current_et > jet2_et) {
458 jet2_et = i_calojet->et();
464 h_jet_et ->Fill(jet_et);
465 h_jet_count->Fill(jet_count);
473 e.
getByLabel(theCaloMETCollectionLabel, caloMETCollection);
474 if ( caloMETCollection.
isValid() ){
475 float caloMet = caloMETCollection->begin()->et();
476 float caloMet_phi = caloMETCollection->begin()->phi();
477 h_caloMet ->Fill(caloMet);
478 h_caloMet_phi ->Fill(caloMet_phi);
481 e.
getByLabel(thePfMETCollectionLabel, pfMETCollection);
482 if ( pfMETCollection.
isValid() ){
483 float pfMet = pfMETCollection->begin()->et();
484 float pfMet_phi = pfMETCollection->begin()->phi();
485 h_pfMet ->Fill(pfMet);
486 h_pfMet_phi ->Fill(pfMet_phi);
492 if(nMu+nEle > 2 && nMu+nEle < 10){
493 if(nMu==0 && nEle==3) h_lepcounts->Fill(0);
494 if(nMu==0 && nEle==4) h_lepcounts->Fill(1);
495 if(nMu==0 && nEle==5) h_lepcounts->Fill(2);
496 if(nMu==0 && nEle==6) h_lepcounts->Fill(3);
497 if(nMu==0 && nEle==7) h_lepcounts->Fill(4);
498 if(nMu==0 && nEle==8) h_lepcounts->Fill(5);
499 if(nMu==0 && nEle==9) h_lepcounts->Fill(6);
500 if(nMu==1 && nEle==2) h_lepcounts->Fill(7);
501 if(nMu==1 && nEle==3) h_lepcounts->Fill(8);
502 if(nMu==1 && nEle==4) h_lepcounts->Fill(9);
503 if(nMu==1 && nEle==5) h_lepcounts->Fill(10);
504 if(nMu==1 && nEle==6) h_lepcounts->Fill(11);
505 if(nMu==1 && nEle==7) h_lepcounts->Fill(12);
506 if(nMu==1 && nEle==8) h_lepcounts->Fill(13);
507 if(nMu==2 && nEle==1) h_lepcounts->Fill(14);
508 if(nMu==2 && nEle==2) h_lepcounts->Fill(15);
509 if(nMu==2 && nEle==3) h_lepcounts->Fill(16);
510 if(nMu==2 && nEle==4) h_lepcounts->Fill(17);
511 if(nMu==2 && nEle==5) h_lepcounts->Fill(18);
512 if(nMu==2 && nEle==6) h_lepcounts->Fill(19);
513 if(nMu==2 && nEle==7) h_lepcounts->Fill(20);
514 if(nMu==3 && nEle==0) h_lepcounts->Fill(21);
515 if(nMu==3 && nEle==1) h_lepcounts->Fill(22);
516 if(nMu==3 && nEle==2) h_lepcounts->Fill(23);
517 if(nMu==3 && nEle==3) h_lepcounts->Fill(24);
518 if(nMu==3 && nEle==4) h_lepcounts->Fill(25);
519 if(nMu==3 && nEle==5) h_lepcounts->Fill(26);
520 if(nMu==3 && nEle==6) h_lepcounts->Fill(27);
521 if(nMu==4 && nEle==0) h_lepcounts->Fill(28);
522 if(nMu==4 && nEle==1) h_lepcounts->Fill(29);
523 if(nMu==4 && nEle==2) h_lepcounts->Fill(30);
524 if(nMu==4 && nEle==3) h_lepcounts->Fill(31);
525 if(nMu==4 && nEle==4) h_lepcounts->Fill(32);
526 if(nMu==4 && nEle==5) h_lepcounts->Fill(33);
527 if(nMu==5 && nEle==0) h_lepcounts->Fill(34);
528 if(nMu==5 && nEle==1) h_lepcounts->Fill(35);
529 if(nMu==5 && nEle==2) h_lepcounts->Fill(36);
530 if(nMu==5 && nEle==3) h_lepcounts->Fill(37);
531 if(nMu==5 && nEle==4) h_lepcounts->Fill(38);
532 if(nMu==6 && nEle==0) h_lepcounts->Fill(39);
533 if(nMu==6 && nEle==1) h_lepcounts->Fill(40);
534 if(nMu==6 && nEle==2) h_lepcounts->Fill(41);
535 if(nMu==6 && nEle==3) h_lepcounts->Fill(42);
536 if(nMu==7 && nEle==0) h_lepcounts->Fill(43);
537 if(nMu==7 && nEle==1) h_lepcounts->Fill(44);
538 if(nMu==7 && nEle==2) h_lepcounts->Fill(45);
539 if(nMu==8 && nEle==0) h_lepcounts->Fill(46);
540 if(nMu==8 && nEle==1) h_lepcounts->Fill(47);
541 if(nMu==9 && nEle==0) h_lepcounts->Fill(48);
545 if ((nMu+nEle) >= 10)
546 LogDebug(
"HiggsDQM") <<
"WARNING: "<<nMu+nEle<<
" leptons in this event: run="<<e.
id().
run()<<
", event="<<e.
id().
event()<<
"\n";
641 edm::LogInfo (
"HiggsDQM") <<
"[HiggsDQM]: End of LS transition, performing the DQM client operation";
646 edm::LogInfo(
"HiggsDQM") <<
"====================================================== " << endl <<
" ===> Iteration # " << nLumiSecs_ <<
" " << lumiSeg.
luminosityBlock() << endl <<
"====================================================== " << endl;
667 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.
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