CMS 3D CMS Logo

relval_upgrade.py
Go to the documentation of this file.
1 # import the definition of the steps and input files:
3 
4 # here only define the workflows as a combination of the steps defined above:
5 workflows = Matrix()
6 
7 # each workflow defines a name and a list of steps to be done.
8 # if no explicit name/label given for the workflow (first arg),
9 # the name of step1 will be used
10 
11 def makeStepNameSim(key,frag,step,suffix):
12  return frag+'_'+key+'_'+step+suffix
13 
14 def makeStepName(key,frag,step,suffix):
15  return step+suffix+'_'+key
16 
17 #just define all of them
18 
19 for year in upgradeKeys:
20  for i,key in enumerate(upgradeKeys[year]):
21  numWF=numWFAll[year][i]
22  for frag,info in upgradeFragments.items():
23  # phase2-specific fragments are skipped in phase1
24  if ("CE_E" in frag or "CE_H" in frag) and year==2017:
25  numWF += 1
26  continue
27  stepList={}
28  for specialType in upgradeWFs.keys():
29  stepList[specialType] = []
30  hasHarvest = False
31  for step in upgradeProperties[year][key]['ScenToRun']:
32  stepMaker = makeStepName
33  if 'Sim' in step:
34  if 'HLBeamSpot' in step and '14TeV' in frag:
35  step = 'GenSimHLBeamSpot14'
36  stepMaker = makeStepNameSim
37 
38  if 'HARVEST' in step: hasHarvest = True
39 
40  for specialType,specialWF in upgradeWFs.items():
41  if (specialType != 'baseline') and ( ('PU' in step and step.replace('PU','') in specialWF.PU) or (step in specialWF.steps) ):
42  stepList[specialType].append(stepMaker(key,frag[:-4],step,specialWF.suffix))
43  # hack to add an extra step
44  if 'ProdLike' in specialType:
45  if 'Reco' in step: # handles both Reco and RecoGlobal
46  stepList[specialType].append(stepMaker(key,frag[:-4],step.replace('RecoGlobal','MiniAOD').replace('Reco','MiniAOD'),specialWF.suffix))
47  # similar hacks for premixing
48  if 'PMX' in specialType:
49  if 'GenSim' in step:
50  s = step.replace('GenSim','Premix')+'PU' # later processing requires to have PU here
51  if step in specialWF.PU:
52  stepMade = stepMaker(key,'PREMIX',s,specialWF.suffix)
53  # append for combined
54  if 'S2' in specialType: stepList[specialType].append(stepMade)
55  # replace for s1
56  else: stepList[specialType][-1] = stepMade
57  else:
58  stepList[specialType].append(stepMaker(key,frag[:-4],step,''))
59 
60  for specialType,specialWF in upgradeWFs.items():
61  # remove other steps for premixS1
62  if specialType=="PMXS1":
63  stepList[specialType] = stepList[specialType][:1]
64  specialWF.workflow(workflows, numWF, info.dataset, stepList[specialType], key, hasHarvest)
65 
66  numWF+=1
relval_steps
relval_upgrade.makeStepNameSim
def makeStepNameSim(key, frag, step, suffix)
Definition: relval_upgrade.py:11
relval_upgrade.makeStepName
def makeStepName(key, frag, step, suffix)
Definition: relval_upgrade.py:14
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