Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
2 changes: 2 additions & 0 deletions Configuration/PyReleaseValidation/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -97,6 +97,8 @@ The offsets currently in use are:
* 0.31: Photon energy corrections with DRN architecture
* 0.61: ECAL `phase2_ecal_devel` era, on CPU
* 0.612: ECAL `phase2_ecal_devel` era, with automatic offload to GPU if available
* 0.6199: ECAL `phase2_ecal_devel` era, on CPU and with premixing stage1+stage2
* 0.61299: ECAL `phase2_ecal_devel` era, with automatic offload to GPU if available and premixing stage1+stage2
* 0.631: ECAL component-method based digis
* 0.632: ECAL component-method based finely-sampled waveforms
* 0.633: ECAL phase2 Trigger Primitive
Expand Down
222 changes: 163 additions & 59 deletions Configuration/PyReleaseValidation/python/upgradeWorkflowComponents.py
Original file line number Diff line number Diff line change
Expand Up @@ -2294,8 +2294,9 @@ def __init__(self, digi = {}, reco = {}, harvest = {}, **kwargs):
self.__harvest = harvest

def setup_(self, step, stepName, stepDict, k, properties):
# run the ECAL devel modules and the Phase 2 ECAL TP
mods = {'--era': stepDict[step][k]['--era']+',phase2_ecal_devel,phase2_ecalTP_devel'}
# temporarily remove trigger & downstream steps
mods = {'--era': stepDict[step][k]['--era']+',phase2_ecal_devel'}
if 'Digi' in step:
mods['-s'] = 'DIGI:pdigi_valid,DIGI2RAW'
mods['--custom_conditions'] = 'EcalSimPulseShapePhaseII,EcalSimPulseShapeRcd,frontier://FrontierProd/CMS_CONDITIONS'
Expand Down Expand Up @@ -2333,71 +2334,108 @@ def condition(self, fragment, stepList, key, hasHarvest):
offset = 0.612,
)

# Offline HGCAL NanoAOD workflows
class UpgradeWorkflow_HGCALNano(UpgradeWorkflow):
# ECAL Phase 2 workflow with Alpaka reconstruction and PU from premix
class UpgradeWorkflowPremix_ecalDevel(UpgradeWorkflow):
def __init__(self, digi = {}, reco = {}, harvest = {}, **kwargs):
# adapt the parameters for the UpgradeWorkflow init method
super(UpgradeWorkflowPremix_ecalDevel, self).__init__(
steps = [],
PU = [
'GenSimHLBeamSpot14',
'DigiTrigger',
'RecoGlobal',
'RecoGlobalFakeHLT',
'HARVESTGlobal',
'HARVESTGlobalFakeHLT',
'ALCAPhase2',
],
**kwargs)
self.__digi = digi
self.__reco = reco
self.__harvest = harvest
def setup_(self, step, stepName, stepDict, k, properties):
if 'RecoGlobal' in step:
stepDict[stepName][k] = merge([self.step3, stepDict[step][k]])
else:
stepDict[stepName][k] = merge([stepDict[step][k]])
# just copy steps
stepDict[stepName][k] = merge([stepDict[step][k]])
def setupPU_(self, step, stepName, stepDict, k, properties):
# setup for stage 1
if "GenSim" in stepName:
stepNamePmx = stepName.replace('GenSim','Premix')
if not stepNamePmx in stepDict: stepDict[stepNamePmx] = {}
stepDict[stepNamePmx][k] = merge([
{
'-s': 'GEN,SIM,DIGI:pdigi_valid',
'--era': stepDict[step][k]['--era']+',phase2_ecal_devel,phase2_ecalTP_devel',
'--datatier': 'PREMIX',
'--eventcontent': 'PREMIX',
'--procModifiers': 'premix_stage1',
'--custom_conditions': 'EcalSimPulseShapePhaseII,EcalSimPulseShapeRcd,frontier://FrontierProd/CMS_CONDITIONS'
},
stepDict[stepName][k]
])
# setup for stage 2
elif 'Digi' in step or 'Reco' in step:
# run the ECAL devel modules and the Phase 2 ECAL TP
mods = {'--era': stepDict[step][k]['--era']+',phase2_ecal_devel,phase2_ecalTP_devel'}
# temporarily remove trigger & downstream steps
if 'Digi' in step:
mods['-s'] = 'DIGI:pdigi_valid,DATAMIX,DIGI2RAW'
mods['--datamix'] = 'PreMix'
mods['--custom_conditions'] = 'EcalSimPulseShapePhaseII,EcalSimPulseShapeRcd,frontier://FrontierProd/CMS_CONDITIONS'
mods['--filein'] = 'file:step1.root'
mods['--pileup_input'] = 'file:step2.root'
mods |= self.__digi

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why does L2453 mods['--procModifiers'] = 'premix_stage2' come before mods |= self.__digi, but L2463 mods |= self.__reco comes before L2464 mods['--procModifiers'] = mods['--procModifiers']+',premix_stage2' if '--procModifiers' in mods else 'premix_stage2'. Shouldn't these have the same pattern?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It could be done in the same way for the digi mods to avoid a digi customisation in a workflow overwriting the premix_stage2 modifier. In this case it has no effect though since no workflow modifies the digi step.

mods['--procModifiers'] = mods['--procModifiers']+',premix_stage2' if '--procModifiers' in mods else 'premix_stage2'
elif 'Reco' in step:
mods['-s'] = 'RAW2DIGI:RawToDigi_ecalOnly,RECO:reconstruction_ecalOnly,VALIDATION:@ecalOnlyValidation,DQM:@ecalOnly'
mods['--datatier'] = 'GEN-SIM-RECO,DQMIO'
mods['--eventcontent'] = 'FEVTDEBUGHLT,DQM'
mods['--custom_conditions'] = 'EcalSimPulseShapePhaseII,EcalSimPulseShapeRcd,frontier://FrontierProd/CMS_CONDITIONS'
mods |= self.__reco
mods['--procModifiers'] = mods['--procModifiers']+',premix_stage2' if '--procModifiers' in mods else 'premix_stage2'
stepDict[stepName][k] = merge([mods, stepDict[step][k]])
if 'HARVEST' in stepName:
# run the ECAL devel modules and the Phase 2 ECAL TP
mods = {'--era': stepDict[step][k]['--era']+',phase2_ecal_devel,phase2_ecalTP_devel'}
mods['-s'] = 'HARVESTING:@ecalOnlyValidation+@ecal'
mods |= self.__harvest
stepDict[stepName][k] = merge([mods, stepDict[step][k]])
# skip ALCA step
if 'ALCA' in step:
stepDict[stepName][k] = None

def condition(self, fragment, stepList, key, hasHarvest):
# Apply to all Run4 workflows
return 'Run4' in key

upgradeWFs['HGCALNano'] = UpgradeWorkflow_HGCALNano(
steps = [
'RecoGlobal',
'HARVESTGlobal',
'ALCAPhase2',
],
PU = [
'RecoGlobal',
'HARVESTGlobal',
'ALCAPhase2',
],
suffix = '_HGCALNano',
offset = 0.212,
)

upgradeWFs['HGCALNano'].step3 = {
'-s': 'RAW2DIGI,RECO,RECOSIM,PAT,NANO:@HGCAL,VALIDATION:@phase2Validation+@miniAODValidation,DQM:@phase2+@miniAODDQM',
'--datatier': 'GEN-SIM-RECO,MINIAODSIM,DQMIO,NANOAODSIM',
'--eventcontent': 'FEVTDEBUGHLT,MINIAODSIM,DQM,NANOAODSIM'
}

# Offline HGCAL NanoAOD with validation objects
class UpgradeWorkflow_HGCALNanoVal(UpgradeWorkflow):
def setup_(self, step, stepName, stepDict, k, properties):
if 'RecoGlobal' in step:
stepDict[stepName][k] = merge([self.step3, stepDict[step][k]])
else:
stepDict[stepName][k] = merge([stepDict[step][k]])
if not 'PU' in key:
return False
return any([f in fragment for f in [
"SingleElectron",
"SingleEFlat",
"SingleGamma",
"CloseByPGun_Barrel_Front",
"TTbar_14TeV",
"ZEE_14",
"DYToLL_M_50_14TeV",
"H125GGgluonfusion_14"
]]) and not 'Eta1p7_2p7' in fragment and 'Run4' in key

def condition(self, fragment, stepList, key, hasHarvest):
# Apply to all Run4 workflows
return 'Run4' in key
def workflow_(self, workflows, num, fragment, stepList, key):
fragmentTmp = fragment
super(UpgradeWorkflowPremix_ecalDevel,self).workflow_(workflows, num, fragmentTmp, stepList, key)

upgradeWFs['HGCALNanoVal'] = UpgradeWorkflow_HGCALNanoVal(
steps = [
'RecoGlobal',
'HARVESTGlobal',
'ALCAPhase2',
],
PU = [
'RecoGlobal',
'HARVESTGlobal',
'ALCAPhase2',
],
suffix = '_HGCALNanoVal',
offset = 0.213,
# ECAL developemnt workflow on CPU with premix combined stage1+stage2
upgradeWFs['ecalDevelPMXS1S2'] = UpgradeWorkflowPremix_ecalDevel(
suffix = '_ecalDevelPMXS1S2',
offset = 0.6199,
)

upgradeWFs['HGCALNanoVal'].step3 = {
'-s': 'RAW2DIGI,RECO,RECOSIM,PAT,NANO:@HGCALVal,VALIDATION:@phase2Validation+@miniAODValidation,DQM:@phase2+@miniAODDQM',
'--datatier': 'GEN-SIM-RECO,MINIAODSIM,DQMIO,NANOAODSIM',
'--eventcontent': 'FEVTDEBUGHLT,MINIAODSIM,DQM,NANOAODSIM'
}
# ECAL developemnt Alpaka workflow with premix combined stage1+stage2
upgradeWFs['ecalDevelAlpakaPMXS1S2'] = UpgradeWorkflowPremix_ecalDevel(
reco = {
'--procModifiers': 'alpaka',
'--customise' : 'HeterogeneousCore/AlpakaServices/customiseAlpakaServiceMemoryFilling.customiseAlpakaServiceMemoryFilling'
},
suffix = '_ecalDevelAlpakaPMXS1S2',
offset = 0.61299,
)

# ECAL component
class UpgradeWorkflow_ECalComponent(UpgradeWorkflow):
Expand Down Expand Up @@ -2488,6 +2526,72 @@ def condition(self, fragment, stepList, key, hasHarvest):
ecalMod = 'ecal_component_finely_sampled_waveforms',
)

# Offline HGCAL NanoAOD workflows
class UpgradeWorkflow_HGCALNano(UpgradeWorkflow):
def setup_(self, step, stepName, stepDict, k, properties):
if 'RecoGlobal' in step:
stepDict[stepName][k] = merge([self.step3, stepDict[step][k]])
else:
stepDict[stepName][k] = merge([stepDict[step][k]])

def condition(self, fragment, stepList, key, hasHarvest):
# Apply to all Run4 workflows
return 'Run4' in key

upgradeWFs['HGCALNano'] = UpgradeWorkflow_HGCALNano(
steps = [
'RecoGlobal',
'HARVESTGlobal',
'ALCAPhase2',
],
PU = [
'RecoGlobal',
'HARVESTGlobal',
'ALCAPhase2',
],
suffix = '_HGCALNano',
offset = 0.212,
)

upgradeWFs['HGCALNano'].step3 = {
'-s': 'RAW2DIGI,RECO,RECOSIM,PAT,NANO:@HGCAL,VALIDATION:@phase2Validation+@miniAODValidation,DQM:@phase2+@miniAODDQM',
'--datatier': 'GEN-SIM-RECO,MINIAODSIM,DQMIO,NANOAODSIM',
'--eventcontent': 'FEVTDEBUGHLT,MINIAODSIM,DQM,NANOAODSIM'
}

# Offline HGCAL NanoAOD with validation objects
class UpgradeWorkflow_HGCALNanoVal(UpgradeWorkflow):
def setup_(self, step, stepName, stepDict, k, properties):
if 'RecoGlobal' in step:
stepDict[stepName][k] = merge([self.step3, stepDict[step][k]])
else:
stepDict[stepName][k] = merge([stepDict[step][k]])

def condition(self, fragment, stepList, key, hasHarvest):
# Apply to all Run4 workflows
return 'Run4' in key

upgradeWFs['HGCALNanoVal'] = UpgradeWorkflow_HGCALNanoVal(
steps = [
'RecoGlobal',
'HARVESTGlobal',
'ALCAPhase2',
],
PU = [
'RecoGlobal',
'HARVESTGlobal',
'ALCAPhase2',
],
suffix = '_HGCALNanoVal',
offset = 0.213,
)

upgradeWFs['HGCALNanoVal'].step3 = {
'-s': 'RAW2DIGI,RECO,RECOSIM,PAT,NANO:@HGCALVal,VALIDATION:@phase2Validation+@miniAODValidation,DQM:@phase2+@miniAODDQM',
'--datatier': 'GEN-SIM-RECO,MINIAODSIM,DQMIO,NANOAODSIM',
'--eventcontent': 'FEVTDEBUGHLT,MINIAODSIM,DQM,NANOAODSIM'
}

class UpgradeWorkflow_0T(UpgradeWorkflow):
def setup_(self, step, stepName, stepDict, k, properties):
myGT=stepDict[step][k]['--conditions']
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -42,3 +42,10 @@
# Convert the uncalibrated rechits from Portable Collection to legacy format
ecalUncalibRecHitPhase2
))

# Get the digis from the mixing module for premixing
from Configuration.Eras.Modifier_phase2_ecal_devel_cff import phase2_ecal_devel
from Configuration.ProcessModifiers.premix_stage2_cff import premix_stage2
(phase2_ecal_devel & premix_stage2 & ~alpaka).toModify(ecalUncalibRecHitPhase2, BarrelDigis = 'mixData')
(phase2_ecal_devel & premix_stage2).toModify(ecalUncalibRecHitPhase2Legacy, BarrelDigis = 'mixData')
(phase2_ecal_devel & premix_stage2).toModify(simEcalUnsuppressedDigisSoA, BarrelDigis = 'mixData')
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,15 @@
run3_ecal_devel.toModify(SimCalorimetryRAW.outputCommands, func=lambda outputCommands: outputCommands.append('keep EBDigiCollection_simEcalUnsuppressedDigis_*_*') )

from Configuration.Eras.Modifier_phase2_ecal_devel_cff import phase2_ecal_devel
phase2_ecal_devel.toModify(SimCalorimetryFEVTDEBUG.outputCommands, func=lambda outputCommands: outputCommands.append('keep *_ecal*_*_*') )
_phase2_ecal_extraCommands = cms.PSet( # using PSet in order to potentially customize with Modifier
v = cms.vstring('drop EBDigiCollection_*_*_*', 'drop EEDigiCollection_*_*_*', 'drop ESDigiCollection_*_*_*', 'keep *_simEcalUnsuppressedDigis_*_*', 'keep *_ecal*_*_*'),
)
phase2_ecal_devel.toModify(SimCalorimetryFEVTDEBUG, outputCommands = SimCalorimetryFEVTDEBUG.outputCommands + _phase2_ecal_extraCommands.v)
phase2_ecal_devel.toModify(SimCalorimetryPREMIX, outputCommands = SimCalorimetryPREMIX.outputCommands + _phase2_ecal_extraCommands.v)
phase2_ecal_devel.toModify(SimCalorimetryRAW, outputCommands = SimCalorimetryRAW.outputCommands + _phase2_ecal_extraCommands.v)

from Configuration.ProcessModifiers.premix_stage2_cff import premix_stage2
premix_stage2.toModify( SimCalorimetryFEVTDEBUG.outputCommands, func=lambda outputCommands: outputCommands.append('keep EBDigiCollectionPh2_mixData_*_*') )

from Configuration.Eras.Modifier_phase2_hcal_cff import phase2_hcal
phase2_hcal.toModify(SimCalorimetryFEVTDEBUG.outputCommands, func=lambda outputCommands: outputCommands.append('keep *_DMHcalDigis_*_*') )
Expand All @@ -78,7 +86,6 @@
v = cms.vstring('keep *_simHGCalUnsuppressedDigis_EE_*', 'keep *_simHGCalUnsuppressedDigis_HEfront_*', 'keep *_simHGCalUnsuppressedDigis_HEback_*', 'keep *_mix_MergedCaloTruth*_*', 'keep *_mix_MergedMtdTruth_*', 'keep *_mix_MergedMtdTruthLC_*', 'keep *_mix_MergedMtdTruthST_*'),
)
# For phase2 premixing switch the sim digi collections to the ones including pileup
from Configuration.ProcessModifiers.premix_stage2_cff import premix_stage2
premix_stage2.toModify(_phase2_hgc_extraCommands,
v = ['keep *_mixData_HGCDigisEE_*', 'keep *_mixData_HGCDigisHEfront_*', 'keep *_mixData_HGCDigisHEback_*', 'keep *_mixData_MergedCaloTruth*_*', 'keep *_mix_MergedMtdTruth_*', 'keep *_mixData_MergedMtdTruthLC_*', 'keep *_mix_MergedMtdTruthST_*'])
phase2_hgcal.toModify( SimCalorimetryRAW, outputCommands = SimCalorimetryRAW.outputCommands + _phase2_hgc_extraCommands.v )
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,4 +14,6 @@


from Configuration.Eras.Modifier_phase2_ecalTP_devel_cff import phase2_ecalTP_devel
from Configuration.ProcessModifiers.premix_stage2_cff import premix_stage2
phase2_ecalTP_devel.toModify( simEcalEBTriggerPrimitivePhase2Digis)
(phase2_ecalTP_devel & premix_stage2).toModify(simEcalEBTriggerPrimitivePhase2Digis, barrelEcalDigis = 'mixData')
Loading