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 |
|
|
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_){ |
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 |
|
// |
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())); |
1416 |
|
|
1417 |
|
mf.nValidTracker = p1.numberOfValidTrackerHits(); |
1418 |
|
mf.nValidPixel = p1.numberOfValidPixelHits(); |
1419 |
+ |
mf.nValidLayers = p1.trackerLayersWithMeasurement(); |
1420 |
+ |
mf.isPF = mu->isPFMuon(); |
1421 |
|
|
1422 |
|
|
1423 |
|
|
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 |
|
|
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){ |
1975 |
|
sj.SF_CSVTerr=0; |
1976 |
|
|
1977 |
|
|
1978 |
+ |
|
1979 |
+ |
|
1980 |
+ |
|
1981 |
|
if (jet_iter->isPFJet() == true) { |
1982 |
|
|
1983 |
|
sj.chargedHadronEFraction = jet_iter-> chargedHadronEnergyFraction(); |