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,"SingleNuE10_cf",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' and 'RecoFullGlobal' in step:
64  stepList[specialType].append(stepMaker(key,frag[:-4],step.replace('RecoFullGlobal','MiniAODFullGlobal'),specialWF.suffix))
65  else:
66  stepList[specialType].append(stepMaker(key,frag[:-4],step,''))
67 
68  for specialType,specialWF in six.iteritems(upgradeWFs):
69  specialWF.workflow(workflows, numWF, info.dataset, stepList[specialType], key, hasHarvest)
70 
71  inclPremix = 'PU' in key
72  if inclPremix:
73  inclPremix = False
74  for y in ['2021', '2023', '2024', '2026']:
75  if y in key:
76  inclPremix = True
77  continue
78  if inclPremix:
79  # premixing stage1, only for NuGun
80  if info.dataset=="NuGun":
81  workflows[numWF+upgradeWFs['Premix'].offset] = [info.dataset, stepList['Premix']]
82 
83  # premixing stage2
84  slist = []
85  for step in stepList['baseline']:
86  s = step
87  if "Digi" in step or "Reco" in step:
88  s = s.replace("PU", "PUPRMX", 1)
89  slist.append(s)
90  workflows[numWF+upgradeWFs['premixS2'].offset] = [info.dataset, slist]
91 
92  # Combined stage1+stage2
93  def nano(s):
94  if "Nano" in s:
95  if "_" in s:
96  return s.replace("_", "PUPRMXCombined_")
97  return s+"PUPRMXCombined"
98  return s
99  workflows[numWF+upgradeWFs['premixS1S2'].offset] = [info.dataset, # Signal fragment
100  [slist[0]] + # Start with signal generation
101  stepList['Premix'] + # Premixing stage1
102  [slist[1].replace("PUPRMX", "PUPRMXCombined")] + # Premixing stage2, customized for the combined (defined in relval_steps.py)
103  list(map(nano, slist[2:]))] # Remaining standard steps
104 
105  numWF+=1
def makeStepName(key, frag, step, suffix)
def replace(string, replacements)
CLHEP::HepMatrix Matrix
Definition: matutil.h:62
def makeStepNameSim(key, frag, step, suffix)
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