CMS 3D CMS Logo

relval_upgrade.py
Go to the documentation of this file.
1 import six
2 # import the definition of the steps and input files:
4 
5 # here only define the workflows as a combination of the steps defined above:
6 workflows = Matrix()
7 
8 # each workflow defines a name and a list of steps to be done.
9 # if no explicit name/label given for the workflow (first arg),
10 # the name of step1 will be used
11 
12 def makeStepNameSim(key,frag,step,suffix):
13  return frag+'_'+key+'_'+step+suffix
14 
15 def makeStepName(key,frag,step,suffix):
16  return step+suffix+'_'+key
17 
18 #just define all of them
19 
20 for year in upgradeKeys:
21  for i,key in enumerate(upgradeKeys[year]):
22  numWF=numWFAll[year][i]
23  for frag,info in six.iteritems(upgradeFragments):
24  # phase2-specific fragments are skipped in phase1
25  if ("CE_E" in frag or "CE_H" in frag) and year==2017:
26  numWF += 1
27  continue
28  stepList={}
29  for specialType in upgradeWFs.keys():
30  stepList[specialType] = []
31  hasHarvest = False
32  for step in upgradeProperties[year][key]['ScenToRun']:
33  stepMaker = makeStepName
34  if 'Sim' in step:
35  if 'HLBeamSpotFull' in step and '14TeV' in frag:
36  step = 'GenSimHLBeamSpotFull14'
37  stepMaker = makeStepNameSim
38 
39  if 'HARVEST' in step: hasHarvest = True
40 
41  for specialType,specialWF in six.iteritems(upgradeWFs):
42  # use variation only when available
43  if specialType == 'Premix':
44  # Premixing stage1
45  #
46  # This is a hack which should be placed somewhere else, but likely requires more massive changes for "proper" PUPRMX treatment
47  #
48  # On one hand the place where upgradeWorkflowComponents.upgradeProperties[year][...PU]
49  # are defined from the noPU workflows would be a logical place. On the other hand, that
50  # would need the premixing workflows to be defined in upgradeWorkflowComponents.upgradeKeys[year]
51  # dictionary, which would further mean that we would get full set of additional workflows for
52  # premixing, while the preferred solution would be to define the premixing workflows as variations of the PU workflows.
53  s = step.replace('GenSim', 'Premix')
54  if not s in specialWF.PU:
55  continue
56  s = s + 'PU' # later processing requires to have PU here
57  # Hardcode nu gun fragment below in order to use it for combined stage1+stage2
58  # Anyway all other fragments are irrelevant for premixing stage1
59  stepList[specialType].append(stepMaker(key,'PREMIX',s,specialWF.suffix))
60  elif (specialType is not 'baseline') and ( ('PU' in step and step.replace('PU','') in specialWF.PU) or (step in specialWF.steps) ):
61  stepList[specialType].append(stepMaker(key,frag[:-4],step,specialWF.suffix))
62  # hack to add an extra step
63  if (specialType == 'ProdLike' or specialType == 'TestOldDigiProdLike') and 'RecoFullGlobal' in step:
64  stepList[specialType].append(stepMaker(key,frag[:-4],step.replace('RecoFullGlobal','MiniAODFullGlobal'),specialWF.suffix))
65  elif specialType == 'ProdLike' and 'RecoFull' in step:
66  stepList[specialType].append(stepMaker(key,frag[:-4],step.replace('RecoFull','MiniAODFullGlobal'),specialWF.suffix))
67  else:
68  stepList[specialType].append(stepMaker(key,frag[:-4],step,''))
69 
70  for specialType,specialWF in six.iteritems(upgradeWFs):
71  specialWF.workflow(workflows, numWF, info.dataset, stepList[specialType], key, hasHarvest)
72 
73  inclPremix = 'PU' in key
74  if inclPremix:
75  inclPremix = False
76  for y in ['2021', '2023', '2024', '2026']:
77  if y in key:
78  inclPremix = True
79  continue
80  if inclPremix:
81  # premixing stage1, only for NuGun
82  if info.dataset=="NuGun":
83  # The first element of the list sets the dataset name(?)
84  datasetName = 'PREMIXUP' + key[2:].replace("PU", "").replace("Design", "") + '_PU25'
85  workflows[numWF+upgradeWFs['Premix'].offset] = [datasetName, stepList['Premix']]
86 
87  # premixing stage2
88  slist = []
89  for step in stepList['baseline']:
90  s = step
91  if "Digi" in step or "Reco" in step:
92  s = s.replace("PU", "PUPRMX", 1)
93  slist.append(s)
94  workflows[numWF+upgradeWFs['premixS2'].offset] = [info.dataset, slist]
95 
96  # Combined stage1+stage2
97  def nano(s):
98  if "Nano" in s:
99  if "_" in s:
100  return s.replace("_", "PUPRMXCombined_")
101  return s+"PUPRMXCombined"
102  return s
103  workflows[numWF+upgradeWFs['premixS1S2'].offset] = [info.dataset, # Signal fragment
104  [slist[0]] + # Start with signal generation
105  stepList['Premix'] + # Premixing stage1
106  [slist[1].replace("PUPRMX", "PUPRMXCombined")] + # Premixing stage2, customized for the combined (defined in relval_steps.py)
107  list(map(nano, slist[2:]))] # Remaining standard steps
108 
109  numWF+=1
relval_steps
relval_upgrade.makeStepNameSim
def makeStepNameSim(key, frag, step, suffix)
Definition: relval_upgrade.py:12
relval_upgrade.nano
def nano(s)
Definition: relval_upgrade.py:97
relval_upgrade.makeStepName
def makeStepName(key, frag, step, suffix)
Definition: relval_upgrade.py:15
mps_setup.append
append
Definition: mps_setup.py:85
hitfit::Matrix
CLHEP::HepMatrix Matrix
Definition: matutil.h:62
list
How EventSelector::AcceptEvent() decides whether to accept an event for output otherwise it is excluding the probing of A single or multiple positive and the trigger will pass if any such matching triggers are PASS or EXCEPTION[A criterion thatmatches no triggers at all is detected and causes a throw.] A single negative with an expectation of appropriate bit checking in the decision and the trigger will pass if any such matching triggers are FAIL or EXCEPTION A wildcarded negative criterion that matches more than one trigger in the trigger list("!*", "!HLTx*" if it matches 2 triggers or more) will accept the event if all the matching triggers are FAIL. It will reject the event if any of the triggers are PASS or EXCEPTION(this matches the behavior of "!*" before the partial wildcard feature was incorporated). Triggers which are in the READY state are completely ignored.(READY should never be returned since the trigger paths have been run
genParticles_cff.map
map
Definition: genParticles_cff.py:11
python.rootplot.root2matplotlib.replace
def replace(string, replacements)
Definition: root2matplotlib.py:444