Skip to content

Commit ac6c225

Browse files
authored
Merge pull request #48695 from mmusich/mm_add_ageing_to_ph2_hlt
add ageing customization to `ph2_hlt` workflows
2 parents 57a10f3 + 924b11b commit ac6c225

File tree

2 files changed

+54
-28
lines changed

2 files changed

+54
-28
lines changed

Configuration/PyReleaseValidation/python/upgradeWorkflowComponents.py

Lines changed: 26 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1830,7 +1830,13 @@ def setup_(self, step, stepName, stepDict, k, properties):
18301830
if ('ALCA' in step) or ('Reco' in step) or ('HLT' in step):
18311831
stepDict[stepName][k] = None
18321832
elif 'DigiTrigger' in step:
1833-
stepDict[stepName][k] = merge([self.step2, stepDict[step][k]])
1833+
# Add the aging customization
1834+
mergedStep = merge([self.step2, stepDict[step][k]])
1835+
if '--customise' in mergedStep:
1836+
mergedStep['--customise'] += ',SLHCUpgradeSimulations/Configuration/aging.customise_aging_1000'
1837+
else:
1838+
mergedStep['--customise'] = 'SLHCUpgradeSimulations/Configuration/aging.customise_aging_1000'
1839+
stepDict[stepName][k] = mergedStep
18341840
elif 'HARVEST' in step:
18351841
stepDict[stepName][k] = merge([self.step3, stepDict[step][k]])
18361842
else:
@@ -2004,13 +2010,19 @@ def setup_(self, step, stepName, stepDict, k, properties):
20042010
if ('ALCA' in step) or ('Reco' in step) or ('HLT' in step) or ('HARVEST' in step):
20052011
stepDict[stepName][k] = None
20062012
elif 'DigiTrigger' in step:
2007-
stepDict[stepName][k] = merge([self.step2, stepDict[step][k]])
2013+
# Add the aging customization
2014+
mergedStep = merge([self.step2, stepDict[step][k]])
2015+
if '--customise' in mergedStep:
2016+
mergedStep['--customise'] += ',SLHCUpgradeSimulations/Configuration/aging.customise_aging_1000'
2017+
else:
2018+
mergedStep['--customise'] = 'SLHCUpgradeSimulations/Configuration/aging.customise_aging_1000'
2019+
stepDict[stepName][k] = mergedStep
20082020
else:
20092021
stepDict[stepName][k] = merge([stepDict[step][k]])
20102022
def condition(self, fragment, stepList, key, hasHarvest):
20112023
return fragment=="TTbar_14TeV" and 'Run4' in key
20122024

2013-
upgradeWFs['HLTPhaseWithNano'] = UpgradeWorkflow_HLTPhase2_WithNano(
2025+
upgradeWFs['HLTPhase2WithNano'] = UpgradeWorkflow_HLTPhase2_WithNano(
20142026
steps = [
20152027
'Reco',
20162028
'RecoGlobal',
@@ -2035,16 +2047,16 @@ def condition(self, fragment, stepList, key, hasHarvest):
20352047
'HARVESTGlobal',
20362048
'HARVESTGlobalFakeHLT',
20372049
],
2038-
suffix = '_HLTPhaseWithNano',
2050+
suffix = '_HLTPhase2WithNano',
20392051
offset = 0.759,
20402052
)
2041-
upgradeWFs['HLTPhaseWithNano'].step2 = {
2053+
upgradeWFs['HLTPhase2WithNano'].step2 = {
20422054
'-s':'DIGI:pdigi_valid,L1TrackTrigger,L1,L1P2GT,DIGI2RAW,HLT:75e33,NANO:@Phase2HLT',
20432055
'--datatier':'GEN-SIM-DIGI-RAW,NANOAODSIM',
20442056
'--eventcontent':'FEVTDEBUGHLT,NANOAODSIM'
20452057
}
20462058

2047-
upgradeWFs['NGTScoutingWithNano'] = deepcopy(upgradeWFs['HLTPhaseWithNano'])
2059+
upgradeWFs['NGTScoutingWithNano'] = deepcopy(upgradeWFs['HLTPhase2WithNano'])
20482060
upgradeWFs['NGTScoutingWithNano'].suffix = '_NGTScoutingWithNano'
20492061
upgradeWFs['NGTScoutingWithNano'].offset = 0.771
20502062
upgradeWFs['NGTScoutingWithNano'].step2 = {
@@ -2054,7 +2066,7 @@ def condition(self, fragment, stepList, key, hasHarvest):
20542066
'--eventcontent':'FEVTDEBUGHLT,NANOAODSIM'
20552067
}
20562068

2057-
upgradeWFs['NGTScoutingWithNanoValid'] = deepcopy(upgradeWFs['HLTPhaseWithNano'])
2069+
upgradeWFs['NGTScoutingWithNanoValid'] = deepcopy(upgradeWFs['HLTPhase2WithNano'])
20582070
upgradeWFs['NGTScoutingWithNanoValid'].suffix = '_NGTScoutingWithNanoVal'
20592071
upgradeWFs['NGTScoutingWithNanoValid'].offset = 0.772
20602072
upgradeWFs['NGTScoutingWithNanoValid'].step2 = {
@@ -2087,7 +2099,13 @@ def setup_(self, step, stepName, stepDict, k, properties):
20872099
if ('ALCA' in step) or ('Reco' in step) or ('HLT' in step):
20882100
stepDict[stepName][k] = None
20892101
elif 'DigiTrigger' in step:
2090-
stepDict[stepName][k] = merge([self.step2, stepDict[step][k]])
2102+
# Add the aging customization
2103+
mergedStep = merge([self.step2, stepDict[step][k]])
2104+
if '--customise' in mergedStep:
2105+
mergedStep['--customise'] += ',SLHCUpgradeSimulations/Configuration/aging.customise_aging_1000'
2106+
else:
2107+
mergedStep['--customise'] = 'SLHCUpgradeSimulations/Configuration/aging.customise_aging_1000'
2108+
stepDict[stepName][k] = mergedStep
20912109
elif 'HARVEST' in step:
20922110
stepDict[stepName][k] = merge([self.step3, stepDict[step][k]])
20932111
else:

SLHCUpgradeSimulations/Configuration/python/aging.py

Lines changed: 28 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -104,19 +104,25 @@ def ageSiPM(process,turnon,lumi):
104104
"rec": [1.25, 2.5, 2.5, 2.5],
105105
},
106106
}
107-
ctmodules = ['calotowermaker','caloTowerForTrk','caloTowerForTrkPreSplitting','towerMaker','towerMakerWithHO']
107+
ctmodules = ['calotowermaker','caloTowerForTrk','caloTowerForTrkPreSplitting','towerMaker','towerMakerWithHO','hltPhase2TowerMakerForAll',' hltTowerMaker']
108108
for ilumi, hcal_lumi in enumerate(hcal_lumis[:-1]):
109109
if lumi >= hcal_lumi and lumi < hcal_lumis[ilumi+1]:
110-
if hasattr(process,'particleFlowClusterHBHE'):
111-
process.particleFlowClusterHBHE.seedFinder.thresholdsByDetector[0].seedingThreshold = hcal_thresholds[hcal_lumi]["seed"]
112-
process.particleFlowClusterHBHE.initialClusteringStep.thresholdsByDetector[0].gatheringThreshold = hcal_thresholds[hcal_lumi]["rec"]
113-
process.particleFlowClusterHBHE.pfClusterBuilder.recHitEnergyNorms[0].recHitEnergyNorm = hcal_thresholds[hcal_lumi]["rec"]
114-
process.particleFlowClusterHBHE.pfClusterBuilder.positionCalc.logWeightDenominatorByDetector[0].logWeightDenominator = hcal_thresholds[hcal_lumi]["rec"]
115-
process.particleFlowClusterHBHE.pfClusterBuilder.allCellsPositionCalc.logWeightDenominatorByDetector[0].logWeightDenominator = hcal_thresholds[hcal_lumi]["rec"]
116-
if hasattr(process,'particleFlowClusterHCAL'):
117-
process.particleFlowClusterHCAL.pfClusterBuilder.allCellsPositionCalc.logWeightDenominatorByDetector[0].logWeightDenominator = hcal_thresholds[hcal_lumi]["rec"]
118-
if hasattr(process,'particleFlowRecHitHBHE'):
119-
process.particleFlowRecHitHBHE.producers[0].qualityTests[0].cuts[0].threshold = hcal_thresholds[hcal_lumi]["rec"]
110+
pfclushbhemodules = ['particleFlowClusterHBHE','hltParticleFlowClusterHBHE']
111+
for pfhbhemod in pfclushbhemodules:
112+
if hasattr(process,pfhbhemod):
113+
getattr(process,pfhbhemod).seedFinder.thresholdsByDetector[0].seedingThreshold = hcal_thresholds[hcal_lumi]["seed"]
114+
getattr(process,pfhbhemod).initialClusteringStep.thresholdsByDetector[0].gatheringThreshold = hcal_thresholds[hcal_lumi]["rec"]
115+
getattr(process,pfhbhemod).pfClusterBuilder.recHitEnergyNorms[0].recHitEnergyNorm = hcal_thresholds[hcal_lumi]["rec"]
116+
getattr(process,pfhbhemod).pfClusterBuilder.positionCalc.logWeightDenominatorByDetector[0].logWeightDenominator = hcal_thresholds[hcal_lumi]["rec"]
117+
getattr(process,pfhbhemod).pfClusterBuilder.allCellsPositionCalc.logWeightDenominatorByDetector[0].logWeightDenominator = hcal_thresholds[hcal_lumi]["rec"]
118+
pfclushcalmodules = ['particleFlowClusterHCAL','hltParticleFlowClusterHCAL']
119+
for pfhcalmod in pfclushcalmodules:
120+
if hasattr(process,pfhcalmod):
121+
getattr(process,pfhcalmod).pfClusterBuilder.allCellsPositionCalc.logWeightDenominatorByDetector[0].logWeightDenominator = hcal_thresholds[hcal_lumi]["rec"]
122+
pfrechithbhemodules = ['particleFlowRecHitHBHE', 'hltParticleFlowRecHitHBHE']
123+
for pfrechitmod in pfrechithbhemodules:
124+
if hasattr(process,pfrechitmod):
125+
getattr(process,pfrechitmod).producers[0].qualityTests[0].cuts[0].threshold = hcal_thresholds[hcal_lumi]["rec"]
120126
for ctmod in ctmodules:
121127
if hasattr(process,ctmod):
122128
getattr(process,ctmod).HBThreshold1 = hcal_thresholds[hcal_lumi]["rec"][0]
@@ -218,15 +224,17 @@ def ageEcal(process,lumi,instLumi):
218224
connect = cms.string("frontier://FrontierProd/CMS_CONDITIONS")
219225
)
220226
)
221-
if hasattr(process,"particleFlowClusterECALUncorrected"):
222-
_seeds = process.particleFlowClusterECALUncorrected.seedFinder.thresholdsByDetector
223-
for iseed in range(0,len(_seeds)):
224-
if _seeds[iseed].detector.value()=="ECAL_BARREL":
225-
_seeds[iseed].seedingThreshold = cms.double(ecal_thresholds[int(lumi)]*ecal_seed_multiplier)
226-
_clusters = process.particleFlowClusterECALUncorrected.initialClusteringStep.thresholdsByDetector
227-
for icluster in range(0,len(_clusters)):
228-
if _clusters[icluster].detector.value()=="ECAL_BARREL":
229-
_clusters[icluster].gatheringThreshold = cms.double(ecal_thresholds[int(lumi)])
227+
pfclusecaluncorrmodules = ['particleFlowClusterECALUncorrected','hltParticleFlowClusterECALUncorrected','hltParticleFlowClusterECALUncorrectedL1Seeded',' hltParticleFlowClusterECALUncorrectedUnseeded']
228+
for pfclusecaluncorrmod in pfclusecaluncorrmodules:
229+
if hasattr(process,pfclusecaluncorrmod):
230+
_seeds = getattr(process,pfclusecaluncorrmod).seedFinder.thresholdsByDetector
231+
for iseed in range(0,len(_seeds)):
232+
if _seeds[iseed].detector.value()=="ECAL_BARREL":
233+
_seeds[iseed].seedingThreshold = cms.double(ecal_thresholds[int(lumi)]*ecal_seed_multiplier)
234+
_clusters = getattr(process,pfclusecaluncorrmod).initialClusteringStep.thresholdsByDetector
235+
for icluster in range(0,len(_clusters)):
236+
if _clusters[icluster].detector.value()=="ECAL_BARREL":
237+
_clusters[icluster].gatheringThreshold = cms.double(ecal_thresholds[int(lumi)])
230238

231239
return process
232240

0 commit comments

Comments
 (0)