Skip to content

Commit

Permalink
Merge pull request #38834 from srimanob/125_NanoInFastSim
Browse files Browse the repository at this point in the history
Add NANO step and Mini+Nano validations to FastSim workflows
  • Loading branch information
cmsbuild authored Aug 3, 2022
2 parents be16b47 + 26b433b commit 20d46ab
Show file tree
Hide file tree
Showing 8 changed files with 79 additions and 21 deletions.
31 changes: 22 additions & 9 deletions Configuration/PyReleaseValidation/python/relval_steps.py
Original file line number Diff line number Diff line change
Expand Up @@ -3724,6 +3724,16 @@ def gen2021HiMix(fragment,howMuch):
beamspot=upgradeProperties[year][k].get('BeamSpot', None)

# setup baseline steps
upgradeStepDict['Gen'][k]= {'-s' : 'GEN',
'-n' : 10,
'--conditions' : gt,
'--beamspot' : 'Realistic25ns13TeVEarly2017Collision',
'--datatier' : 'GEN',
'--eventcontent': 'FEVTDEBUG',
'--geometry' : geom
}
if beamspot is not None: upgradeStepDict['Gen'][k]['--beamspot']=beamspot

upgradeStepDict['GenSim'][k]= {'-s' : 'GEN,SIM',
'-n' : 10,
'--conditions' : gt,
Expand Down Expand Up @@ -3886,24 +3896,24 @@ def gen2021HiMix(fragment,howMuch):
'--scenario' : 'pp'
}

upgradeStepDict['FastSimRun3'][k]={'-s':'GEN,SIM,RECOBEFMIX,DIGI:pdigi_valid,L1,DIGI2RAW,L1Reco,RECO,PAT,VALIDATION:@standardValidation,DQM:@standardDQMFS',
upgradeStepDict['FastSimRun3'][k]={'-s':'SIM,RECOBEFMIX,DIGI:pdigi_valid,L1,DIGI2RAW,L1Reco,RECO,PAT,NANO,VALIDATION:@standardValidation+@miniAODValidation,DQM:@standardDQMFS+@miniAODDQM+@nanoAODDQM',
'--fast':'',
'--era':'Run3_FastSim',
'--beamspot':beamspot,
'--conditions':gt,
'--geometry':geom,
'--eventcontent':'FEVTDEBUGHLT,MINIAODSIM,DQM',
'--datatier':'GEN-SIM-DIGI-RECO,MINIAODSIM,DQMIO',
'--relval':'27000,3000'}
'--eventcontent':'FEVTDEBUGHLT,MINIAODSIM,NANOEDMAODSIM,DQM',
'--datatier':'GEN-SIM-DIGI-RECO,MINIAODSIM,NANOAODSIM,DQMIO',
}

upgradeStepDict['HARVESTFastRun3'][k]={'-s':'HARVESTING:validationHarvesting',
upgradeStepDict['HARVESTFastRun3'][k]={'-s':'HARVESTING:validationHarvesting+@miniAODValidation+@miniAODDQM+@nanoAODDQM',
'--conditions':gt,
'--mc':'',
'--fast':'',
'--geometry':geom,
'--scenario':'pp',
'--filetype':'DQM',
'--filein':'file:step1_inDQM.root'}
'--filein':'file:step2_inDQM.root'}

upgradeStepDict['Nano'][k] = {'-s':'NANO,DQM:@nanoAODDQM',
'--conditions':gt,
Expand Down Expand Up @@ -3942,7 +3952,7 @@ def gen2021HiMix(fragment,howMuch):

for step in upgradeStepDict.keys():
# we need to do this for each fragment
if 'Sim' in step or 'Premix' in step:
if ('Sim' in step and 'Fast' not in step) or ('Premix' in step) or ('Sim' not in step and 'Gen' in step):
for frag,info in upgradeFragments.items():
howMuch=info.howMuch
for key in [key for year in upgradeKeys for key in upgradeKeys[year]]:
Expand All @@ -3967,8 +3977,11 @@ def gen2021HiMix(fragment,howMuch):
istep = step+preventReuseKeyword
if 'FastSim' not in k and s+'INPUT' not in steps and s in baseDataSetReleaseBetter and defaultDataSets[key] != '' and \
(istep not in upgradeStepDict or key not in upgradeStepDict[istep] or upgradeStepDict[istep][key] is not None):
steps[k+'INPUT']={'INPUT':InputInfo(dataSet='/RelVal'+info.dataset+'/%s/GEN-SIM'%(baseDataSetReleaseBetter[s],),location='STD')}
else:
if 'FS' not in key: #For FullSim
steps[k+'INPUT']={'INPUT':InputInfo(dataSet='/RelVal'+info.dataset+'/%s/GEN-SIM'%(baseDataSetReleaseBetter[s],),location='STD')}
#else: #For FastSim to recycle GEN (to enable when datasets are available)
# steps[k+'INPUT']={'INPUT':InputInfo(dataSet='/RelVal'+info.dataset+'/%s/GEN'%(baseDataSetReleaseBetter[s],),location='STD')}
else:
for key in [key for year in upgradeKeys for key in upgradeKeys[year]]:
k=step+'_'+key
if step in upgradeStepDict and key in upgradeStepDict[step]:
Expand Down
4 changes: 3 additions & 1 deletion Configuration/PyReleaseValidation/python/relval_upgrade.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,13 +30,15 @@ def makeStepName(key,frag,step,suffix):
hasHarvest = False
for step in upgradeProperties[year][key]['ScenToRun']:
stepMaker = makeStepName
if 'Sim' in step:
if 'Sim' in step and 'Fast' not in step:
if 'HLBeamSpot' in step:
if '14TeV' in frag:
step = 'GenSimHLBeamSpot14'
if 'CloseByParticle' in frag or 'CE_E' in frag or 'CE_H' in frag:
step = 'GenSimHLBeamSpotHGCALCloseBy'
stepMaker = makeStepNameSim
elif 'Gen' in step:
stepMaker = makeStepNameSim

if 'HARVEST' in step: hasHarvest = True

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -148,6 +148,8 @@ def condition(self, fragment, stepList, key, hasHarvest):
def preventReuse(self, stepName, stepDict, k):
if "Sim" in stepName:
stepDict[stepName][k] = None
if "Gen" in stepName:
stepDict[stepName][k] = None
upgradeWFs = OrderedDict()

class UpgradeWorkflow_baseline(UpgradeWorkflow):
Expand All @@ -163,6 +165,7 @@ def condition(self, fragment, stepList, key, hasHarvest):
return True
upgradeWFs['baseline'] = UpgradeWorkflow_baseline(
steps = [
'Gen',
'GenSim',
'GenSimHLBeamSpot',
'GenSimHLBeamSpot14',
Expand Down Expand Up @@ -1826,6 +1829,7 @@ def condition(self, fragment, stepList, key, hasHarvest):
return '2021FS' in key
upgradeWFs['Run3FStrackingOnly'] = UpgradeWorkflow_Run3FStrackingOnly(
steps = [
'Gen',
'FastSimRun3',
'HARVESTFastRun3'
],
Expand All @@ -1839,7 +1843,7 @@ def condition(self, fragment, stepList, key, hasHarvest):

class UpgradeWorkflow_Run3FSMBMixing(UpgradeWorkflow):
def setup_(self, step, stepName, stepDict, k, properties):
if 'FastSimRun3' in step:
if 'Gen' in step:
stepDict[stepName][k] = merge([{'-s':'GEN,SIM,RECOBEFMIX',
'--fast':'',
'--era':'Run3_FastSim',
Expand All @@ -1852,6 +1856,7 @@ def condition(self, fragment, stepList, key, hasHarvest):
return '2021FS' in key and fragment=="MinBias_14TeV"
upgradeWFs['Run3FSMBMixing'] = UpgradeWorkflow_Run3FSMBMixing(
steps = [
'Gen',
'FastSimRun3',
'HARVESTFastRun3'
],
Expand Down Expand Up @@ -2069,7 +2074,7 @@ def condition(self, fragment, stepList, key, hasHarvest):
'HLTmenu': '@relval2022',
'Era' : 'Run3_FastSim',
'BeamSpot': 'Run3RoundOptics25ns13TeVLowSigmaZ',
'ScenToRun' : ['FastSimRun3','HARVESTFastRun3'],
'ScenToRun' : ['Gen','FastSimRun3','HARVESTFastRun3'],
},
}

Expand All @@ -2081,7 +2086,7 @@ def condition(self, fragment, stepList, key, hasHarvest):
(['RecoNanoPU','HARVESTNanoPU'] if '202' in key else ['RecoFakeHLTPU','HARVESTFakeHLTPU']) + \
(['Nano'] if 'Nano' in upgradeProperties[2017][key]['ScenToRun'] else [])
else:
upgradeProperties[2017][key+'PU']['ScenToRun'] = ['FastSimRun3PU','HARVESTFastRun3PU']
upgradeProperties[2017][key+'PU']['ScenToRun'] = ['Gen','FastSimRun3PU','HARVESTFastRun3PU']

upgradeProperties[2026] = {
'2026D49' : {
Expand Down
3 changes: 3 additions & 0 deletions Configuration/StandardSequences/python/Harvesting_cff.py
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,9 @@
for _entry in [hltpostvalidation]:
_validationHarvesting_fastsim.remove(_entry)
_validationHarvesting_fastsim.remove(hltpostvalidation)
_validationHarvesting_fastsim.remove(efficienciesTauValidationMiniAODRealData)
_validationHarvesting_fastsim.remove(efficienciesTauValidationMiniAODRealElectronsData)
_validationHarvesting_fastsim.remove(efficienciesTauValidationMiniAODRealMuonsData)
from Configuration.Eras.Modifier_fastSim_cff import fastSim
fastSim.toReplaceWith(validationHarvesting,_validationHarvesting_fastsim)

Expand Down
29 changes: 29 additions & 0 deletions DQMOffline/Configuration/python/DQMOfflineFS_cff.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import FWCore.ParameterSet.Config as cms

# FastSim version of DQMOffline/Configuration/python/DQMOfflineMC_cff.py .
# MiniAOD part is a clone from DQMOffline/Configuration/python/DQMOffline_cff.py

from DQMOffline.RecoB.PrimaryVertexMonitor_cff import *
from DQM.Physics.DQMPhysics_cff import *
Expand All @@ -22,4 +23,32 @@
singleTopElectronMediumDQM.setup.jetExtras.jetCorrector = cms.InputTag("ak4PFCHSL1FastL2L3Corrector")

DQMOfflineFS = cms.Sequence(DQMOfflinePrePOG)

# miniAOD DQM validation
from DQMOffline.JetMET.jetMETDQMOfflineSource_cff import *
from DQMOffline.Muon.muonMonitors_cff import *
from Validation.RecoParticleFlow.miniAODDQM_cff import * # On MiniAOD vs RECO
from Validation.RecoParticleFlow.DQMForPF_MiniAOD_cff import * # MiniAOD PF variables
from DQM.TrackingMonitor.tracksDQMMiniAOD_cff import *
from DQMOffline.RecoB.bTagMiniDQM_cff import *
from DQMOffline.Muon.miniAOD_cff import *
from DQM.Physics.DQMTopMiniAOD_cff import *

DQMOfflineMiniAOD = cms.Sequence(jetMETDQMOfflineRedoProductsMiniAOD*bTagMiniDQMSource*muonMonitors_miniAOD*MuonMiniAOD*DQMOfflinePF)

#Post sequences are automatically placed in the EndPath by ConfigBuilder if PAT is run.
#miniAOD DQM sequences need to access the filter results.

PostDQMOfflineMiniAOD = cms.Sequence(miniAODDQMSequence*jetMETDQMOfflineSourceMiniAOD*tracksDQMMiniAOD*topPhysicsminiAOD)
PostDQMOffline = cms.Sequence()

from Configuration.Eras.Modifier_run3_HB_cff import run3_HB
run3_HB.toReplaceWith( PostDQMOfflineMiniAOD, PostDQMOfflineMiniAOD.copyAndExclude([
pfMetDQMAnalyzerMiniAOD, pfPuppiMetDQMAnalyzerMiniAOD # No hcalnoise (yet)
]))

from PhysicsTools.NanoAOD.nanoDQM_cff import nanoDQM
DQMOfflineNanoAOD = cms.Sequence(nanoDQM)
#PostDQMOfflineNanoAOD = cms.Sequence(nanoDQM)
from PhysicsTools.NanoAOD.nanogenDQM_cff import nanogenDQM
DQMOfflineNanoGen = cms.Sequence(nanogenDQM)
17 changes: 9 additions & 8 deletions DQMOffline/Muon/python/muonAnalyzer_cff.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,14 +22,6 @@
muonPFsequence*
muonRecoOneHLT)



muonAnalyzer_miniAOD = cms.Sequence(muonRecoAnalyzer_miniAOD*
muonKinVsEtaAnalyzer_miniAOD*
diMuonHistos_miniAOD*
EfficiencyAnalyzer_miniAOD*
triggerMatchMonitor_miniAOD)

muonAnalyzer_noHLT = cms.Sequence(muonEnergyDepositAnalyzer*
muonSeedsAnalyzer*
muonRecoAnalyzer*
Expand All @@ -39,3 +31,12 @@
diMuonHistos*
EfficiencyAnalyzer*
muonPFsequence)

muonAnalyzer_miniAOD = cms.Sequence(muonRecoAnalyzer_miniAOD*
muonKinVsEtaAnalyzer_miniAOD*
diMuonHistos_miniAOD*
EfficiencyAnalyzer_miniAOD*
triggerMatchMonitor_miniAOD)

from Configuration.Eras.Modifier_fastSim_cff import fastSim
fastSim.toReplaceWith(muonAnalyzer_miniAOD, muonAnalyzer_miniAOD.copyAndExclude([triggerMatchMonitor_miniAOD]))
2 changes: 2 additions & 0 deletions Validation/RecoTau/python/DQMMCValidation_cfi.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,8 @@
produceDenominatorZMM+
produceDenominatorZTT
)
from Configuration.Eras.Modifier_fastSim_cff import fastSim
fastSim.toReplaceWith(produceDenoms,produceDenoms.copyAndExclude([produceDenominatorRealData,produceDenominatorRealElectronsData,produceDenominatorRealMuonsData]))

runTauEff = cms.Sequence(
efficienciesQCD+
Expand Down
3 changes: 3 additions & 0 deletions Validation/RecoTau/python/RecoTauValidation_cff.py
Original file line number Diff line number Diff line change
Expand Up @@ -111,3 +111,6 @@
)

tauValidationSequenceMiniAOD = cms.Sequence(tauValidationMiniAODZTT*tauValidationMiniAODZEE*tauValidationMiniAODZMM*tauValidationMiniAODQCD*tauValidationMiniAODRealData*tauValidationMiniAODRealElectronsData*tauValidationMiniAODRealMuonsData)

from Configuration.Eras.Modifier_fastSim_cff import fastSim
fastSim.toReplaceWith(tauValidationSequenceMiniAOD,tauValidationSequenceMiniAOD.copyAndExclude([tauValidationMiniAODRealData,tauValidationMiniAODRealElectronsData,tauValidationMiniAODRealMuonsData]))

0 comments on commit 20d46ab

Please sign in to comment.