CMS 3D CMS Logo

All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Modules Pages
autoNANO.py
Go to the documentation of this file.
1 def expandNanoMapping(seqList, mapping, key):
2  maxLevel=30
3  level=0
4  while '@' in repr(seqList) and level<maxLevel:
5  level+=1
6  for specifiedCommand in seqList:
7  if specifiedCommand.startswith('@'):
8  location=specifiedCommand[1:]
9  if not location in mapping:
10  raise Exception("Impossible to map "+location+" from "+repr(mapping))
11  mappedTo=mapping[location]
12  # no mapping for specified key
13  # NOTE: mising key of key=None is interpreted differently than empty string:
14  # - An empty string recalls the default for the given key
15  # - None is interpreted as "ignore this"
16  seqList.remove(specifiedCommand)
17  if key in mappedTo and mappedTo[key] is not None:
18  seqList.extend(mappedTo[key].split('+'))
19  break;
20  if level==maxLevel:
21  raise Exception("Could not fully expand "+repr(seqList)+" from "+repr(mapping))
22 
23 
24 autoNANO = {
25  # PHYS is a mapping to the default NANO config, i.e. empty strings
26  'PHYS': {'sequence': '',
27  'customize': ''},
28  # L1 flavours: add tables through customize, supposed to be combined with PHYS
29  'L1' : {'customize': 'nanoL1TrigObjCustomize'},
30  'L1FULL' : {'customize': 'nanoL1TrigObjCustomizeFull'},
31  #scouting nano
32  'Scout' : {'sequence': 'PhysicsTools/NanoAOD/custom_run3scouting_cff'},
33  # JME custom NANO
34  'JME' : { 'sequence': '@PHYS',
35  'customize': '@PHYS+PhysicsTools/NanoAOD/custom_jme_cff.PrepJMECustomNanoAOD'},
36  # Muon POG flavours : add tables through customize, supposed to be combined with PHYS
37  'MUPOG' : { 'sequence': '@PHYS',
38  'customize' : '@PHYS+PhysicsTools/NanoAOD/custom_muon_cff.PrepMuonCustomNanoAOD'},
39  # MUDPG flavours: use their own sequence
40  'MUDPG' : {'sequence': 'DPGAnalysis/MuonTools/muNtupleProducer_cff.muDPGNanoProducer',
41  'customize': 'DPGAnalysis/MuonTools/muNtupleProducer_cff.muDPGNanoCustomize'},
42  'MUDPGBKG' : {'sequence': 'DPGAnalysis/MuonTools/muNtupleProducerBkg_cff.muDPGNanoProducerBkg',
43  'customize': 'DPGAnalysis/MuonTools/muNtupleProducerBkg_cff.muDPGNanoBkgCustomize'},
44  #EGM flavours: add variables through customize
45  'EGM' : {'sequence': '@PHYS',
46  'customize' : '@PHYS+PhysicsTools/NanoAOD/egamma_custom_cff.addExtraEGammaVarsCustomize'},
47  # PromptReco config: PHYS+L1
48  'Prompt' : {'sequence': '@PHYS',
49  'customize': '@PHYS+@L1'},
50  # Add lepton track parameters through customize combined with PHYS
51  'LepTrackInfo' : {'sequence': '@PHYS',
52  'customize': '@PHYS+PhysicsTools/NanoAOD/leptonTimeLifeInfo_common_cff.addTrackVarsToTimeLifeInfo'},
53  # Custom BTV Nano for SF measurements or tagger training
54  'BTV' : {'sequence': '@PHYS',
55  'customize':'@PHYS+PhysicsTools/NanoAOD/custom_btv_cff.BTVCustomNanoAOD'}
56 }
def expandNanoMapping(seqList, mapping, key)
Definition: autoNANO.py:1