32 |
|
#include "SimDataFormats/PileupSummaryInfo/interface/PileupSummaryInfo.h" |
33 |
|
|
34 |
|
#include "SimDataFormats/GeneratorProducts/interface/GenEventInfoProduct.h" |
35 |
+ |
#include "DataFormats/Math/interface/deltaR.h" |
36 |
+ |
#include "DataFormats/Math/interface/LorentzVector.h" |
37 |
+ |
#include "DataFormats/Math/interface/Vector3D.h" |
38 |
+ |
#include "Math/GenVector/PxPyPzM4D.h" |
39 |
+ |
|
40 |
+ |
#include "RecoEcal/EgammaCoreTools/interface/EcalClusterLazyTools.h" |
41 |
+ |
#include "TrackingTools/TransientTrack/interface/TransientTrackBuilder.h" |
42 |
+ |
#include "TrackingTools/Records/interface/TransientTrackRecord.h" |
43 |
+ |
#include "TrackingTools/IPTools/interface/IPTools.h" |
44 |
+ |
|
45 |
+ |
|
46 |
+ |
#include <cmath> |
47 |
+ |
|
48 |
+ |
|
49 |
+ |
|
50 |
|
|
51 |
|
#define GENPTOLOR(a) TLorentzVector((a).px(), (a).py(), (a).pz(), (a).energy()) |
52 |
|
#define GENPTOLORP(a) TLorentzVector((a)->px(), (a)->py(), (a)->pz(), (a)->energy()) |
53 |
|
|
54 |
|
|
55 |
+ |
|
56 |
|
struct CompareJetPtMuons { |
57 |
|
bool operator()( const VHbbEvent::MuonInfo& j1, const VHbbEvent::MuonInfo& j2 ) const { |
58 |
|
return j1.p4.Pt() > j2.p4.Pt(); |
74 |
|
HbbAnalyzerNew::HbbAnalyzerNew(const edm::ParameterSet& iConfig): |
75 |
|
eleLabel_(iConfig.getParameter<edm::InputTag>("electronTag")), |
76 |
|
muoLabel_(iConfig.getParameter<edm::InputTag>("muonTag")), |
77 |
+ |
lep_ptCutForBjets_(iConfig.getParameter<double>("lep_ptCutForBjets")), |
78 |
+ |
elenoCutsLabel_(iConfig.getParameter<edm::InputTag>("electronNoCutsTag")), |
79 |
+ |
muonoCutsLabel_(iConfig.getParameter<edm::InputTag>("muonNoCutsTag")), |
80 |
|
jetLabel_(iConfig.getParameter<edm::InputTag>("jetTag")), |
81 |
|
subjetLabel_(iConfig.getParameter<edm::InputTag>("subjetTag")), |
82 |
+ |
filterjetLabel_(iConfig.getParameter<edm::InputTag>("filterjetTag")), |
83 |
|
simplejet1Label_(iConfig.getParameter<edm::InputTag>("simplejet1Tag")), |
84 |
|
simplejet2Label_(iConfig.getParameter<edm::InputTag>("simplejet2Tag")), |
85 |
|
simplejet3Label_(iConfig.getParameter<edm::InputTag>("simplejet3Tag")), |
123 |
|
|
124 |
|
// JetCorrectionUncertainty *jecUnc=0; |
125 |
|
edm::ESHandle<JetCorrectorParametersCollection> JetCorParColl; |
126 |
< |
iSetup.get<JetCorrectionsRecord>().get("AK5PF",JetCorParColl); |
126 |
> |
iSetup.get<JetCorrectionsRecord>().get("AK5PFchs",JetCorParColl); |
127 |
|
JetCorrectionUncertainty *jecUnc=0; |
128 |
|
// if (!runOnMC_){ |
129 |
|
JetCorrectorParameters const & JetCorPar = (*JetCorParColl)["Uncertainty"]; |
188 |
|
|
189 |
|
const Vertex &RecVtx = (*recVtxs)[VtxIn]; |
190 |
|
const Vertex &RecVtxFirst = (*recVtxs)[0]; |
191 |
+ |
const Vertex &vertex = RecVtxFirst; //used in ele id 2012 |
192 |
|
|
193 |
|
auxInfo->pvInfo.firstPVInPT2 = TVector3(RecVtxFirst.x(), RecVtxFirst.y(), RecVtxFirst.z()); |
194 |
|
auxInfo->pvInfo.firstPVInProb = TVector3(RecVtx.x(), RecVtx.y(), RecVtx.z()); |
195 |
< |
|
195 |
> |
|
196 |
> |
(auxInfo->pvInfo).efirstPVInPT2 = (RecVtxFirst.error()); |
197 |
> |
(auxInfo->pvInfo).efirstPVInProb = RecVtx.error(); |
198 |
|
|
199 |
|
edm::Handle<double> rhoHandle; |
200 |
|
iEvent.getByLabel(edm::InputTag("kt6PFJets", "rho"),rhoHandle); |
274 |
|
} |
275 |
|
auxInfo->mcW.push_back(wtemp); |
276 |
|
} |
277 |
+ |
|
278 |
+ |
if(abs(id)==15) { |
279 |
+ |
VHbbEventAuxInfo::ParticleMCInfo tautemp; |
280 |
+ |
tautemp.status=st; |
281 |
+ |
tautemp.charge=p.charge(); |
282 |
+ |
if(p.mother(0)!=0) tautemp.momid=p.mother(0)->pdgId(); |
283 |
+ |
if(p.mother(0)!=0 && p.mother(0)->mother(0)!=0) tautemp.gmomid=p.mother(0)->mother(0)->pdgId(); |
284 |
+ |
tautemp.p4=GENPTOLOR(p); |
285 |
+ |
|
286 |
+ |
int ndau = p.numberOfDaughters(); |
287 |
+ |
for(int j = 0; j < ndau; ++ j) { |
288 |
+ |
const Candidate * Taudau = p.daughter( j ); |
289 |
+ |
tautemp.dauid.push_back(Taudau->pdgId()); |
290 |
+ |
tautemp.dauFourMomentum.push_back(GENPTOLORP(Taudau)); |
291 |
+ |
} |
292 |
+ |
auxInfo->mcTau.push_back(tautemp); |
293 |
+ |
} |
294 |
|
|
295 |
|
if(abs(id)==23){ |
296 |
|
|
306 |
|
for(int j = 0; j < ndau; ++ j) { |
307 |
|
const Candidate * Zdau = p.daughter( j ); |
308 |
|
ztemp.dauid.push_back(Zdau->pdgId()); |
309 |
< |
ztemp.dauFourMomentum.push_back(GENPTOLOR(p)); |
309 |
> |
ztemp.dauFourMomentum.push_back(GENPTOLORP(Zdau)); |
310 |
|
} |
311 |
|
auxInfo->mcZ.push_back(ztemp); |
312 |
|
} |
394 |
|
iEvent.getByLabel(subjetLabel_,subjetHandle); |
395 |
|
edm::View<pat::Jet> subjets = *subjetHandle; |
396 |
|
|
397 |
+ |
// filter jet |
398 |
+ |
edm::Handle<edm::View<pat::Jet> > filterjetHandle; |
399 |
+ |
iEvent.getByLabel(filterjetLabel_,filterjetHandle); |
400 |
+ |
edm::View<pat::Jet> filterjets = *filterjetHandle; |
401 |
+ |
|
402 |
|
// standard jets |
403 |
|
|
359 |
– |
edm::Handle<edm::View<pat::Jet> > simplejet1Handle; |
360 |
– |
iEvent.getByLabel(simplejet1Label_,simplejet1Handle); |
361 |
– |
edm::View<pat::Jet> simplejets1 = *simplejet1Handle; |
404 |
|
|
405 |
|
edm::Handle<edm::View<pat::Jet> > simplejet2Handle; |
406 |
|
iEvent.getByLabel(simplejet2Label_,simplejet2Handle); |
410 |
|
iEvent.getByLabel(simplejet3Label_,simplejet3Handle); |
411 |
|
edm::View<pat::Jet> simplejets3 = *simplejet3Handle; |
412 |
|
|
371 |
– |
edm::Handle<edm::View<pat::Jet> > simplejet4Handle; |
372 |
– |
iEvent.getByLabel(simplejet4Label_,simplejet4Handle); |
373 |
– |
edm::View<pat::Jet> simplejets4 = *simplejet4Handle; |
413 |
|
|
414 |
|
|
415 |
|
edm::Handle<edm::View<pat::Electron> > electronHandle; |
424 |
|
edm::Handle<edm::View<pat::Tau> > tauHandle; |
425 |
|
iEvent.getByLabel(tauLabel_,tauHandle); |
426 |
|
edm::View<pat::Tau> taus = *tauHandle; |
427 |
< |
|
427 |
> |
|
428 |
> |
//Get the computer for the CSV |
429 |
> |
ESHandle<JetTagComputer> handle; |
430 |
> |
iSetup.get<JetTagComputerRecord>().get("combinedSecondaryVertex", handle); |
431 |
> |
computer = dynamic_cast<const GenericMVAJetTagComputer*>(handle.product()); |
432 |
|
|
433 |
|
//BTAGGING SCALE FACTOR FROM DATABASE |
434 |
|
//Combined Secondary Vertex Loose |
459 |
|
btagSFs.MISTAGSF_CSVT = (mistagSF_CSVT_.product()); |
460 |
|
|
461 |
|
#ifdef ENABLE_SIMPLEJETS1 |
462 |
+ |
edm::Handle<edm::View<pat::Jet> > simplejet1Handle; |
463 |
+ |
iEvent.getByLabel(simplejet1Label_,simplejet1Handle); |
464 |
+ |
edm::View<pat::Jet> simplejets1 = *simplejet1Handle; |
465 |
|
for(edm::View<pat::Jet>::const_iterator jet_iter = simplejets1.begin(); jet_iter!=simplejets1.end(); ++jet_iter){ |
466 |
|
// if(jet_iter->pt()>50) |
467 |
|
// njetscounter++; |
468 |
|
VHbbEvent::SimpleJet sj; |
469 |
+ |
// std::cout <<" sj1"<<std::endl; |
470 |
|
fillSimpleJet(sj,jet_iter); |
471 |
|
// if(!runOnMC_) |
472 |
|
|
482 |
|
//genJet |
483 |
|
const reco::GenJet *gJ = jet_iter->genJet(); |
484 |
|
//physical parton for mother info ONLY |
485 |
< |
if( (jet_iter->genParton()) |
486 |
< |
and (jet_iter->genParton()->mother()) ) |
487 |
< |
sj.bestMCmomid=jet_iter->genParton()->mother()->pdgId(); |
485 |
> |
if( (jet_iter->genParton()) ){ |
486 |
> |
sj.bestMCid = jet_iter->genParton()->pdgId(); |
487 |
> |
if( (jet_iter->genParton()->mother()) ) |
488 |
> |
sj.bestMCmomid=jet_iter->genParton()->mother()->pdgId(); |
489 |
> |
} |
490 |
|
TLorentzVector gJp4; |
491 |
|
if(gJ){ |
492 |
|
gJp4.SetPtEtaPhiE(gJ->pt(),gJ->eta(),gJ->phi(),gJ->energy()); |
493 |
< |
sj.bestMCp4mom = gJp4; |
445 |
< |
std::cout <<" KKKKK 1 "<< sj.bestMCp4mom.Pt() <<std::endl; |
493 |
> |
sj.bestMCp4 = gJp4; |
494 |
|
if(verbose_){ |
495 |
|
std::clog << "genJet matched Pt = " << gJp4.Pt() << std::endl; |
496 |
|
std::clog << "genJet matched eta = " << gJp4.Eta() << std::endl; |
509 |
|
// if(jet_iter->pt()>50) |
510 |
|
// njetscounter++; |
511 |
|
VHbbEvent::SimpleJet sj; |
512 |
+ |
// std::cout <<" sj3"<<std::endl; |
513 |
|
fillSimpleJet(sj,jet_iter); |
514 |
|
// if(!runOnMC_) |
515 |
|
setJecUnc(sj,jecUnc); |
516 |
|
|
468 |
– |
|
517 |
|
Particle::LorentzVector p4Jet = jet_iter->p4(); |
518 |
|
|
519 |
|
if(runOnMC_){ |
524 |
|
//genJet |
525 |
|
const reco::GenJet *gJ = jet_iter->genJet(); |
526 |
|
//physical parton for mother info ONLY |
527 |
< |
if( (jet_iter->genParton()) |
528 |
< |
and (jet_iter->genParton()->mother()) ) |
529 |
< |
sj.bestMCmomid=jet_iter->genParton()->mother()->pdgId(); |
527 |
> |
if( (jet_iter->genParton()) ){ |
528 |
> |
sj.bestMCid = jet_iter->genParton()->pdgId(); |
529 |
> |
if( (jet_iter->genParton()->mother()) ) |
530 |
> |
sj.bestMCmomid=jet_iter->genParton()->mother()->pdgId(); |
531 |
> |
} |
532 |
|
TLorentzVector gJp4; |
533 |
|
if(gJ){ |
534 |
|
gJp4.SetPtEtaPhiE(gJ->pt(),gJ->eta(),gJ->phi(),gJ->energy()); |
535 |
< |
sj.bestMCp4mom = gJp4; |
486 |
< |
std::cout <<" KKKKK 2 "<< (sj.bestMCp4mom.Pt()) <<std::endl; |
535 |
> |
sj.bestMCp4 = gJp4; |
536 |
|
if(verbose_){ |
537 |
|
std::clog << "genJet matched Pt = " << gJp4.Pt() << std::endl; |
538 |
|
std::clog << "genJet matched eta = " << gJp4.Eta() << std::endl; |
542 |
|
} |
543 |
|
|
544 |
|
} //isMC |
545 |
+ |
// |
546 |
+ |
|
547 |
+ |
|
548 |
|
hbbInfo->simpleJets3.push_back(sj); |
549 |
|
|
550 |
|
} |
551 |
|
|
552 |
|
#ifdef ENABLE_SIMPLEJETS4 |
553 |
+ |
edm::Handle<edm::View<pat::Jet> > simplejet4Handle; |
554 |
+ |
iEvent.getByLabel(simplejet4Label_,simplejet4Handle); |
555 |
+ |
edm::View<pat::Jet> simplejets4 = *simplejet4Handle; |
556 |
|
for(edm::View<pat::Jet>::const_iterator jet_iter = simplejets4.begin(); jet_iter!=simplejets4.end(); ++jet_iter){ |
557 |
|
// if(jet_iter->pt()>50) |
558 |
|
// njetscounter++; |
559 |
|
VHbbEvent::SimpleJet sj; |
560 |
+ |
// std::cout <<" sj4"<<std::endl; |
561 |
|
fillSimpleJet(sj,jet_iter); |
562 |
|
// if(!runOnMC_) |
563 |
|
setJecUnc(sj,jecUnc); |
573 |
|
//genJet |
574 |
|
const reco::GenJet *gJ = jet_iter->genJet(); |
575 |
|
//physical parton for mother info ONLY |
576 |
< |
if( (jet_iter->genParton()) |
577 |
< |
and (jet_iter->genParton()->mother()) ) |
578 |
< |
sj.bestMCmomid=jet_iter->genParton()->mother()->pdgId(); |
576 |
> |
if( (jet_iter->genParton()) ){ |
577 |
> |
sj.bestMCid = jet_iter->genParton()->pdgId(); |
578 |
> |
if( (jet_iter->genParton()->mother()) ) |
579 |
> |
sj.bestMCmomid=jet_iter->genParton()->mother()->pdgId(); |
580 |
> |
} |
581 |
|
TLorentzVector gJp4; |
582 |
|
if(gJ){ |
583 |
|
gJp4.SetPtEtaPhiE(gJ->pt(),gJ->eta(),gJ->phi(),gJ->energy()); |
584 |
< |
sj.bestMCp4mom = gJp4; |
527 |
< |
std::cout <<" KKKKK 3 "<< sj.bestMCp4mom.Pt() <<std::endl; |
584 |
> |
sj.bestMCp4 = gJp4; |
585 |
|
if(verbose_){ |
586 |
|
std::clog << "genJet matched Pt = " << gJp4.Pt() << std::endl; |
587 |
|
std::clog << "genJet matched eta = " << gJp4.Eta() << std::endl; |
600 |
|
for(edm::View<pat::Jet>::const_iterator jet_iter = simplejets2.begin(); jet_iter!=simplejets2.end(); ++jet_iter){ |
601 |
|
|
602 |
|
VHbbEvent::SimpleJet sj; |
603 |
+ |
// std::cout <<" sj2"<<std::endl; |
604 |
|
fillSimpleJet(sj,jet_iter); |
605 |
|
// if(!runOnMC_) |
606 |
|
setJecUnc(sj,jecUnc); |
656 |
|
//genJet |
657 |
|
const reco::GenJet *gJ = jet_iter->genJet(); |
658 |
|
//physical parton for mother info ONLY |
659 |
< |
if( (jet_iter->genParton()) |
660 |
< |
and (jet_iter->genParton()->mother()) ) |
661 |
< |
sj.bestMCmomid=jet_iter->genParton()->mother()->pdgId(); |
659 |
> |
if( (jet_iter->genParton()) ){ |
660 |
> |
sj.bestMCid = jet_iter->genParton()->pdgId(); |
661 |
> |
if( (jet_iter->genParton()->mother()) ) |
662 |
> |
sj.bestMCmomid=jet_iter->genParton()->mother()->pdgId(); |
663 |
> |
} |
664 |
|
TLorentzVector gJp4; |
665 |
|
if(gJ){ |
666 |
|
gJp4.SetPtEtaPhiE(gJ->pt(),gJ->eta(),gJ->phi(),gJ->energy()); |
667 |
< |
sj.bestMCp4mom = gJp4; |
608 |
< |
std::cout <<" KKKKK 4 "<< sj.bestMCp4mom.Pt() <<std::endl; |
667 |
> |
sj.bestMCp4 = gJp4; |
668 |
|
if(verbose_){ |
669 |
|
std::clog << "genJet matched Pt = " << gJp4.Pt() << std::endl; |
670 |
|
std::clog << "genJet matched eta = " << gJp4.Eta() << std::endl; |
673 |
|
} |
674 |
|
} |
675 |
|
|
676 |
< |
} //isMC |
676 |
> |
// add flag if a mc lepton is find inside a cone around the jets... |
677 |
> |
iEvent.getByLabel("genParticles", genParticles); |
678 |
> |
|
679 |
> |
for(size_t i = 0; i < genParticles->size(); ++ i) { |
680 |
> |
|
681 |
> |
const GenParticle & p = (*genParticles)[i]; |
682 |
> |
int id = 0; |
683 |
> |
p.pt()> lep_ptCutForBjets_ ? id= p.pdgId(): 0; |
684 |
> |
|
685 |
> |
// std::cout<< "found a muon with pt " << mu->pt() << std::endl; |
686 |
> |
if ((abs(id)==13 || abs(id)==11) && deltaR(p.eta(), p.phi(), sj.p4.Eta(), sj.p4.Phi() ) <0.5) sj.isSemiLeptMCtruth=1; |
687 |
> |
} |
688 |
> |
|
689 |
> |
} //isMC |
690 |
> |
|
691 |
> |
// add flag if a reco lepton is find inside a cone around the jets... |
692 |
> |
edm::Handle<edm::View<reco::Candidate> > muonNoCutsHandle; |
693 |
> |
iEvent.getByLabel(muonoCutsLabel_,muonNoCutsHandle); |
694 |
> |
edm::View<reco::Candidate> muonsNoCuts = *muonNoCutsHandle; |
695 |
> |
|
696 |
> |
|
697 |
> |
|
698 |
> |
for(edm::View<reco::Candidate>::const_iterator mu = muonsNoCuts.begin(); mu!=muonsNoCuts.end() && sj.isSemiLept!=1; ++mu){ |
699 |
> |
// std::cout<< "found a muon with pt " << mu->pt() << std::endl; |
700 |
> |
const pat::Muon& m = static_cast <const pat::Muon&> (*mu); |
701 |
> |
float Smpt = m.pt(); |
702 |
> |
float Smeta = m.eta(); |
703 |
> |
float Smphi = m.phi(); |
704 |
> |
|
705 |
> |
float SmJdR = deltaR(Smeta, Smphi, sj.p4.Eta(), sj.p4.Phi()); |
706 |
> |
|
707 |
> |
if ( Smpt> lep_ptCutForBjets_ && SmJdR <0.5) { |
708 |
> |
sj.isSemiLept=1; |
709 |
> |
//isSemiLept(-99), isSemiLeptMCtruth(-99), SoftLeptPt(-99), SoftLeptdR(-99), SoftLeptptRel(-99), SoftLeptpdgId(-99), SoftLeptIdlooseMu(-99), SoftLeptId95(-99), SoftLeptRelCombIso(-99), |
710 |
> |
sj.SoftLeptpdgId =13; |
711 |
> |
sj.SoftLeptdR= SmJdR; |
712 |
> |
sj.SoftLeptPt=Smpt; |
713 |
> |
TVector3 mvec ( m.p4().Vect().X(), m.p4().Vect().Y(), m.p4().Vect().Z() ); |
714 |
> |
sj.SoftLeptptRel= sj.p4.Perp( mvec ); |
715 |
> |
sj.SoftLeptRelCombIso = (m.trackIso() + m.ecalIso() + m.hcalIso() ) / Smpt ; |
716 |
> |
sj.SoftLeptIdlooseMu=m.muonID("TMLastStationLoose"); |
717 |
> |
} |
718 |
> |
} |
719 |
> |
|
720 |
> |
|
721 |
> |
edm::Handle<edm::View<reco::Candidate> > eleNoCutsHandle; |
722 |
> |
iEvent.getByLabel(elenoCutsLabel_,eleNoCutsHandle); |
723 |
> |
edm::View<reco::Candidate> elesNoCuts = *eleNoCutsHandle; |
724 |
> |
|
725 |
> |
|
726 |
> |
|
727 |
> |
for(edm::View<reco::Candidate>::const_iterator ele = elesNoCuts.begin(); ele!=elesNoCuts.end() && sj.isSemiLept!=1; ++ele){ |
728 |
> |
|
729 |
> |
const pat::Electron& e = static_cast <const pat::Electron&> (*ele); |
730 |
> |
float Smpt = e.pt(); |
731 |
> |
float Smeta = e.eta(); |
732 |
> |
float Smphi = e.phi(); |
733 |
> |
|
734 |
> |
float SmJdR = deltaR(Smeta, Smphi, sj.p4.Eta(), sj.p4.Phi()); |
735 |
> |
if ( Smpt> lep_ptCutForBjets_ && SmJdR <0.5) { |
736 |
> |
sj.isSemiLept=1; |
737 |
> |
sj.SoftLeptpdgId =11; |
738 |
> |
sj.SoftLeptdR= SmJdR; |
739 |
> |
sj.SoftLeptPt=Smpt; |
740 |
> |
TVector3 mvec ( e.p4().Vect().X(), e.p4().Vect().Y(), e.p4().Vect().Z() ); |
741 |
> |
sj.SoftLeptptRel= sj.p4.Perp( mvec ); |
742 |
> |
sj.SoftLeptRelCombIso = (e.trackIso() + e.ecalIso() + e.hcalIso() ) / Smpt ; |
743 |
> |
// sj.SoftLeptId95=e.electronID("eidVBTFCom95"); |
744 |
> |
//std::cout << "before ele id " << std::endl; |
745 |
> |
// std::cout << " e.e.sigmaIetaIeta " << e.sigmaIetaIeta() << std::endl; |
746 |
> |
//std::cout << " e.isEB() " << e.isEB() << std::endl; |
747 |
> |
if ( |
748 |
> |
( fabs(Smeta)<2.5 && !( abs(Smeta)>1.4442 && abs(Smeta)<1.566)) && |
749 |
> |
|
750 |
> |
(( abs(Smeta)>1.566 && (e.sigmaIetaIeta()<0.01) && ( e.deltaPhiSuperClusterTrackAtVtx()<0.8 && e.deltaPhiSuperClusterTrackAtVtx()>-0.8) && ( e.deltaEtaSuperClusterTrackAtVtx()<0.007 && e.deltaEtaSuperClusterTrackAtVtx()>-0.007 ) ) |
751 |
> |
|| ( abs(Smeta)<1.4442 && (e.sigmaIetaIeta()<0.03) && ( e.deltaPhiSuperClusterTrackAtVtx()<0.7 && e.deltaPhiSuperClusterTrackAtVtx()>-0.7 ) && ( e.deltaEtaSuperClusterTrackAtVtx()<0.01 && e.deltaEtaSuperClusterTrackAtVtx()>-0.01 ) )) |
752 |
> |
) |
753 |
> |
sj.SoftLeptId95=1; |
754 |
> |
} |
755 |
> |
} |
756 |
> |
|
757 |
> |
|
758 |
> |
|
759 |
> |
|
760 |
|
|
761 |
|
hbbInfo->simpleJets2.push_back(sj); |
762 |
|
|
827 |
|
<< "," << subjet_iter->bDiscriminator("combinedSecondaryVertexBJetTags") << "\n";} |
828 |
|
|
829 |
|
VHbbEvent::SimpleJet sj; |
830 |
+ |
// std::cout <<" sub jet "<<std::endl; |
831 |
|
fillSimpleJet(sj,subjet_iter); |
832 |
|
// if(!runOnMC_) |
833 |
|
setJecUnc(sj,jecUnc); |
863 |
|
|
864 |
|
} |
865 |
|
|
866 |
+ |
for(edm::View<pat::Jet>::const_iterator filterjet_iter = filterjets.begin(); filterjet_iter!=filterjets.end(); ++filterjet_iter){ |
867 |
+ |
|
868 |
+ |
if(printJet) {std::cout << "FilterjetTagged Pt: " << filterjet_iter->pt() << " E,M,eta,phi,Btag: " << filterjet_iter->p4().E() << "," << filterjet_iter->p4().M() << "," << filterjet_iter->eta() << "," << filterjet_iter->phi() << "," << filterjet_iter->bDiscriminator("combinedSecondaryVertexBJetTags") << "\n";} |
869 |
+ |
|
870 |
+ |
VHbbEvent::SimpleJet fj; |
871 |
+ |
// std::cout <<" sub jet "<<std::endl; |
872 |
+ |
fillSimpleJet(fj,filterjet_iter); |
873 |
+ |
// if(!runOnMC_) |
874 |
+ |
setJecUnc(fj,jecUnc); |
875 |
+ |
|
876 |
+ |
hbbInfo->filterJets.push_back(fj); |
877 |
+ |
|
878 |
+ |
|
879 |
+ |
} |
880 |
+ |
|
881 |
+ |
// |
882 |
+ |
// add charged met |
883 |
+ |
// |
884 |
+ |
|
885 |
+ |
edm::Handle<edm::View<reco::MET> > metChargedHandle; |
886 |
+ |
iEvent.getByLabel("pfMETNoPUCharge",metChargedHandle); |
887 |
+ |
edm::View<reco::MET> metsCh = *metChargedHandle; |
888 |
+ |
if(metsCh.size()){ |
889 |
+ |
hbbInfo->metCh.sumEt=(metsCh[0]).sumEt(); |
890 |
+ |
hbbInfo->metCh.metSig=metSignificance(& (metsCh[0])); |
891 |
+ |
hbbInfo->metCh.eLong=(metsCh[0]).e_longitudinal(); |
892 |
+ |
hbbInfo->metCh.p4=GENPTOLOR((metsCh[0])); |
893 |
+ |
if (verbose_) std::cout <<" METCharged "<< hbbInfo->metCh.metSig <<" " << hbbInfo->metCh.sumEt<<std::endl; |
894 |
+ |
} |
895 |
+ |
|
896 |
+ |
// type 1 corr met |
897 |
+ |
edm::Handle<edm::View<reco::MET> > pfmetType1corrHandle; |
898 |
+ |
iEvent.getByLabel("patType1CorrectedPFMet",pfmetType1corrHandle); |
899 |
+ |
edm::View<reco::MET> pfmetsType1corr = *pfmetType1corrHandle; |
900 |
+ |
if(pfmetsType1corr.size()){ |
901 |
+ |
hbbInfo->pfmetType1corr.sumEt=(pfmetsType1corr[0]).sumEt(); |
902 |
+ |
hbbInfo->pfmetType1corr.metSig=metSignificance(& (pfmetsType1corr[0])); |
903 |
+ |
hbbInfo->pfmetType1corr.eLong=(pfmetsType1corr[0]).e_longitudinal(); |
904 |
+ |
hbbInfo->pfmetType1corr.p4=GENPTOLOR((pfmetsType1corr[0])); |
905 |
+ |
if (verbose_) std::cout <<" type 1 corrected pfMET "<< hbbInfo->pfmetType1corr.metSig <<" " << hbbInfo->pfmetType1corr.sumEt<<std::endl; |
906 |
+ |
} |
907 |
+ |
|
908 |
+ |
|
909 |
+ |
// type 1 + 2 corr met |
910 |
+ |
edm::Handle<edm::View<reco::MET> > pfmetType1p2corrHandle; |
911 |
+ |
iEvent.getByLabel("patType1p2CorrectedPFMet",pfmetType1p2corrHandle); |
912 |
+ |
edm::View<reco::MET> pfmetsType1p2corr = *pfmetType1p2corrHandle; |
913 |
+ |
if(pfmetsType1p2corr.size()){ |
914 |
+ |
hbbInfo->pfmetType1p2corr.sumEt=(pfmetsType1p2corr[0]).sumEt(); |
915 |
+ |
hbbInfo->pfmetType1p2corr.metSig=metSignificance(& (pfmetsType1p2corr[0])); |
916 |
+ |
hbbInfo->pfmetType1p2corr.eLong=(pfmetsType1p2corr[0]).e_longitudinal(); |
917 |
+ |
hbbInfo->pfmetType1p2corr.p4=GENPTOLOR((pfmetsType1p2corr[0])); |
918 |
+ |
if (verbose_) std::cout <<" type 1 +2 corrected pfMET "<< hbbInfo->pfmetType1p2corr.metSig <<" " << hbbInfo->pfmetType1p2corr.sumEt<<std::endl; |
919 |
+ |
} |
920 |
+ |
|
921 |
+ |
// type 1 corr met NoPU |
922 |
+ |
/* edm::Handle<edm::View<reco::MET> > pfmetNoPUType1corrHandle; |
923 |
+ |
iEvent.getByLabel("patType1CorrectedPFMetNoPU",pfmetNoPUType1corrHandle); |
924 |
+ |
edm::View<reco::MET> pfmetsNoPUType1corr = *pfmetNoPUType1corrHandle; |
925 |
+ |
if(pfmetsNoPUType1corr.size()){ |
926 |
+ |
hbbInfo->pfmetNoPUType1corr.sumEt=(pfmetsNoPUType1corr[0]).sumEt(); |
927 |
+ |
hbbInfo->pfmetNoPUType1corr.metSig=metSignificance(& (pfmetsNoPUType1corr[0])); |
928 |
+ |
hbbInfo->pfmetNoPUType1corr.eLong=(pfmetsNoPUType1corr[0]).e_longitudinal(); |
929 |
+ |
hbbInfo->pfmetNoPUType1corr.p4=GENPTOLOR((pfmetsNoPUType1corr[0])); |
930 |
+ |
if (verbose_) std::cout <<" type 1 corrected pfMET NoPU"<< hbbInfo->pfmetNoPUType1corr.metSig <<" " << hbbInfo->pfmetNoPUType1corr.sumEt<<std::endl; |
931 |
+ |
} |
932 |
+ |
|
933 |
+ |
|
934 |
+ |
// type 1 + 2 corr met |
935 |
+ |
edm::Handle<edm::View<reco::MET> > pfmetNoPUType1p2corrHandle; |
936 |
+ |
iEvent.getByLabel("patType1p2CorrectedPFMetNoPU",pfmetNoPUType1p2corrHandle); |
937 |
+ |
edm::View<reco::MET> pfmetsNoPUType1p2corr = *pfmetNoPUType1p2corrHandle; |
938 |
+ |
if(pfmetsNoPUType1p2corr.size()){ |
939 |
+ |
hbbInfo->pfmetNoPUType1p2corr.sumEt=(pfmetsNoPUType1p2corr[0]).sumEt(); |
940 |
+ |
hbbInfo->pfmetNoPUType1p2corr.metSig=metSignificance(& (pfmetsNoPUType1p2corr[0])); |
941 |
+ |
hbbInfo->pfmetNoPUType1p2corr.eLong=(pfmetsNoPUType1p2corr[0]).e_longitudinal(); |
942 |
+ |
hbbInfo->pfmetNoPUType1p2corr.p4=GENPTOLOR((pfmetsNoPUType1p2corr[0])); |
943 |
+ |
if (verbose_) std::cout <<" type 1 +2 corrected pfMET "<< hbbInfo->pfmetNoPUType1p2corr.metSig <<" " << hbbInfo->pfmetNoPUType1p2corr.sumEt<<std::endl; |
944 |
+ |
} |
945 |
+ |
|
946 |
+ |
*/ |
947 |
+ |
|
948 |
+ |
/* |
949 |
+ |
// MET uncertainty vector |
950 |
+ |
vector<pat::MET> "patType1CorrectedPFMet" "" "VH" |
951 |
+ |
vector<pat::MET> "patType1CorrectedPFMetElectronEnDown" "" "VH" |
952 |
+ |
vector<pat::MET> "patType1CorrectedPFMetElectronEnUp" "" "VH" |
953 |
+ |
vector<pat::MET> "patType1CorrectedPFMetJetEnDown" "" "VH" |
954 |
+ |
vector<pat::MET> "patType1CorrectedPFMetJetEnUp" "" "VH" |
955 |
+ |
vector<pat::MET> "patType1CorrectedPFMetJetResDown" "" "VH" |
956 |
+ |
vector<pat::MET> "patType1CorrectedPFMetJetResUp" "" "VH" |
957 |
+ |
vector<pat::MET> "patType1CorrectedPFMetMuonEnDown" "" "VH" |
958 |
+ |
vector<pat::MET> "patType1CorrectedPFMetMuonEnUp" "" "VH" |
959 |
+ |
vector<pat::MET> "patType1CorrectedPFMetNoPU" "" "VH" |
960 |
+ |
vector<pat::MET> "patType1CorrectedPFMetTauEnDown" "" "VH" |
961 |
+ |
vector<pat::MET> "patType1CorrectedPFMetTauEnUp" "" "VH" |
962 |
+ |
vector<pat::MET> "patType1CorrectedPFMetUnclusteredEnDown" "" "VH" |
963 |
+ |
vector<pat::MET> "patType1CorrectedPFMetUnclusteredEnUp" "" "VH" |
964 |
+ |
vector<pat::MET> "patType1p2CorrectedPFMet" "" "VH" |
965 |
+ |
vector<pat::MET> "patType1p2CorrectedPFMetElectronEnDown" "" "VH" |
966 |
+ |
vector<pat::MET> "patType1p2CorrectedPFMetElectronEnUp" "" "VH" |
967 |
+ |
vector<pat::MET> "patType1p2CorrectedPFMetJetEnDown" "" "VH" |
968 |
+ |
vector<pat::MET> "patType1p2CorrectedPFMetJetEnUp" "" "VH" |
969 |
+ |
vector<pat::MET> "patType1p2CorrectedPFMetJetResDown" "" "VH" |
970 |
+ |
vector<pat::MET> "patType1p2CorrectedPFMetJetResUp" "" "VH" |
971 |
+ |
vector<pat::MET> "patType1p2CorrectedPFMetMuonEnDown" "" "VH" |
972 |
+ |
vector<pat::MET> "patType1p2CorrectedPFMetMuonEnUp" "" "VH" |
973 |
+ |
vector<pat::MET> "patType1p2CorrectedPFMetNoPU" "" "VH" |
974 |
+ |
vector<pat::MET> "patType1p2CorrectedPFMetTauEnDown" "" "VH" |
975 |
+ |
vector<pat::MET> "patType1p2CorrectedPFMetTauEnUp" "" "VH" |
976 |
+ |
vector<pat::MET> "patType1p2CorrectedPFMetUnclusteredEnDown" "" "VH" |
977 |
+ |
vector<pat::MET> "patType1p2CorrectedPFMetUnclusteredEnUp" "" "VH" |
978 |
+ |
*/ |
979 |
+ |
|
980 |
+ |
VHbbEvent::METInfo metunc; |
981 |
+ |
edm::Handle<edm::View<reco::MET> > patType1CorrectedPFMetElectronEnDownHandle; |
982 |
+ |
iEvent.getByLabel("patType1CorrectedPFMetElectronEnDown",patType1CorrectedPFMetElectronEnDownHandle); |
983 |
+ |
edm::View<reco::MET> patType1CorrectedPFMetsElectronEnDown = *patType1CorrectedPFMetElectronEnDownHandle; |
984 |
+ |
if(patType1CorrectedPFMetsElectronEnDown.size()){ |
985 |
+ |
metunc.sumEt =(patType1CorrectedPFMetsElectronEnDown[0]).sumEt(); |
986 |
+ |
metunc.metSig=metSignificance(& (patType1CorrectedPFMetsElectronEnDown[0])); |
987 |
+ |
metunc.eLong=(patType1CorrectedPFMetsElectronEnDown[0]).e_longitudinal(); |
988 |
+ |
metunc.p4=GENPTOLOR((patType1CorrectedPFMetsElectronEnDown[0])); |
989 |
+ |
hbbInfo->metUncInfo.push_back(metunc); |
990 |
+ |
} |
991 |
+ |
|
992 |
+ |
edm::Handle<edm::View<reco::MET> > patType1CorrectedPFMetElectronEnUpHandle; |
993 |
+ |
iEvent.getByLabel("patType1CorrectedPFMetElectronEnUp",patType1CorrectedPFMetElectronEnUpHandle); |
994 |
+ |
edm::View<reco::MET> patType1CorrectedPFMetsElectronEnUp = *patType1CorrectedPFMetElectronEnUpHandle; |
995 |
+ |
if(patType1CorrectedPFMetsElectronEnUp.size()){ |
996 |
+ |
metunc.sumEt =(patType1CorrectedPFMetsElectronEnUp[0]).sumEt(); |
997 |
+ |
metunc.metSig=metSignificance(& (patType1CorrectedPFMetsElectronEnUp[0])); |
998 |
+ |
metunc.eLong=(patType1CorrectedPFMetsElectronEnUp[0]).e_longitudinal(); |
999 |
+ |
metunc.p4=GENPTOLOR((patType1CorrectedPFMetsElectronEnUp[0])); |
1000 |
+ |
hbbInfo->metUncInfo.push_back(metunc); |
1001 |
+ |
} |
1002 |
+ |
|
1003 |
+ |
|
1004 |
+ |
|
1005 |
+ |
edm::Handle<edm::View<reco::MET> > patType1CorrectedPFMetMuonEnDownHandle; |
1006 |
+ |
iEvent.getByLabel("patType1CorrectedPFMetMuonEnDown",patType1CorrectedPFMetMuonEnDownHandle); |
1007 |
+ |
edm::View<reco::MET> patType1CorrectedPFMetsMuonEnDown = *patType1CorrectedPFMetMuonEnDownHandle; |
1008 |
+ |
if(patType1CorrectedPFMetsMuonEnDown.size()){ |
1009 |
+ |
metunc.sumEt =(patType1CorrectedPFMetsMuonEnDown[0]).sumEt(); |
1010 |
+ |
metunc.metSig=metSignificance(& (patType1CorrectedPFMetsMuonEnDown[0])); |
1011 |
+ |
metunc.eLong=(patType1CorrectedPFMetsMuonEnDown[0]).e_longitudinal(); |
1012 |
+ |
metunc.p4=GENPTOLOR((patType1CorrectedPFMetsMuonEnDown[0])); |
1013 |
+ |
hbbInfo->metUncInfo.push_back(metunc); |
1014 |
+ |
} |
1015 |
+ |
|
1016 |
+ |
edm::Handle<edm::View<reco::MET> > patType1CorrectedPFMetMuonEnUpHandle; |
1017 |
+ |
iEvent.getByLabel("patType1CorrectedPFMetMuonEnUp",patType1CorrectedPFMetMuonEnUpHandle); |
1018 |
+ |
edm::View<reco::MET> patType1CorrectedPFMetsMuonEnUp = *patType1CorrectedPFMetMuonEnUpHandle; |
1019 |
+ |
if(patType1CorrectedPFMetsMuonEnUp.size()){ |
1020 |
+ |
metunc.sumEt =(patType1CorrectedPFMetsMuonEnUp[0]).sumEt(); |
1021 |
+ |
metunc.metSig=metSignificance(& (patType1CorrectedPFMetsMuonEnUp[0])); |
1022 |
+ |
metunc.eLong=(patType1CorrectedPFMetsMuonEnUp[0]).e_longitudinal(); |
1023 |
+ |
metunc.p4=GENPTOLOR((patType1CorrectedPFMetsMuonEnUp[0])); |
1024 |
+ |
hbbInfo->metUncInfo.push_back(metunc); |
1025 |
+ |
} |
1026 |
+ |
|
1027 |
+ |
|
1028 |
+ |
|
1029 |
+ |
edm::Handle<edm::View<reco::MET> > patType1CorrectedPFMetTauEnDownHandle; |
1030 |
+ |
iEvent.getByLabel("patType1CorrectedPFMetTauEnDown",patType1CorrectedPFMetTauEnDownHandle); |
1031 |
+ |
edm::View<reco::MET> patType1CorrectedPFMetsTauEnDown = *patType1CorrectedPFMetTauEnDownHandle; |
1032 |
+ |
if(patType1CorrectedPFMetsTauEnDown.size()){ |
1033 |
+ |
metunc.sumEt =(patType1CorrectedPFMetsTauEnDown[0]).sumEt(); |
1034 |
+ |
metunc.metSig=metSignificance(& (patType1CorrectedPFMetsTauEnDown[0])); |
1035 |
+ |
metunc.eLong=(patType1CorrectedPFMetsTauEnDown[0]).e_longitudinal(); |
1036 |
+ |
metunc.p4=GENPTOLOR((patType1CorrectedPFMetsTauEnDown[0])); |
1037 |
+ |
hbbInfo->metUncInfo.push_back(metunc); |
1038 |
+ |
} |
1039 |
+ |
|
1040 |
+ |
edm::Handle<edm::View<reco::MET> > patType1CorrectedPFMetTauEnUpHandle; |
1041 |
+ |
iEvent.getByLabel("patType1CorrectedPFMetTauEnUp",patType1CorrectedPFMetTauEnUpHandle); |
1042 |
+ |
edm::View<reco::MET> patType1CorrectedPFMetsTauEnUp = *patType1CorrectedPFMetTauEnUpHandle; |
1043 |
+ |
if(patType1CorrectedPFMetsTauEnUp.size()){ |
1044 |
+ |
metunc.sumEt =(patType1CorrectedPFMetsTauEnUp[0]).sumEt(); |
1045 |
+ |
metunc.metSig=metSignificance(& (patType1CorrectedPFMetsTauEnUp[0])); |
1046 |
+ |
metunc.eLong=(patType1CorrectedPFMetsTauEnUp[0]).e_longitudinal(); |
1047 |
+ |
metunc.p4=GENPTOLOR((patType1CorrectedPFMetsTauEnUp[0])); |
1048 |
+ |
hbbInfo->metUncInfo.push_back(metunc); |
1049 |
+ |
} |
1050 |
+ |
|
1051 |
+ |
|
1052 |
+ |
edm::Handle<edm::View<reco::MET> > patType1CorrectedPFMetJetEnDownHandle; |
1053 |
+ |
iEvent.getByLabel("patType1CorrectedPFMetJetEnDown",patType1CorrectedPFMetJetEnDownHandle); |
1054 |
+ |
edm::View<reco::MET> patType1CorrectedPFMetsJetEnDown = *patType1CorrectedPFMetJetEnDownHandle; |
1055 |
+ |
if(patType1CorrectedPFMetsJetEnDown.size()){ |
1056 |
+ |
metunc.sumEt =(patType1CorrectedPFMetsJetEnDown[0]).sumEt(); |
1057 |
+ |
metunc.metSig=metSignificance(& (patType1CorrectedPFMetsJetEnDown[0])); |
1058 |
+ |
metunc.eLong=(patType1CorrectedPFMetsJetEnDown[0]).e_longitudinal(); |
1059 |
+ |
metunc.p4=GENPTOLOR((patType1CorrectedPFMetsJetEnDown[0])); |
1060 |
+ |
hbbInfo->metUncInfo.push_back(metunc); |
1061 |
+ |
} |
1062 |
+ |
|
1063 |
+ |
edm::Handle<edm::View<reco::MET> > patType1CorrectedPFMetJetEnUpHandle; |
1064 |
+ |
iEvent.getByLabel("patType1CorrectedPFMetJetEnUp",patType1CorrectedPFMetJetEnUpHandle); |
1065 |
+ |
edm::View<reco::MET> patType1CorrectedPFMetsJetEnUp = *patType1CorrectedPFMetJetEnUpHandle; |
1066 |
+ |
if(patType1CorrectedPFMetsJetEnUp.size()){ |
1067 |
+ |
metunc.sumEt =(patType1CorrectedPFMetsJetEnUp[0]).sumEt(); |
1068 |
+ |
metunc.metSig=metSignificance(& (patType1CorrectedPFMetsJetEnUp[0])); |
1069 |
+ |
metunc.eLong=(patType1CorrectedPFMetsJetEnUp[0]).e_longitudinal(); |
1070 |
+ |
metunc.p4=GENPTOLOR((patType1CorrectedPFMetsJetEnUp[0])); |
1071 |
+ |
hbbInfo->metUncInfo.push_back(metunc); |
1072 |
+ |
} |
1073 |
+ |
|
1074 |
+ |
|
1075 |
+ |
edm::Handle<edm::View<reco::MET> > patType1CorrectedPFMetJetResDownHandle; |
1076 |
+ |
iEvent.getByLabel("patType1CorrectedPFMetJetResDown",patType1CorrectedPFMetJetResDownHandle); |
1077 |
+ |
edm::View<reco::MET> patType1CorrectedPFMetsJetResDown = *patType1CorrectedPFMetJetResDownHandle; |
1078 |
+ |
if(patType1CorrectedPFMetsJetResDown.size()){ |
1079 |
+ |
metunc.sumEt =(patType1CorrectedPFMetsJetResDown[0]).sumEt(); |
1080 |
+ |
metunc.metSig=metSignificance(& (patType1CorrectedPFMetsJetResDown[0])); |
1081 |
+ |
metunc.eLong=(patType1CorrectedPFMetsJetResDown[0]).e_longitudinal(); |
1082 |
+ |
metunc.p4=GENPTOLOR((patType1CorrectedPFMetsJetResDown[0])); |
1083 |
+ |
hbbInfo->metUncInfo.push_back(metunc); |
1084 |
+ |
} |
1085 |
+ |
|
1086 |
+ |
edm::Handle<edm::View<reco::MET> > patType1CorrectedPFMetJetResUpHandle; |
1087 |
+ |
iEvent.getByLabel("patType1CorrectedPFMetJetResUp",patType1CorrectedPFMetJetResUpHandle); |
1088 |
+ |
edm::View<reco::MET> patType1CorrectedPFMetsJetResUp = *patType1CorrectedPFMetJetResUpHandle; |
1089 |
+ |
if(patType1CorrectedPFMetsJetResUp.size()){ |
1090 |
+ |
metunc.sumEt =(patType1CorrectedPFMetsJetResUp[0]).sumEt(); |
1091 |
+ |
metunc.metSig=metSignificance(& (patType1CorrectedPFMetsJetResUp[0])); |
1092 |
+ |
metunc.eLong=(patType1CorrectedPFMetsJetResUp[0]).e_longitudinal(); |
1093 |
+ |
metunc.p4=GENPTOLOR((patType1CorrectedPFMetsJetResUp[0])); |
1094 |
+ |
hbbInfo->metUncInfo.push_back(metunc); |
1095 |
+ |
} |
1096 |
+ |
|
1097 |
+ |
|
1098 |
+ |
edm::Handle<edm::View<reco::MET> > patType1CorrectedPFMetUnclusteredEnDownHandle; |
1099 |
+ |
iEvent.getByLabel("patType1CorrectedPFMetUnclusteredEnDown",patType1CorrectedPFMetUnclusteredEnDownHandle); |
1100 |
+ |
edm::View<reco::MET> patType1CorrectedPFMetsUnclusteredEnDown = *patType1CorrectedPFMetUnclusteredEnDownHandle; |
1101 |
+ |
if(patType1CorrectedPFMetsUnclusteredEnDown.size()){ |
1102 |
+ |
metunc.sumEt =(patType1CorrectedPFMetsUnclusteredEnDown[0]).sumEt(); |
1103 |
+ |
metunc.metSig=metSignificance(& (patType1CorrectedPFMetsUnclusteredEnDown[0])); |
1104 |
+ |
metunc.eLong=(patType1CorrectedPFMetsUnclusteredEnDown[0]).e_longitudinal(); |
1105 |
+ |
metunc.p4=GENPTOLOR((patType1CorrectedPFMetsUnclusteredEnDown[0])); |
1106 |
+ |
hbbInfo->metUncInfo.push_back(metunc); |
1107 |
+ |
} |
1108 |
+ |
|
1109 |
+ |
edm::Handle<edm::View<reco::MET> > patType1CorrectedPFMetUnclusteredEnUpHandle; |
1110 |
+ |
iEvent.getByLabel("patType1CorrectedPFMetUnclusteredEnUp",patType1CorrectedPFMetUnclusteredEnUpHandle); |
1111 |
+ |
edm::View<reco::MET> patType1CorrectedPFMetsUnclusteredEnUp = *patType1CorrectedPFMetUnclusteredEnUpHandle; |
1112 |
+ |
if(patType1CorrectedPFMetsUnclusteredEnUp.size()){ |
1113 |
+ |
metunc.sumEt =(patType1CorrectedPFMetsUnclusteredEnUp[0]).sumEt(); |
1114 |
+ |
metunc.metSig=metSignificance(& (patType1CorrectedPFMetsUnclusteredEnUp[0])); |
1115 |
+ |
metunc.eLong=(patType1CorrectedPFMetsUnclusteredEnUp[0]).e_longitudinal(); |
1116 |
+ |
metunc.p4=GENPTOLOR((patType1CorrectedPFMetsUnclusteredEnUp[0])); |
1117 |
+ |
hbbInfo->metUncInfo.push_back(metunc); |
1118 |
+ |
} |
1119 |
+ |
|
1120 |
+ |
|
1121 |
+ |
edm::Handle<edm::View<reco::MET> > patType1p2CorrectedPFMetElectronEnDownHandle; |
1122 |
+ |
iEvent.getByLabel("patType1p2CorrectedPFMetElectronEnDown",patType1p2CorrectedPFMetElectronEnDownHandle); |
1123 |
+ |
edm::View<reco::MET> patType1p2CorrectedPFMetsElectronEnDown = *patType1p2CorrectedPFMetElectronEnDownHandle; |
1124 |
+ |
if(patType1p2CorrectedPFMetsElectronEnDown.size()){ |
1125 |
+ |
metunc.sumEt =(patType1p2CorrectedPFMetsElectronEnDown[0]).sumEt(); |
1126 |
+ |
metunc.metSig=metSignificance(& (patType1p2CorrectedPFMetsElectronEnDown[0])); |
1127 |
+ |
metunc.eLong=(patType1p2CorrectedPFMetsElectronEnDown[0]).e_longitudinal(); |
1128 |
+ |
metunc.p4=GENPTOLOR((patType1p2CorrectedPFMetsElectronEnDown[0])); |
1129 |
+ |
hbbInfo->metUncInfo.push_back(metunc); |
1130 |
+ |
} |
1131 |
+ |
|
1132 |
+ |
edm::Handle<edm::View<reco::MET> > patType1p2CorrectedPFMetElectronEnUpHandle; |
1133 |
+ |
iEvent.getByLabel("patType1p2CorrectedPFMetElectronEnUp",patType1p2CorrectedPFMetElectronEnUpHandle); |
1134 |
+ |
edm::View<reco::MET> patType1p2CorrectedPFMetsElectronEnUp = *patType1p2CorrectedPFMetElectronEnUpHandle; |
1135 |
+ |
if(patType1p2CorrectedPFMetsElectronEnUp.size()){ |
1136 |
+ |
metunc.sumEt =(patType1p2CorrectedPFMetsElectronEnUp[0]).sumEt(); |
1137 |
+ |
metunc.metSig=metSignificance(& (patType1p2CorrectedPFMetsElectronEnUp[0])); |
1138 |
+ |
metunc.eLong=(patType1p2CorrectedPFMetsElectronEnUp[0]).e_longitudinal(); |
1139 |
+ |
metunc.p4=GENPTOLOR((patType1p2CorrectedPFMetsElectronEnUp[0])); |
1140 |
+ |
hbbInfo->metUncInfo.push_back(metunc); |
1141 |
+ |
} |
1142 |
+ |
|
1143 |
+ |
|
1144 |
+ |
|
1145 |
+ |
edm::Handle<edm::View<reco::MET> > patType1p2CorrectedPFMetMuonEnDownHandle; |
1146 |
+ |
iEvent.getByLabel("patType1p2CorrectedPFMetMuonEnDown",patType1p2CorrectedPFMetMuonEnDownHandle); |
1147 |
+ |
edm::View<reco::MET> patType1p2CorrectedPFMetsMuonEnDown = *patType1p2CorrectedPFMetMuonEnDownHandle; |
1148 |
+ |
if(patType1p2CorrectedPFMetsMuonEnDown.size()){ |
1149 |
+ |
metunc.sumEt =(patType1p2CorrectedPFMetsMuonEnDown[0]).sumEt(); |
1150 |
+ |
metunc.metSig=metSignificance(& (patType1p2CorrectedPFMetsMuonEnDown[0])); |
1151 |
+ |
metunc.eLong=(patType1p2CorrectedPFMetsMuonEnDown[0]).e_longitudinal(); |
1152 |
+ |
metunc.p4=GENPTOLOR((patType1p2CorrectedPFMetsMuonEnDown[0])); |
1153 |
+ |
hbbInfo->metUncInfo.push_back(metunc); |
1154 |
+ |
} |
1155 |
+ |
|
1156 |
+ |
edm::Handle<edm::View<reco::MET> > patType1p2CorrectedPFMetMuonEnUpHandle; |
1157 |
+ |
iEvent.getByLabel("patType1p2CorrectedPFMetMuonEnUp",patType1p2CorrectedPFMetMuonEnUpHandle); |
1158 |
+ |
edm::View<reco::MET> patType1p2CorrectedPFMetsMuonEnUp = *patType1p2CorrectedPFMetMuonEnUpHandle; |
1159 |
+ |
if(patType1p2CorrectedPFMetsMuonEnUp.size()){ |
1160 |
+ |
metunc.sumEt =(patType1p2CorrectedPFMetsMuonEnUp[0]).sumEt(); |
1161 |
+ |
metunc.metSig=metSignificance(& (patType1p2CorrectedPFMetsMuonEnUp[0])); |
1162 |
+ |
metunc.eLong=(patType1p2CorrectedPFMetsMuonEnUp[0]).e_longitudinal(); |
1163 |
+ |
metunc.p4=GENPTOLOR((patType1p2CorrectedPFMetsMuonEnUp[0])); |
1164 |
+ |
hbbInfo->metUncInfo.push_back(metunc); |
1165 |
+ |
} |
1166 |
+ |
|
1167 |
+ |
|
1168 |
+ |
|
1169 |
+ |
edm::Handle<edm::View<reco::MET> > patType1p2CorrectedPFMetTauEnDownHandle; |
1170 |
+ |
iEvent.getByLabel("patType1p2CorrectedPFMetTauEnDown",patType1p2CorrectedPFMetTauEnDownHandle); |
1171 |
+ |
edm::View<reco::MET> patType1p2CorrectedPFMetsTauEnDown = *patType1p2CorrectedPFMetTauEnDownHandle; |
1172 |
+ |
if(patType1p2CorrectedPFMetsTauEnDown.size()){ |
1173 |
+ |
metunc.sumEt =(patType1p2CorrectedPFMetsTauEnDown[0]).sumEt(); |
1174 |
+ |
metunc.metSig=metSignificance(& (patType1p2CorrectedPFMetsTauEnDown[0])); |
1175 |
+ |
metunc.eLong=(patType1p2CorrectedPFMetsTauEnDown[0]).e_longitudinal(); |
1176 |
+ |
metunc.p4=GENPTOLOR((patType1p2CorrectedPFMetsTauEnDown[0])); |
1177 |
+ |
hbbInfo->metUncInfo.push_back(metunc); |
1178 |
+ |
} |
1179 |
+ |
|
1180 |
+ |
edm::Handle<edm::View<reco::MET> > patType1p2CorrectedPFMetTauEnUpHandle; |
1181 |
+ |
iEvent.getByLabel("patType1p2CorrectedPFMetTauEnUp",patType1p2CorrectedPFMetTauEnUpHandle); |
1182 |
+ |
edm::View<reco::MET> patType1p2CorrectedPFMetsTauEnUp = *patType1p2CorrectedPFMetTauEnUpHandle; |
1183 |
+ |
if(patType1p2CorrectedPFMetsTauEnUp.size()){ |
1184 |
+ |
metunc.sumEt =(patType1p2CorrectedPFMetsTauEnUp[0]).sumEt(); |
1185 |
+ |
metunc.metSig=metSignificance(& (patType1p2CorrectedPFMetsTauEnUp[0])); |
1186 |
+ |
metunc.eLong=(patType1p2CorrectedPFMetsTauEnUp[0]).e_longitudinal(); |
1187 |
+ |
metunc.p4=GENPTOLOR((patType1p2CorrectedPFMetsTauEnUp[0])); |
1188 |
+ |
hbbInfo->metUncInfo.push_back(metunc); |
1189 |
+ |
} |
1190 |
+ |
|
1191 |
+ |
|
1192 |
+ |
edm::Handle<edm::View<reco::MET> > patType1p2CorrectedPFMetJetEnDownHandle; |
1193 |
+ |
iEvent.getByLabel("patType1p2CorrectedPFMetJetEnDown",patType1p2CorrectedPFMetJetEnDownHandle); |
1194 |
+ |
edm::View<reco::MET> patType1p2CorrectedPFMetsJetEnDown = *patType1p2CorrectedPFMetJetEnDownHandle; |
1195 |
+ |
if(patType1p2CorrectedPFMetsJetEnDown.size()){ |
1196 |
+ |
metunc.sumEt =(patType1p2CorrectedPFMetsJetEnDown[0]).sumEt(); |
1197 |
+ |
metunc.metSig=metSignificance(& (patType1p2CorrectedPFMetsJetEnDown[0])); |
1198 |
+ |
metunc.eLong=(patType1p2CorrectedPFMetsJetEnDown[0]).e_longitudinal(); |
1199 |
+ |
metunc.p4=GENPTOLOR((patType1p2CorrectedPFMetsJetEnDown[0])); |
1200 |
+ |
hbbInfo->metUncInfo.push_back(metunc); |
1201 |
+ |
} |
1202 |
+ |
|
1203 |
+ |
edm::Handle<edm::View<reco::MET> > patType1p2CorrectedPFMetJetEnUpHandle; |
1204 |
+ |
iEvent.getByLabel("patType1p2CorrectedPFMetJetEnUp",patType1p2CorrectedPFMetJetEnUpHandle); |
1205 |
+ |
edm::View<reco::MET> patType1p2CorrectedPFMetsJetEnUp = *patType1p2CorrectedPFMetJetEnUpHandle; |
1206 |
+ |
if(patType1p2CorrectedPFMetsJetEnUp.size()){ |
1207 |
+ |
metunc.sumEt =(patType1p2CorrectedPFMetsJetEnUp[0]).sumEt(); |
1208 |
+ |
metunc.metSig=metSignificance(& (patType1p2CorrectedPFMetsJetEnUp[0])); |
1209 |
+ |
metunc.eLong=(patType1p2CorrectedPFMetsJetEnUp[0]).e_longitudinal(); |
1210 |
+ |
metunc.p4=GENPTOLOR((patType1p2CorrectedPFMetsJetEnUp[0])); |
1211 |
+ |
hbbInfo->metUncInfo.push_back(metunc); |
1212 |
+ |
} |
1213 |
+ |
|
1214 |
+ |
|
1215 |
+ |
edm::Handle<edm::View<reco::MET> > patType1p2CorrectedPFMetJetResDownHandle; |
1216 |
+ |
iEvent.getByLabel("patType1p2CorrectedPFMetJetResDown",patType1p2CorrectedPFMetJetResDownHandle); |
1217 |
+ |
edm::View<reco::MET> patType1p2CorrectedPFMetsJetResDown = *patType1p2CorrectedPFMetJetResDownHandle; |
1218 |
+ |
if(patType1p2CorrectedPFMetsJetResDown.size()){ |
1219 |
+ |
metunc.sumEt =(patType1p2CorrectedPFMetsJetResDown[0]).sumEt(); |
1220 |
+ |
metunc.metSig=metSignificance(& (patType1p2CorrectedPFMetsJetResDown[0])); |
1221 |
+ |
metunc.eLong=(patType1p2CorrectedPFMetsJetResDown[0]).e_longitudinal(); |
1222 |
+ |
metunc.p4=GENPTOLOR((patType1p2CorrectedPFMetsJetResDown[0])); |
1223 |
+ |
hbbInfo->metUncInfo.push_back(metunc); |
1224 |
+ |
} |
1225 |
+ |
|
1226 |
+ |
edm::Handle<edm::View<reco::MET> > patType1p2CorrectedPFMetJetResUpHandle; |
1227 |
+ |
iEvent.getByLabel("patType1p2CorrectedPFMetJetResUp",patType1p2CorrectedPFMetJetResUpHandle); |
1228 |
+ |
edm::View<reco::MET> patType1p2CorrectedPFMetsJetResUp = *patType1p2CorrectedPFMetJetResUpHandle; |
1229 |
+ |
if(patType1p2CorrectedPFMetsJetResUp.size()){ |
1230 |
+ |
metunc.sumEt =(patType1p2CorrectedPFMetsJetResUp[0]).sumEt(); |
1231 |
+ |
metunc.metSig=metSignificance(& (patType1p2CorrectedPFMetsJetResUp[0])); |
1232 |
+ |
metunc.eLong=(patType1p2CorrectedPFMetsJetResUp[0]).e_longitudinal(); |
1233 |
+ |
metunc.p4=GENPTOLOR((patType1p2CorrectedPFMetsJetResUp[0])); |
1234 |
+ |
hbbInfo->metUncInfo.push_back(metunc); |
1235 |
+ |
} |
1236 |
+ |
|
1237 |
+ |
|
1238 |
+ |
edm::Handle<edm::View<reco::MET> > patType1p2CorrectedPFMetUnclusteredEnDownHandle; |
1239 |
+ |
iEvent.getByLabel("patType1p2CorrectedPFMetUnclusteredEnDown",patType1p2CorrectedPFMetUnclusteredEnDownHandle); |
1240 |
+ |
edm::View<reco::MET> patType1p2CorrectedPFMetsUnclusteredEnDown = *patType1p2CorrectedPFMetUnclusteredEnDownHandle; |
1241 |
+ |
if(patType1p2CorrectedPFMetsUnclusteredEnDown.size()){ |
1242 |
+ |
metunc.sumEt =(patType1p2CorrectedPFMetsUnclusteredEnDown[0]).sumEt(); |
1243 |
+ |
metunc.metSig=metSignificance(& (patType1p2CorrectedPFMetsUnclusteredEnDown[0])); |
1244 |
+ |
metunc.eLong=(patType1p2CorrectedPFMetsUnclusteredEnDown[0]).e_longitudinal(); |
1245 |
+ |
metunc.p4=GENPTOLOR((patType1p2CorrectedPFMetsUnclusteredEnDown[0])); |
1246 |
+ |
hbbInfo->metUncInfo.push_back(metunc); |
1247 |
+ |
} |
1248 |
+ |
|
1249 |
+ |
edm::Handle<edm::View<reco::MET> > patType1p2CorrectedPFMetUnclusteredEnUpHandle; |
1250 |
+ |
iEvent.getByLabel("patType1p2CorrectedPFMetUnclusteredEnUp",patType1p2CorrectedPFMetUnclusteredEnUpHandle); |
1251 |
+ |
edm::View<reco::MET> patType1p2CorrectedPFMetsUnclusteredEnUp = *patType1p2CorrectedPFMetUnclusteredEnUpHandle; |
1252 |
+ |
if(patType1p2CorrectedPFMetsUnclusteredEnUp.size()){ |
1253 |
+ |
metunc.sumEt =(patType1p2CorrectedPFMetsUnclusteredEnUp[0]).sumEt(); |
1254 |
+ |
metunc.metSig=metSignificance(& (patType1p2CorrectedPFMetsUnclusteredEnUp[0])); |
1255 |
+ |
metunc.eLong=(patType1p2CorrectedPFMetsUnclusteredEnUp[0]).e_longitudinal(); |
1256 |
+ |
metunc.p4=GENPTOLOR((patType1p2CorrectedPFMetsUnclusteredEnUp[0])); |
1257 |
+ |
hbbInfo->metUncInfo.push_back(metunc); |
1258 |
+ |
} |
1259 |
+ |
|
1260 |
+ |
|
1261 |
|
|
1262 |
|
// |
1263 |
|
// met is calomet |
1268 |
|
edm::View<pat::MET> metsTC = *metTCHandle; |
1269 |
|
if(metsTC.size()){ |
1270 |
|
hbbInfo->tcmet.sumEt=(metsTC[0]).sumEt(); |
1271 |
< |
hbbInfo->tcmet.metSig=(metsTC[0]).significance(); |
1271 |
> |
hbbInfo->tcmet.metSig=metSignificance(&(metsTC[0])); |
1272 |
|
hbbInfo->tcmet.eLong=(metsTC[0]).e_longitudinal(); |
1273 |
|
hbbInfo->tcmet.p4=GENPTOLOR((metsTC[0])); |
1274 |
|
if (verbose_) std::cout <<" METTC "<< hbbInfo->tcmet.metSig <<" " << hbbInfo->tcmet.sumEt<<std::endl; |
1279 |
|
edm::View<reco::MET> metspfMETNoPU = *pfMETNoPUHandle; |
1280 |
|
if(metspfMETNoPU.size()){ |
1281 |
|
hbbInfo->metNoPU.sumEt=(metspfMETNoPU[0]).sumEt(); |
1282 |
< |
hbbInfo->metNoPU.metSig=(metspfMETNoPU[0]).significance(); |
1282 |
> |
hbbInfo->metNoPU.metSig=metSignificance(&(metspfMETNoPU[0])); |
1283 |
|
hbbInfo->metNoPU.eLong=(metspfMETNoPU[0]).e_longitudinal(); |
1284 |
|
hbbInfo->metNoPU.p4=GENPTOLOR((metspfMETNoPU[0])); |
1285 |
|
if (verbose_) std::cout <<" pfMETNoPU "<< hbbInfo->metNoPU.metSig <<" " << hbbInfo->metNoPU.sumEt<<std::endl; |
1290 |
|
edm::View<reco::MET> metsHT = *mHTHandle; |
1291 |
|
if(metsHT.size()){ |
1292 |
|
hbbInfo->mht.sumEt=(metsHT[0]).sumEt(); |
1293 |
< |
hbbInfo->mht.metSig=(metsHT[0]).significance(); |
1293 |
> |
hbbInfo->mht.metSig=metSignificance(&(metsHT[0])); |
1294 |
|
hbbInfo->mht.eLong=(metsHT[0]).e_longitudinal(); |
1295 |
|
hbbInfo->mht.p4=GENPTOLOR((metsHT[0])); |
1296 |
|
if (verbose_) std::cout <<" METHT "<< hbbInfo->mht.metSig <<" " << hbbInfo->mht.sumEt<<std::endl; |
1302 |
|
|
1303 |
|
if(mets.size()){ |
1304 |
|
hbbInfo->calomet.sumEt=(mets[0]).sumEt(); |
1305 |
< |
hbbInfo->calomet.metSig=(mets[0]).significance(); |
1305 |
> |
hbbInfo->calomet.metSig=metSignificance(&(mets[0])); |
1306 |
|
hbbInfo->calomet.eLong=(mets[0]).e_longitudinal(); |
1307 |
|
hbbInfo->calomet.p4=GENPTOLOR((mets[0])); |
1308 |
|
if (verbose_) std::cout <<" METCALO "<< hbbInfo->calomet.metSig <<" " << hbbInfo->calomet.sumEt<<std::endl; |
1309 |
|
} |
1310 |
|
|
1311 |
|
edm::Handle<edm::View<pat::MET> > metPFHandle; |
1312 |
< |
iEvent.getByLabel("patMETsPF",metPFHandle); |
1312 |
> |
iEvent.getByLabel("patMETs",metPFHandle); |
1313 |
|
edm::View<pat::MET> metsPF = *metPFHandle; |
1314 |
|
|
1315 |
|
if(metsPF.size()){ |
1316 |
|
hbbInfo->pfmet.sumEt=(metsPF[0]).sumEt(); |
1317 |
< |
hbbInfo->pfmet.metSig=(metsPF[0]).significance(); |
1317 |
> |
hbbInfo->pfmet.metSig=metSignificance(&(metsPF[0])); |
1318 |
|
hbbInfo->pfmet.eLong=(metsPF[0]).e_longitudinal(); |
1319 |
|
hbbInfo->pfmet.p4=GENPTOLOR((metsPF[0])); |
1320 |
|
if (verbose_) std::cout <<" METPF "<< hbbInfo->pfmet.metSig <<" " << hbbInfo->pfmet.sumEt<<std::endl; |
1343 |
|
double acop = deltaphi.value(); |
1344 |
|
mf.acop=acop; |
1345 |
|
|
1346 |
+ |
mf.emEnergy = mu->calEnergy().em; |
1347 |
+ |
mf.hadEnergy = mu->calEnergy().had; |
1348 |
+ |
|
1349 |
+ |
mf.nMatches = mu->numberOfMatches(); |
1350 |
+ |
|
1351 |
|
mf.ipDb=mu->dB(); |
1352 |
|
mf.ipErrDb=mu->edB(); |
1353 |
|
mf.cat=0; |
1354 |
+ |
|
1355 |
|
if(mu->isGlobalMuon()) mf.cat|=1; |
1356 |
|
if(mu->isTrackerMuon()) mf.cat|=2; |
1357 |
|
if(mu->isStandAloneMuon()) mf.cat|=4; |
1365 |
|
TrackRef iTrack1 = mu->innerTrack(); |
1366 |
|
const reco::HitPattern& p1 = iTrack1->hitPattern(); |
1367 |
|
mf.nPixelHits=p1.pixelLayersWithMeasurement(); |
1368 |
< |
} |
1368 |
> |
|
1369 |
> |
mf.nValidTracker = p1.numberOfValidTrackerHits(); |
1370 |
> |
mf.nValidPixel = p1.numberOfValidPixelHits(); |
1371 |
> |
|
1372 |
> |
|
1373 |
> |
|
1374 |
> |
} |
1375 |
|
if(mu->isGlobalMuon()){ |
1376 |
|
TrackRef gTrack = mu->globalTrack(); |
1377 |
|
const reco::HitPattern& q = gTrack->hitPattern(); |
1425 |
|
|
1426 |
|
if(verbose_) |
1427 |
|
std::cout << " INPUT electrons "<<electrons.size()<<std::endl; |
1428 |
+ |
InputTag reducedEBRecHitCollection(string("reducedEcalRecHitsEB")); |
1429 |
+ |
InputTag reducedEERecHitCollection(string("reducedEcalRecHitsEE")); |
1430 |
+ |
EcalClusterLazyTools lazyTools(iEvent, iSetup, reducedEBRecHitCollection, reducedEERecHitCollection); |
1431 |
+ |
edm::ESHandle<TransientTrackBuilder> builder; |
1432 |
+ |
iSetup.get<TransientTrackRecord>().get("TransientTrackBuilder", builder); |
1433 |
+ |
const TransientTrackBuilder & transientTrackBuilder= *(builder.product()); |
1434 |
+ |
|
1435 |
|
for(edm::View<pat::Electron>::const_iterator elec = electrons.begin(); elec!=electrons.end(); ++elec){ |
1436 |
|
VHbbEvent::ElectronInfo ef; |
1437 |
|
ef.p4=GENPTOLORP(elec); |
1447 |
|
ef.pfPhoIso=elec->photonIso(); |
1448 |
|
ef.pfNeuIso=elec->neutralHadronIso(); |
1449 |
|
|
1450 |
+ |
// |
1451 |
+ |
// ip info |
1452 |
+ |
// |
1453 |
+ |
|
1454 |
+ |
ef.ipDb=elec->dB(); |
1455 |
+ |
ef.ipErrDb=elec->edB(); |
1456 |
+ |
|
1457 |
+ |
|
1458 |
+ |
|
1459 |
|
Geom::Phi<double> deltaphi(elec->superCluster()->phi()-atan2(hbbInfo->pfmet.p4.Py(),hbbInfo->pfmet.p4.Px())); |
1460 |
|
ef.acop = deltaphi.value(); |
1461 |
|
// |
1462 |
+ |
ef.sihih = elec->sigmaIetaIeta(); |
1463 |
+ |
ef.Dphi = elec->deltaPhiSuperClusterTrackAtVtx(); |
1464 |
+ |
ef.Deta = elec->deltaEtaSuperClusterTrackAtVtx(); |
1465 |
+ |
ef.HoE = elec->hadronicOverEm(); |
1466 |
+ |
ef.convDist = elec->convDist(); |
1467 |
+ |
ef.convDcot = elec->convDcot(); |
1468 |
+ |
if(elec->gsfTrack().isNonnull()) ef.innerHits = elec->gsfTrack()->trackerExpectedHitsInner().numberOfHits(); |
1469 |
+ |
ef.isEB = elec->isEB(); |
1470 |
+ |
ef.isEE = elec->isEE(); |
1471 |
+ |
/* 2012 ELEID*/ |
1472 |
+ |
|
1473 |
+ |
const pat::Electron & ele = *elec; |
1474 |
+ |
bool validKF= false; |
1475 |
+ |
reco::TrackRef myTrackRef = ele.closestCtfTrackRef(); |
1476 |
+ |
validKF = (myTrackRef.isAvailable()); |
1477 |
+ |
validKF = (myTrackRef.isNonnull()); |
1478 |
+ |
|
1479 |
+ |
// Pure tracking variables |
1480 |
+ |
ef.fMVAVar_fbrem = ele.fbrem(); |
1481 |
+ |
ef.fMVAVar_kfchi2 = (validKF) ? myTrackRef->normalizedChi2() : 0 ; |
1482 |
+ |
ef.fMVAVar_kfhits = (validKF) ? myTrackRef->hitPattern().trackerLayersWithMeasurement() : -1. ; |
1483 |
+ |
// fMVAVar_kfhitsall = (validKF) ? myTrackRef->numberOfValidHits() : -1. ; // save also this in your ntuple as possible alternative |
1484 |
+ |
ef.fMVAVar_gsfchi2 = ele.gsfTrack()->normalizedChi2(); |
1485 |
+ |
|
1486 |
+ |
|
1487 |
+ |
// Geometrical matchings |
1488 |
+ |
ef.fMVAVar_deta = ele.deltaEtaSuperClusterTrackAtVtx(); |
1489 |
+ |
ef.fMVAVar_dphi = ele.deltaPhiSuperClusterTrackAtVtx(); |
1490 |
+ |
ef.fMVAVar_detacalo = ele.deltaEtaSeedClusterTrackAtCalo(); |
1491 |
+ |
// fMVAVar_dphicalo = ele.deltaPhiSeedClusterTrackAtCalo(); // save also this in your ntuple |
1492 |
+ |
|
1493 |
+ |
|
1494 |
+ |
// Pure ECAL -> shower shapes |
1495 |
+ |
ef.fMVAVar_see = ele.sigmaIetaIeta(); //EleSigmaIEtaIEta |
1496 |
+ |
std::vector<float> vCov = lazyTools.localCovariances(*(ele.superCluster()->seed())) ; |
1497 |
+ |
if (!isnan(vCov[2])) ef.fMVAVar_spp = sqrt (vCov[2]); //EleSigmaIPhiIPhi |
1498 |
+ |
else ef.fMVAVar_spp = 0.; |
1499 |
+ |
// fMVAVar_sigmaIEtaIPhi = vCov[1]; // save also this in your ntuple |
1500 |
+ |
|
1501 |
+ |
ef.fMVAVar_etawidth = ele.superCluster()->etaWidth(); |
1502 |
+ |
ef.fMVAVar_phiwidth = ele.superCluster()->phiWidth(); |
1503 |
+ |
ef.fMVAVar_e1x5e5x5 = (ele.e5x5()) !=0. ? 1.-(ele.e1x5()/ele.e5x5()) : -1. ; |
1504 |
+ |
ef.fMVAVar_R9 = lazyTools.e3x3(*(ele.superCluster()->seed())) / ele.superCluster()->rawEnergy(); |
1505 |
+ |
//fMVAVar_nbrems = fabs(ele.numberOfBrems()); // save also this in your ntuple |
1506 |
+ |
|
1507 |
+ |
// Energy matching |
1508 |
+ |
ef.fMVAVar_HoE = ele.hadronicOverEm(); |
1509 |
+ |
ef.fMVAVar_EoP = ele.eSuperClusterOverP(); |
1510 |
+ |
// fMVAVar_IoEmIoP = (1.0/(ele.superCluster()->energy())) - (1.0 / ele.p()); // in the future to be changed with ele.gsfTrack()->p() |
1511 |
+ |
ef.fMVAVar_IoEmIoP = (1.0/ele.ecalEnergy()) - (1.0 / ele.p()); // in the future to be changed with ele.gsfTrack()->p() // 24/04/2012 changed to correctly access the corrected supercluster energy from CMSSW_52X |
1512 |
+ |
|
1513 |
+ |
ef.fMVAVar_eleEoPout = ele.eEleClusterOverPout(); |
1514 |
+ |
ef.fMVAVar_PreShowerOverRaw= ele.superCluster()->preshowerEnergy() / ele.superCluster()->rawEnergy(); |
1515 |
+ |
// fMVAVar_EoPout = ele.eSeedClusterOverPout(); // save also this in your ntuple |
1516 |
+ |
|
1517 |
+ |
|
1518 |
+ |
// Spectators |
1519 |
+ |
ef.fMVAVar_eta = ele.superCluster()->eta(); |
1520 |
+ |
ef.fMVAVar_pt = ele.pt(); |
1521 |
+ |
|
1522 |
+ |
//additional for cut based |
1523 |
+ |
ef.dxy = elec->gsfTrack()->dxy(vertex.position()); |
1524 |
+ |
ef.dz = elec->gsfTrack()->dz(vertex.position()); |
1525 |
+ |
|
1526 |
+ |
|
1527 |
+ |
//d0 |
1528 |
+ |
if (ele.gsfTrack().isNonnull()) { |
1529 |
+ |
ef.fMVAVar_d0 = (-1.0)*ele.gsfTrack()->dxy(vertex.position()); |
1530 |
+ |
} else if (ele.closestCtfTrackRef().isNonnull()) { |
1531 |
+ |
ef.fMVAVar_d0 = (-1.0)*ele.closestCtfTrackRef()->dxy(vertex.position()); |
1532 |
+ |
} else { |
1533 |
+ |
ef.fMVAVar_d0 = -9999.0; |
1534 |
+ |
|
1535 |
+ |
//default values for IP3D |
1536 |
+ |
ef.fMVAVar_ip3d = -999.0; |
1537 |
+ |
// fMVAVar_ip3dSig = 0.0; |
1538 |
+ |
if (ele.gsfTrack().isNonnull()) { |
1539 |
+ |
const double gsfsign = ( (-ele.gsfTrack()->dxy(vertex.position())) >=0 ) ? 1. : -1.; |
1540 |
+ |
|
1541 |
+ |
const reco::TransientTrack &tt = transientTrackBuilder.build(ele.gsfTrack()); |
1542 |
+ |
const std::pair<bool,Measurement1D> &ip3dpv = IPTools::absoluteImpactParameter3D(tt,vertex); |
1543 |
+ |
if (ip3dpv.first) { |
1544 |
+ |
double ip3d = gsfsign*ip3dpv.second.value(); |
1545 |
+ |
//double ip3derr = ip3dpv.second.error(); |
1546 |
+ |
ef.fMVAVar_ip3d = ip3d; |
1547 |
+ |
// fMVAVar_ip3dSig = ip3d/ip3derr; |
1548 |
+ |
} |
1549 |
+ |
} |
1550 |
+ |
} |
1551 |
+ |
|
1552 |
+ |
|
1553 |
+ |
/* end of 2012 ELEID*/ |
1554 |
+ |
|
1555 |
+ |
// |
1556 |
|
// fill eleids |
1557 |
|
// |
1558 |
|
/* ef.id95 = elec->electronID("simpleEleId95cIso"); |
1612 |
|
Geom::Phi<double> deltaphi(tau->phi()-atan2(hbbInfo->pfmet.p4.Py(),hbbInfo->pfmet.p4.Px())); |
1613 |
|
double acop = deltaphi.value(); |
1614 |
|
tf.acop=acop; |
1615 |
< |
tf.idbyIso=tau->tauID("byIsolation"); |
1616 |
< |
tf.idbyTrackIso=tau->tauID("trackIsolation"); |
1617 |
< |
tf.idbyTaNCfrOnePercent=tau->tauID("byTaNCfrOnePercent"); |
1618 |
< |
tf.idbyTaNCfrHalfPercent=tau->tauID("byTaNCfrHalfPercent"); |
1619 |
< |
tf.idbyTaNCfrQuarterPercent=tau->tauID("byTaNCfrQuarterPercent"); |
1620 |
< |
tf.idbyTaNCfrTenthPercent=tau->tauID("byTaNCfrTenthPercent"); |
1621 |
< |
tf.idbyTaNC=tau->tauID("byTaNC"); |
1615 |
> |
if (tau->isTauIDAvailable("againstElectronLoose")) tf.againstElectronLoose=tau->tauID("againstElectronLoose"); |
1616 |
> |
if (tau->isTauIDAvailable("againstElectronMedium")) tf.againstElectronMedium=tau->tauID("againstElectronMedium"); |
1617 |
> |
if (tau->isTauIDAvailable("againstElectronTight")) tf.againstElectronTight=tau->tauID("againstElectronTight"); |
1618 |
> |
if (tau->isTauIDAvailable("againstMuonLoose")) tf.againstMuonLoose=tau->tauID("againstMuonLoose"); |
1619 |
> |
if (tau->isTauIDAvailable("againstMuonTight")) tf.againstMuonTight=tau->tauID("againstMuonTight"); |
1620 |
> |
if (tau->isTauIDAvailable("byLooseIsolation")) tf.byLooseIsolation=tau->tauID("byLooseIsolation"); |
1621 |
> |
if (tau->isTauIDAvailable("byMediumIsolation")) tf.byMediumIsolation=tau->tauID("byMediumIsolation"); |
1622 |
> |
if (tau->isTauIDAvailable("byTightIsolation")) tf.byTightIsolation=tau->tauID("byTightIsolation"); |
1623 |
> |
if (tau->isTauIDAvailable("byVLooseIsolation")) tf.byVLooseIsolation=tau->tauID("byVLooseIsolation"); |
1624 |
> |
if (tau->isTauIDAvailable("decayModeFinding")) tf.decayModeFinding=tau->tauID("decayModeFinding"); |
1625 |
> |
if (tau->isTauIDAvailable("byIsolation")) tf.byIsolation=tau->tauID("byIsolation"); |
1626 |
> |
if (tau->isTauIDAvailable("trackIsolation")) tf.trackIsolation=tau->tauID("trackIsolation"); |
1627 |
> |
if (tau->isTauIDAvailable("byTaNCfrOnePercent")) tf.byTaNCfrOnePercent=tau->tauID("byTaNCfrOnePercent"); |
1628 |
> |
if (tau->isTauIDAvailable("byTaNCfrHalfPercent")) tf.byTaNCfrHalfPercent=tau->tauID("byTaNCfrHalfPercent"); |
1629 |
> |
if (tau->isTauIDAvailable("byTaNCfrQuarterPercent")) tf.byTaNCfrQuarterPercent=tau->tauID("byTaNCfrQuarterPercent"); |
1630 |
> |
if (tau->isTauIDAvailable("byTaNCfrTenthPercent")) tf.byTaNCfrTenthPercent=tau->tauID("byTaNCfrTenthPercent"); |
1631 |
> |
if (tau->isTauIDAvailable("byTaNC")) tf.byTaNC=tau->tauID("byTaNC"); |
1632 |
> |
if (tau->isTauIDAvailable("byLooseCombinedIsolationDeltaBetaCorr")) tf.byLooseCombinedIsolationDeltaBetaCorr=tau->tauID("byLooseCombinedIsolationDeltaBetaCorr"); |
1633 |
> |
if (tau->isTauIDAvailable("againstElectronMVA")) tf.againstElectronMVA=tau->tauID("againstElectronMVA"); |
1634 |
> |
if (tau->isPFTau()) { |
1635 |
> |
tf.isolationPFChargedHadrCandsPtSum = tau->isolationPFChargedHadrCandsPtSum(); |
1636 |
> |
tf.isolationPFGammaCandsEtSum = tau->isolationPFGammaCandsEtSum(); |
1637 |
> |
if (tau->leadPFChargedHadrCand().isAvailable()) tf.leadPFChargedHadrCandPt = tau->leadPFChargedHadrCand()->pt(); |
1638 |
> |
tf.NsignalPFChargedHadrCands = tau->signalPFChargedHadrCands().size(); |
1639 |
> |
tf.NsignalPFGammaCands = tau->signalPFGammaCands().size(); |
1640 |
> |
} |
1641 |
|
hbbInfo->tauInfo.push_back(tf); |
1642 |
+ |
if (verbose_) { |
1643 |
+ |
std::cout << "SCZ DEBUG: againstElectronLoose is " << tf.againstElectronLoose << std::endl; |
1644 |
+ |
std::cout << "SCZ DEBUG: againstElectronMedium is " << tf.againstElectronMedium << std::endl; |
1645 |
+ |
std::cout << "SCZ DEBUG: againstElectronTight is " << tf.againstElectronTight << std::endl; |
1646 |
+ |
std::cout << "SCZ DEBUG: againstMuonLoose is " << tf.againstMuonLoose << std::endl; |
1647 |
+ |
std::cout << "SCZ DEBUG: againstMuonTight is " << tf.againstMuonTight << std::endl; |
1648 |
+ |
std::cout << "SCZ DEBUG: byLooseIsolation is " << tf.byLooseIsolation << std::endl; |
1649 |
+ |
std::cout << "SCZ DEBUG: byMediumIsolation is " << tf.byMediumIsolation << std::endl; |
1650 |
+ |
std::cout << "SCZ DEBUG: byTightIsolation is " << tf.byTightIsolation << std::endl; |
1651 |
+ |
std::cout << "SCZ DEBUG: byVLooseIsolation is " << tf.byVLooseIsolation << std::endl; |
1652 |
+ |
std::cout << "SCZ DEBUG: decayModeFinding is " << tf.decayModeFinding << std::endl; |
1653 |
+ |
std::cout << "SCZ DEBUG: byIsolation is " << tf.byIsolation<< std::endl; |
1654 |
+ |
std::cout << "SCZ DEBUG: trackIsolation is " << tf.trackIsolation << std::endl; |
1655 |
+ |
std::cout << "SCZ DEBUG: byTaNCfrOnePercent is " << tf.byTaNCfrOnePercent << std::endl; |
1656 |
+ |
std::cout << "SCZ DEBUG: byTaNCfrHalfPercent is " << tf.byTaNCfrHalfPercent << std::endl; |
1657 |
+ |
std::cout << "SCZ DEBUG: byTaNCfrQuarterPercent is " << tf.byTaNCfrQuarterPercent << std::endl; |
1658 |
+ |
std::cout << "SCZ DEBUG: byTaNCfrTenthPercent is " << tf.byTaNCfrTenthPercent << std::endl; |
1659 |
+ |
std::cout << "SCZ DEBUG: byTaNC is " << tf.byTaNC << std::endl; |
1660 |
+ |
std::cout << "SCZ DEBUG: isolationPFChargedHadrCandsPtSum is " << tf.isolationPFChargedHadrCandsPtSum << std::endl; |
1661 |
+ |
std::cout << "SCZ DEBUG: isolationPFGammaCandsEtSum is " << tf.isolationPFGammaCandsEtSum << std::endl; |
1662 |
+ |
std::cout << "SCZ DEBUG: isolationPFGammaCandsEtSum is " << tf.leadPFChargedHadrCandPt << std::endl; |
1663 |
+ |
std::cout << "SCZ DEBUG: NsignalPFChargedHadrCands is " << tf.NsignalPFChargedHadrCands << std::endl; |
1664 |
+ |
std::cout << "SCZ DEBUG: NsignalPFGammaCands is " << tf.NsignalPFGammaCands << std::endl; |
1665 |
+ |
std::cout << "SCZ DEBUG: byLooseCombinedIsolationDeltaBetaCorr is " << tf.byLooseCombinedIsolationDeltaBetaCorr << std::endl; |
1666 |
+ |
std::cout << "SCZ DEBUG: againstElectronMVA is " << tf.againstElectronMVA << std::endl; |
1667 |
+ |
} |
1668 |
|
} |
1669 |
|
|
1670 |
|
CompareJetPtMuons ptComparatorMu; |
1684 |
|
" SimpleJets2 = "<<hbbInfo->simpleJets2.size()<<std::endl<< |
1685 |
|
" SubJets = "<<hbbInfo->subJets.size()<<std::endl<< |
1686 |
|
" HardJets = "<<hbbInfo->hardJets.size()<<std::endl<< |
1687 |
+ |
" FilterJets = "<<hbbInfo->filterJets.size()<<std::endl<< |
1688 |
|
" Muons = "<<hbbInfo->muInfo.size()<<std::endl<< |
1689 |
|
" Electrons = "<<hbbInfo->eleInfo.size()<<std::endl<< |
1690 |
|
" Taus = "<<hbbInfo->tauInfo.size()<<std::endl<< |
1697 |
|
iEvent.put(auxInfo); |
1698 |
|
|
1699 |
|
|
1700 |
+ |
delete jecUnc; |
1701 |
+ |
|
1702 |
|
} |
1703 |
|
|
1704 |
|
void |
1887 |
|
// test |
1888 |
|
// |
1889 |
|
|
1890 |
< |
return; |
1890 |
> |
// return; |
1891 |
|
double eta = sj.p4.Eta(); |
1892 |
|
double pt = sj.p4.Pt(); |
1893 |
|
|
1908 |
|
sj.ssvhe=jet_iter->bDiscriminator("simpleSecondaryVertexHighEffBJetTags"); |
1909 |
|
sj.csv=jet_iter->bDiscriminator("combinedSecondaryVertexBJetTags"); |
1910 |
|
sj.csvmva=jet_iter->bDiscriminator("combinedSecondaryVertexMVABJetTags"); |
1911 |
+ |
sj.csvivf=jet_iter->bDiscriminator("combinedInclusiveSecondaryVertexBJetTags"); |
1912 |
+ |
sj.cmva=jet_iter->bDiscriminator("combinedMVABJetTags"); |
1913 |
|
sj.charge=jet_iter->jetCharge(); |
1914 |
|
sj.ntracks=jet_iter->associatedTracks().size(); |
1915 |
|
sj.p4=GENPTOLORP(jet_iter); |
1916 |
+ |
// std::cout << " ECCO "<<sj.csv<< " "<< sj.p4.Pt()<<std::endl; |
1917 |
|
sj.chargedTracksFourMomentum=(getChargedTracksMomentum(&*(jet_iter))); |
1918 |
|
sj.SF_CSVL=1; |
1919 |
|
sj.SF_CSVM=1; |
1932 |
|
sj.nConstituents = jet_iter->getPFConstituents().size(); |
1933 |
|
|
1934 |
|
} |
1935 |
+ |
sj.jetArea = jet_iter->jetArea(); |
1936 |
|
// |
1937 |
|
// addtaginfo for csv |
1938 |
|
// |
1941 |
|
|
1942 |
|
const reco::SecondaryVertexTagInfo * tf = jet_iter->tagInfoSecondaryVertex(); |
1943 |
|
if (tf){ |
1944 |
+ |
math::XYZTLorentzVectorD vertexSum; |
1945 |
+ |
for(size_t vi=0;vi< tf->nVertices();vi++) |
1946 |
+ |
{ |
1947 |
+ |
vertexSum+=tf->secondaryVertex(vi).p4(); |
1948 |
+ |
} |
1949 |
+ |
sj.vtxP4 = GENPTOLOR(vertexSum); |
1950 |
+ |
|
1951 |
|
if (tf->nVertices() >0){ |
1952 |
< |
sj.vtxMass = tf->secondaryVertex(0).p4().mass(); |
1952 |
> |
sj.vtxPosition = TVector3(tf->secondaryVertex(0).position().x(),tf->secondaryVertex(0).position().y(),tf->secondaryVertex(0).position().z()); |
1953 |
> |
sj.vtxMass = tf->secondaryVertex(0).p4().mass(); |
1954 |
|
sj.vtxNTracks = tf->secondaryVertex(0).nTracks(); |
1955 |
|
std::vector<reco::TrackBaseRef >::const_iterator tit = tf->secondaryVertex(0).tracks_begin(); |
1956 |
|
for (; tit< tf->secondaryVertex(0).tracks_end(); ++tit){ |
1961 |
|
sj.vtx3deL = m.error(); |
1962 |
|
} |
1963 |
|
} |
1964 |
+ |
|
1965 |
+ |
// CSV track info |
1966 |
+ |
const reco::SecondaryVertexTagInfo * svTagInfos = jet_iter->tagInfoSecondaryVertex(); |
1967 |
+ |
const reco::TrackIPTagInfo * ipTagInfos = jet_iter->tagInfoTrackIP(); |
1968 |
+ |
for (edm::RefVector<reco::TrackCollection>::const_iterator t = ipTagInfos->selectedTracks().begin(); t != ipTagInfos->selectedTracks().end(); t++){ |
1969 |
+ |
sj.btagTrackIds.push_back(t->key()); |
1970 |
+ |
}// all btag IP selected tracks |
1971 |
+ |
std::vector<const reco::BaseTagInfo*> tagInfos; |
1972 |
+ |
tagInfos.push_back(dynamic_cast<const reco::BaseTagInfo*>(ipTagInfos)); |
1973 |
+ |
tagInfos.push_back(dynamic_cast<const reco::BaseTagInfo*>(svTagInfos)); |
1974 |
+ |
JetTagComputer::TagInfoHelper helper(tagInfos); |
1975 |
+ |
reco::TaggingVariableList varList = computer->taggingVariables(helper); // computer for getting CSV variables |
1976 |
+ |
|
1977 |
+ |
for(reco::TaggingVariableList::const_iterator iter = varList.begin(); iter != varList.end(); ++iter) |
1978 |
+ |
{ |
1979 |
+ |
//std::cout << reco::TaggingVariableTokens[iter->first] << " = " << iter->second << std::endl; |
1980 |
+ |
for (edm::RefVector<reco::TrackCollection>::const_iterator t = ipTagInfos->selectedTracks().begin(); t != ipTagInfos->selectedTracks().end(); t++){ |
1981 |
+ |
|
1982 |
+ |
if (strcmp(reco::TaggingVariableTokens[iter->first], "trackMomentum") == 0 && (fabs((float)iter->second - (float)(*t)->p()) < 0.0001) ){ |
1983 |
+ |
sj.csvTrackIds.push_back(t->key()); |
1984 |
+ |
}// if tagged track |
1985 |
+ |
}// loop on IPtracks |
1986 |
+ |
}// loop on CSV variables |
1987 |
+ |
|
1988 |
+ |
|
1989 |
+ |
sj.btagNTracks= ipTagInfos->selectedTracks().size(); |
1990 |
+ |
sj.csvNTracks = sj.csvTrackIds.size(); |
1991 |
+ |
|
1992 |
|
// |
1993 |
|
// add tVector |
1994 |
|
// |
1995 |
|
sj.tVector = getTvect(&(*jet_iter)); |
1996 |
+ |
|
1997 |
+ |
sj.ptRaw = jet_iter->correctedJet(0).pt(); |
1998 |
+ |
|
1999 |
+ |
sj.ptLeadTrack =-9999.; |
2000 |
+ |
if (jet_iter->isPFJet() == true) { |
2001 |
+ |
std::vector <reco::PFCandidatePtr> constituents = jet_iter->getPFConstituents (); |
2002 |
+ |
for (unsigned ic = 0; ic < constituents.size (); ++ic) { |
2003 |
+ |
if ( constituents[ic]->particleId() > 3 ) continue; |
2004 |
+ |
reco::TrackRef trackRef = constituents[ic]->trackRef(); |
2005 |
+ |
if ( trackRef.isNonnull() ) { if(trackRef->pt() > sj.ptLeadTrack) sj.ptLeadTrack=trackRef->pt(); } |
2006 |
+ |
} |
2007 |
+ |
} |
2008 |
+ |
|
2009 |
+ |
|
2010 |
+ |
} |
2011 |
+ |
|
2012 |
+ |
float HbbAnalyzerNew::metSignificance(const reco::MET * met) |
2013 |
+ |
{ |
2014 |
+ |
double sigmaX2= met->getSignificanceMatrix()(0,0); |
2015 |
+ |
double sigmaY2= met->getSignificanceMatrix()(1,1); |
2016 |
+ |
double significance = 0; |
2017 |
+ |
try { |
2018 |
+ |
if(sigmaX2<1.e10 && sigmaY2<1.e10) significance = met->significance(); |
2019 |
+ |
} |
2020 |
+ |
catch(...) |
2021 |
+ |
{ |
2022 |
+ |
std::cout << "PROBLEM WITH MET SIGNIFICANCE sigma X2 and Y2 are: " << sigmaX2 << " " << sigmaY2 << std::endl; |
2023 |
+ |
} |
2024 |
+ |
return significance; |
2025 |
|
} |
2026 |
|
|
2027 |
|
|