CMS 3D CMS Logo

relval_upgrade.py
Go to the documentation of this file.
1 
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 neutronKeys = ['2023D14','2023D16','2023D17']
19 neutronFrags = ['ZMM_14','MinBias_14TeV']
20 
21 #just define all of them
22 
23 for year in upgradeKeys:
24  for i,key in enumerate(upgradeKeys[year]):
25  numWF=numWFAll[year][i]
26  for frag in upgradeFragments:
27  stepList={}
28  for stepType in upgradeSteps.keys():
29  stepList[stepType] = []
30  hasHarvest = False
31  for step in upgradeProperties[year][key]['ScenToRun']:
32  stepMaker = makeStepName
33  if 'Sim' in step:
34  if 'HLBeamSpotFull' in step and '14TeV' in frag:
35  step = 'GenSimHLBeamSpotFull14'
36  stepMaker = makeStepNameSim
37 
38  if 'HARVEST' in step: hasHarvest = True
39 
40  for stepType in upgradeSteps.keys():
41  # use variation only when available
42  if (stepType is not 'baseline') and ( ('PU' in step and step.replace('PU','') in upgradeSteps[stepType]['PU']) or (step in upgradeSteps[stepType]['steps']) ):
43  stepList[stepType].append(stepMaker(key,frag[:-4],step,upgradeSteps[stepType]['suffix']))
44  else:
45  stepList[stepType].append(stepMaker(key,frag[:-4],step,upgradeSteps['baseline']['suffix']))
46 
47  workflows[numWF] = [ upgradeDatasetFromFragment[frag], stepList['baseline']]
48 
49  # only keep some special workflows for timing
50  if upgradeDatasetFromFragment[frag]=="TTbar_14TeV" and '2023' in key:
51  workflows[numWF+upgradeSteps['Timing']['offset']] = [ upgradeDatasetFromFragment[frag]+"_Timing", stepList['Timing']]
52 
53  # special workflows for neutron bkg sim
54  if any(upgradeDatasetFromFragment[frag]==nfrag for nfrag in neutronFrags) and any(nkey in key for nkey in neutronKeys):
55  workflows[numWF+upgradeSteps['Neutron']['offset']] = [ upgradeDatasetFromFragment[frag]+"_Neutron", stepList['Neutron']]
56 
57  # special workflows for tracker
58  if (upgradeDatasetFromFragment[frag]=="TTbar_13" or upgradeDatasetFromFragment[frag]=="TTbar_14TeV") and not 'PU' in key and hasHarvest:
59  workflows[numWF+upgradeSteps['trackingOnly']['offset']] = [ upgradeDatasetFromFragment[frag], stepList['trackingOnly']]
60 
61  numWF+=1
def makeStepName(key, frag, step, suffix)
bool any(const std::vector< T > &v, const T &what)
Definition: ECalSD.cc:34
CLHEP::HepMatrix Matrix
Definition: matutil.h:65
def makeStepNameSim(key, frag, step, suffix)