Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

EITopPAG updates, merging with E/Gamma features #680

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
33 commits
Select commit Hold shift + click to select a range
34454c2
porting into CMSSW_7X
beaudett Jul 5, 2013
99709f1
porting into CMSSW_7X
beaudett Jul 5, 2013
bf77ccc
porting into CMSSW_7X
beaudett Jul 5, 2013
4f84c3e
porting into CMSSW_7X
beaudett Jul 5, 2013
2695016
porting into CMSSW_7X
beaudett Jul 5, 2013
2d1d60b
porting into CMSSW_7X
beaudett Jul 5, 2013
3f69083
porting into CMSSW_7X
beaudett Jul 5, 2013
a4eaf31
porting into CMSSW_7X
beaudett Jul 5, 2013
6fc9d07
porting into CMSSW_7X
beaudett Jul 5, 2013
6561e08
porting into CMSSW_7X
beaudett Jul 5, 2013
9d0ca11
porting into CMSSW_7X
beaudett Jul 5, 2013
c031234
porting into CMSSW_7X
beaudett Jul 5, 2013
1f78059
porting into CMSSW_7X
beaudett Jul 5, 2013
4cce33f
porting into CMSSW_7X
beaudett Jul 5, 2013
b08d198
porting into CMSSW_7X
beaudett Jul 5, 2013
f8bff9a
porting into CMSSW_7X
beaudett Jul 5, 2013
7c385ca
porting into CMSSW_7X
beaudett Jul 5, 2013
f6364d6
porting into CMSSW_7X
beaudett Jul 5, 2013
59ad33b
porting into CMSSW_7X
beaudett Jul 5, 2013
1b6c72b
fixing EITopPAG_cff file
beaudett Jul 16, 2013
22bbf88
fixing EITopPAG_cff file
beaudett Jul 16, 2013
05a54b6
remove HLTriggerOffline/Tau/python/Validation/__init__.pyc
beaudett Jul 18, 2013
d3ff0be
reverting to 214ab73 Validation/RecoEgamma/plugins/PhotonValidator.cc…
beaudett Jul 19, 2013
d664ceb
Merged refs/pull/120/head from repository cms-sw
deguio Jul 19, 2013
672a14f
including back the changes lost during the porting to GIT
deguio Jul 21, 2013
e8de1fc
Merged refs/pull/156/head from repository cms-sw
deguio Jul 21, 2013
97d23b4
Revert "porting into CMSSW_7X"
deguio Jul 25, 2013
a18bd31
Merged refs/pull/156/head from repository cms-sw
Aug 29, 2013
ca74c1a
Adapt to new GsfElectron functions.
Aug 29, 2013
68cdfb3
Merge branch 'cms-sw/refs/pull/678/head' into cms-sw/refs/pull/156/head
rappoccio Aug 30, 2013
9e63113
Adapting the PFElectronTranslator to actually fill the PU isolation v…
rappoccio Aug 30, 2013
4e8874a
Adding changes to EITopPAG_cff.py itself
rappoccio Aug 30, 2013
8ef7e91
Merged refs/pull/666/head from repository cms-sw
rappoccio Aug 30, 2013
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
31 changes: 18 additions & 13 deletions CommonTools/ParticleFlow/python/EITopPAG_cff.py
Original file line number Diff line number Diff line change
Expand Up @@ -51,15 +51,18 @@
pfIsolatedMuonsEI = cms.EDFilter(
"PFCandidateFwdPtrCollectionStringFilter",
src = cms.InputTag("pfMuonsFromVertexEI"),
cut = cms.string("pt > 5 & muonRef.isAvailable() & "\
"muonRef.pfIsolationR04().sumChargedHadronPt + "\
"muonRef.pfIsolationR04().sumNeutralHadronEt + "\
"muonRef.pfIsolationR04().sumPhotonEt "\
" < 0.15 * pt "
),
cut = cms.string('''abs(eta)<2.5 && pt>10. && muonRef.isAvailable() &&
(muonRef.pfIsolationR04().sumChargedHadronPt+
max(0.,muonRef.pfIsolationR04().sumNeutralHadronEt+
muonRef.pfIsolationR04().sumPhotonEt-
0.50*muonRef.pfIsolationR04().sumPUPt))/pt < 0.20 &&
(muonRef.isPFMuon && (muonRef.isGlobalMuon || muonRef.isTrackerMuon) )'''
),
makeClones = cms.bool(True)
)



pfNoMuon.topCollection = 'pfIsolatedMuonsEI'
pfNoMuon.bottomCollection = 'pfNoPileUpEI'

Expand All @@ -81,20 +84,22 @@

pfElectronsFromVertexEI = pfElectronsFromVertex.clone( src = cms.InputTag('pfAllElectronsEI') )


pfIsolatedElectronsEI = cms.EDFilter(
"PFCandidateFwdPtrCollectionStringFilter",
src = cms.InputTag("pfElectronsFromVertexEI"),
cut = cms.string(" pt > 5 & gsfElectronRef.isAvailable() & gsfTrackRef.trackerExpectedHitsInner.numberOfLostHits<2 & "\
"gsfElectronRef.pfIsolationVariables().chargedHadronIso + "\
"gsfElectronRef.pfIsolationVariables().neutralHadronIso + "\
"gsfElectronRef.pfIsolationVariables().photonIso "\
" < 0.2 * pt "
),
cut = cms.string('''abs(eta)<2.5 && pt>20. &&
gsfTrackRef.isAvailable() &&
gsfTrackRef.trackerExpectedHitsInner.numberOfLostHits<2 &&
(gsfElectronRef.pfIsolationVariables().sumChargedHadronPt+
max(0.,gsfElectronRef.pfIsolationVariables().sumNeutralHadronEt+
gsfElectronRef.pfIsolationVariables().sumPhotonEt-
0.5*gsfElectronRef.pfIsolationVariables().sumPUPt))/pt < 0.15
'''),
makeClones = cms.bool(True)
)



pfNoElectron.topCollection = 'pfIsolatedElectronsEI'
pfNoElectron.bottomCollection = 'pfNoMuon'

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,9 @@
"PFCandidateFwdPtrCollectionStringFilter",
src = cms.InputTag("pfElectronsFromVertex"),
cut = cms.string(" pt > 5 & gsfElectronRef.isAvailable() & gsfTrackRef.trackerExpectedHitsInner.numberOfLostHits<2 & "\
"gsfElectronRef.pfIsolationVariables().chargedHadronIso + "\
"gsfElectronRef.pfIsolationVariables().neutralHadronIso + "\
"gsfElectronRef.pfIsolationVariables().photonIso "\
"gsfElectronRef.pfIsolationVariables().sumChargedHadronPt + "\
"gsfElectronRef.pfIsolationVariables().sumNeutralHadronEt + "\
"gsfElectronRef.pfIsolationVariables().sumPhotonEt "\
" < 0.2 * pt "
),
makeClones = cms.bool(True)
Expand Down
19 changes: 13 additions & 6 deletions DataFormats/EgammaCandidates/interface/GsfElectron.h
Original file line number Diff line number Diff line change
Expand Up @@ -514,12 +514,19 @@ class GsfElectron : public RecoCandidate

struct PflowIsolationVariables
{
float chargedHadronIso ;
float neutralHadronIso ;
float photonIso ;
PflowIsolationVariables()
: chargedHadronIso(0.), neutralHadronIso(0.), photonIso(0.)
{}
//first three data members that changed names, according to DataFormats/MuonReco/interface/MuonPFIsolation.h
float sumChargedHadronPt; //!< sum-pt of charged Hadron // old float chargedHadronIso ;
float sumNeutralHadronEt; //!< sum pt of neutral hadrons // old float neutralHadronIso ;
float sumPhotonEt; //!< sum pt of PF photons // old float photonIso ;
//then four new data members, corresponding to DataFormats/MuonReco/interface/MuonPFIsolation.h
float sumChargedParticlePt; //!< sum-pt of charged Particles(inludes e/mu)
float sumNeutralHadronEtHighThreshold; //!< sum pt of neutral hadrons with a higher threshold
float sumPhotonEtHighThreshold; //!< sum pt of PF photons with a higher threshold
float sumPUPt; //!< sum pt of charged Particles not from PV (for Pu corrections)

PflowIsolationVariables() :
sumChargedHadronPt(0),sumNeutralHadronEt(0),sumPhotonEt(0),sumChargedParticlePt(0),
sumNeutralHadronEtHighThreshold(0),sumPhotonEtHighThreshold(0),sumPUPt(0) {};
} ;

struct MvaInput
Expand Down
24 changes: 23 additions & 1 deletion DataFormats/EgammaCandidates/src/classes_def.xml
Original file line number Diff line number Diff line change
Expand Up @@ -138,8 +138,30 @@
<class name="reco::GsfElectron::ChargeInfo" ClassVersion="10">
<version ClassVersion="10" checksum="1415326811"/>
</class>
<class name="reco::GsfElectron::PflowIsolationVariables" ClassVersion="10">
<class name="reco::GsfElectron::PflowIsolationVariables" ClassVersion="11">
<version ClassVersion="11" checksum="2389048798"/>
<version ClassVersion="10" checksum="4270399196"/>
<ioread sourceClass="reco::GsfElectron::PflowIsolationVariables" version="[1-10]" source="float chargedHadronIso" targetClass="reco::GsfElectron::PflowIsolationVariables" target="sumChargedHadronPt">
<![CDATA[sumChargedHadronPt = onfile.chargedHadronIso;]]>
</ioread>
<ioread sourceClass="reco::GsfElectron::PflowIsolationVariables" version="[1-10]" source="float neutralHadronIso" targetClass="reco::GsfElectron::PflowIsolationVariables" target="sumNeutralHadronEt">
<![CDATA[sumNeutralHadronEt = onfile.neutralHadronIso;]]>
</ioread>
<ioread sourceClass="reco::GsfElectron::PflowIsolationVariables" version="[1-10]" source="float photonIso" targetClass="reco::GsfElectron::PflowIsolationVariables" target="sumPhotonEt">
<![CDATA[sumPhotonEt = onfile.photonIso;]]>
</ioread>
<ioread sourceClass="reco::GsfElectron::PflowIsolationVariables" version="[1-10]" source="" targetClass="reco::GsfElectron::PflowIsolationVariables" target="sumChargedParticlePt">
<![CDATA[sumChargedParticlePt = 0.;]]>
</ioread>
<ioread sourceClass="reco::GsfElectron::PflowIsolationVariables" version="[1-10]" source="" targetClass="reco::GsfElectron::PflowIsolationVariables" target="sumNeutralHadronEtHighThreshold">
<![CDATA[sumNeutralHadronEtHighThreshold = 0.;]]>
</ioread>
<ioread sourceClass="reco::GsfElectron::PflowIsolationVariables" version="[1-10]" source="" targetClass="reco::GsfElectron::PflowIsolationVariables" target="sumPhotonEtHighThreshold">
<![CDATA[sumPhotonEtHighThreshold = 0.;]]>
</ioread>
<ioread sourceClass="reco::GsfElectron::PflowIsolationVariables" version="[1-10]" source="" targetClass="reco::GsfElectron::PflowIsolationVariables" target="sumPUPt">
<![CDATA[sumPUPt = 0.;]]>
</ioread>
</class>
<class name="reco::GsfElectron::MvaInput" ClassVersion="11">
<version ClassVersion="11" checksum="2106253688"/>
Expand Down
24 changes: 12 additions & 12 deletions RecoEgamma/EgammaElectronAlgos/src/GsfElectronAlgo.cc
Original file line number Diff line number Diff line change
Expand Up @@ -741,9 +741,9 @@ void GsfElectronAlgo::beginEvent( edm::Event & event )
//Fill in the Isolation Value Maps for PF and EcalDriven electrons
std::vector<edm::InputTag> inputTagIsoVals;
if(! generalData_->inputCfg.pfIsoVals.empty() ) {
inputTagIsoVals.push_back(generalData_->inputCfg.pfIsoVals.getParameter<edm::InputTag>("pfChargedHadrons"));
inputTagIsoVals.push_back(generalData_->inputCfg.pfIsoVals.getParameter<edm::InputTag>("pfPhotons"));
inputTagIsoVals.push_back(generalData_->inputCfg.pfIsoVals.getParameter<edm::InputTag>("pfNeutralHadrons"));
inputTagIsoVals.push_back(generalData_->inputCfg.pfIsoVals.getParameter<edm::InputTag>("pfSumChargedHadronPt"));
inputTagIsoVals.push_back(generalData_->inputCfg.pfIsoVals.getParameter<edm::InputTag>("pfSumPhotonEt"));
inputTagIsoVals.push_back(generalData_->inputCfg.pfIsoVals.getParameter<edm::InputTag>("pfSumNeutralHadronEt"));

eventData_->pfIsolationValues.resize(inputTagIsoVals.size());

Expand All @@ -755,9 +755,9 @@ void GsfElectronAlgo::beginEvent( edm::Event & event )

if(! generalData_->inputCfg.edIsoVals.empty() ) {
inputTagIsoVals.clear();
inputTagIsoVals.push_back(generalData_->inputCfg.edIsoVals.getParameter<edm::InputTag>("edChargedHadrons"));
inputTagIsoVals.push_back(generalData_->inputCfg.edIsoVals.getParameter<edm::InputTag>("edPhotons"));
inputTagIsoVals.push_back(generalData_->inputCfg.edIsoVals.getParameter<edm::InputTag>("edNeutralHadrons"));
inputTagIsoVals.push_back(generalData_->inputCfg.edIsoVals.getParameter<edm::InputTag>("edSumChargedHadronPt"));
inputTagIsoVals.push_back(generalData_->inputCfg.edIsoVals.getParameter<edm::InputTag>("edSumPhotonEt"));
inputTagIsoVals.push_back(generalData_->inputCfg.edIsoVals.getParameter<edm::InputTag>("edSumNeutralHadronEt"));

eventData_->edIsolationValues.resize(inputTagIsoVals.size());

Expand Down Expand Up @@ -904,9 +904,9 @@ void GsfElectronAlgo::addPflowInfo()
reco::GsfElectronRef
pfElectronRef(eventData_->pflowElectrons, pfIndex);
reco::GsfElectron::PflowIsolationVariables isoVariables;
isoVariables.chargedHadronIso=(*(eventData_->pfIsolationValues)[0])[pfElectronRef];
isoVariables.photonIso =(*(eventData_->pfIsolationValues)[1])[pfElectronRef];
isoVariables.neutralHadronIso=(*(eventData_->pfIsolationValues)[2])[pfElectronRef];
isoVariables.sumChargedHadronPt =(*(eventData_->pfIsolationValues)[0])[pfElectronRef];
isoVariables.sumPhotonEt =(*(eventData_->pfIsolationValues)[1])[pfElectronRef];
isoVariables.sumNeutralHadronEt =(*(eventData_->pfIsolationValues)[2])[pfElectronRef];
(*el)->setPfIsolationVariables(isoVariables);
}

Expand Down Expand Up @@ -940,9 +940,9 @@ void GsfElectronAlgo::addPflowInfo()
reco::GsfElectronRef
edElectronRef(eventData_->previousElectrons, edIndex);
reco::GsfElectron::PflowIsolationVariables isoVariables;
isoVariables.chargedHadronIso=(*(eventData_->edIsolationValues)[0])[edElectronRef];
isoVariables.photonIso =(*(eventData_->edIsolationValues)[1])[edElectronRef];
isoVariables.neutralHadronIso=(*(eventData_->edIsolationValues)[2])[edElectronRef];
isoVariables.sumChargedHadronPt =(*(eventData_->edIsolationValues)[0])[edElectronRef];
isoVariables.sumPhotonEt =(*(eventData_->edIsolationValues)[1])[edElectronRef];
isoVariables.sumNeutralHadronEt =(*(eventData_->edIsolationValues)[2])[edElectronRef];
(*el)->setPfIsolationVariables(isoVariables);
}

Expand Down
12 changes: 6 additions & 6 deletions RecoEgamma/EgammaElectronProducers/python/gsfElectrons_cfi.py
Original file line number Diff line number Diff line change
Expand Up @@ -277,14 +277,14 @@
# Iso Values (PF and EcalDriven)
useIsolationValues = cms.bool(True),
pfIsolationValues = cms.PSet(
pfChargedHadrons = cms.InputTag('elPFIsoValueCharged04'),
pfPhotons = cms.InputTag('elPFIsoValueGamma04'),
pfNeutralHadrons= cms.InputTag('elPFIsoValueNeutral04')),
pfSumChargedHadronPt = cms.InputTag('elPFIsoValueCharged04'),
pfSumPhotonEt = cms.InputTag('elPFIsoValueGamma04'),
pfSumNeutralHadronEt= cms.InputTag('elPFIsoValueNeutral04')),

edIsolationValues = cms.PSet(
edChargedHadrons = cms.InputTag('elEDIsoValueCharged04'),
edPhotons = cms.InputTag('elEDIsoValueGamma04'),
edNeutralHadrons= cms.InputTag('elEDIsoValueNeutral04'))
edSumChargedHadronPt = cms.InputTag('elEDIsoValueCharged04'),
edSumPhotonEt = cms.InputTag('elEDIsoValueGamma04'),
edSumNeutralHadronEt= cms.InputTag('elEDIsoValueNeutral04'))

)

Expand Down
15 changes: 9 additions & 6 deletions RecoParticleFlow/PFProducer/plugins/PFElectronTranslator.cc
Original file line number Diff line number Diff line change
Expand Up @@ -36,11 +36,13 @@ PFElectronTranslator::PFElectronTranslator(const edm::ParameterSet & iConfig) {
edm::ParameterSet isoVals =
iConfig.getParameter<edm::ParameterSet> ("isolationValues");
inputTagIsoVals_.push_back
(isoVals.getParameter<edm::InputTag>("pfChargedHadrons"));
(isoVals.getParameter<edm::InputTag>("pfSumChargedHadronPt"));
inputTagIsoVals_.push_back
(isoVals.getParameter<edm::InputTag>("pfPhotons"));
(isoVals.getParameter<edm::InputTag>("pfSumPhotonEt"));
inputTagIsoVals_.push_back
(isoVals.getParameter<edm::InputTag>("pfNeutralHadrons"));
(isoVals.getParameter<edm::InputTag>("pfSumNeutralHadronEt"));
inputTagIsoVals_.push_back
(isoVals.getParameter<edm::InputTag>("pfSumPUPt"));
}
}

Expand Down Expand Up @@ -630,9 +632,10 @@ void PFElectronTranslator::createGsfElectrons(const reco::PFCandidateCollection
// isolation
if( isolationValues.size() != 0 ) {
reco::GsfElectron::PflowIsolationVariables myPFIso;
myPFIso.chargedHadronIso=(*isolationValues[0])[CandidatePtr_[iGSF]];
myPFIso.photonIso=(*isolationValues[1])[CandidatePtr_[iGSF]];
myPFIso.neutralHadronIso=(*isolationValues[2])[CandidatePtr_[iGSF]];
myPFIso.sumChargedHadronPt=(*isolationValues[0])[CandidatePtr_[iGSF]];
myPFIso.sumPhotonEt=(*isolationValues[1])[CandidatePtr_[iGSF]];
myPFIso.sumNeutralHadronEt=(*isolationValues[2])[CandidatePtr_[iGSF]];
myPFIso.sumPUPt=(*isolationValues[3])[CandidatePtr_[iGSF]];
myElectron.setPfIsolationVariables(myPFIso);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,9 @@

useIsolationValues = cms.bool(False),
isolationValues = cms.PSet(
pfChargedHadrons = cms.InputTag('elPFIsoValueCharged04PFId'),
pfPhotons = cms.InputTag('elPFIsoValueGamma04PFId'),
pfNeutralHadrons= cms.InputTag('elPFIsoValueNeutral04PFId'))
pfSumChargedHadronPt = cms.InputTag('elPFIsoValueCharged04PFId'),
pfSumPhotonEt = cms.InputTag('elPFIsoValueGamma04PFId'),
pfSumNeutralHadronEt= cms.InputTag('elPFIsoValueNeutral04PFId'),
pfSumPUPt= cms.InputTag('elPFIsoValuePU04PFId'),
)
)
18 changes: 9 additions & 9 deletions Validation/RecoEgamma/plugins/ElectronMcFakeValidator.cc
Original file line number Diff line number Diff line change
Expand Up @@ -1372,17 +1372,17 @@ void ElectronMcFakeValidator::analyze( const edm::Event & iEvent, const edm::Eve
if (!bestGsfElectron.trackerDrivenSeed()&&bestGsfElectron.ecalDrivenSeed() && bestGsfElectron.isEE()) h1_ele_provenance_endcaps->Fill(2.);

// Pflow isolation
h1_ele_chargedHadronIso->Fill(bestGsfElectron.pfIsolationVariables().chargedHadronIso);
if (bestGsfElectron.isEB()) h1_ele_chargedHadronIso_barrel->Fill(bestGsfElectron.pfIsolationVariables().chargedHadronIso);
if (bestGsfElectron.isEE()) h1_ele_chargedHadronIso_endcaps->Fill(bestGsfElectron.pfIsolationVariables().chargedHadronIso);
h1_ele_chargedHadronIso->Fill(bestGsfElectron.pfIsolationVariables().sumChargedHadronPt);
if (bestGsfElectron.isEB()) h1_ele_chargedHadronIso_barrel->Fill(bestGsfElectron.pfIsolationVariables().sumChargedHadronPt);
if (bestGsfElectron.isEE()) h1_ele_chargedHadronIso_endcaps->Fill(bestGsfElectron.pfIsolationVariables().sumChargedHadronPt);

h1_ele_neutralHadronIso->Fill(bestGsfElectron.pfIsolationVariables().neutralHadronIso);
if (bestGsfElectron.isEB()) h1_ele_neutralHadronIso_barrel->Fill(bestGsfElectron.pfIsolationVariables().neutralHadronIso);
if (bestGsfElectron.isEE()) h1_ele_neutralHadronIso_endcaps->Fill(bestGsfElectron.pfIsolationVariables().neutralHadronIso);
h1_ele_neutralHadronIso->Fill(bestGsfElectron.pfIsolationVariables().sumNeutralHadronEt);
if (bestGsfElectron.isEB()) h1_ele_neutralHadronIso_barrel->Fill(bestGsfElectron.pfIsolationVariables().sumNeutralHadronEt);
if (bestGsfElectron.isEE()) h1_ele_neutralHadronIso_endcaps->Fill(bestGsfElectron.pfIsolationVariables().sumNeutralHadronEt);

h1_ele_photonIso->Fill(bestGsfElectron.pfIsolationVariables().photonIso);
if (bestGsfElectron.isEB()) h1_ele_photonIso_barrel->Fill(bestGsfElectron.pfIsolationVariables().photonIso);
if (bestGsfElectron.isEE()) h1_ele_photonIso_endcaps->Fill(bestGsfElectron.pfIsolationVariables().photonIso);
h1_ele_photonIso->Fill(bestGsfElectron.pfIsolationVariables().sumPhotonEt);
if (bestGsfElectron.isEB()) h1_ele_photonIso_barrel->Fill(bestGsfElectron.pfIsolationVariables().sumPhotonEt);
if (bestGsfElectron.isEE()) h1_ele_photonIso_endcaps->Fill(bestGsfElectron.pfIsolationVariables().sumPhotonEt);

// isolation
h1_ele_tkSumPt_dr03->Fill(bestGsfElectron.dr03TkSumPt());
Expand Down
Loading