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 |
+ |
#include "CMGTools/External/interface/PileupJetIdentifier.h" |
46 |
+ |
#include "CMGTools/External/interface/PileupJetIdAlgo.h" |
47 |
+ |
//#include "CMGTools/External/interface/PileupJetIdProducer.h" |
48 |
+ |
|
49 |
+ |
#include <cmath> |
50 |
+ |
|
51 |
+ |
|
52 |
+ |
|
53 |
|
|
54 |
|
#define GENPTOLOR(a) TLorentzVector((a).px(), (a).py(), (a).pz(), (a).energy()) |
55 |
|
#define GENPTOLORP(a) TLorentzVector((a)->px(), (a)->py(), (a)->pz(), (a)->energy()) |
56 |
|
|
57 |
|
|
58 |
+ |
|
59 |
|
struct CompareJetPtMuons { |
60 |
|
bool operator()( const VHbbEvent::MuonInfo& j1, const VHbbEvent::MuonInfo& j2 ) const { |
61 |
|
return j1.p4.Pt() > j2.p4.Pt(); |
77 |
|
HbbAnalyzerNew::HbbAnalyzerNew(const edm::ParameterSet& iConfig): |
78 |
|
eleLabel_(iConfig.getParameter<edm::InputTag>("electronTag")), |
79 |
|
muoLabel_(iConfig.getParameter<edm::InputTag>("muonTag")), |
80 |
+ |
lep_ptCutForBjets_(iConfig.getParameter<double>("lep_ptCutForBjets")), |
81 |
+ |
elenoCutsLabel_(iConfig.getParameter<edm::InputTag>("electronNoCutsTag")), |
82 |
+ |
muonoCutsLabel_(iConfig.getParameter<edm::InputTag>("muonNoCutsTag")), |
83 |
|
jetLabel_(iConfig.getParameter<edm::InputTag>("jetTag")), |
84 |
|
subjetLabel_(iConfig.getParameter<edm::InputTag>("subjetTag")), |
85 |
+ |
filterjetLabel_(iConfig.getParameter<edm::InputTag>("filterjetTag")), |
86 |
|
simplejet1Label_(iConfig.getParameter<edm::InputTag>("simplejet1Tag")), |
87 |
|
simplejet2Label_(iConfig.getParameter<edm::InputTag>("simplejet2Tag")), |
88 |
|
simplejet3Label_(iConfig.getParameter<edm::InputTag>("simplejet3Tag")), |
126 |
|
|
127 |
|
// JetCorrectionUncertainty *jecUnc=0; |
128 |
|
edm::ESHandle<JetCorrectorParametersCollection> JetCorParColl; |
129 |
< |
iSetup.get<JetCorrectionsRecord>().get("AK5PF",JetCorParColl); |
129 |
> |
iSetup.get<JetCorrectionsRecord>().get("AK5PFchs",JetCorParColl); |
130 |
|
JetCorrectionUncertainty *jecUnc=0; |
131 |
|
// if (!runOnMC_){ |
132 |
|
JetCorrectorParameters const & JetCorPar = (*JetCorParColl)["Uncertainty"]; |
191 |
|
|
192 |
|
const Vertex &RecVtx = (*recVtxs)[VtxIn]; |
193 |
|
const Vertex &RecVtxFirst = (*recVtxs)[0]; |
194 |
+ |
const Vertex &vertex = RecVtxFirst; //used in ele id 2012 |
195 |
|
|
196 |
|
auxInfo->pvInfo.firstPVInPT2 = TVector3(RecVtxFirst.x(), RecVtxFirst.y(), RecVtxFirst.z()); |
197 |
|
auxInfo->pvInfo.firstPVInProb = TVector3(RecVtx.x(), RecVtx.y(), RecVtx.z()); |
198 |
< |
|
198 |
> |
|
199 |
> |
(auxInfo->pvInfo).efirstPVInPT2 = (RecVtxFirst.error()); |
200 |
> |
(auxInfo->pvInfo).efirstPVInProb = RecVtx.error(); |
201 |
|
|
202 |
|
edm::Handle<double> rhoHandle; |
203 |
|
iEvent.getByLabel(edm::InputTag("kt6PFJets", "rho"),rhoHandle); |
207 |
|
iEvent.getByLabel(edm::InputTag("kt6PFJets25", "rho"),rho25Handle); |
208 |
|
auxInfo->puInfo.rho25 = *rho25Handle; |
209 |
|
|
210 |
+ |
edm::Handle<double> rhoNeutralHandle; |
211 |
+ |
iEvent.getByLabel(edm::InputTag("kt6PFJetsCentralNeutral", "rho"),rhoNeutralHandle); |
212 |
+ |
auxInfo->puInfo.rhoNeutral = *rhoNeutralHandle; |
213 |
+ |
|
214 |
+ |
|
215 |
|
edm::Handle<std::vector< PileupSummaryInfo> > puHandle; |
216 |
|
|
217 |
|
if (runOnMC_){ |
282 |
|
} |
283 |
|
auxInfo->mcW.push_back(wtemp); |
284 |
|
} |
285 |
+ |
|
286 |
+ |
if(abs(id)==15) { |
287 |
+ |
VHbbEventAuxInfo::ParticleMCInfo tautemp; |
288 |
+ |
tautemp.status=st; |
289 |
+ |
tautemp.charge=p.charge(); |
290 |
+ |
if(p.mother(0)!=0) tautemp.momid=p.mother(0)->pdgId(); |
291 |
+ |
if(p.mother(0)!=0 && p.mother(0)->mother(0)!=0) tautemp.gmomid=p.mother(0)->mother(0)->pdgId(); |
292 |
+ |
tautemp.p4=GENPTOLOR(p); |
293 |
+ |
|
294 |
+ |
int ndau = p.numberOfDaughters(); |
295 |
+ |
for(int j = 0; j < ndau; ++ j) { |
296 |
+ |
const Candidate * Taudau = p.daughter( j ); |
297 |
+ |
tautemp.dauid.push_back(Taudau->pdgId()); |
298 |
+ |
tautemp.dauFourMomentum.push_back(GENPTOLORP(Taudau)); |
299 |
+ |
} |
300 |
+ |
auxInfo->mcTau.push_back(tautemp); |
301 |
+ |
} |
302 |
|
|
303 |
|
if(abs(id)==23){ |
304 |
|
|
314 |
|
for(int j = 0; j < ndau; ++ j) { |
315 |
|
const Candidate * Zdau = p.daughter( j ); |
316 |
|
ztemp.dauid.push_back(Zdau->pdgId()); |
317 |
< |
ztemp.dauFourMomentum.push_back(GENPTOLOR(p)); |
317 |
> |
ztemp.dauFourMomentum.push_back(GENPTOLORP(Zdau)); |
318 |
|
} |
319 |
|
auxInfo->mcZ.push_back(ztemp); |
320 |
|
} |
402 |
|
iEvent.getByLabel(subjetLabel_,subjetHandle); |
403 |
|
edm::View<pat::Jet> subjets = *subjetHandle; |
404 |
|
|
405 |
+ |
// filter jet |
406 |
+ |
edm::Handle<edm::View<pat::Jet> > filterjetHandle; |
407 |
+ |
iEvent.getByLabel(filterjetLabel_,filterjetHandle); |
408 |
+ |
edm::View<pat::Jet> filterjets = *filterjetHandle; |
409 |
+ |
|
410 |
|
// standard jets |
411 |
|
|
359 |
– |
edm::Handle<edm::View<pat::Jet> > simplejet1Handle; |
360 |
– |
iEvent.getByLabel(simplejet1Label_,simplejet1Handle); |
361 |
– |
edm::View<pat::Jet> simplejets1 = *simplejet1Handle; |
412 |
|
|
413 |
|
edm::Handle<edm::View<pat::Jet> > simplejet2Handle; |
414 |
|
iEvent.getByLabel(simplejet2Label_,simplejet2Handle); |
418 |
|
iEvent.getByLabel(simplejet3Label_,simplejet3Handle); |
419 |
|
edm::View<pat::Jet> simplejets3 = *simplejet3Handle; |
420 |
|
|
371 |
– |
edm::Handle<edm::View<pat::Jet> > simplejet4Handle; |
372 |
– |
iEvent.getByLabel(simplejet4Label_,simplejet4Handle); |
373 |
– |
edm::View<pat::Jet> simplejets4 = *simplejet4Handle; |
421 |
|
|
422 |
|
|
423 |
|
edm::Handle<edm::View<pat::Electron> > electronHandle; |
432 |
|
edm::Handle<edm::View<pat::Tau> > tauHandle; |
433 |
|
iEvent.getByLabel(tauLabel_,tauHandle); |
434 |
|
edm::View<pat::Tau> taus = *tauHandle; |
435 |
< |
|
435 |
> |
|
436 |
> |
//Get the computer for the CSV |
437 |
> |
ESHandle<JetTagComputer> handle; |
438 |
> |
iSetup.get<JetTagComputerRecord>().get("combinedSecondaryVertex", handle); |
439 |
> |
computer = dynamic_cast<const GenericMVAJetTagComputer*>(handle.product()); |
440 |
|
|
441 |
|
//BTAGGING SCALE FACTOR FROM DATABASE |
442 |
|
//Combined Secondary Vertex Loose |
467 |
|
btagSFs.MISTAGSF_CSVT = (mistagSF_CSVT_.product()); |
468 |
|
|
469 |
|
#ifdef ENABLE_SIMPLEJETS1 |
470 |
+ |
edm::Handle<edm::View<pat::Jet> > simplejet1Handle; |
471 |
+ |
iEvent.getByLabel(simplejet1Label_,simplejet1Handle); |
472 |
+ |
edm::View<pat::Jet> simplejets1 = *simplejet1Handle; |
473 |
|
for(edm::View<pat::Jet>::const_iterator jet_iter = simplejets1.begin(); jet_iter!=simplejets1.end(); ++jet_iter){ |
474 |
|
// if(jet_iter->pt()>50) |
475 |
|
// njetscounter++; |
522 |
|
// if(!runOnMC_) |
523 |
|
setJecUnc(sj,jecUnc); |
524 |
|
|
471 |
– |
|
525 |
|
Particle::LorentzVector p4Jet = jet_iter->p4(); |
526 |
|
|
527 |
|
if(runOnMC_){ |
550 |
|
} |
551 |
|
|
552 |
|
} //isMC |
553 |
+ |
// |
554 |
+ |
|
555 |
+ |
|
556 |
|
hbbInfo->simpleJets3.push_back(sj); |
557 |
|
|
558 |
|
} |
559 |
|
|
560 |
|
#ifdef ENABLE_SIMPLEJETS4 |
561 |
+ |
edm::Handle<edm::View<pat::Jet> > simplejet4Handle; |
562 |
+ |
iEvent.getByLabel(simplejet4Label_,simplejet4Handle); |
563 |
+ |
edm::View<pat::Jet> simplejets4 = *simplejet4Handle; |
564 |
|
for(edm::View<pat::Jet>::const_iterator jet_iter = simplejets4.begin(); jet_iter!=simplejets4.end(); ++jet_iter){ |
565 |
|
// if(jet_iter->pt()>50) |
566 |
|
// njetscounter++; |
567 |
< |
VHbbEvent::SimpleJet sj; |
567 |
> |
|
568 |
> |
VHbbEvent::SimpleJet sj; |
569 |
|
// std::cout <<" sj4"<<std::endl; |
570 |
|
fillSimpleJet(sj,jet_iter); |
571 |
|
// if(!runOnMC_) |
572 |
|
setJecUnc(sj,jecUnc); |
573 |
+ |
|
574 |
|
|
575 |
|
|
576 |
|
Particle::LorentzVector p4Jet = jet_iter->p4(); |
606 |
|
} |
607 |
|
#endif //ENABLE SIMPLEJETS4 |
608 |
|
|
609 |
< |
|
609 |
> |
|
610 |
|
for(edm::View<pat::Jet>::const_iterator jet_iter = simplejets2.begin(); jet_iter!=simplejets2.end(); ++jet_iter){ |
611 |
|
|
612 |
+ |
|
613 |
+ |
|
614 |
|
VHbbEvent::SimpleJet sj; |
615 |
|
// std::cout <<" sj2"<<std::endl; |
616 |
< |
fillSimpleJet(sj,jet_iter); |
616 |
> |
fillSimpleJet(sj,jet_iter); |
617 |
> |
|
618 |
> |
///########### PU JET ID ################# |
619 |
> |
// add puId... |
620 |
> |
edm::Handle<edm::ValueMap<float> > puJetIdMVA; |
621 |
> |
iEvent.getByLabel("puJetMva","fullDiscriminant", puJetIdMVA); |
622 |
> |
|
623 |
> |
edm::Handle<edm::ValueMap<int> > puJetIdFlag; |
624 |
> |
iEvent.getByLabel("puJetMva", "fullId", puJetIdFlag); |
625 |
> |
|
626 |
> |
// cout << " pt " << jet_iter->pt() << " eta " << jet_iter->eta() << std::endl; |
627 |
> |
unsigned int idx = jet_iter - simplejets2.begin(); |
628 |
> |
|
629 |
> |
|
630 |
> |
|
631 |
> |
sj.puJetIdMva = (*puJetIdMVA)[simplejets2.refAt(idx)]; |
632 |
> |
int idflag = (*puJetIdFlag)[simplejets2.refAt(idx)]; |
633 |
> |
|
634 |
> |
|
635 |
> |
// cout << " PU JetID MVA " << mva; |
636 |
> |
if( PileupJetIdentifier::passJetId( idflag, PileupJetIdentifier::kLoose )) { |
637 |
> |
//cout << " pass loose wp"; |
638 |
> |
sj.puJetIdL =1; |
639 |
> |
} |
640 |
> |
if( PileupJetIdentifier::passJetId( idflag, PileupJetIdentifier::kMedium )) { |
641 |
> |
// cout << " pass medium wp"; |
642 |
> |
sj.puJetIdM =1; |
643 |
> |
} |
644 |
> |
if( PileupJetIdentifier::passJetId( idflag, PileupJetIdentifier::kTight )) { |
645 |
> |
// cout << " pass tight wp"; |
646 |
> |
sj.puJetIdT =1; |
647 |
> |
} |
648 |
> |
// cout << endl; |
649 |
> |
// ############# END OF PU JET ID ###################### |
650 |
> |
|
651 |
> |
|
652 |
|
// if(!runOnMC_) |
653 |
|
setJecUnc(sj,jecUnc); |
654 |
|
/* sj.flavour = jet_iter->partonFlavour(); |
671 |
|
sj.SF_CSVLerr=0; |
672 |
|
sj.SF_CSVMerr=0; |
673 |
|
sj.SF_CSVTerr=0; |
674 |
< |
|
674 |
> |
|
675 |
> |
|
676 |
|
// |
677 |
|
// addtaginfo for csv |
678 |
|
// |
721 |
|
} |
722 |
|
} |
723 |
|
|
724 |
< |
} //isMC |
724 |
> |
// add flag if a mc lepton is find inside a cone around the jets... |
725 |
> |
iEvent.getByLabel("genParticles", genParticles); |
726 |
> |
|
727 |
> |
for(size_t i = 0; i < genParticles->size(); ++ i) { |
728 |
> |
|
729 |
> |
const GenParticle & p = (*genParticles)[i]; |
730 |
> |
int id = 0; |
731 |
> |
p.pt()> lep_ptCutForBjets_ ? id= p.pdgId(): 0; |
732 |
> |
|
733 |
> |
// std::cout<< "found a muon with pt " << mu->pt() << std::endl; |
734 |
> |
if ((abs(id)==13 || abs(id)==11) && deltaR(p.eta(), p.phi(), sj.p4.Eta(), sj.p4.Phi() ) <0.5) sj.isSemiLeptMCtruth=1; |
735 |
> |
} |
736 |
> |
|
737 |
> |
} //isMC |
738 |
> |
|
739 |
> |
// add flag if a reco lepton is find inside a cone around the jets... |
740 |
> |
edm::Handle<edm::View<reco::Candidate> > muonNoCutsHandle; |
741 |
> |
iEvent.getByLabel(muonoCutsLabel_,muonNoCutsHandle); |
742 |
> |
edm::View<reco::Candidate> muonsNoCuts = *muonNoCutsHandle; |
743 |
> |
|
744 |
> |
|
745 |
> |
|
746 |
> |
for(edm::View<reco::Candidate>::const_iterator mu = muonsNoCuts.begin(); mu!=muonsNoCuts.end() && sj.isSemiLept!=1; ++mu){ |
747 |
> |
// std::cout<< "found a muon with pt " << mu->pt() << std::endl; |
748 |
> |
const pat::Muon& m = static_cast <const pat::Muon&> (*mu); |
749 |
> |
float Smpt = m.pt(); |
750 |
> |
float Smeta = m.eta(); |
751 |
> |
float Smphi = m.phi(); |
752 |
> |
|
753 |
> |
float SmJdR = deltaR(Smeta, Smphi, sj.p4.Eta(), sj.p4.Phi()); |
754 |
> |
|
755 |
> |
if ( Smpt> lep_ptCutForBjets_ && SmJdR <0.5) { |
756 |
> |
sj.isSemiLept=1; |
757 |
> |
//isSemiLept(-99), isSemiLeptMCtruth(-99), SoftLeptPt(-99), SoftLeptdR(-99), SoftLeptptRel(-99), SoftLeptpdgId(-99), SoftLeptIdlooseMu(-99), SoftLeptId95(-99), SoftLeptRelCombIso(-99), |
758 |
> |
sj.SoftLeptpdgId =13; |
759 |
> |
sj.SoftLeptdR= SmJdR; |
760 |
> |
sj.SoftLeptPt=Smpt; |
761 |
> |
TVector3 mvec ( m.p4().Vect().X(), m.p4().Vect().Y(), m.p4().Vect().Z() ); |
762 |
> |
sj.SoftLeptptRel= sj.p4.Perp( mvec ); |
763 |
> |
sj.SoftLeptRelCombIso = (m.trackIso() + m.ecalIso() + m.hcalIso() ) / Smpt ; |
764 |
> |
sj.SoftLeptIdlooseMu=m.muonID("TMLastStationLoose"); |
765 |
> |
} |
766 |
> |
} |
767 |
> |
|
768 |
> |
|
769 |
> |
edm::Handle<edm::View<reco::Candidate> > eleNoCutsHandle; |
770 |
> |
iEvent.getByLabel(elenoCutsLabel_,eleNoCutsHandle); |
771 |
> |
edm::View<reco::Candidate> elesNoCuts = *eleNoCutsHandle; |
772 |
> |
|
773 |
> |
|
774 |
> |
|
775 |
> |
for(edm::View<reco::Candidate>::const_iterator ele = elesNoCuts.begin(); ele!=elesNoCuts.end() && sj.isSemiLept!=1; ++ele){ |
776 |
> |
|
777 |
> |
const pat::Electron& e = static_cast <const pat::Electron&> (*ele); |
778 |
> |
float Smpt = e.pt(); |
779 |
> |
float Smeta = e.eta(); |
780 |
> |
float Smphi = e.phi(); |
781 |
> |
|
782 |
> |
float SmJdR = deltaR(Smeta, Smphi, sj.p4.Eta(), sj.p4.Phi()); |
783 |
> |
if ( Smpt> lep_ptCutForBjets_ && SmJdR <0.5) { |
784 |
> |
sj.isSemiLept=1; |
785 |
> |
sj.SoftLeptpdgId =11; |
786 |
> |
sj.SoftLeptdR= SmJdR; |
787 |
> |
sj.SoftLeptPt=Smpt; |
788 |
> |
TVector3 mvec ( e.p4().Vect().X(), e.p4().Vect().Y(), e.p4().Vect().Z() ); |
789 |
> |
sj.SoftLeptptRel= sj.p4.Perp( mvec ); |
790 |
> |
sj.SoftLeptRelCombIso = (e.trackIso() + e.ecalIso() + e.hcalIso() ) / Smpt ; |
791 |
> |
// sj.SoftLeptId95=e.electronID("eidVBTFCom95"); |
792 |
> |
//std::cout << "before ele id " << std::endl; |
793 |
> |
// std::cout << " e.e.sigmaIetaIeta " << e.sigmaIetaIeta() << std::endl; |
794 |
> |
//std::cout << " e.isEB() " << e.isEB() << std::endl; |
795 |
> |
if ( |
796 |
> |
( fabs(Smeta)<2.5 && !( abs(Smeta)>1.4442 && abs(Smeta)<1.566)) && |
797 |
> |
|
798 |
> |
(( abs(Smeta)>1.566 && (e.sigmaIetaIeta()<0.01) && ( e.deltaPhiSuperClusterTrackAtVtx()<0.8 && e.deltaPhiSuperClusterTrackAtVtx()>-0.8) && ( e.deltaEtaSuperClusterTrackAtVtx()<0.007 && e.deltaEtaSuperClusterTrackAtVtx()>-0.007 ) ) |
799 |
> |
|| ( abs(Smeta)<1.4442 && (e.sigmaIetaIeta()<0.03) && ( e.deltaPhiSuperClusterTrackAtVtx()<0.7 && e.deltaPhiSuperClusterTrackAtVtx()>-0.7 ) && ( e.deltaEtaSuperClusterTrackAtVtx()<0.01 && e.deltaEtaSuperClusterTrackAtVtx()>-0.01 ) )) |
800 |
> |
) |
801 |
> |
sj.SoftLeptId95=1; |
802 |
> |
} |
803 |
> |
} |
804 |
> |
|
805 |
> |
|
806 |
> |
|
807 |
> |
|
808 |
|
|
809 |
|
hbbInfo->simpleJets2.push_back(sj); |
810 |
|
|
911 |
|
|
912 |
|
} |
913 |
|
|
914 |
+ |
for(edm::View<pat::Jet>::const_iterator filterjet_iter = filterjets.begin(); filterjet_iter!=filterjets.end(); ++filterjet_iter){ |
915 |
+ |
|
916 |
+ |
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";} |
917 |
+ |
|
918 |
+ |
VHbbEvent::SimpleJet fj; |
919 |
+ |
// std::cout <<" sub jet "<<std::endl; |
920 |
+ |
fillSimpleJet(fj,filterjet_iter); |
921 |
+ |
// if(!runOnMC_) |
922 |
+ |
setJecUnc(fj,jecUnc); |
923 |
+ |
|
924 |
+ |
hbbInfo->filterJets.push_back(fj); |
925 |
+ |
|
926 |
+ |
|
927 |
+ |
} |
928 |
+ |
|
929 |
+ |
// |
930 |
+ |
// add charged met |
931 |
+ |
// |
932 |
+ |
|
933 |
+ |
edm::Handle<edm::View<reco::MET> > metChargedHandle; |
934 |
+ |
iEvent.getByLabel("pfMETNoPUCharge",metChargedHandle); |
935 |
+ |
edm::View<reco::MET> metsCh = *metChargedHandle; |
936 |
+ |
if(metsCh.size()){ |
937 |
+ |
hbbInfo->metCh.sumEt=(metsCh[0]).sumEt(); |
938 |
+ |
hbbInfo->metCh.metSig=metSignificance(& (metsCh[0])); |
939 |
+ |
hbbInfo->metCh.eLong=(metsCh[0]).e_longitudinal(); |
940 |
+ |
hbbInfo->metCh.p4=GENPTOLOR((metsCh[0])); |
941 |
+ |
if (verbose_) std::cout <<" METCharged "<< hbbInfo->metCh.metSig <<" " << hbbInfo->metCh.sumEt<<std::endl; |
942 |
+ |
} |
943 |
+ |
|
944 |
+ |
// type 1 corr met |
945 |
+ |
edm::Handle<edm::View<reco::MET> > pfmetType1corrHandle; |
946 |
+ |
iEvent.getByLabel("patType1CorrectedPFMet",pfmetType1corrHandle); |
947 |
+ |
edm::View<reco::MET> pfmetsType1corr = *pfmetType1corrHandle; |
948 |
+ |
if(pfmetsType1corr.size()){ |
949 |
+ |
hbbInfo->pfmetType1corr.sumEt=(pfmetsType1corr[0]).sumEt(); |
950 |
+ |
hbbInfo->pfmetType1corr.metSig=metSignificance(& (pfmetsType1corr[0])); |
951 |
+ |
hbbInfo->pfmetType1corr.eLong=(pfmetsType1corr[0]).e_longitudinal(); |
952 |
+ |
hbbInfo->pfmetType1corr.p4=GENPTOLOR((pfmetsType1corr[0])); |
953 |
+ |
if (verbose_) std::cout <<" type 1 corrected pfMET "<< hbbInfo->pfmetType1corr.metSig <<" " << hbbInfo->pfmetType1corr.sumEt<<std::endl; |
954 |
+ |
} |
955 |
+ |
|
956 |
+ |
|
957 |
+ |
// type 1 + 2 corr met |
958 |
+ |
edm::Handle<edm::View<reco::MET> > pfmetType1p2corrHandle; |
959 |
+ |
iEvent.getByLabel("patType1p2CorrectedPFMet",pfmetType1p2corrHandle); |
960 |
+ |
edm::View<reco::MET> pfmetsType1p2corr = *pfmetType1p2corrHandle; |
961 |
+ |
if(pfmetsType1p2corr.size()){ |
962 |
+ |
hbbInfo->pfmetType1p2corr.sumEt=(pfmetsType1p2corr[0]).sumEt(); |
963 |
+ |
hbbInfo->pfmetType1p2corr.metSig=metSignificance(& (pfmetsType1p2corr[0])); |
964 |
+ |
hbbInfo->pfmetType1p2corr.eLong=(pfmetsType1p2corr[0]).e_longitudinal(); |
965 |
+ |
hbbInfo->pfmetType1p2corr.p4=GENPTOLOR((pfmetsType1p2corr[0])); |
966 |
+ |
if (verbose_) std::cout <<" type 1 +2 corrected pfMET "<< hbbInfo->pfmetType1p2corr.metSig <<" " << hbbInfo->pfmetType1p2corr.sumEt<<std::endl; |
967 |
+ |
} |
968 |
+ |
|
969 |
+ |
// type 1 corr met NoPU |
970 |
+ |
/* edm::Handle<edm::View<reco::MET> > pfmetNoPUType1corrHandle; |
971 |
+ |
iEvent.getByLabel("patType1CorrectedPFMetNoPU",pfmetNoPUType1corrHandle); |
972 |
+ |
edm::View<reco::MET> pfmetsNoPUType1corr = *pfmetNoPUType1corrHandle; |
973 |
+ |
if(pfmetsNoPUType1corr.size()){ |
974 |
+ |
hbbInfo->pfmetNoPUType1corr.sumEt=(pfmetsNoPUType1corr[0]).sumEt(); |
975 |
+ |
hbbInfo->pfmetNoPUType1corr.metSig=metSignificance(& (pfmetsNoPUType1corr[0])); |
976 |
+ |
hbbInfo->pfmetNoPUType1corr.eLong=(pfmetsNoPUType1corr[0]).e_longitudinal(); |
977 |
+ |
hbbInfo->pfmetNoPUType1corr.p4=GENPTOLOR((pfmetsNoPUType1corr[0])); |
978 |
+ |
if (verbose_) std::cout <<" type 1 corrected pfMET NoPU"<< hbbInfo->pfmetNoPUType1corr.metSig <<" " << hbbInfo->pfmetNoPUType1corr.sumEt<<std::endl; |
979 |
+ |
} |
980 |
+ |
|
981 |
+ |
|
982 |
+ |
// type 1 + 2 corr met |
983 |
+ |
edm::Handle<edm::View<reco::MET> > pfmetNoPUType1p2corrHandle; |
984 |
+ |
iEvent.getByLabel("patType1p2CorrectedPFMetNoPU",pfmetNoPUType1p2corrHandle); |
985 |
+ |
edm::View<reco::MET> pfmetsNoPUType1p2corr = *pfmetNoPUType1p2corrHandle; |
986 |
+ |
if(pfmetsNoPUType1p2corr.size()){ |
987 |
+ |
hbbInfo->pfmetNoPUType1p2corr.sumEt=(pfmetsNoPUType1p2corr[0]).sumEt(); |
988 |
+ |
hbbInfo->pfmetNoPUType1p2corr.metSig=metSignificance(& (pfmetsNoPUType1p2corr[0])); |
989 |
+ |
hbbInfo->pfmetNoPUType1p2corr.eLong=(pfmetsNoPUType1p2corr[0]).e_longitudinal(); |
990 |
+ |
hbbInfo->pfmetNoPUType1p2corr.p4=GENPTOLOR((pfmetsNoPUType1p2corr[0])); |
991 |
+ |
if (verbose_) std::cout <<" type 1 +2 corrected pfMET "<< hbbInfo->pfmetNoPUType1p2corr.metSig <<" " << hbbInfo->pfmetNoPUType1p2corr.sumEt<<std::endl; |
992 |
+ |
} |
993 |
+ |
|
994 |
+ |
*/ |
995 |
+ |
|
996 |
+ |
/* |
997 |
+ |
// MET uncertainty vector |
998 |
+ |
vector<pat::MET> "patType1CorrectedPFMet" "" "VH" |
999 |
+ |
vector<pat::MET> "patType1CorrectedPFMetElectronEnDown" "" "VH" |
1000 |
+ |
vector<pat::MET> "patType1CorrectedPFMetElectronEnUp" "" "VH" |
1001 |
+ |
vector<pat::MET> "patType1CorrectedPFMetJetEnDown" "" "VH" |
1002 |
+ |
vector<pat::MET> "patType1CorrectedPFMetJetEnUp" "" "VH" |
1003 |
+ |
vector<pat::MET> "patType1CorrectedPFMetJetResDown" "" "VH" |
1004 |
+ |
vector<pat::MET> "patType1CorrectedPFMetJetResUp" "" "VH" |
1005 |
+ |
vector<pat::MET> "patType1CorrectedPFMetMuonEnDown" "" "VH" |
1006 |
+ |
vector<pat::MET> "patType1CorrectedPFMetMuonEnUp" "" "VH" |
1007 |
+ |
vector<pat::MET> "patType1CorrectedPFMetNoPU" "" "VH" |
1008 |
+ |
vector<pat::MET> "patType1CorrectedPFMetTauEnDown" "" "VH" |
1009 |
+ |
vector<pat::MET> "patType1CorrectedPFMetTauEnUp" "" "VH" |
1010 |
+ |
vector<pat::MET> "patType1CorrectedPFMetUnclusteredEnDown" "" "VH" |
1011 |
+ |
vector<pat::MET> "patType1CorrectedPFMetUnclusteredEnUp" "" "VH" |
1012 |
+ |
vector<pat::MET> "patType1p2CorrectedPFMet" "" "VH" |
1013 |
+ |
vector<pat::MET> "patType1p2CorrectedPFMetElectronEnDown" "" "VH" |
1014 |
+ |
vector<pat::MET> "patType1p2CorrectedPFMetElectronEnUp" "" "VH" |
1015 |
+ |
vector<pat::MET> "patType1p2CorrectedPFMetJetEnDown" "" "VH" |
1016 |
+ |
vector<pat::MET> "patType1p2CorrectedPFMetJetEnUp" "" "VH" |
1017 |
+ |
vector<pat::MET> "patType1p2CorrectedPFMetJetResDown" "" "VH" |
1018 |
+ |
vector<pat::MET> "patType1p2CorrectedPFMetJetResUp" "" "VH" |
1019 |
+ |
vector<pat::MET> "patType1p2CorrectedPFMetMuonEnDown" "" "VH" |
1020 |
+ |
vector<pat::MET> "patType1p2CorrectedPFMetMuonEnUp" "" "VH" |
1021 |
+ |
vector<pat::MET> "patType1p2CorrectedPFMetNoPU" "" "VH" |
1022 |
+ |
vector<pat::MET> "patType1p2CorrectedPFMetTauEnDown" "" "VH" |
1023 |
+ |
vector<pat::MET> "patType1p2CorrectedPFMetTauEnUp" "" "VH" |
1024 |
+ |
vector<pat::MET> "patType1p2CorrectedPFMetUnclusteredEnDown" "" "VH" |
1025 |
+ |
vector<pat::MET> "patType1p2CorrectedPFMetUnclusteredEnUp" "" "VH" |
1026 |
+ |
*/ |
1027 |
+ |
|
1028 |
+ |
VHbbEvent::METInfo metunc; |
1029 |
+ |
edm::Handle<edm::View<reco::MET> > patType1CorrectedPFMetElectronEnDownHandle; |
1030 |
+ |
iEvent.getByLabel("patType1CorrectedPFMetElectronEnDown",patType1CorrectedPFMetElectronEnDownHandle); |
1031 |
+ |
edm::View<reco::MET> patType1CorrectedPFMetsElectronEnDown = *patType1CorrectedPFMetElectronEnDownHandle; |
1032 |
+ |
if(patType1CorrectedPFMetsElectronEnDown.size()){ |
1033 |
+ |
metunc.sumEt =(patType1CorrectedPFMetsElectronEnDown[0]).sumEt(); |
1034 |
+ |
metunc.metSig=metSignificance(& (patType1CorrectedPFMetsElectronEnDown[0])); |
1035 |
+ |
metunc.eLong=(patType1CorrectedPFMetsElectronEnDown[0]).e_longitudinal(); |
1036 |
+ |
metunc.p4=GENPTOLOR((patType1CorrectedPFMetsElectronEnDown[0])); |
1037 |
+ |
hbbInfo->metUncInfo.push_back(metunc); |
1038 |
+ |
} |
1039 |
+ |
|
1040 |
+ |
edm::Handle<edm::View<reco::MET> > patType1CorrectedPFMetElectronEnUpHandle; |
1041 |
+ |
iEvent.getByLabel("patType1CorrectedPFMetElectronEnUp",patType1CorrectedPFMetElectronEnUpHandle); |
1042 |
+ |
edm::View<reco::MET> patType1CorrectedPFMetsElectronEnUp = *patType1CorrectedPFMetElectronEnUpHandle; |
1043 |
+ |
if(patType1CorrectedPFMetsElectronEnUp.size()){ |
1044 |
+ |
metunc.sumEt =(patType1CorrectedPFMetsElectronEnUp[0]).sumEt(); |
1045 |
+ |
metunc.metSig=metSignificance(& (patType1CorrectedPFMetsElectronEnUp[0])); |
1046 |
+ |
metunc.eLong=(patType1CorrectedPFMetsElectronEnUp[0]).e_longitudinal(); |
1047 |
+ |
metunc.p4=GENPTOLOR((patType1CorrectedPFMetsElectronEnUp[0])); |
1048 |
+ |
hbbInfo->metUncInfo.push_back(metunc); |
1049 |
+ |
} |
1050 |
+ |
|
1051 |
+ |
|
1052 |
+ |
|
1053 |
+ |
edm::Handle<edm::View<reco::MET> > patType1CorrectedPFMetMuonEnDownHandle; |
1054 |
+ |
iEvent.getByLabel("patType1CorrectedPFMetMuonEnDown",patType1CorrectedPFMetMuonEnDownHandle); |
1055 |
+ |
edm::View<reco::MET> patType1CorrectedPFMetsMuonEnDown = *patType1CorrectedPFMetMuonEnDownHandle; |
1056 |
+ |
if(patType1CorrectedPFMetsMuonEnDown.size()){ |
1057 |
+ |
metunc.sumEt =(patType1CorrectedPFMetsMuonEnDown[0]).sumEt(); |
1058 |
+ |
metunc.metSig=metSignificance(& (patType1CorrectedPFMetsMuonEnDown[0])); |
1059 |
+ |
metunc.eLong=(patType1CorrectedPFMetsMuonEnDown[0]).e_longitudinal(); |
1060 |
+ |
metunc.p4=GENPTOLOR((patType1CorrectedPFMetsMuonEnDown[0])); |
1061 |
+ |
hbbInfo->metUncInfo.push_back(metunc); |
1062 |
+ |
} |
1063 |
+ |
|
1064 |
+ |
edm::Handle<edm::View<reco::MET> > patType1CorrectedPFMetMuonEnUpHandle; |
1065 |
+ |
iEvent.getByLabel("patType1CorrectedPFMetMuonEnUp",patType1CorrectedPFMetMuonEnUpHandle); |
1066 |
+ |
edm::View<reco::MET> patType1CorrectedPFMetsMuonEnUp = *patType1CorrectedPFMetMuonEnUpHandle; |
1067 |
+ |
if(patType1CorrectedPFMetsMuonEnUp.size()){ |
1068 |
+ |
metunc.sumEt =(patType1CorrectedPFMetsMuonEnUp[0]).sumEt(); |
1069 |
+ |
metunc.metSig=metSignificance(& (patType1CorrectedPFMetsMuonEnUp[0])); |
1070 |
+ |
metunc.eLong=(patType1CorrectedPFMetsMuonEnUp[0]).e_longitudinal(); |
1071 |
+ |
metunc.p4=GENPTOLOR((patType1CorrectedPFMetsMuonEnUp[0])); |
1072 |
+ |
hbbInfo->metUncInfo.push_back(metunc); |
1073 |
+ |
} |
1074 |
+ |
|
1075 |
+ |
|
1076 |
+ |
|
1077 |
+ |
edm::Handle<edm::View<reco::MET> > patType1CorrectedPFMetTauEnDownHandle; |
1078 |
+ |
iEvent.getByLabel("patType1CorrectedPFMetTauEnDown",patType1CorrectedPFMetTauEnDownHandle); |
1079 |
+ |
edm::View<reco::MET> patType1CorrectedPFMetsTauEnDown = *patType1CorrectedPFMetTauEnDownHandle; |
1080 |
+ |
if(patType1CorrectedPFMetsTauEnDown.size()){ |
1081 |
+ |
metunc.sumEt =(patType1CorrectedPFMetsTauEnDown[0]).sumEt(); |
1082 |
+ |
metunc.metSig=metSignificance(& (patType1CorrectedPFMetsTauEnDown[0])); |
1083 |
+ |
metunc.eLong=(patType1CorrectedPFMetsTauEnDown[0]).e_longitudinal(); |
1084 |
+ |
metunc.p4=GENPTOLOR((patType1CorrectedPFMetsTauEnDown[0])); |
1085 |
+ |
hbbInfo->metUncInfo.push_back(metunc); |
1086 |
+ |
} |
1087 |
+ |
|
1088 |
+ |
edm::Handle<edm::View<reco::MET> > patType1CorrectedPFMetTauEnUpHandle; |
1089 |
+ |
iEvent.getByLabel("patType1CorrectedPFMetTauEnUp",patType1CorrectedPFMetTauEnUpHandle); |
1090 |
+ |
edm::View<reco::MET> patType1CorrectedPFMetsTauEnUp = *patType1CorrectedPFMetTauEnUpHandle; |
1091 |
+ |
if(patType1CorrectedPFMetsTauEnUp.size()){ |
1092 |
+ |
metunc.sumEt =(patType1CorrectedPFMetsTauEnUp[0]).sumEt(); |
1093 |
+ |
metunc.metSig=metSignificance(& (patType1CorrectedPFMetsTauEnUp[0])); |
1094 |
+ |
metunc.eLong=(patType1CorrectedPFMetsTauEnUp[0]).e_longitudinal(); |
1095 |
+ |
metunc.p4=GENPTOLOR((patType1CorrectedPFMetsTauEnUp[0])); |
1096 |
+ |
hbbInfo->metUncInfo.push_back(metunc); |
1097 |
+ |
} |
1098 |
+ |
|
1099 |
+ |
|
1100 |
+ |
edm::Handle<edm::View<reco::MET> > patType1CorrectedPFMetJetEnDownHandle; |
1101 |
+ |
iEvent.getByLabel("patType1CorrectedPFMetJetEnDown",patType1CorrectedPFMetJetEnDownHandle); |
1102 |
+ |
edm::View<reco::MET> patType1CorrectedPFMetsJetEnDown = *patType1CorrectedPFMetJetEnDownHandle; |
1103 |
+ |
if(patType1CorrectedPFMetsJetEnDown.size()){ |
1104 |
+ |
metunc.sumEt =(patType1CorrectedPFMetsJetEnDown[0]).sumEt(); |
1105 |
+ |
metunc.metSig=metSignificance(& (patType1CorrectedPFMetsJetEnDown[0])); |
1106 |
+ |
metunc.eLong=(patType1CorrectedPFMetsJetEnDown[0]).e_longitudinal(); |
1107 |
+ |
metunc.p4=GENPTOLOR((patType1CorrectedPFMetsJetEnDown[0])); |
1108 |
+ |
hbbInfo->metUncInfo.push_back(metunc); |
1109 |
+ |
} |
1110 |
+ |
|
1111 |
+ |
edm::Handle<edm::View<reco::MET> > patType1CorrectedPFMetJetEnUpHandle; |
1112 |
+ |
iEvent.getByLabel("patType1CorrectedPFMetJetEnUp",patType1CorrectedPFMetJetEnUpHandle); |
1113 |
+ |
edm::View<reco::MET> patType1CorrectedPFMetsJetEnUp = *patType1CorrectedPFMetJetEnUpHandle; |
1114 |
+ |
if(patType1CorrectedPFMetsJetEnUp.size()){ |
1115 |
+ |
metunc.sumEt =(patType1CorrectedPFMetsJetEnUp[0]).sumEt(); |
1116 |
+ |
metunc.metSig=metSignificance(& (patType1CorrectedPFMetsJetEnUp[0])); |
1117 |
+ |
metunc.eLong=(patType1CorrectedPFMetsJetEnUp[0]).e_longitudinal(); |
1118 |
+ |
metunc.p4=GENPTOLOR((patType1CorrectedPFMetsJetEnUp[0])); |
1119 |
+ |
hbbInfo->metUncInfo.push_back(metunc); |
1120 |
+ |
} |
1121 |
+ |
|
1122 |
+ |
|
1123 |
+ |
edm::Handle<edm::View<reco::MET> > patType1CorrectedPFMetJetResDownHandle; |
1124 |
+ |
iEvent.getByLabel("patType1CorrectedPFMetJetResDown",patType1CorrectedPFMetJetResDownHandle); |
1125 |
+ |
edm::View<reco::MET> patType1CorrectedPFMetsJetResDown = *patType1CorrectedPFMetJetResDownHandle; |
1126 |
+ |
if(patType1CorrectedPFMetsJetResDown.size()){ |
1127 |
+ |
metunc.sumEt =(patType1CorrectedPFMetsJetResDown[0]).sumEt(); |
1128 |
+ |
metunc.metSig=metSignificance(& (patType1CorrectedPFMetsJetResDown[0])); |
1129 |
+ |
metunc.eLong=(patType1CorrectedPFMetsJetResDown[0]).e_longitudinal(); |
1130 |
+ |
metunc.p4=GENPTOLOR((patType1CorrectedPFMetsJetResDown[0])); |
1131 |
+ |
hbbInfo->metUncInfo.push_back(metunc); |
1132 |
+ |
} |
1133 |
+ |
|
1134 |
+ |
edm::Handle<edm::View<reco::MET> > patType1CorrectedPFMetJetResUpHandle; |
1135 |
+ |
iEvent.getByLabel("patType1CorrectedPFMetJetResUp",patType1CorrectedPFMetJetResUpHandle); |
1136 |
+ |
edm::View<reco::MET> patType1CorrectedPFMetsJetResUp = *patType1CorrectedPFMetJetResUpHandle; |
1137 |
+ |
if(patType1CorrectedPFMetsJetResUp.size()){ |
1138 |
+ |
metunc.sumEt =(patType1CorrectedPFMetsJetResUp[0]).sumEt(); |
1139 |
+ |
metunc.metSig=metSignificance(& (patType1CorrectedPFMetsJetResUp[0])); |
1140 |
+ |
metunc.eLong=(patType1CorrectedPFMetsJetResUp[0]).e_longitudinal(); |
1141 |
+ |
metunc.p4=GENPTOLOR((patType1CorrectedPFMetsJetResUp[0])); |
1142 |
+ |
hbbInfo->metUncInfo.push_back(metunc); |
1143 |
+ |
} |
1144 |
+ |
|
1145 |
+ |
|
1146 |
+ |
edm::Handle<edm::View<reco::MET> > patType1CorrectedPFMetUnclusteredEnDownHandle; |
1147 |
+ |
iEvent.getByLabel("patType1CorrectedPFMetUnclusteredEnDown",patType1CorrectedPFMetUnclusteredEnDownHandle); |
1148 |
+ |
edm::View<reco::MET> patType1CorrectedPFMetsUnclusteredEnDown = *patType1CorrectedPFMetUnclusteredEnDownHandle; |
1149 |
+ |
if(patType1CorrectedPFMetsUnclusteredEnDown.size()){ |
1150 |
+ |
metunc.sumEt =(patType1CorrectedPFMetsUnclusteredEnDown[0]).sumEt(); |
1151 |
+ |
metunc.metSig=metSignificance(& (patType1CorrectedPFMetsUnclusteredEnDown[0])); |
1152 |
+ |
metunc.eLong=(patType1CorrectedPFMetsUnclusteredEnDown[0]).e_longitudinal(); |
1153 |
+ |
metunc.p4=GENPTOLOR((patType1CorrectedPFMetsUnclusteredEnDown[0])); |
1154 |
+ |
hbbInfo->metUncInfo.push_back(metunc); |
1155 |
+ |
} |
1156 |
+ |
|
1157 |
+ |
edm::Handle<edm::View<reco::MET> > patType1CorrectedPFMetUnclusteredEnUpHandle; |
1158 |
+ |
iEvent.getByLabel("patType1CorrectedPFMetUnclusteredEnUp",patType1CorrectedPFMetUnclusteredEnUpHandle); |
1159 |
+ |
edm::View<reco::MET> patType1CorrectedPFMetsUnclusteredEnUp = *patType1CorrectedPFMetUnclusteredEnUpHandle; |
1160 |
+ |
if(patType1CorrectedPFMetsUnclusteredEnUp.size()){ |
1161 |
+ |
metunc.sumEt =(patType1CorrectedPFMetsUnclusteredEnUp[0]).sumEt(); |
1162 |
+ |
metunc.metSig=metSignificance(& (patType1CorrectedPFMetsUnclusteredEnUp[0])); |
1163 |
+ |
metunc.eLong=(patType1CorrectedPFMetsUnclusteredEnUp[0]).e_longitudinal(); |
1164 |
+ |
metunc.p4=GENPTOLOR((patType1CorrectedPFMetsUnclusteredEnUp[0])); |
1165 |
+ |
hbbInfo->metUncInfo.push_back(metunc); |
1166 |
+ |
} |
1167 |
+ |
|
1168 |
+ |
|
1169 |
+ |
edm::Handle<edm::View<reco::MET> > patType1p2CorrectedPFMetElectronEnDownHandle; |
1170 |
+ |
iEvent.getByLabel("patType1p2CorrectedPFMetElectronEnDown",patType1p2CorrectedPFMetElectronEnDownHandle); |
1171 |
+ |
edm::View<reco::MET> patType1p2CorrectedPFMetsElectronEnDown = *patType1p2CorrectedPFMetElectronEnDownHandle; |
1172 |
+ |
if(patType1p2CorrectedPFMetsElectronEnDown.size()){ |
1173 |
+ |
metunc.sumEt =(patType1p2CorrectedPFMetsElectronEnDown[0]).sumEt(); |
1174 |
+ |
metunc.metSig=metSignificance(& (patType1p2CorrectedPFMetsElectronEnDown[0])); |
1175 |
+ |
metunc.eLong=(patType1p2CorrectedPFMetsElectronEnDown[0]).e_longitudinal(); |
1176 |
+ |
metunc.p4=GENPTOLOR((patType1p2CorrectedPFMetsElectronEnDown[0])); |
1177 |
+ |
hbbInfo->metUncInfo.push_back(metunc); |
1178 |
+ |
} |
1179 |
+ |
|
1180 |
+ |
edm::Handle<edm::View<reco::MET> > patType1p2CorrectedPFMetElectronEnUpHandle; |
1181 |
+ |
iEvent.getByLabel("patType1p2CorrectedPFMetElectronEnUp",patType1p2CorrectedPFMetElectronEnUpHandle); |
1182 |
+ |
edm::View<reco::MET> patType1p2CorrectedPFMetsElectronEnUp = *patType1p2CorrectedPFMetElectronEnUpHandle; |
1183 |
+ |
if(patType1p2CorrectedPFMetsElectronEnUp.size()){ |
1184 |
+ |
metunc.sumEt =(patType1p2CorrectedPFMetsElectronEnUp[0]).sumEt(); |
1185 |
+ |
metunc.metSig=metSignificance(& (patType1p2CorrectedPFMetsElectronEnUp[0])); |
1186 |
+ |
metunc.eLong=(patType1p2CorrectedPFMetsElectronEnUp[0]).e_longitudinal(); |
1187 |
+ |
metunc.p4=GENPTOLOR((patType1p2CorrectedPFMetsElectronEnUp[0])); |
1188 |
+ |
hbbInfo->metUncInfo.push_back(metunc); |
1189 |
+ |
} |
1190 |
+ |
|
1191 |
+ |
|
1192 |
+ |
|
1193 |
+ |
edm::Handle<edm::View<reco::MET> > patType1p2CorrectedPFMetMuonEnDownHandle; |
1194 |
+ |
iEvent.getByLabel("patType1p2CorrectedPFMetMuonEnDown",patType1p2CorrectedPFMetMuonEnDownHandle); |
1195 |
+ |
edm::View<reco::MET> patType1p2CorrectedPFMetsMuonEnDown = *patType1p2CorrectedPFMetMuonEnDownHandle; |
1196 |
+ |
if(patType1p2CorrectedPFMetsMuonEnDown.size()){ |
1197 |
+ |
metunc.sumEt =(patType1p2CorrectedPFMetsMuonEnDown[0]).sumEt(); |
1198 |
+ |
metunc.metSig=metSignificance(& (patType1p2CorrectedPFMetsMuonEnDown[0])); |
1199 |
+ |
metunc.eLong=(patType1p2CorrectedPFMetsMuonEnDown[0]).e_longitudinal(); |
1200 |
+ |
metunc.p4=GENPTOLOR((patType1p2CorrectedPFMetsMuonEnDown[0])); |
1201 |
+ |
hbbInfo->metUncInfo.push_back(metunc); |
1202 |
+ |
} |
1203 |
+ |
|
1204 |
+ |
edm::Handle<edm::View<reco::MET> > patType1p2CorrectedPFMetMuonEnUpHandle; |
1205 |
+ |
iEvent.getByLabel("patType1p2CorrectedPFMetMuonEnUp",patType1p2CorrectedPFMetMuonEnUpHandle); |
1206 |
+ |
edm::View<reco::MET> patType1p2CorrectedPFMetsMuonEnUp = *patType1p2CorrectedPFMetMuonEnUpHandle; |
1207 |
+ |
if(patType1p2CorrectedPFMetsMuonEnUp.size()){ |
1208 |
+ |
metunc.sumEt =(patType1p2CorrectedPFMetsMuonEnUp[0]).sumEt(); |
1209 |
+ |
metunc.metSig=metSignificance(& (patType1p2CorrectedPFMetsMuonEnUp[0])); |
1210 |
+ |
metunc.eLong=(patType1p2CorrectedPFMetsMuonEnUp[0]).e_longitudinal(); |
1211 |
+ |
metunc.p4=GENPTOLOR((patType1p2CorrectedPFMetsMuonEnUp[0])); |
1212 |
+ |
hbbInfo->metUncInfo.push_back(metunc); |
1213 |
+ |
} |
1214 |
+ |
|
1215 |
+ |
|
1216 |
+ |
|
1217 |
+ |
edm::Handle<edm::View<reco::MET> > patType1p2CorrectedPFMetTauEnDownHandle; |
1218 |
+ |
iEvent.getByLabel("patType1p2CorrectedPFMetTauEnDown",patType1p2CorrectedPFMetTauEnDownHandle); |
1219 |
+ |
edm::View<reco::MET> patType1p2CorrectedPFMetsTauEnDown = *patType1p2CorrectedPFMetTauEnDownHandle; |
1220 |
+ |
if(patType1p2CorrectedPFMetsTauEnDown.size()){ |
1221 |
+ |
metunc.sumEt =(patType1p2CorrectedPFMetsTauEnDown[0]).sumEt(); |
1222 |
+ |
metunc.metSig=metSignificance(& (patType1p2CorrectedPFMetsTauEnDown[0])); |
1223 |
+ |
metunc.eLong=(patType1p2CorrectedPFMetsTauEnDown[0]).e_longitudinal(); |
1224 |
+ |
metunc.p4=GENPTOLOR((patType1p2CorrectedPFMetsTauEnDown[0])); |
1225 |
+ |
hbbInfo->metUncInfo.push_back(metunc); |
1226 |
+ |
} |
1227 |
+ |
|
1228 |
+ |
edm::Handle<edm::View<reco::MET> > patType1p2CorrectedPFMetTauEnUpHandle; |
1229 |
+ |
iEvent.getByLabel("patType1p2CorrectedPFMetTauEnUp",patType1p2CorrectedPFMetTauEnUpHandle); |
1230 |
+ |
edm::View<reco::MET> patType1p2CorrectedPFMetsTauEnUp = *patType1p2CorrectedPFMetTauEnUpHandle; |
1231 |
+ |
if(patType1p2CorrectedPFMetsTauEnUp.size()){ |
1232 |
+ |
metunc.sumEt =(patType1p2CorrectedPFMetsTauEnUp[0]).sumEt(); |
1233 |
+ |
metunc.metSig=metSignificance(& (patType1p2CorrectedPFMetsTauEnUp[0])); |
1234 |
+ |
metunc.eLong=(patType1p2CorrectedPFMetsTauEnUp[0]).e_longitudinal(); |
1235 |
+ |
metunc.p4=GENPTOLOR((patType1p2CorrectedPFMetsTauEnUp[0])); |
1236 |
+ |
hbbInfo->metUncInfo.push_back(metunc); |
1237 |
+ |
} |
1238 |
+ |
|
1239 |
+ |
|
1240 |
+ |
edm::Handle<edm::View<reco::MET> > patType1p2CorrectedPFMetJetEnDownHandle; |
1241 |
+ |
iEvent.getByLabel("patType1p2CorrectedPFMetJetEnDown",patType1p2CorrectedPFMetJetEnDownHandle); |
1242 |
+ |
edm::View<reco::MET> patType1p2CorrectedPFMetsJetEnDown = *patType1p2CorrectedPFMetJetEnDownHandle; |
1243 |
+ |
if(patType1p2CorrectedPFMetsJetEnDown.size()){ |
1244 |
+ |
metunc.sumEt =(patType1p2CorrectedPFMetsJetEnDown[0]).sumEt(); |
1245 |
+ |
metunc.metSig=metSignificance(& (patType1p2CorrectedPFMetsJetEnDown[0])); |
1246 |
+ |
metunc.eLong=(patType1p2CorrectedPFMetsJetEnDown[0]).e_longitudinal(); |
1247 |
+ |
metunc.p4=GENPTOLOR((patType1p2CorrectedPFMetsJetEnDown[0])); |
1248 |
+ |
hbbInfo->metUncInfo.push_back(metunc); |
1249 |
+ |
} |
1250 |
+ |
|
1251 |
+ |
edm::Handle<edm::View<reco::MET> > patType1p2CorrectedPFMetJetEnUpHandle; |
1252 |
+ |
iEvent.getByLabel("patType1p2CorrectedPFMetJetEnUp",patType1p2CorrectedPFMetJetEnUpHandle); |
1253 |
+ |
edm::View<reco::MET> patType1p2CorrectedPFMetsJetEnUp = *patType1p2CorrectedPFMetJetEnUpHandle; |
1254 |
+ |
if(patType1p2CorrectedPFMetsJetEnUp.size()){ |
1255 |
+ |
metunc.sumEt =(patType1p2CorrectedPFMetsJetEnUp[0]).sumEt(); |
1256 |
+ |
metunc.metSig=metSignificance(& (patType1p2CorrectedPFMetsJetEnUp[0])); |
1257 |
+ |
metunc.eLong=(patType1p2CorrectedPFMetsJetEnUp[0]).e_longitudinal(); |
1258 |
+ |
metunc.p4=GENPTOLOR((patType1p2CorrectedPFMetsJetEnUp[0])); |
1259 |
+ |
hbbInfo->metUncInfo.push_back(metunc); |
1260 |
+ |
} |
1261 |
+ |
|
1262 |
+ |
|
1263 |
+ |
edm::Handle<edm::View<reco::MET> > patType1p2CorrectedPFMetJetResDownHandle; |
1264 |
+ |
iEvent.getByLabel("patType1p2CorrectedPFMetJetResDown",patType1p2CorrectedPFMetJetResDownHandle); |
1265 |
+ |
edm::View<reco::MET> patType1p2CorrectedPFMetsJetResDown = *patType1p2CorrectedPFMetJetResDownHandle; |
1266 |
+ |
if(patType1p2CorrectedPFMetsJetResDown.size()){ |
1267 |
+ |
metunc.sumEt =(patType1p2CorrectedPFMetsJetResDown[0]).sumEt(); |
1268 |
+ |
metunc.metSig=metSignificance(& (patType1p2CorrectedPFMetsJetResDown[0])); |
1269 |
+ |
metunc.eLong=(patType1p2CorrectedPFMetsJetResDown[0]).e_longitudinal(); |
1270 |
+ |
metunc.p4=GENPTOLOR((patType1p2CorrectedPFMetsJetResDown[0])); |
1271 |
+ |
hbbInfo->metUncInfo.push_back(metunc); |
1272 |
+ |
} |
1273 |
+ |
|
1274 |
+ |
edm::Handle<edm::View<reco::MET> > patType1p2CorrectedPFMetJetResUpHandle; |
1275 |
+ |
iEvent.getByLabel("patType1p2CorrectedPFMetJetResUp",patType1p2CorrectedPFMetJetResUpHandle); |
1276 |
+ |
edm::View<reco::MET> patType1p2CorrectedPFMetsJetResUp = *patType1p2CorrectedPFMetJetResUpHandle; |
1277 |
+ |
if(patType1p2CorrectedPFMetsJetResUp.size()){ |
1278 |
+ |
metunc.sumEt =(patType1p2CorrectedPFMetsJetResUp[0]).sumEt(); |
1279 |
+ |
metunc.metSig=metSignificance(& (patType1p2CorrectedPFMetsJetResUp[0])); |
1280 |
+ |
metunc.eLong=(patType1p2CorrectedPFMetsJetResUp[0]).e_longitudinal(); |
1281 |
+ |
metunc.p4=GENPTOLOR((patType1p2CorrectedPFMetsJetResUp[0])); |
1282 |
+ |
hbbInfo->metUncInfo.push_back(metunc); |
1283 |
+ |
} |
1284 |
+ |
|
1285 |
+ |
|
1286 |
+ |
edm::Handle<edm::View<reco::MET> > patType1p2CorrectedPFMetUnclusteredEnDownHandle; |
1287 |
+ |
iEvent.getByLabel("patType1p2CorrectedPFMetUnclusteredEnDown",patType1p2CorrectedPFMetUnclusteredEnDownHandle); |
1288 |
+ |
edm::View<reco::MET> patType1p2CorrectedPFMetsUnclusteredEnDown = *patType1p2CorrectedPFMetUnclusteredEnDownHandle; |
1289 |
+ |
if(patType1p2CorrectedPFMetsUnclusteredEnDown.size()){ |
1290 |
+ |
metunc.sumEt =(patType1p2CorrectedPFMetsUnclusteredEnDown[0]).sumEt(); |
1291 |
+ |
metunc.metSig=metSignificance(& (patType1p2CorrectedPFMetsUnclusteredEnDown[0])); |
1292 |
+ |
metunc.eLong=(patType1p2CorrectedPFMetsUnclusteredEnDown[0]).e_longitudinal(); |
1293 |
+ |
metunc.p4=GENPTOLOR((patType1p2CorrectedPFMetsUnclusteredEnDown[0])); |
1294 |
+ |
hbbInfo->metUncInfo.push_back(metunc); |
1295 |
+ |
} |
1296 |
+ |
|
1297 |
+ |
edm::Handle<edm::View<reco::MET> > patType1p2CorrectedPFMetUnclusteredEnUpHandle; |
1298 |
+ |
iEvent.getByLabel("patType1p2CorrectedPFMetUnclusteredEnUp",patType1p2CorrectedPFMetUnclusteredEnUpHandle); |
1299 |
+ |
edm::View<reco::MET> patType1p2CorrectedPFMetsUnclusteredEnUp = *patType1p2CorrectedPFMetUnclusteredEnUpHandle; |
1300 |
+ |
if(patType1p2CorrectedPFMetsUnclusteredEnUp.size()){ |
1301 |
+ |
metunc.sumEt =(patType1p2CorrectedPFMetsUnclusteredEnUp[0]).sumEt(); |
1302 |
+ |
metunc.metSig=metSignificance(& (patType1p2CorrectedPFMetsUnclusteredEnUp[0])); |
1303 |
+ |
metunc.eLong=(patType1p2CorrectedPFMetsUnclusteredEnUp[0]).e_longitudinal(); |
1304 |
+ |
metunc.p4=GENPTOLOR((patType1p2CorrectedPFMetsUnclusteredEnUp[0])); |
1305 |
+ |
hbbInfo->metUncInfo.push_back(metunc); |
1306 |
+ |
} |
1307 |
+ |
|
1308 |
+ |
|
1309 |
|
|
1310 |
|
// |
1311 |
|
// met is calomet |
1316 |
|
edm::View<pat::MET> metsTC = *metTCHandle; |
1317 |
|
if(metsTC.size()){ |
1318 |
|
hbbInfo->tcmet.sumEt=(metsTC[0]).sumEt(); |
1319 |
< |
hbbInfo->tcmet.metSig=(metsTC[0]).significance(); |
1319 |
> |
hbbInfo->tcmet.metSig=metSignificance(&(metsTC[0])); |
1320 |
|
hbbInfo->tcmet.eLong=(metsTC[0]).e_longitudinal(); |
1321 |
|
hbbInfo->tcmet.p4=GENPTOLOR((metsTC[0])); |
1322 |
|
if (verbose_) std::cout <<" METTC "<< hbbInfo->tcmet.metSig <<" " << hbbInfo->tcmet.sumEt<<std::endl; |
1327 |
|
edm::View<reco::MET> metspfMETNoPU = *pfMETNoPUHandle; |
1328 |
|
if(metspfMETNoPU.size()){ |
1329 |
|
hbbInfo->metNoPU.sumEt=(metspfMETNoPU[0]).sumEt(); |
1330 |
< |
hbbInfo->metNoPU.metSig=(metspfMETNoPU[0]).significance(); |
1330 |
> |
hbbInfo->metNoPU.metSig=metSignificance(&(metspfMETNoPU[0])); |
1331 |
|
hbbInfo->metNoPU.eLong=(metspfMETNoPU[0]).e_longitudinal(); |
1332 |
|
hbbInfo->metNoPU.p4=GENPTOLOR((metspfMETNoPU[0])); |
1333 |
|
if (verbose_) std::cout <<" pfMETNoPU "<< hbbInfo->metNoPU.metSig <<" " << hbbInfo->metNoPU.sumEt<<std::endl; |
1338 |
|
edm::View<reco::MET> metsHT = *mHTHandle; |
1339 |
|
if(metsHT.size()){ |
1340 |
|
hbbInfo->mht.sumEt=(metsHT[0]).sumEt(); |
1341 |
< |
hbbInfo->mht.metSig=(metsHT[0]).significance(); |
1341 |
> |
hbbInfo->mht.metSig=metSignificance(&(metsHT[0])); |
1342 |
|
hbbInfo->mht.eLong=(metsHT[0]).e_longitudinal(); |
1343 |
|
hbbInfo->mht.p4=GENPTOLOR((metsHT[0])); |
1344 |
|
if (verbose_) std::cout <<" METHT "<< hbbInfo->mht.metSig <<" " << hbbInfo->mht.sumEt<<std::endl; |
1350 |
|
|
1351 |
|
if(mets.size()){ |
1352 |
|
hbbInfo->calomet.sumEt=(mets[0]).sumEt(); |
1353 |
< |
hbbInfo->calomet.metSig=(mets[0]).significance(); |
1353 |
> |
hbbInfo->calomet.metSig=metSignificance(&(mets[0])); |
1354 |
|
hbbInfo->calomet.eLong=(mets[0]).e_longitudinal(); |
1355 |
|
hbbInfo->calomet.p4=GENPTOLOR((mets[0])); |
1356 |
|
if (verbose_) std::cout <<" METCALO "<< hbbInfo->calomet.metSig <<" " << hbbInfo->calomet.sumEt<<std::endl; |
1357 |
|
} |
1358 |
|
|
1359 |
|
edm::Handle<edm::View<pat::MET> > metPFHandle; |
1360 |
< |
iEvent.getByLabel("patMETsPF",metPFHandle); |
1360 |
> |
iEvent.getByLabel("patMETs",metPFHandle); |
1361 |
|
edm::View<pat::MET> metsPF = *metPFHandle; |
1362 |
|
|
1363 |
|
if(metsPF.size()){ |
1364 |
|
hbbInfo->pfmet.sumEt=(metsPF[0]).sumEt(); |
1365 |
< |
hbbInfo->pfmet.metSig=(metsPF[0]).significance(); |
1365 |
> |
hbbInfo->pfmet.metSig=metSignificance(&(metsPF[0])); |
1366 |
|
hbbInfo->pfmet.eLong=(metsPF[0]).e_longitudinal(); |
1367 |
|
hbbInfo->pfmet.p4=GENPTOLOR((metsPF[0])); |
1368 |
|
if (verbose_) std::cout <<" METPF "<< hbbInfo->pfmet.metSig <<" " << hbbInfo->pfmet.sumEt<<std::endl; |
1384 |
|
mf.eIso=mu->ecalIso(); |
1385 |
|
mf.hIso=mu->hcalIso(); |
1386 |
|
mf.pfChaIso=mu->chargedHadronIso(); |
1387 |
< |
mf.pfChaPUIso=mu->userIso(5); |
1387 |
> |
mf.pfChaPUIso=mu->puChargedHadronIso(); //userIso(5); |
1388 |
|
mf.pfPhoIso=mu->photonIso(); |
1389 |
|
mf.pfNeuIso=mu->neutralHadronIso(); |
1390 |
|
Geom::Phi<double> deltaphi(mu->phi()-atan2(mf.p4.Px(), mf.p4.Py())); |
1391 |
|
double acop = deltaphi.value(); |
1392 |
|
mf.acop=acop; |
1393 |
|
|
1394 |
< |
mf.nMatches = mu->numberOfMatches(); |
1395 |
< |
mf.nValidTracker = mu->hitPattern().numberOfValidTrackerHits(); |
819 |
< |
mf.nValidPixel = mu->hitPattern().numberOfValidPixelHits(); |
1394 |
> |
mf.emEnergy = mu->calEnergy().em; |
1395 |
> |
mf.hadEnergy = mu->calEnergy().had; |
1396 |
|
|
1397 |
+ |
mf.nMatches = mu->numberOfMatches(); |
1398 |
|
|
1399 |
|
mf.ipDb=mu->dB(); |
1400 |
|
mf.ipErrDb=mu->edB(); |
1401 |
|
mf.cat=0; |
1402 |
+ |
|
1403 |
|
if(mu->isGlobalMuon()) mf.cat|=1; |
1404 |
|
if(mu->isTrackerMuon()) mf.cat|=2; |
1405 |
|
if(mu->isStandAloneMuon()) mf.cat|=4; |
1413 |
|
TrackRef iTrack1 = mu->innerTrack(); |
1414 |
|
const reco::HitPattern& p1 = iTrack1->hitPattern(); |
1415 |
|
mf.nPixelHits=p1.pixelLayersWithMeasurement(); |
1416 |
< |
} |
1416 |
> |
|
1417 |
> |
mf.nValidTracker = p1.numberOfValidTrackerHits(); |
1418 |
> |
mf.nValidPixel = p1.numberOfValidPixelHits(); |
1419 |
> |
mf.nValidLayers = p1.trackerLayersWithMeasurement(); |
1420 |
> |
mf.isPF = mu->isPFMuon(); |
1421 |
> |
|
1422 |
> |
|
1423 |
> |
|
1424 |
> |
} |
1425 |
|
if(mu->isGlobalMuon()){ |
1426 |
|
TrackRef gTrack = mu->globalTrack(); |
1427 |
|
const reco::HitPattern& q = gTrack->hitPattern(); |
1475 |
|
|
1476 |
|
if(verbose_) |
1477 |
|
std::cout << " INPUT electrons "<<electrons.size()<<std::endl; |
1478 |
+ |
InputTag reducedEBRecHitCollection(string("reducedEcalRecHitsEB")); |
1479 |
+ |
InputTag reducedEERecHitCollection(string("reducedEcalRecHitsEE")); |
1480 |
+ |
EcalClusterLazyTools lazyTools(iEvent, iSetup, reducedEBRecHitCollection, reducedEERecHitCollection); |
1481 |
+ |
edm::ESHandle<TransientTrackBuilder> builder; |
1482 |
+ |
iSetup.get<TransientTrackRecord>().get("TransientTrackBuilder", builder); |
1483 |
+ |
const TransientTrackBuilder & transientTrackBuilder= *(builder.product()); |
1484 |
+ |
|
1485 |
|
for(edm::View<pat::Electron>::const_iterator elec = electrons.begin(); elec!=electrons.end(); ++elec){ |
1486 |
|
VHbbEvent::ElectronInfo ef; |
1487 |
|
ef.p4=GENPTOLORP(elec); |
1493 |
|
ef.eIso=elec->ecalIso(); |
1494 |
|
ef.hIso=elec->hcalIso(); |
1495 |
|
ef.pfChaIso=elec->chargedHadronIso(); |
1496 |
< |
ef.pfChaPUIso=elec->userIso(5); |
1496 |
> |
ef.pfChaPUIso=elec->puChargedHadronIso();//userIso(5); |
1497 |
|
ef.pfPhoIso=elec->photonIso(); |
1498 |
|
ef.pfNeuIso=elec->neutralHadronIso(); |
1499 |
|
|
1500 |
+ |
// |
1501 |
+ |
// ip info |
1502 |
+ |
// |
1503 |
+ |
|
1504 |
+ |
ef.ipDb=elec->dB(); |
1505 |
+ |
ef.ipErrDb=elec->edB(); |
1506 |
+ |
|
1507 |
+ |
|
1508 |
+ |
|
1509 |
|
Geom::Phi<double> deltaphi(elec->superCluster()->phi()-atan2(hbbInfo->pfmet.p4.Py(),hbbInfo->pfmet.p4.Px())); |
1510 |
|
ef.acop = deltaphi.value(); |
1511 |
|
// |
1512 |
+ |
ef.sihih = elec->sigmaIetaIeta(); |
1513 |
+ |
ef.Dphi = elec->deltaPhiSuperClusterTrackAtVtx(); |
1514 |
+ |
ef.Deta = elec->deltaEtaSuperClusterTrackAtVtx(); |
1515 |
+ |
ef.HoE = elec->hadronicOverEm(); |
1516 |
+ |
ef.convDist = elec->convDist(); |
1517 |
+ |
ef.convDcot = elec->convDcot(); |
1518 |
+ |
if(elec->gsfTrack().isNonnull()) ef.innerHits = elec->gsfTrack()->trackerExpectedHitsInner().numberOfHits(); |
1519 |
+ |
ef.isEB = elec->isEB(); |
1520 |
+ |
ef.isEE = elec->isEE(); |
1521 |
+ |
/* 2012 ELEID*/ |
1522 |
+ |
|
1523 |
+ |
const pat::Electron & ele = *elec; |
1524 |
+ |
bool validKF= false; |
1525 |
+ |
reco::TrackRef myTrackRef = ele.closestCtfTrackRef(); |
1526 |
+ |
validKF = (myTrackRef.isAvailable()); |
1527 |
+ |
validKF = (myTrackRef.isNonnull()); |
1528 |
+ |
|
1529 |
+ |
// Pure tracking variables |
1530 |
+ |
ef.fMVAVar_fbrem = ele.fbrem(); |
1531 |
+ |
ef.fMVAVar_kfchi2 = (validKF) ? myTrackRef->normalizedChi2() : 0 ; |
1532 |
+ |
ef.fMVAVar_kfhits = (validKF) ? myTrackRef->hitPattern().trackerLayersWithMeasurement() : -1. ; |
1533 |
+ |
// fMVAVar_kfhitsall = (validKF) ? myTrackRef->numberOfValidHits() : -1. ; // save also this in your ntuple as possible alternative |
1534 |
+ |
ef.fMVAVar_gsfchi2 = ele.gsfTrack()->normalizedChi2(); |
1535 |
+ |
|
1536 |
+ |
|
1537 |
+ |
// Geometrical matchings |
1538 |
+ |
ef.fMVAVar_deta = ele.deltaEtaSuperClusterTrackAtVtx(); |
1539 |
+ |
ef.fMVAVar_dphi = ele.deltaPhiSuperClusterTrackAtVtx(); |
1540 |
+ |
ef.fMVAVar_detacalo = ele.deltaEtaSeedClusterTrackAtCalo(); |
1541 |
+ |
// fMVAVar_dphicalo = ele.deltaPhiSeedClusterTrackAtCalo(); // save also this in your ntuple |
1542 |
+ |
|
1543 |
+ |
|
1544 |
+ |
// Pure ECAL -> shower shapes |
1545 |
+ |
ef.fMVAVar_see = ele.sigmaIetaIeta(); //EleSigmaIEtaIEta |
1546 |
+ |
std::vector<float> vCov = lazyTools.localCovariances(*(ele.superCluster()->seed())) ; |
1547 |
+ |
if (!isnan(vCov[2])) ef.fMVAVar_spp = sqrt (vCov[2]); //EleSigmaIPhiIPhi |
1548 |
+ |
else ef.fMVAVar_spp = 0.; |
1549 |
+ |
// fMVAVar_sigmaIEtaIPhi = vCov[1]; // save also this in your ntuple |
1550 |
+ |
|
1551 |
+ |
ef.fMVAVar_etawidth = ele.superCluster()->etaWidth(); |
1552 |
+ |
ef.fMVAVar_phiwidth = ele.superCluster()->phiWidth(); |
1553 |
+ |
ef.fMVAVar_e1x5e5x5 = (ele.e5x5()) !=0. ? 1.-(ele.e1x5()/ele.e5x5()) : -1. ; |
1554 |
+ |
ef.fMVAVar_R9 = lazyTools.e3x3(*(ele.superCluster()->seed())) / ele.superCluster()->rawEnergy(); |
1555 |
+ |
//fMVAVar_nbrems = fabs(ele.numberOfBrems()); // save also this in your ntuple |
1556 |
+ |
|
1557 |
+ |
// Energy matching |
1558 |
+ |
ef.fMVAVar_HoE = ele.hadronicOverEm(); |
1559 |
+ |
ef.fMVAVar_EoP = ele.eSuperClusterOverP(); |
1560 |
+ |
// fMVAVar_IoEmIoP = (1.0/(ele.superCluster()->energy())) - (1.0 / ele.p()); // in the future to be changed with ele.gsfTrack()->p() |
1561 |
+ |
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 |
1562 |
+ |
|
1563 |
+ |
ef.fMVAVar_eleEoPout = ele.eEleClusterOverPout(); |
1564 |
+ |
ef.fMVAVar_PreShowerOverRaw= ele.superCluster()->preshowerEnergy() / ele.superCluster()->rawEnergy(); |
1565 |
+ |
// fMVAVar_EoPout = ele.eSeedClusterOverPout(); // save also this in your ntuple |
1566 |
+ |
|
1567 |
+ |
|
1568 |
+ |
// Spectators |
1569 |
+ |
ef.fMVAVar_eta = ele.superCluster()->eta(); |
1570 |
+ |
ef.fMVAVar_pt = ele.pt(); |
1571 |
+ |
|
1572 |
+ |
//additional for cut based |
1573 |
+ |
ef.dxy = elec->gsfTrack()->dxy(vertex.position()); |
1574 |
+ |
ef.dz = elec->gsfTrack()->dz(vertex.position()); |
1575 |
+ |
|
1576 |
+ |
|
1577 |
+ |
//d0 |
1578 |
+ |
if (ele.gsfTrack().isNonnull()) { |
1579 |
+ |
ef.fMVAVar_d0 = (-1.0)*ele.gsfTrack()->dxy(vertex.position()); |
1580 |
+ |
} else if (ele.closestCtfTrackRef().isNonnull()) { |
1581 |
+ |
ef.fMVAVar_d0 = (-1.0)*ele.closestCtfTrackRef()->dxy(vertex.position()); |
1582 |
+ |
} else { |
1583 |
+ |
ef.fMVAVar_d0 = -9999.0; |
1584 |
+ |
|
1585 |
+ |
//default values for IP3D |
1586 |
+ |
ef.fMVAVar_ip3d = -999.0; |
1587 |
+ |
// fMVAVar_ip3dSig = 0.0; |
1588 |
+ |
if (ele.gsfTrack().isNonnull()) { |
1589 |
+ |
const double gsfsign = ( (-ele.gsfTrack()->dxy(vertex.position())) >=0 ) ? 1. : -1.; |
1590 |
+ |
|
1591 |
+ |
const reco::TransientTrack &tt = transientTrackBuilder.build(ele.gsfTrack()); |
1592 |
+ |
const std::pair<bool,Measurement1D> &ip3dpv = IPTools::absoluteImpactParameter3D(tt,vertex); |
1593 |
+ |
if (ip3dpv.first) { |
1594 |
+ |
double ip3d = gsfsign*ip3dpv.second.value(); |
1595 |
+ |
//double ip3derr = ip3dpv.second.error(); |
1596 |
+ |
ef.fMVAVar_ip3d = ip3d; |
1597 |
+ |
// fMVAVar_ip3dSig = ip3d/ip3derr; |
1598 |
+ |
} |
1599 |
+ |
} |
1600 |
+ |
} |
1601 |
+ |
|
1602 |
+ |
|
1603 |
+ |
/* end of 2012 ELEID*/ |
1604 |
+ |
|
1605 |
+ |
// |
1606 |
|
// fill eleids |
1607 |
|
// |
1608 |
|
/* ef.id95 = elec->electronID("simpleEleId95cIso"); |
1620 |
|
ef.id80r=elec->electronID("eidVBTFRel80"); |
1621 |
|
ef.id70 =elec->electronID("eidVBTFCom70"); |
1622 |
|
ef.id70r=elec->electronID("eidVBTFRel70"); |
1623 |
+ |
ef.mvaOut=elec->electronID("mvaNonTrigV0"); |
1624 |
+ |
ef.mvaOutTrig=elec->electronID("mvaTrigV0"); |
1625 |
|
|
1626 |
|
//Electron trigger matching |
1627 |
|
for (int itrig = 0; itrig != ntrigs; ++itrig){ |
1664 |
|
Geom::Phi<double> deltaphi(tau->phi()-atan2(hbbInfo->pfmet.p4.Py(),hbbInfo->pfmet.p4.Px())); |
1665 |
|
double acop = deltaphi.value(); |
1666 |
|
tf.acop=acop; |
1667 |
< |
tf.idbyIso=tau->tauID("byIsolation"); |
1668 |
< |
tf.idbyTrackIso=tau->tauID("trackIsolation"); |
1669 |
< |
tf.idbyTaNCfrOnePercent=tau->tauID("byTaNCfrOnePercent"); |
1670 |
< |
tf.idbyTaNCfrHalfPercent=tau->tauID("byTaNCfrHalfPercent"); |
1671 |
< |
tf.idbyTaNCfrQuarterPercent=tau->tauID("byTaNCfrQuarterPercent"); |
1672 |
< |
tf.idbyTaNCfrTenthPercent=tau->tauID("byTaNCfrTenthPercent"); |
1673 |
< |
tf.idbyTaNC=tau->tauID("byTaNC"); |
1667 |
> |
if (tau->isTauIDAvailable("againstElectronLoose")) tf.againstElectronLoose=tau->tauID("againstElectronLoose"); |
1668 |
> |
if (tau->isTauIDAvailable("againstElectronMedium")) tf.againstElectronMedium=tau->tauID("againstElectronMedium"); |
1669 |
> |
if (tau->isTauIDAvailable("againstElectronTight")) tf.againstElectronTight=tau->tauID("againstElectronTight"); |
1670 |
> |
if (tau->isTauIDAvailable("againstMuonLoose")) tf.againstMuonLoose=tau->tauID("againstMuonLoose"); |
1671 |
> |
if (tau->isTauIDAvailable("againstMuonTight")) tf.againstMuonTight=tau->tauID("againstMuonTight"); |
1672 |
> |
if (tau->isTauIDAvailable("byLooseIsolation")) tf.byLooseIsolation=tau->tauID("byLooseIsolation"); |
1673 |
> |
if (tau->isTauIDAvailable("byMediumIsolation")) tf.byMediumIsolation=tau->tauID("byMediumIsolation"); |
1674 |
> |
if (tau->isTauIDAvailable("byTightIsolation")) tf.byTightIsolation=tau->tauID("byTightIsolation"); |
1675 |
> |
if (tau->isTauIDAvailable("byVLooseIsolation")) tf.byVLooseIsolation=tau->tauID("byVLooseIsolation"); |
1676 |
> |
if (tau->isTauIDAvailable("decayModeFinding")) tf.decayModeFinding=tau->tauID("decayModeFinding"); |
1677 |
> |
if (tau->isTauIDAvailable("byIsolation")) tf.byIsolation=tau->tauID("byIsolation"); |
1678 |
> |
if (tau->isTauIDAvailable("trackIsolation")) tf.trackIsolation=tau->tauID("trackIsolation"); |
1679 |
> |
if (tau->isTauIDAvailable("byTaNCfrOnePercent")) tf.byTaNCfrOnePercent=tau->tauID("byTaNCfrOnePercent"); |
1680 |
> |
if (tau->isTauIDAvailable("byTaNCfrHalfPercent")) tf.byTaNCfrHalfPercent=tau->tauID("byTaNCfrHalfPercent"); |
1681 |
> |
if (tau->isTauIDAvailable("byTaNCfrQuarterPercent")) tf.byTaNCfrQuarterPercent=tau->tauID("byTaNCfrQuarterPercent"); |
1682 |
> |
if (tau->isTauIDAvailable("byTaNCfrTenthPercent")) tf.byTaNCfrTenthPercent=tau->tauID("byTaNCfrTenthPercent"); |
1683 |
> |
if (tau->isTauIDAvailable("byTaNC")) tf.byTaNC=tau->tauID("byTaNC"); |
1684 |
> |
if (tau->isTauIDAvailable("byLooseCombinedIsolationDeltaBetaCorr")) tf.byLooseCombinedIsolationDeltaBetaCorr=tau->tauID("byLooseCombinedIsolationDeltaBetaCorr"); |
1685 |
> |
if (tau->isTauIDAvailable("againstElectronMVA")) tf.againstElectronMVA=tau->tauID("againstElectronMVA"); |
1686 |
> |
if (tau->isPFTau()) { |
1687 |
> |
tf.isolationPFChargedHadrCandsPtSum = tau->isolationPFChargedHadrCandsPtSum(); |
1688 |
> |
tf.isolationPFGammaCandsEtSum = tau->isolationPFGammaCandsEtSum(); |
1689 |
> |
if (tau->leadPFChargedHadrCand().isAvailable()) tf.leadPFChargedHadrCandPt = tau->leadPFChargedHadrCand()->pt(); |
1690 |
> |
tf.NsignalPFChargedHadrCands = tau->signalPFChargedHadrCands().size(); |
1691 |
> |
tf.NsignalPFGammaCands = tau->signalPFGammaCands().size(); |
1692 |
> |
} |
1693 |
|
hbbInfo->tauInfo.push_back(tf); |
1694 |
+ |
if (verbose_) { |
1695 |
+ |
std::cout << "SCZ DEBUG: againstElectronLoose is " << tf.againstElectronLoose << std::endl; |
1696 |
+ |
std::cout << "SCZ DEBUG: againstElectronMedium is " << tf.againstElectronMedium << std::endl; |
1697 |
+ |
std::cout << "SCZ DEBUG: againstElectronTight is " << tf.againstElectronTight << std::endl; |
1698 |
+ |
std::cout << "SCZ DEBUG: againstMuonLoose is " << tf.againstMuonLoose << std::endl; |
1699 |
+ |
std::cout << "SCZ DEBUG: againstMuonTight is " << tf.againstMuonTight << std::endl; |
1700 |
+ |
std::cout << "SCZ DEBUG: byLooseIsolation is " << tf.byLooseIsolation << std::endl; |
1701 |
+ |
std::cout << "SCZ DEBUG: byMediumIsolation is " << tf.byMediumIsolation << std::endl; |
1702 |
+ |
std::cout << "SCZ DEBUG: byTightIsolation is " << tf.byTightIsolation << std::endl; |
1703 |
+ |
std::cout << "SCZ DEBUG: byVLooseIsolation is " << tf.byVLooseIsolation << std::endl; |
1704 |
+ |
std::cout << "SCZ DEBUG: decayModeFinding is " << tf.decayModeFinding << std::endl; |
1705 |
+ |
std::cout << "SCZ DEBUG: byIsolation is " << tf.byIsolation<< std::endl; |
1706 |
+ |
std::cout << "SCZ DEBUG: trackIsolation is " << tf.trackIsolation << std::endl; |
1707 |
+ |
std::cout << "SCZ DEBUG: byTaNCfrOnePercent is " << tf.byTaNCfrOnePercent << std::endl; |
1708 |
+ |
std::cout << "SCZ DEBUG: byTaNCfrHalfPercent is " << tf.byTaNCfrHalfPercent << std::endl; |
1709 |
+ |
std::cout << "SCZ DEBUG: byTaNCfrQuarterPercent is " << tf.byTaNCfrQuarterPercent << std::endl; |
1710 |
+ |
std::cout << "SCZ DEBUG: byTaNCfrTenthPercent is " << tf.byTaNCfrTenthPercent << std::endl; |
1711 |
+ |
std::cout << "SCZ DEBUG: byTaNC is " << tf.byTaNC << std::endl; |
1712 |
+ |
std::cout << "SCZ DEBUG: isolationPFChargedHadrCandsPtSum is " << tf.isolationPFChargedHadrCandsPtSum << std::endl; |
1713 |
+ |
std::cout << "SCZ DEBUG: isolationPFGammaCandsEtSum is " << tf.isolationPFGammaCandsEtSum << std::endl; |
1714 |
+ |
std::cout << "SCZ DEBUG: isolationPFGammaCandsEtSum is " << tf.leadPFChargedHadrCandPt << std::endl; |
1715 |
+ |
std::cout << "SCZ DEBUG: NsignalPFChargedHadrCands is " << tf.NsignalPFChargedHadrCands << std::endl; |
1716 |
+ |
std::cout << "SCZ DEBUG: NsignalPFGammaCands is " << tf.NsignalPFGammaCands << std::endl; |
1717 |
+ |
std::cout << "SCZ DEBUG: byLooseCombinedIsolationDeltaBetaCorr is " << tf.byLooseCombinedIsolationDeltaBetaCorr << std::endl; |
1718 |
+ |
std::cout << "SCZ DEBUG: againstElectronMVA is " << tf.againstElectronMVA << std::endl; |
1719 |
+ |
} |
1720 |
|
} |
1721 |
|
|
1722 |
|
CompareJetPtMuons ptComparatorMu; |
1736 |
|
" SimpleJets2 = "<<hbbInfo->simpleJets2.size()<<std::endl<< |
1737 |
|
" SubJets = "<<hbbInfo->subJets.size()<<std::endl<< |
1738 |
|
" HardJets = "<<hbbInfo->hardJets.size()<<std::endl<< |
1739 |
+ |
" FilterJets = "<<hbbInfo->filterJets.size()<<std::endl<< |
1740 |
|
" Muons = "<<hbbInfo->muInfo.size()<<std::endl<< |
1741 |
|
" Electrons = "<<hbbInfo->eleInfo.size()<<std::endl<< |
1742 |
|
" Taus = "<<hbbInfo->tauInfo.size()<<std::endl<< |
1749 |
|
iEvent.put(auxInfo); |
1750 |
|
|
1751 |
|
|
1752 |
+ |
delete jecUnc; |
1753 |
+ |
|
1754 |
|
} |
1755 |
|
|
1756 |
|
void |
1939 |
|
// test |
1940 |
|
// |
1941 |
|
|
1942 |
< |
return; |
1942 |
> |
// return; |
1943 |
|
double eta = sj.p4.Eta(); |
1944 |
|
double pt = sj.p4.Pt(); |
1945 |
|
|
1959 |
|
sj.jpb=jet_iter->bDiscriminator("jetBProbabilityBJetTags"); |
1960 |
|
sj.ssvhe=jet_iter->bDiscriminator("simpleSecondaryVertexHighEffBJetTags"); |
1961 |
|
sj.csv=jet_iter->bDiscriminator("combinedSecondaryVertexBJetTags"); |
1962 |
< |
sj.csvmva=jet_iter->bDiscriminator("combinedSecondaryVertexMVABJetTags"); |
1962 |
> |
sj.csvmva=jet_iter->bDiscriminator("combinedSecondaryVertexMVABJetTags"); |
1963 |
> |
sj.csvivf=jet_iter->bDiscriminator("combinedInclusiveSecondaryVertexBJetTags"); |
1964 |
> |
sj.cmva=jet_iter->bDiscriminator("combinedMVABJetTags"); |
1965 |
|
sj.charge=jet_iter->jetCharge(); |
1966 |
|
sj.ntracks=jet_iter->associatedTracks().size(); |
1967 |
|
sj.p4=GENPTOLORP(jet_iter); |
1975 |
|
sj.SF_CSVTerr=0; |
1976 |
|
|
1977 |
|
|
1978 |
+ |
|
1979 |
+ |
|
1980 |
+ |
|
1981 |
|
if (jet_iter->isPFJet() == true) { |
1982 |
|
|
1983 |
|
sj.chargedHadronEFraction = jet_iter-> chargedHadronEnergyFraction(); |
1987 |
|
sj.nConstituents = jet_iter->getPFConstituents().size(); |
1988 |
|
|
1989 |
|
} |
1990 |
+ |
sj.jetArea = jet_iter->jetArea(); |
1991 |
|
// |
1992 |
|
// addtaginfo for csv |
1993 |
|
// |
1996 |
|
|
1997 |
|
const reco::SecondaryVertexTagInfo * tf = jet_iter->tagInfoSecondaryVertex(); |
1998 |
|
if (tf){ |
1999 |
+ |
math::XYZTLorentzVectorD vertexSum; |
2000 |
+ |
for(size_t vi=0;vi< tf->nVertices();vi++) |
2001 |
+ |
{ |
2002 |
+ |
vertexSum+=tf->secondaryVertex(vi).p4(); |
2003 |
+ |
} |
2004 |
+ |
sj.vtxP4 = GENPTOLOR(vertexSum); |
2005 |
+ |
|
2006 |
|
if (tf->nVertices() >0){ |
2007 |
< |
sj.vtxMass = tf->secondaryVertex(0).p4().mass(); |
2007 |
> |
sj.vtxPosition = TVector3(tf->secondaryVertex(0).position().x(),tf->secondaryVertex(0).position().y(),tf->secondaryVertex(0).position().z()); |
2008 |
> |
sj.vtxMass = tf->secondaryVertex(0).p4().mass(); |
2009 |
|
sj.vtxNTracks = tf->secondaryVertex(0).nTracks(); |
2010 |
|
std::vector<reco::TrackBaseRef >::const_iterator tit = tf->secondaryVertex(0).tracks_begin(); |
2011 |
|
for (; tit< tf->secondaryVertex(0).tracks_end(); ++tit){ |
2016 |
|
sj.vtx3deL = m.error(); |
2017 |
|
} |
2018 |
|
} |
2019 |
+ |
|
2020 |
+ |
// CSV track info |
2021 |
+ |
const reco::SecondaryVertexTagInfo * svTagInfos = jet_iter->tagInfoSecondaryVertex(); |
2022 |
+ |
const reco::TrackIPTagInfo * ipTagInfos = jet_iter->tagInfoTrackIP(); |
2023 |
+ |
for (edm::RefVector<reco::TrackCollection>::const_iterator t = ipTagInfos->selectedTracks().begin(); t != ipTagInfos->selectedTracks().end(); t++){ |
2024 |
+ |
sj.btagTrackIds.push_back(t->key()); |
2025 |
+ |
}// all btag IP selected tracks |
2026 |
+ |
std::vector<const reco::BaseTagInfo*> tagInfos; |
2027 |
+ |
tagInfos.push_back(dynamic_cast<const reco::BaseTagInfo*>(ipTagInfos)); |
2028 |
+ |
tagInfos.push_back(dynamic_cast<const reco::BaseTagInfo*>(svTagInfos)); |
2029 |
+ |
JetTagComputer::TagInfoHelper helper(tagInfos); |
2030 |
+ |
reco::TaggingVariableList varList = computer->taggingVariables(helper); // computer for getting CSV variables |
2031 |
+ |
|
2032 |
+ |
for(reco::TaggingVariableList::const_iterator iter = varList.begin(); iter != varList.end(); ++iter) |
2033 |
+ |
{ |
2034 |
+ |
//std::cout << reco::TaggingVariableTokens[iter->first] << " = " << iter->second << std::endl; |
2035 |
+ |
for (edm::RefVector<reco::TrackCollection>::const_iterator t = ipTagInfos->selectedTracks().begin(); t != ipTagInfos->selectedTracks().end(); t++){ |
2036 |
+ |
|
2037 |
+ |
if (strcmp(reco::TaggingVariableTokens[iter->first], "trackMomentum") == 0 && (fabs((float)iter->second - (float)(*t)->p()) < 0.0001) ){ |
2038 |
+ |
sj.csvTrackIds.push_back(t->key()); |
2039 |
+ |
}// if tagged track |
2040 |
+ |
}// loop on IPtracks |
2041 |
+ |
}// loop on CSV variables |
2042 |
+ |
|
2043 |
+ |
|
2044 |
+ |
sj.btagNTracks= ipTagInfos->selectedTracks().size(); |
2045 |
+ |
sj.csvNTracks = sj.csvTrackIds.size(); |
2046 |
+ |
|
2047 |
|
// |
2048 |
|
// add tVector |
2049 |
|
// |
2050 |
|
sj.tVector = getTvect(&(*jet_iter)); |
2051 |
+ |
|
2052 |
+ |
sj.ptRaw = jet_iter->correctedJet(0).pt(); |
2053 |
+ |
|
2054 |
+ |
sj.ptLeadTrack =-9999.; |
2055 |
+ |
if (jet_iter->isPFJet() == true) { |
2056 |
+ |
std::vector <reco::PFCandidatePtr> constituents = jet_iter->getPFConstituents (); |
2057 |
+ |
for (unsigned ic = 0; ic < constituents.size (); ++ic) { |
2058 |
+ |
if ( constituents[ic]->particleId() > 3 ) continue; |
2059 |
+ |
reco::TrackRef trackRef = constituents[ic]->trackRef(); |
2060 |
+ |
if ( trackRef.isNonnull() ) { if(trackRef->pt() > sj.ptLeadTrack) sj.ptLeadTrack=trackRef->pt(); } |
2061 |
+ |
} |
2062 |
+ |
} |
2063 |
+ |
|
2064 |
+ |
|
2065 |
+ |
} |
2066 |
+ |
|
2067 |
+ |
float HbbAnalyzerNew::metSignificance(const reco::MET * met) |
2068 |
+ |
{ |
2069 |
+ |
double sigmaX2= met->getSignificanceMatrix()(0,0); |
2070 |
+ |
double sigmaY2= met->getSignificanceMatrix()(1,1); |
2071 |
+ |
double significance = 0; |
2072 |
+ |
try { |
2073 |
+ |
if(sigmaX2<1.e10 && sigmaY2<1.e10) significance = met->significance(); |
2074 |
+ |
} |
2075 |
+ |
catch(...) |
2076 |
+ |
{ |
2077 |
+ |
std::cout << "PROBLEM WITH MET SIGNIFICANCE sigma X2 and Y2 are: " << sigmaX2 << " " << sigmaY2 << std::endl; |
2078 |
+ |
} |
2079 |
+ |
return significance; |
2080 |
|
} |
2081 |
|
|
2082 |
|
|