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
Protections for jets and MET for PFEGamma and customize function to switch on PFEG in ParticleFlow REDUX #1242
Merged
ktf
merged 26 commits into
cms-sw:CMSSW_7_0_X
from
lgray:pfegamma_mva_and_protections_new
Nov 1, 2013
Merged
Changes from all commits
Commits
Show all changes
26 commits
Select commit
Hold shift + click to select a range
a4fa11b
working on eleMva calculation
lgray 6baa842
Old eleMva resurrected, working on protections / bitmasks
lgray 2ca8c63
add back old dataformat
lgray d4958ba
get old electron mva output in PFEG mostly inline with PFElectronAlgo
lgray acdc1cc
fill electron veto bits
lgray fb76076
change to new model for extra information, now stores ElementsInBlock…
lgray 4490120
fix crash in PFEGammaAlgo when no brems present
lgray 3643a76
include function to switch on PFEG and off gsfElectrons,etc
lgray 05e1420
fix crash in BremTangents
lgray a8e9582
working on PFEGCandidate checker
lgray 6d14ca8
some simply analyzers and batch scripts
lgray 26f69cc
protections part 1
dbenedet 28b6b5d
protections part 2
dbenedet d54fcb6
protections part 3
dbenedet 8cc7aa7
fix bad merge conflict resolution
lgray 3e441e5
Protections against spurious PFclusters using residual minimization
lgray d33dae5
customization to turn on EGammaGED
lgray 4d208bb
customize script for PFEG + GED switch, and associated patches for so…
lgray fe08e11
fixes to make the matrix really run (remove a few things in harvestin…
lgray 830d067
add even more cluster protections
lgray 2a484e6
provide a better interface for the protections
lgray cfbbf33
move combination.hpp and update PFEG
lgray 2b2f7ae
customize fixes
lgray 31ea1d3
remote commit conflict garbage
lgray f774cae
pass autoptrs up by reference, avoid accidentally resetting lists
lgray 7e6bbf3
remove interesting det id collectors for old-pf collections when turn…
lgray File filter
Filter by extension
Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
197 changes: 197 additions & 0 deletions
197
RecoEgamma/Configuration/python/customizePFforEGammaGED.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,197 @@ | ||
import FWCore.ParameterSet.Config as cms | ||
import FWCore.ParameterSet.Utilities as psu | ||
from PhysicsTools.PatAlgos.tools.helpers import massSearchReplaceAnyInputTag as _replaceTags | ||
|
||
def customizePFforEGammaGED(process): | ||
for path in process.paths: | ||
sequences = getattr(process,path) | ||
#for seq in path: | ||
_replaceTags(sequences, | ||
cms.InputTag('gsfElectrons'), | ||
cms.InputTag('gedGsfElectrons')) | ||
_replaceTags(sequences, | ||
cms.InputTag('gsfElectronCores'), | ||
cms.InputTag('gedGsfElectronCores')) | ||
|
||
# all the rest: | ||
if hasattr(process,'DigiToRaw'): | ||
process=_customize_DigiToRaw(process) | ||
if hasattr(process,'RawToDigi'): | ||
process=_customize_RawToDigi(process) | ||
if hasattr(process,'reconstruction'): | ||
process=_customize_Reco(process) | ||
if hasattr(process,'reconstructionWithFamos'): | ||
process=_customize_FastSim(process) | ||
if hasattr(process,'digitisation_step'): | ||
process=_customize_Digi(process) | ||
if hasattr(process,'HLTSchedule'): | ||
process=_customize_HLT(process) | ||
if hasattr(process,'L1simulation_step'): | ||
process=_customize_L1Emulator(process) | ||
if hasattr(process,'dqmoffline_step'): | ||
process=_customize_DQM(process) | ||
if hasattr(process,'dqmHarvesting'): | ||
process=_customize_harvesting(process) | ||
if hasattr(process,'validation_step'): | ||
process=_customize_Validation(process) | ||
|
||
|
||
return process | ||
|
||
def _configurePFForGEDEGamma(process): | ||
process.particleFlowTmp.useEGammaFilters = cms.bool(True) | ||
process.particleFlowTmp.usePFPhotons = cms.bool(False) | ||
process.particleFlowTmp.usePFElectrons = cms.bool(False) | ||
process.particleFlow.GsfElectrons = cms.InputTag('gedGsfElectrons') | ||
process.particleFlow.Photons = cms.InputTag('gedPhotons') | ||
return process | ||
|
||
|
||
|
||
def _customize_DQM(process): | ||
return process | ||
|
||
|
||
def _customize_Validation(process): | ||
_replaceTags(process.validation_step, | ||
cms.InputTag('gsfElectrons'), | ||
cms.InputTag('gedGsfElectrons')) | ||
_replaceTags(process.validation_step, | ||
cms.InputTag('gsfElectronCores'), | ||
cms.InputTag('gedGsfElectronCores')) | ||
#don't ask... just don't ask | ||
if hasattr(process,'HLTSusyExoValFastSim'): | ||
process.HLTSusyExoValFastSim.PlotMakerRecoInput.electrons = \ | ||
cms.string('gedGsfElectrons') | ||
for pset in process.HLTSusyExoValFastSim.reco_parametersets: | ||
pset.electrons = cms.string('gedGsfElectrons') | ||
if hasattr(process,'HLTSusyExoVal'): | ||
process.HLTSusyExoVal.PlotMakerRecoInput.electrons = \ | ||
cms.string('gedGsfElectrons') | ||
for pset in process.HLTSusyExoVal.reco_parametersets: | ||
pset.electrons = cms.string('gedGsfElectrons') | ||
if hasattr(process,'hltHiggsValidator'): | ||
process.hltHiggsValidator.H2tau.recElecLabel = \ | ||
cms.string('gedGsfElectrons') | ||
process.hltHiggsValidator.HZZ.recElecLabel = \ | ||
cms.string('gedGsfElectrons') | ||
process.hltHiggsValidator.HWW.recElecLabel = \ | ||
cms.string('gedGsfElectrons') | ||
if hasattr(process,'oldpfPhotonValidation'): | ||
process.photonValidationSequence.remove(process.oldpfPhotonValidation) | ||
return process | ||
|
||
|
||
def _customize_Digi(process): | ||
return process | ||
|
||
|
||
def _customize_L1Emulator(process): | ||
return process | ||
|
||
|
||
def _customize_RawToDigi(process): | ||
return process | ||
|
||
|
||
def _customize_DigiToRaw(process): | ||
return process | ||
|
||
|
||
def _customize_HLT(process): | ||
return process | ||
|
||
def _customize_FastSim(process): | ||
process=_configurePFForGEDEGamma(process) | ||
process.famosParticleFlowSequence.remove(process.pfElectronTranslatorSequence) | ||
process.famosParticleFlowSequence.remove(process.pfPhotonTranslatorSequence) | ||
process.egammaHighLevelRecoPostPF.remove(process.gsfElectronMergingSequence) | ||
process.reducedEcalRecHitsEB.interestingDetIdCollections = cms.VInputTag( | ||
# ecal | ||
cms.InputTag("interestingEcalDetIdEB"), | ||
cms.InputTag("interestingEcalDetIdEBU"), | ||
# egamma | ||
cms.InputTag("interestingEleIsoDetIdEB"), | ||
cms.InputTag("interestingGamIsoDetIdEB"), | ||
# tau | ||
#cms.InputTag("caloRecoTauProducer"), | ||
#pf | ||
#cms.InputTag("pfElectronInterestingEcalDetIdEB"), | ||
#cms.InputTag("pfPhotonInterestingEcalDetIdEB"), | ||
# muons | ||
cms.InputTag("muonEcalDetIds"), | ||
# high pt tracks | ||
cms.InputTag("interestingTrackEcalDetIds") | ||
) | ||
process.reducedEcalRecHitsEE.interestingDetIdCollections = cms.VInputTag( | ||
# ecal | ||
cms.InputTag("interestingEcalDetIdEE"), | ||
# egamma | ||
cms.InputTag("interestingEleIsoDetIdEE"), | ||
cms.InputTag("interestingGamIsoDetIdEE"), | ||
# tau | ||
#cms.InputTag("caloRecoTauProducer"), | ||
#pf | ||
#cms.InputTag("pfElectronInterestingEcalDetIdEE"), | ||
#cms.InputTag("pfPhotonInterestingEcalDetIdEE"), | ||
# muons | ||
cms.InputTag("muonEcalDetIds"), | ||
# high pt tracks | ||
cms.InputTag("interestingTrackEcalDetIds") | ||
) | ||
|
||
if hasattr(process,'ecalDrivenElectronSeeds'): | ||
process.ecalDrivenElectronSeeds.barrelSuperClusters = cms.InputTag('particleFlowSuperClusterECAL:particleFlowSuperClusterECALBarrel') | ||
process.ecalDrivenElectronSeeds.endcapSuperClusters = cms.InputTag('particleFlowSuperClusterECAL:particleFlowSuperClusterECALEndcapWithPreshower') | ||
return process | ||
|
||
|
||
def _customize_Reco(process): | ||
process=_configurePFForGEDEGamma(process) | ||
process.particleFlowReco.remove(process.pfElectronTranslatorSequence) | ||
process.particleFlowReco.remove(process.pfPhotonTranslatorSequence) | ||
process.egammaHighLevelRecoPostPF.remove(process.gsfElectronMergingSequence) | ||
process.reducedEcalRecHitsEB.interestingDetIdCollections = cms.VInputTag( | ||
# ecal | ||
cms.InputTag("interestingEcalDetIdEB"), | ||
cms.InputTag("interestingEcalDetIdEBU"), | ||
# egamma | ||
cms.InputTag("interestingEleIsoDetIdEB"), | ||
cms.InputTag("interestingGamIsoDetIdEB"), | ||
# tau | ||
#cms.InputTag("caloRecoTauProducer"), | ||
#pf | ||
#cms.InputTag("pfElectronInterestingEcalDetIdEB"), | ||
#cms.InputTag("pfPhotonInterestingEcalDetIdEB"), | ||
# muons | ||
cms.InputTag("muonEcalDetIds"), | ||
# high pt tracks | ||
cms.InputTag("interestingTrackEcalDetIds") | ||
) | ||
process.reducedEcalRecHitsEE.interestingDetIdCollections = cms.VInputTag( | ||
# ecal | ||
cms.InputTag("interestingEcalDetIdEE"), | ||
# egamma | ||
cms.InputTag("interestingEleIsoDetIdEE"), | ||
cms.InputTag("interestingGamIsoDetIdEE"), | ||
# tau | ||
#cms.InputTag("caloRecoTauProducer"), | ||
#pf | ||
#cms.InputTag("pfElectronInterestingEcalDetIdEE"), | ||
#cms.InputTag("pfPhotonInterestingEcalDetIdEE"), | ||
# muons | ||
cms.InputTag("muonEcalDetIds"), | ||
# high pt tracks | ||
cms.InputTag("interestingTrackEcalDetIds") | ||
) | ||
|
||
if hasattr(process,'ecalDrivenElectronSeeds'): | ||
process.ecalDrivenElectronSeeds.barrelSuperClusters = cms.InputTag('particleFlowSuperClusterECAL:particleFlowSuperClusterECALBarrel') | ||
process.ecalDrivenElectronSeeds.endcapSuperClusters = cms.InputTag('particleFlowSuperClusterECAL:particleFlowSuperClusterECALEndcapWithPreshower') | ||
return process | ||
|
||
|
||
def _customize_harvesting(process): | ||
if hasattr(process,'oldpfPhotonPostprocessing'): | ||
process.photonPostProcessor.remove(process.oldpfPhotonPostprocessing) | ||
return process |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This sanity check should not simply be switched off.