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 is not '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 (specialType == 'ProdLike' or specialType == 'TestOldDigiProdLike') and 'RecoGlobal' in step:
46  stepList[specialType].append(stepMaker(key,frag[:-4],step.replace('RecoGlobal','MiniAOD'),specialWF.suffix))
47  elif specialType == 'ProdLike' and 'Reco' in step:
48  stepList[specialType].append(stepMaker(key,frag[:-4],step.replace('Reco','MiniAOD'),specialWF.suffix))
49  # similar hacks for premixing
50  elif 'PMX' in specialType:
51  if 'GenSim' in step:
52  s = step.replace('GenSim','Premix')+'PU' # later processing requires to have PU here
53  if step in specialWF.PU:
54  stepMade = stepMaker(key,'PREMIX',s,specialWF.suffix)
55  # append for combined
56  if 'S2' in specialType: stepList[specialType].append(stepMade)
57  # replace for s1
58  else: stepList[specialType][-1] = stepMade
59  else:
60  stepList[specialType].append(stepMaker(key,frag[:-4],step,''))
61 
62  for specialType,specialWF in six.iteritems(upgradeWFs):
63  # remove other steps for premixS1
64  if specialType=="PMXS1":
65  stepList[specialType] = stepList[specialType][:1]
66  specialWF.workflow(workflows, numWF, info.dataset, stepList[specialType], key, hasHarvest)
67 
68  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