Skip to content
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

Update nano relval matrix #45419

Merged
merged 3 commits into from
Jul 23, 2024
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
14 changes: 0 additions & 14 deletions Configuration/Applications/python/ConfigBuilder.py
Original file line number Diff line number Diff line change
Expand Up @@ -1007,7 +1007,6 @@ def define_Configs(self):
self.RECOSIMDefaultCFF="Configuration/StandardSequences/RecoSim_cff"
self.PATDefaultCFF="Configuration/StandardSequences/PAT_cff"
self.NANODefaultCFF="PhysicsTools/NanoAOD/nano_cff"
self.NANOGENDefaultCFF="PhysicsTools/NanoAOD/nanogen_cff"
self.SKIMDefaultCFF="Configuration/StandardSequences/Skims_cff"
self.POSTRECODefaultCFF="Configuration/StandardSequences/PostRecoGenerator_cff"
self.VALIDATIONDefaultCFF="Configuration/StandardSequences/Validation_cff"
Expand Down Expand Up @@ -1057,7 +1056,6 @@ def define_Configs(self):
self.PATDefaultSeq='miniAOD'
self.PATGENDefaultSeq='miniGEN'
#TODO: Check based of file input
self.NANOGENDefaultSeq='nanogenSequence'
self.NANODefaultSeq='nanoSequence'
self.NANODefaultCustom='nanoAOD_customizeCommon'

Expand Down Expand Up @@ -1844,18 +1842,6 @@ def prepare_NANO(self, stepSpec = '' ):
self._options.customise_commands = self._options.customise_commands + " \n"
self._options.customise_commands = self._options.customise_commands + "process.unpackedPatTrigger.triggerResults= cms.InputTag( 'TriggerResults::"+self._options.hltProcess+"' )\n"

def prepare_NANOGEN(self, stepSpec = "nanoAOD"):
''' Enrich the schedule with NANOGEN '''
# TODO: Need to modify this based on the input file type
fromGen = any([x in self.stepMap for x in ['LHE', 'GEN', 'AOD']])
_,_nanogenSeq,_nanogenCff = self.loadDefaultOrSpecifiedCFF(stepSpec,self.NANOGENDefaultCFF)
self.scheduleSequence(_nanogenSeq,'nanoAOD_step')
custom = "customizeNanoGEN" if fromGen else "customizeNanoGENFromMini"
if self._options.runUnscheduled:
self._options.customisation_file_unsch.insert(0, '.'.join([_nanogenCff, custom]))
else:
self._options.customisation_file.insert(0, '.'.join([_nanogenCff, custom]))

def prepare_SKIM(self, stepSpec = "all"):
''' Enrich the schedule with skimming fragments'''
skimConfig,sequence,_ = self.loadDefaultOrSpecifiedCFF(stepSpec,self.SKIMDefaultCFF)
Expand Down
5 changes: 0 additions & 5 deletions Configuration/PyReleaseValidation/python/relval_generator.py
Original file line number Diff line number Diff line change
Expand Up @@ -38,8 +38,3 @@
#workflows[543]=['',['Upsilon4sBaBarExample_BpBm_Dstarpipi_D0Kpi_nonres_forSTEAM_13TeV_TuneCUETP8M1','HARVESTGEN']]
#workflows[544]=['',['LambdaBToLambdaMuMuToPPiMuMu_forSTEAM_13TeV_TuneCUETP8M1','HARVESTGEN']]
workflows[545]=['',['BsToMuMu_forSTEAM_13TeV','HARVESTGEN']]

# Miscellaneous
workflows[546]=['',['DYToLL_M-50_13TeV_pythia8','NANOGENFromGen']]
workflows[547]=['',['DYToll01234Jets_5f_LO_MLM_Madgraph_LHE_13TeV','Hadronizer_TuneCP5_13TeV_MLM_5f_max4j_LHE_pythia8','NANOGENFromGen']]
workflows[548]=['',['TTbar_Pow_LHE_13TeV','Hadronizer_TuneCP5_13TeV_powhegEmissionVeto2p_pythia8','NANOGENFromGen']]
595 changes: 325 additions & 270 deletions Configuration/PyReleaseValidation/python/relval_nano.py

Large diffs are not rendered by default.

5 changes: 0 additions & 5 deletions Configuration/PyReleaseValidation/python/relval_steps.py
Original file line number Diff line number Diff line change
Expand Up @@ -4149,16 +4149,11 @@ def gen2023HiMix(fragment,howMuch):
steps['MINIAODMCUP18FS'] =merge([{'--filein':'file:step1.root','--fast':'','--conditions':'auto:phase1_2018_realistic','--era':'Run2_2018_FastSim'},stepMiniAODMC])

stepNanoAODDefaults = { '-s': 'NANO,DQM:@nanoAODDQM', '-n': 1000 }
stepNanoGenDefaults = { '-s': 'NANOGEN,DQM:@nanogenDQM', '-n': 1000 }
stepNanoAODData = merge([{ '--data':'', '--eventcontent' : 'NANOAOD,DQM' ,'--datatier': 'NANOAOD,DQMIO' }, stepNanoAODDefaults ])
stepNanoAODMC = merge([{ '--mc':'' , '--eventcontent' : 'NANOAODSIM,DQM','--datatier': 'NANOAODSIM,DQMIO' }, stepNanoAODDefaults ])
stepNanoEDMData = merge([{ '--data':'', '--eventcontent' : 'NANOEDMAOD,DQM' ,'--datatier': 'NANOAOD,DQMIO' }, stepNanoAODDefaults ])
stepNanoEDMMC = merge([{ '--mc':'' , '--eventcontent' : 'NANOEDMAODSIM,DQM','--datatier': 'NANOAODSIM,DQMIO' }, stepNanoAODDefaults ])
stepNanoEDMMCProd = merge([{ '--mc':'', '-s': 'NANO', '--eventcontent' : 'NANOEDMAODSIM','--datatier': 'NANOAODSIM' }, stepNanoAODDefaults ])
stepNanoGen = merge([{ '--mc':'' , '--eventcontent' : 'NANOAODGEN,DQM','--datatier': 'NANOAODSIM,DQMIO' }, stepNanoGenDefaults ])

steps['NANOGENFromGen'] = merge([{'--conditions': 'auto:run2_mc', '--customise' : 'PhysicsTools/NanoAOD/nanogen_cff.customizeNanoGEN'}, stepNanoGen ])
steps['NANOGENFromMini'] = merge([{'--conditions': 'auto:run2_mc'}, stepNanoGen ])

steps['NANOEDMMC2018_PROD'] = merge([{'--conditions': 'auto:phase1_2018_realistic', '--era': 'Run2_2018', '--filein':'file:step3_inMINIAODSIM.root'}, stepNanoEDMMCProd ])
steps['NANOUP15'] = merge([{ '--conditions':'auto:run2_mc', '--era':'Run2_2016','-n':'10', '--filein':'file:step3_inMINIAODSIM.root','--nThreads':'2'}, stepNanoEDMMCProd ])
Expand Down
2 changes: 1 addition & 1 deletion Configuration/PyReleaseValidation/scripts/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -327,7 +327,7 @@ MC workflows for pp collisions:
| 12834.7 | RelValTTbar_14TeV | phase1_2023_realistic | Run3_2024 | mkFit |
| 14034.0 | RelValTTbar_14TeV | phase1_2023_realistic | Run3_2023_FastSim | *FastSim* |
| 14234.0 | RelValTTbar_14TeV | phase1_2023_realistic | Run3_2023_FastSim | *FastSim* Run3_Flat55To75_PoissonOOTPU |
| 2500.4 | RelValTTbar_14TeV | phase1_2022_realistic | Run3 | NanoAOD from existing MINI |
| 2500.201 | RelValTTbar_14TeV | phase1_2022_realistic | Run3 | NanoAOD from existing MINI |
| | | | | |
| **Phase2** | | | | **Geometry** |
| | | | | |
Expand Down
2 changes: 1 addition & 1 deletion Configuration/PyReleaseValidation/scripts/runTheMatrix.py
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@ def runSelected(opt):
12834.7, # RelValTTbar_14TeV 2024 mkFit
14034.0, # RelValTTbar_14TeV Run3_2023_FastSim
14234.0, # RelValTTbar_14TeV Run3_2023_FastSim PU = Run3_Flat55To75_PoissonOOTPU
2500.4, # RelValTTbar_14TeV NanoAOD from existing MINI
2500.201, # RelValTTbar_14TeV NanoAOD from existing MINI

# Phase2
29634.0, # RelValTTbar_14TeV phase2_realistic_T33 Extended2026D110 (Phase-2 baseline)
Expand Down
9 changes: 0 additions & 9 deletions PhysicsTools/NanoAOD/python/NanoAODEDMEventContent_cff.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,12 +19,3 @@
compressionLevel = cms.untracked.int32(9),
compressionAlgorithm = cms.untracked.string("LZMA"),
)

NanoGenOutput = NanoAODEDMEventContent.outputCommands[:]
NanoGenOutput.remove("keep edmTriggerResults_*_*_*")

NANOAODGENEventContent = cms.PSet(
compressionLevel = cms.untracked.int32(9),
compressionAlgorithm = cms.untracked.string("LZMA"),
outputCommands = cms.untracked.vstring(NanoGenOutput)
)
89 changes: 49 additions & 40 deletions PhysicsTools/NanoAOD/python/autoNANO.py
Original file line number Diff line number Diff line change
@@ -1,67 +1,76 @@
def expandNanoMapping(seqList, mapping, key):
maxLevel=30
level=0
while '@' in repr(seqList) and level<maxLevel:
level+=1
maxLevel = 30
level = 0
while '@' in repr(seqList) and level < maxLevel:
level += 1
for specifiedCommand in seqList:
if specifiedCommand.startswith('@'):
location=specifiedCommand[1:]
location = specifiedCommand[1:]
if not location in mapping:
raise Exception("Impossible to map "+location+" from "+repr(mapping))
mappedTo=mapping[location]
raise Exception("Impossible to map " + location + " from " + repr(mapping))
mappedTo = mapping[location]
# no mapping for specified key
# NOTE: mising key of key=None is interpreted differently than empty string:
# - An empty string recalls the default for the given key
# - None is interpreted as "ignore this"
insertAt=seqList.index(specifiedCommand)
insertAt = seqList.index(specifiedCommand)
seqList.remove(specifiedCommand)
if key in mappedTo and mappedTo[key] is not None:
allToInsert=mappedTo[key].split('+')
for offset,toInsert in enumerate(allToInsert):
seqList.insert(insertAt+offset,toInsert)
break;
if level==maxLevel:
raise Exception("Could not fully expand "+repr(seqList)+" from "+repr(mapping))
allToInsert = mappedTo[key].split('+')
for offset, toInsert in enumerate(allToInsert):
seqList.insert(insertAt + offset, toInsert)
break
if level == maxLevel:
raise Exception("Could not fully expand " + repr(seqList) + " from " + repr(mapping))


autoNANO = {
# PHYS is a mapping to the default NANO config, i.e. empty strings
'PHYS': {'sequence': '',
'customize': ''},
# L1 flavours: add tables through customize, supposed to be combined with PHYS
'L1' : {'customize': 'PhysicsTools/NanoAOD/l1trig_cff.nanoL1TrigObjCustomize'},
'L1FULL' : {'customize': 'PhysicsTools/NanoAOD/l1trig_cff.nanoL1TrigObjCustomizeFull'},
#scouting nano
'Scout' : {'sequence': 'PhysicsTools/NanoAOD/custom_run3scouting_cff'},
'JME' : { 'sequence': '@PHYS',
'customize': '@PHYS+PhysicsTools/NanoAOD/custom_jme_cff.PrepJMECustomNanoAOD'},
'JMErePuppi' : { 'sequence': '@PHYS',
'customize': '@PHYS+@JME+PhysicsTools/NanoAOD/custom_jme_cff.RecomputePuppiWeightsAndMET'},
'L1': {'customize': 'PhysicsTools/NanoAOD/l1trig_cff.nanoL1TrigObjCustomize'},
'L1FULL': {'customize': 'PhysicsTools/NanoAOD/l1trig_cff.nanoL1TrigObjCustomizeFull'},
# scouting nano
'Scout': {'sequence': 'PhysicsTools/NanoAOD/custom_run3scouting_cff'},
# JME nano
'JME': {'sequence': '@PHYS',
'customize': '@PHYS+PhysicsTools/NanoAOD/custom_jme_cff.PrepJMECustomNanoAOD'},
'JMErePuppi': {'sequence': '@PHYS',
'customize': '@PHYS+@JME+PhysicsTools/NanoAOD/custom_jme_cff.RecomputePuppiWeightsAndMET'},
# L1 DPG (standalone with full calo TP info, L1T reemulation customization)
'L1DPG' : {'sequence': 'DPGAnalysis/L1TNanoAOD/l1tNano_cff.l1tNanoSequence',
'customize': 'PhysicsTools/NanoAOD/l1trig_cff.nanoL1TrigObjCustomizeFull,DPGAnalysis/L1TNanoAOD/l1tNano_cff.addCaloFull,L1Trigger/Configuration/customiseReEmul.L1TReEmulFromRAW'},
'customize': ','.join(['PhysicsTools/NanoAOD/l1trig_cff.nanoL1TrigObjCustomizeFull',
'DPGAnalysis/L1TNanoAOD/l1tNano_cff.addCaloFull',
'L1Trigger/Configuration/customiseReEmul.L1TReEmulFromRAW'])},
# Muon POG flavours : add tables through customize, supposed to be combined with PHYS
'MUPOG' : {'sequence': '@PHYS',
'customize' : '@PHYS+PhysicsTools/NanoAOD/custom_muon_cff.PrepMuonCustomNanoAOD'},
'MUPOG': {'sequence': '@PHYS',
'customize': '@PHYS+PhysicsTools/NanoAOD/custom_muon_cff.PrepMuonCustomNanoAOD'},
# MUDPG flavours: use their own sequence
'MUDPG' : {'sequence': 'DPGAnalysis/MuonTools/muNtupleProducer_cff.muDPGNanoProducer',
'customize': 'DPGAnalysis/MuonTools/muNtupleProducer_cff.muDPGNanoCustomize'},
'MUDPGBKG' : {'sequence': 'DPGAnalysis/MuonTools/muNtupleProducerBkg_cff.muDPGNanoProducerBkg',
'customize': 'DPGAnalysis/MuonTools/muNtupleProducerBkg_cff.muDPGNanoBkgCustomize'},
# HCAL favlours:
'HCAL' : {'sequence': 'DPGAnalysis/HcalNanoAOD/hcalNano_cff.hcalNanoTask'},
'HCALCalib' : { 'sequence': 'DPGAnalysis/HcalNanoAOD/hcalNano_cff.hcalNanoTask',
'customize': 'DPGAnalysis/HcalNanoAOD/hcalNano_cff.customiseHcalCalib'},
#EGM flavours: add variables through customize
'EGM' : {'sequence': '@PHYS',
'customize' : '@PHYS+PhysicsTools/NanoAOD/egamma_custom_cff.addExtraEGammaVarsCustomize'},
'MUDPG': {'sequence': 'DPGAnalysis/MuonTools/muNtupleProducer_cff.muDPGNanoProducer',
'customize': 'DPGAnalysis/MuonTools/muNtupleProducer_cff.muDPGNanoCustomize'},
'MUDPGBKG': {'sequence': 'DPGAnalysis/MuonTools/muNtupleProducerBkg_cff.muDPGNanoProducerBkg',
'customize': 'DPGAnalysis/MuonTools/muNtupleProducerBkg_cff.muDPGNanoBkgCustomize'},
# HCAL flavors:
'HCAL': {'sequence': 'DPGAnalysis/HcalNanoAOD/hcalNano_cff.hcalNanoTask'},
'HCALCalib': {'sequence': 'DPGAnalysis/HcalNanoAOD/hcalNano_cff.hcalNanoTask',
'customize': 'DPGAnalysis/HcalNanoAOD/hcalNano_cff.customiseHcalCalib'},
# EGM flavours: add variables through customize
'EGM': {'sequence': '@PHYS',
'customize': '@PHYS+PhysicsTools/NanoAOD/egamma_custom_cff.addExtraEGammaVarsCustomize'},
# PromptReco config: PHYS+L1
'Prompt' : {'sequence': '@PHYS',
'customize': '@PHYS+@L1'},
'Prompt': {'sequence': '@PHYS',
'customize': '@PHYS+@L1'},
# Add lepton track parameters through customize combined with PHYS
'LepTrackInfo' : {'sequence': '@PHYS',
'customize': '@PHYS+PhysicsTools/NanoAOD/leptonTimeLifeInfo_common_cff.addTrackVarsToTimeLifeInfo'},
# Custom BTV Nano for SF measurements or tagger training
'BTV' : {'sequence': '@PHYS',
'customize':'@PHYS+PhysicsTools/NanoAOD/custom_btv_cff.BTVCustomNanoAOD'}
'BTV': {'sequence': '@PHYS',
'customize': '@PHYS+PhysicsTools/NanoAOD/custom_btv_cff.BTVCustomNanoAOD'},
# NANOGEN (from LHE/GEN/AOD)
'GEN': {'sequence': 'PhysicsTools/NanoAOD/nanogen_cff.nanogenSequence',
'customize': 'PhysicsTools/NanoAOD/nanogen_cff.customizeNanoGEN'},
# NANOGEN (from MiniAOD)
'GENFromMini': {'sequence': 'PhysicsTools/NanoAOD/nanogen_cff.nanogenSequence',
'customize': 'PhysicsTools/NanoAOD/nanogen_cff.customizeNanoGENFromMini'},
}
5 changes: 5 additions & 0 deletions PhysicsTools/NanoAOD/python/nanogen_cff.py
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,10 @@ def nanoGenCommonCustomize(process):
setGenPhiPrecision(process, CandVars.phi.precision)
setGenMassPrecision(process, CandVars.mass.precision)

for output in ("NANOEDMAODSIMoutput", "NANOAODSIMoutput"):
if hasattr(process, output):
getattr(process, output).outputCommands.append("drop edmTriggerResults_*_*_*")

def customizeNanoGENFromMini(process):
process.nanogenSequence.insert(0, process.genParticles2HepMCHiggsVtx)
process.nanogenSequence.insert(0, process.genParticles2HepMC)
Expand All @@ -71,6 +75,7 @@ def customizeNanoGENFromMini(process):
process.genParticleTable.src = "prunedGenParticles"
process.patJetPartonsNano.particles = "prunedGenParticles"
process.particleLevel.src = "genParticles2HepMC:unsmeared"
process.genIso.genPart = "prunedGenParticles"

process.genJetTable.src = "slimmedGenJets"
process.genJetAK8Table.src = "slimmedGenJetsAK8"
Expand Down