File indexing completed on 2024-10-16 05:06:28
0001 def expandNanoMapping(seqList, mapping, key):
0002 maxLevel = 30
0003 level = 0
0004 while '@' in repr(seqList) and level < maxLevel:
0005 level += 1
0006 for specifiedCommand in seqList:
0007 if specifiedCommand.startswith('@'):
0008 location = specifiedCommand[1:]
0009 if not location in mapping:
0010 raise Exception("Impossible to map " + location + " from " + repr(mapping))
0011 mappedTo = mapping[location]
0012
0013
0014
0015
0016 insertAt = seqList.index(specifiedCommand)
0017 seqList.remove(specifiedCommand)
0018 if key in mappedTo and mappedTo[key] is not None:
0019 allToInsert = mappedTo[key].split('+')
0020 for offset, toInsert in enumerate(allToInsert):
0021 seqList.insert(insertAt + offset, toInsert)
0022 break
0023 if level == maxLevel:
0024 raise Exception("Could not fully expand " + repr(seqList) + " from " + repr(mapping))
0025
0026
0027 autoNANO = {
0028
0029 'PHYS': {'sequence': '',
0030 'customize': ''},
0031
0032 'L1': {'customize': 'PhysicsTools/NanoAOD/l1trig_cff.nanoL1TrigObjCustomize'},
0033 'L1FULL': {'customize': 'PhysicsTools/NanoAOD/l1trig_cff.nanoL1TrigObjCustomizeFull'},
0034
0035 'Scout': {'sequence': 'PhysicsTools/NanoAOD/custom_run3scouting_cff'},
0036
0037 'JME': {'sequence': '@PHYS',
0038 'customize': '@PHYS+PhysicsTools/NanoAOD/custom_jme_cff.PrepJMECustomNanoAOD'},
0039 'JMErePuppi': {'sequence': '@PHYS',
0040 'customize': '@PHYS+@JME+PhysicsTools/NanoAOD/custom_jme_cff.RecomputePuppiWeightsMETAK8'},
0041
0042 'L1DPG' : {'sequence': 'DPGAnalysis/L1TNanoAOD/l1tNano_cff.l1tNanoSequence',
0043 'customize': ','.join(['PhysicsTools/NanoAOD/l1trig_cff.nanoL1TrigObjCustomizeFull',
0044 'DPGAnalysis/L1TNanoAOD/l1tNano_cff.addCaloFull',
0045 'L1Trigger/Configuration/customiseReEmul.L1TReEmulFromRAW'])},
0046
0047 'MUPOG': {'sequence': '@PHYS',
0048 'customize': '@PHYS+PhysicsTools/NanoAOD/custom_muon_cff.PrepMuonCustomNanoAOD'},
0049
0050 'MUDPG': {'sequence': 'DPGAnalysis/MuonTools/muNtupleProducer_cff.muDPGNanoProducer',
0051 'customize': 'DPGAnalysis/MuonTools/muNtupleProducer_cff.muDPGNanoCustomize'},
0052 'MUDPGBKG': {'sequence': 'DPGAnalysis/MuonTools/muNtupleProducerBkg_cff.muDPGNanoProducerBkg',
0053 'customize': 'DPGAnalysis/MuonTools/muNtupleProducerBkg_cff.muDPGNanoBkgCustomize'},
0054
0055 'HCAL': {'sequence': 'DPGAnalysis/HcalNanoAOD/hcalNano_cff.hcalNanoTask'},
0056 'HCALCalib': {'sequence': 'DPGAnalysis/HcalNanoAOD/hcalNano_cff.hcalNanoTask',
0057 'customize': 'DPGAnalysis/HcalNanoAOD/customiseHcalCalib_cff.customiseHcalCalib'},
0058
0059 'EGM': {'sequence': '@PHYS',
0060 'customize': '@PHYS+PhysicsTools/NanoAOD/egamma_custom_cff.addExtraEGammaVarsCustomize'},
0061
0062 'Prompt': {'sequence': '@PHYS',
0063 'customize': '@PHYS+@L1'},
0064
0065 'LepTrackInfo' : {'sequence': '@PHYS',
0066 'customize': '@PHYS+PhysicsTools/NanoAOD/leptonTimeLifeInfo_common_cff.addTrackVarsToTimeLifeInfo'},
0067
0068 'BTV': {'sequence': '@PHYS',
0069 'customize': '@PHYS+PhysicsTools/NanoAOD/custom_btv_cff.BTVCustomNanoAOD'},
0070
0071 'GEN': {'sequence': 'PhysicsTools/NanoAOD/nanogen_cff.nanogenSequence',
0072 'customize': 'PhysicsTools/NanoAOD/nanogen_cff.customizeNanoGEN'},
0073
0074 'GENFromMini': {'sequence': 'PhysicsTools/NanoAOD/nanogen_cff.nanogenSequence',
0075 'customize': 'PhysicsTools/NanoAOD/nanogen_cff.customizeNanoGENFromMini'},
0076 }