176 |
|
edm::Handle<double> rhoHandle; |
177 |
|
iEvent.getByLabel(edm::InputTag("kt6PFJets", "rho"),rhoHandle); |
178 |
|
auxInfo->puInfo.rho = *rhoHandle; |
179 |
< |
|
179 |
> |
|
180 |
> |
edm::Handle<double> rho25Handle; |
181 |
> |
iEvent.getByLabel(edm::InputTag("kt6PFJets25", "rho"),rho25Handle); |
182 |
> |
auxInfo->puInfo.rho25 = *rho25Handle; |
183 |
> |
|
184 |
|
edm::Handle<std::vector< PileupSummaryInfo> > puHandle; |
185 |
|
|
186 |
|
if (runOnMC_){ |
420 |
|
// if(jet_iter->pt()>50) |
421 |
|
// njetscounter++; |
422 |
|
VHbbEvent::SimpleJet sj; |
423 |
+ |
// std::cout <<" sj1"<<std::endl; |
424 |
|
fillSimpleJet(sj,jet_iter); |
425 |
|
// if(!runOnMC_) |
426 |
|
|
436 |
|
//genJet |
437 |
|
const reco::GenJet *gJ = jet_iter->genJet(); |
438 |
|
//physical parton for mother info ONLY |
439 |
< |
if( (jet_iter->genParton()) |
440 |
< |
and (jet_iter->genParton()->mother()) ) |
441 |
< |
sj.bestMCmomid=jet_iter->genParton()->mother()->pdgId(); |
439 |
> |
if( (jet_iter->genParton()) ){ |
440 |
> |
sj.bestMCid = jet_iter->genParton()->pdgId(); |
441 |
> |
if( (jet_iter->genParton()->mother()) ) |
442 |
> |
sj.bestMCmomid=jet_iter->genParton()->mother()->pdgId(); |
443 |
> |
} |
444 |
|
TLorentzVector gJp4; |
445 |
|
if(gJ){ |
446 |
|
gJp4.SetPtEtaPhiE(gJ->pt(),gJ->eta(),gJ->phi(),gJ->energy()); |
447 |
< |
sj. bestMCp4mom = gJp4; |
447 |
> |
sj.bestMCp4 = gJp4; |
448 |
|
if(verbose_){ |
449 |
|
std::clog << "genJet matched Pt = " << gJp4.Pt() << std::endl; |
450 |
|
std::clog << "genJet matched eta = " << gJp4.Eta() << std::endl; |
463 |
|
// if(jet_iter->pt()>50) |
464 |
|
// njetscounter++; |
465 |
|
VHbbEvent::SimpleJet sj; |
466 |
+ |
// std::cout <<" sj3"<<std::endl; |
467 |
|
fillSimpleJet(sj,jet_iter); |
468 |
|
// if(!runOnMC_) |
469 |
|
setJecUnc(sj,jecUnc); |
479 |
|
//genJet |
480 |
|
const reco::GenJet *gJ = jet_iter->genJet(); |
481 |
|
//physical parton for mother info ONLY |
482 |
< |
if( (jet_iter->genParton()) |
483 |
< |
and (jet_iter->genParton()->mother()) ) |
484 |
< |
sj.bestMCmomid=jet_iter->genParton()->mother()->pdgId(); |
482 |
> |
if( (jet_iter->genParton()) ){ |
483 |
> |
sj.bestMCid = jet_iter->genParton()->pdgId(); |
484 |
> |
if( (jet_iter->genParton()->mother()) ) |
485 |
> |
sj.bestMCmomid=jet_iter->genParton()->mother()->pdgId(); |
486 |
> |
} |
487 |
|
TLorentzVector gJp4; |
488 |
|
if(gJ){ |
489 |
|
gJp4.SetPtEtaPhiE(gJ->pt(),gJ->eta(),gJ->phi(),gJ->energy()); |
490 |
< |
sj. bestMCp4mom = gJp4; |
490 |
> |
sj.bestMCp4 = gJp4; |
491 |
|
if(verbose_){ |
492 |
|
std::clog << "genJet matched Pt = " << gJp4.Pt() << std::endl; |
493 |
|
std::clog << "genJet matched eta = " << gJp4.Eta() << std::endl; |
506 |
|
// if(jet_iter->pt()>50) |
507 |
|
// njetscounter++; |
508 |
|
VHbbEvent::SimpleJet sj; |
509 |
+ |
// std::cout <<" sj4"<<std::endl; |
510 |
|
fillSimpleJet(sj,jet_iter); |
511 |
|
// if(!runOnMC_) |
512 |
|
setJecUnc(sj,jecUnc); |
522 |
|
//genJet |
523 |
|
const reco::GenJet *gJ = jet_iter->genJet(); |
524 |
|
//physical parton for mother info ONLY |
525 |
< |
if( (jet_iter->genParton()) |
526 |
< |
and (jet_iter->genParton()->mother()) ) |
527 |
< |
sj.bestMCmomid=jet_iter->genParton()->mother()->pdgId(); |
525 |
> |
if( (jet_iter->genParton()) ){ |
526 |
> |
sj.bestMCid = jet_iter->genParton()->pdgId(); |
527 |
> |
if( (jet_iter->genParton()->mother()) ) |
528 |
> |
sj.bestMCmomid=jet_iter->genParton()->mother()->pdgId(); |
529 |
> |
} |
530 |
|
TLorentzVector gJp4; |
531 |
|
if(gJ){ |
532 |
|
gJp4.SetPtEtaPhiE(gJ->pt(),gJ->eta(),gJ->phi(),gJ->energy()); |
533 |
< |
sj. bestMCp4mom = gJp4; |
533 |
> |
sj.bestMCp4 = gJp4; |
534 |
|
if(verbose_){ |
535 |
|
std::clog << "genJet matched Pt = " << gJp4.Pt() << std::endl; |
536 |
|
std::clog << "genJet matched eta = " << gJp4.Eta() << std::endl; |
549 |
|
for(edm::View<pat::Jet>::const_iterator jet_iter = simplejets2.begin(); jet_iter!=simplejets2.end(); ++jet_iter){ |
550 |
|
|
551 |
|
VHbbEvent::SimpleJet sj; |
552 |
+ |
// std::cout <<" sj2"<<std::endl; |
553 |
|
fillSimpleJet(sj,jet_iter); |
554 |
|
// if(!runOnMC_) |
555 |
|
setJecUnc(sj,jecUnc); |
605 |
|
//genJet |
606 |
|
const reco::GenJet *gJ = jet_iter->genJet(); |
607 |
|
//physical parton for mother info ONLY |
608 |
< |
if( (jet_iter->genParton()) |
609 |
< |
and (jet_iter->genParton()->mother()) ) |
610 |
< |
sj.bestMCmomid=jet_iter->genParton()->mother()->pdgId(); |
608 |
> |
if( (jet_iter->genParton()) ){ |
609 |
> |
sj.bestMCid = jet_iter->genParton()->pdgId(); |
610 |
> |
if( (jet_iter->genParton()->mother()) ) |
611 |
> |
sj.bestMCmomid=jet_iter->genParton()->mother()->pdgId(); |
612 |
> |
} |
613 |
|
TLorentzVector gJp4; |
614 |
|
if(gJ){ |
615 |
|
gJp4.SetPtEtaPhiE(gJ->pt(),gJ->eta(),gJ->phi(),gJ->energy()); |
616 |
< |
sj. bestMCp4mom = gJp4; |
616 |
> |
sj.bestMCp4 = gJp4; |
617 |
|
if(verbose_){ |
618 |
|
std::clog << "genJet matched Pt = " << gJp4.Pt() << std::endl; |
619 |
|
std::clog << "genJet matched eta = " << gJp4.Eta() << std::endl; |
693 |
|
<< "," << subjet_iter->bDiscriminator("combinedSecondaryVertexBJetTags") << "\n";} |
694 |
|
|
695 |
|
VHbbEvent::SimpleJet sj; |
696 |
+ |
// std::cout <<" sub jet "<<std::endl; |
697 |
|
fillSimpleJet(sj,subjet_iter); |
698 |
|
// if(!runOnMC_) |
699 |
|
setJecUnc(sj,jecUnc); |
745 |
|
if (verbose_) std::cout <<" METTC "<< hbbInfo->tcmet.metSig <<" " << hbbInfo->tcmet.sumEt<<std::endl; |
746 |
|
} |
747 |
|
|
748 |
+ |
edm::Handle<edm::View<reco::MET> > pfMETNoPUHandle; |
749 |
+ |
iEvent.getByLabel("pfMETNoPU",pfMETNoPUHandle); |
750 |
+ |
edm::View<reco::MET> metspfMETNoPU = *pfMETNoPUHandle; |
751 |
+ |
if(metspfMETNoPU.size()){ |
752 |
+ |
hbbInfo->metNoPU.sumEt=(metspfMETNoPU[0]).sumEt(); |
753 |
+ |
hbbInfo->metNoPU.metSig=(metspfMETNoPU[0]).significance(); |
754 |
+ |
hbbInfo->metNoPU.eLong=(metspfMETNoPU[0]).e_longitudinal(); |
755 |
+ |
hbbInfo->metNoPU.p4=GENPTOLOR((metspfMETNoPU[0])); |
756 |
+ |
if (verbose_) std::cout <<" pfMETNoPU "<< hbbInfo->metNoPU.metSig <<" " << hbbInfo->metNoPU.sumEt<<std::endl; |
757 |
+ |
} |
758 |
|
|
759 |
|
edm::Handle<edm::View<reco::MET> > mHTHandle; |
760 |
|
iEvent.getByLabel("patMETsHT",mHTHandle); |
767 |
|
if (verbose_) std::cout <<" METHT "<< hbbInfo->mht.metSig <<" " << hbbInfo->mht.sumEt<<std::endl; |
768 |
|
} |
769 |
|
|
770 |
< |
edm::Handle<edm::View<pat::MET> > metHandle; |
770 |
> |
edm::Handle<edm::View<reco::MET> > metHandle; |
771 |
|
iEvent.getByLabel(metLabel_,metHandle); |
772 |
< |
edm::View<pat::MET> mets = *metHandle; |
772 |
> |
edm::View<reco::MET> mets = *metHandle; |
773 |
|
|
774 |
|
if(mets.size()){ |
775 |
|
hbbInfo->calomet.sumEt=(mets[0]).sumEt(); |
807 |
|
mf.eIso=mu->ecalIso(); |
808 |
|
mf.hIso=mu->hcalIso(); |
809 |
|
mf.pfChaIso=mu->chargedHadronIso(); |
810 |
+ |
mf.pfChaPUIso=mu->userIso(5); |
811 |
|
mf.pfPhoIso=mu->photonIso(); |
812 |
|
mf.pfNeuIso=mu->neutralHadronIso(); |
813 |
|
Geom::Phi<double> deltaphi(mu->phi()-atan2(mf.p4.Px(), mf.p4.Py())); |
814 |
|
double acop = deltaphi.value(); |
815 |
|
mf.acop=acop; |
816 |
|
|
817 |
+ |
mf.nMatches = mu->numberOfMatches(); |
818 |
+ |
|
819 |
|
mf.ipDb=mu->dB(); |
820 |
|
mf.ipErrDb=mu->edB(); |
821 |
|
mf.cat=0; |
832 |
|
TrackRef iTrack1 = mu->innerTrack(); |
833 |
|
const reco::HitPattern& p1 = iTrack1->hitPattern(); |
834 |
|
mf.nPixelHits=p1.pixelLayersWithMeasurement(); |
835 |
< |
} |
835 |
> |
|
836 |
> |
mf.nValidTracker = p1.numberOfValidTrackerHits(); |
837 |
> |
mf.nValidPixel = p1.numberOfValidPixelHits(); |
838 |
> |
|
839 |
> |
|
840 |
> |
|
841 |
> |
} |
842 |
|
if(mu->isGlobalMuon()){ |
843 |
|
TrackRef gTrack = mu->globalTrack(); |
844 |
|
const reco::HitPattern& q = gTrack->hitPattern(); |
845 |
|
mf.globChi2=gTrack.get()->normalizedChi2(); |
846 |
|
mf.globNHits=q.numberOfValidMuonHits(); |
847 |
< |
mf. validMuStations = q. muonStationsWithValidHits(); |
847 |
> |
mf.validMuStations = q.muonStationsWithValidHits(); |
848 |
|
}else{ |
849 |
|
mf.globChi2=-99; |
850 |
|
mf.globNHits=-99; |
903 |
|
ef.eIso=elec->ecalIso(); |
904 |
|
ef.hIso=elec->hcalIso(); |
905 |
|
ef.pfChaIso=elec->chargedHadronIso(); |
906 |
+ |
ef.pfChaPUIso=elec->userIso(5); |
907 |
|
ef.pfPhoIso=elec->photonIso(); |
908 |
|
ef.pfNeuIso=elec->neutralHadronIso(); |
909 |
|
|
910 |
< |
Geom::Phi<double> deltaphi(elec->superCluster()->phi()-atan2(hbbInfo->calomet.p4.Py(),hbbInfo->calomet.p4.Px())); |
910 |
> |
Geom::Phi<double> deltaphi(elec->superCluster()->phi()-atan2(hbbInfo->pfmet.p4.Py(),hbbInfo->pfmet.p4.Px())); |
911 |
|
ef.acop = deltaphi.value(); |
912 |
|
// |
913 |
+ |
ef.sihih = elec->sigmaIetaIeta(); |
914 |
+ |
ef.Dphi = elec->deltaPhiSuperClusterTrackAtVtx(); |
915 |
+ |
ef.Deta = elec->deltaEtaSuperClusterTrackAtVtx(); |
916 |
+ |
ef.HoE = elec->hadronicOverEm(); |
917 |
+ |
ef.convDist = elec->convDist(); |
918 |
+ |
ef.convDcot = elec->convDcot(); |
919 |
+ |
if(elec->gsfTrack().isNonnull()) ef.innerHits = elec->gsfTrack()->trackerExpectedHitsInner().numberOfHits(); |
920 |
+ |
ef.isEB = elec->isEB(); |
921 |
+ |
ef.isEE = elec->isEE(); |
922 |
+ |
// |
923 |
|
// fill eleids |
924 |
|
// |
925 |
|
/* ef.id95 = elec->electronID("simpleEleId95cIso"); |
976 |
|
tf.tIso=tau->trackIso(); |
977 |
|
tf.eIso=tau->ecalIso(); |
978 |
|
tf.hIso=tau->hcalIso(); |
979 |
< |
Geom::Phi<double> deltaphi(tau->phi()-atan2(hbbInfo->calomet.p4.Py(),hbbInfo->calomet.p4.Px())); |
979 |
> |
Geom::Phi<double> deltaphi(tau->phi()-atan2(hbbInfo->pfmet.p4.Py(),hbbInfo->pfmet.p4.Px())); |
980 |
|
double acop = deltaphi.value(); |
981 |
|
tf.acop=acop; |
982 |
|
tf.idbyIso=tau->tauID("byIsolation"); |
1206 |
|
// test |
1207 |
|
// |
1208 |
|
|
1209 |
< |
return; |
1209 |
> |
// return; |
1210 |
|
double eta = sj.p4.Eta(); |
1211 |
|
double pt = sj.p4.Pt(); |
1212 |
|
|
1226 |
|
sj.jpb=jet_iter->bDiscriminator("jetBProbabilityBJetTags"); |
1227 |
|
sj.ssvhe=jet_iter->bDiscriminator("simpleSecondaryVertexHighEffBJetTags"); |
1228 |
|
sj.csv=jet_iter->bDiscriminator("combinedSecondaryVertexBJetTags"); |
1229 |
< |
sj.csvmva=jet_iter->bDiscriminator("combinedSecondaryVertexMVABJetTags"); |
1229 |
> |
sj.csvmva=jet_iter->bDiscriminator("combinedSecondaryVertexMVABJetTags"); |
1230 |
|
sj.charge=jet_iter->jetCharge(); |
1231 |
|
sj.ntracks=jet_iter->associatedTracks().size(); |
1232 |
|
sj.p4=GENPTOLORP(jet_iter); |
1233 |
+ |
// std::cout << " ECCO "<<sj.csv<< " "<< sj.p4.Pt()<<std::endl; |
1234 |
|
sj.chargedTracksFourMomentum=(getChargedTracksMomentum(&*(jet_iter))); |
1235 |
|
sj.SF_CSVL=1; |
1236 |
|
sj.SF_CSVM=1; |
1246 |
|
sj.neutralHadronEFraction = jet_iter-> neutralHadronEnergyFraction (); |
1247 |
|
sj.chargedEmEFraction = jet_iter-> chargedEmEnergyFraction (); |
1248 |
|
sj.neutralEmEFraction = jet_iter-> neutralEmEnergyFraction (); |
1249 |
< |
sj. nConstituents = jet_iter->getPFConstituents().size(); |
1249 |
> |
sj.nConstituents = jet_iter->getPFConstituents().size(); |
1250 |
|
|
1251 |
|
} |
1252 |
|
// |