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 'HLBeamSpot' in step and '14TeV' in frag:
36  step = 'GenSimHLBeamSpot14'
37  stepMaker = makeStepNameSim
38 
39  if 'HARVEST' in step: hasHarvest = True
40 
41  for specialType,specialWF in six.iteritems(upgradeWFs):
42  if (specialType != 'baseline') and ( ('PU' in step and step.replace('PU','') in specialWF.PU) or (step in specialWF.steps) ):
43  stepList[specialType].append(stepMaker(key,frag[:-4],step,specialWF.suffix))
44  # hack to add an extra step
45  if 'ProdLike' in specialType:
46  if 'Reco' in step: # handles both Reco and RecoGlobal
47  stepList[specialType].append(stepMaker(key,frag[:-4],step.replace('RecoGlobal','MiniAOD').replace('Reco','MiniAOD'),specialWF.suffix))
48  # similar hacks for premixing
49  if 'PMX' in specialType:
50  if 'GenSim' in step:
51  s = step.replace('GenSim','Premix')+'PU' # later processing requires to have PU here
52  if step in specialWF.PU:
53  stepMade = stepMaker(key,'PREMIX',s,specialWF.suffix)
54  # append for combined
55  if 'S2' in specialType: stepList[specialType].append(stepMade)
56  # replace for s1
57  else: stepList[specialType][-1] = stepMade
58  else:
59  stepList[specialType].append(stepMaker(key,frag[:-4],step,''))
60 
61  for specialType,specialWF in six.iteritems(upgradeWFs):
62  # remove other steps for premixS1
63  if specialType=="PMXS1":
64  stepList[specialType] = stepList[specialType][:1]
65  specialWF.workflow(workflows, numWF, info.dataset, stepList[specialType], key, hasHarvest)
66 
67  numWF+=1
relval_steps
relval_upgrade.makeStepNameSim
def makeStepNameSim(key, frag, step, suffix)
Definition: relval_upgrade.py:12
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
python.rootplot.root2matplotlib.replace
def replace(string, replacements)
Definition: root2matplotlib.py:444