Skip to content

Commit

Permalink
Merge pull request #37134 from ssrothman/photon_rebase2
Browse files Browse the repository at this point in the history
Dynamic Reduction Network for photon energy regression in miniAOD using the SonicTriton service
  • Loading branch information
cmsbuild committed Apr 29, 2022
2 parents a951722 + c8484f9 commit ed06b7d
Show file tree
Hide file tree
Showing 11 changed files with 732 additions and 0 deletions.
9 changes: 9 additions & 0 deletions Configuration/ProcessModifiers/python/photonDRN_cff.py
@@ -0,0 +1,9 @@
import FWCore.ParameterSet.Config as cms
from Configuration.ProcessModifiers.enableSonicTriton_cff import enableSonicTriton

#behind-the-scenes modifier that only turns on the DRN photon regression
_photonDRN = cms.Modifier()

#modifier to enable DRN energy regression for photons
#requires also having enableSonicTriton
photonDRN = cms.ModifierChain(_photonDRN, enableSonicTriton)
1 change: 1 addition & 0 deletions Configuration/PyReleaseValidation/README.md
Expand Up @@ -59,6 +59,7 @@ The offsets currently in use are:
* 0.17: Run-3 deep core seeding for JetCore iteration
* 0.21: Production-like sequence
* 0.24: 0 Tesla (Run-2, Run-3)
* 0.31: Photon energy corrections with DRN architecture
* 0.61: `phase2_ecal_devel` era
* 0.75: Phase-2 HLT
* 0.91: Track DNN modifier
Expand Down
2 changes: 2 additions & 0 deletions Configuration/PyReleaseValidation/python/relval_2017.py
Expand Up @@ -18,6 +18,7 @@
# (TTbar trackingOnly, trackingRun2, trackingOnlyRun2, trackingLowPU, pixelTrackingOnly)
# (TTbar PU with JME NanoAOD, disable for now due to Run-3 Nano-Prompt preparation)
# 2018 (ele guns 10, 35, 1000; pho guns 10, 35; mu guns 1, 10, 100, 1000, QCD 3TeV, QCD Flat)
# (pho guns 10, 35 with photonDRN enabled)
# 2018 (ZMM, TTbar, ZEE, MinBias, TTbar PU, ZEE PU, TTbar design)
# (TTbar trackingOnly, pixelTrackingOnly)
# (HE collapse: TTbar, TTbar PU, TTbar design)
Expand Down Expand Up @@ -48,6 +49,7 @@
10024.1,10024.2,10024.3,10024.4,10024.5,
#10224.15,
10801.0,10802.0,10803.0,10804.0,10805.0,10806.0,10807.0,10808.0,10809.0,10859.0,10871.0,
10804.31, 10805.31,
10842.0,10824.0,10825.0,10826.0,10823.0,11024.0,11025.0,11224.0,
10824.1,10824.5,
10824.6,11024.6,11224.6,
Expand Down
Expand Up @@ -517,6 +517,32 @@ def condition(self, fragment, stepList, key, hasHarvest):
'--procModifiers': 'mlpf'
}

# photonDRN workflows
class UpgradeWorkflow_photonDRN(UpgradeWorkflow):
def setup_(self, step, stepName, stepDict, k, properties):
if 'Reco' in step:
stepDict[stepName][k] = merge([self.step3, stepDict[step][k]])
def condition(self, fragment, stepList, key, hasHarvest):
return '2018' in key and "SingleGamma" in fragment

upgradeWFs['photonDRN'] = UpgradeWorkflow_photonDRN(
steps = [
'Reco',
'RecoNano',
'RecoFakeHLT'
],
PU = [
'Reco',
'RecoNano',
'RecoFakeHLT'
],
suffix = '_photonDRN',
offset = 0.31,
)
upgradeWFs['photonDRN'].step3 = {
'--procModifiers': 'enableSonicTriton,photonDRN'
}

# Patatrack workflows:
# - 2018 conditions, TTbar
# - 2018 conditions, Z->mumu,
Expand Down
@@ -0,0 +1,15 @@
import FWCore.ParameterSet.Config as cms

from RecoEgamma.EgammaTools.patElectronDRNCorrectionProducer_cfi import patElectronDRNCorrectionProducer

patElectronsDRN = patElectronDRNCorrectionProducer.clone(
particleSource = 'selectedPatElectrons',
rhoName = 'fixedGridRhoFastjetAll',
Client = patElectronDRNCorrectionProducer.Client.clone(
mode = 'Async',
allowedTries = 1,
modelName = 'electronObjectEnsemble',
modelConfigPath = 'RecoEgamma/EgammaElectronProducers/data/models/electronObjectEnsemble/config.pbtxt',
timeout = 10
)
)
14 changes: 14 additions & 0 deletions PhysicsTools/PatAlgos/python/slimming/patPhotonDRNCorrector_cfi.py
@@ -0,0 +1,14 @@
import FWCore.ParameterSet.Config as cms
from RecoEgamma.EgammaTools.patPhotonDRNCorrectionProducer_cfi import patPhotonDRNCorrectionProducer

patPhotonsDRN = patPhotonDRNCorrectionProducer.clone(
particleSource = 'selectedPatPhotons',
rhoName = 'fixedGridRhoFastjetAll',
Client = patPhotonDRNCorrectionProducer.Client.clone(
mode = 'Async',
allowedTries = 1,
modelName = 'photonObjectEnsemble',
modelConfigPath = 'RecoEgamma/EgammaPhotonProducers/data/models/photonObjectEnsemble/config.pbtxt',
timeout = 10
)
)
4 changes: 4 additions & 0 deletions PhysicsTools/PatAlgos/python/slimming/slimming_cff.py
Expand Up @@ -104,3 +104,7 @@
_phase2_timing_slimmingTask = cms.Task(slimmingTask.copy(),
offlineSlimmedPrimaryVertices4D)
phase2_timing.toReplaceWith(slimmingTask,_phase2_timing_slimmingTask)

from PhysicsTools.PatAlgos.slimming.patPhotonDRNCorrector_cfi import patPhotonsDRN
from Configuration.ProcessModifiers.photonDRN_cff import _photonDRN
_photonDRN.toReplaceWith(slimmingTask, cms.Task(slimmingTask.copy(), patPhotonsDRN))
1 change: 1 addition & 0 deletions RecoEgamma/EgammaTools/BuildFile.xml
Expand Up @@ -17,6 +17,7 @@
<use name="RecoEcal/EgammaCoreTools"/>
<use name="DataFormats/ParticleFlowReco"/>
<use name="PhysicsTools/TensorFlow" />
<use name="HeterogeneousCore/SonicTriton"/>
<export>
<lib name="1"/>
</export>

0 comments on commit ed06b7d

Please sign in to comment.