Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2023-05-17 02:07:23

0001 # import the definition of the steps and input files:
0002 from  Configuration.PyReleaseValidation.relval_steps import *
0003 
0004 # here only define the workflows as a combination of the steps defined above:
0005 workflows = Matrix()
0006 
0007 # each workflow defines a name and a list of steps to be done. 
0008 # if no explicit name/label given for the workflow (first arg),
0009 # the name of step1 will be used
0010 
0011 def makeStepNameSim(key,frag,step,suffix):
0012     return frag+'_'+key+'_'+step+suffix
0013 
0014 def makeStepName(key,frag,step,suffix):
0015    return step+suffix+'_'+key
0016 
0017 #just define all of them
0018 
0019 for year in upgradeKeys:
0020     for i,key in enumerate(upgradeKeys[year]):
0021         numWF=numWFAll[year][i]
0022         for frag,info in upgradeFragments.items():
0023             # phase2-specific fragments are skipped in phase1
0024             if ("CE_E" in frag or "CE_H" in frag) and year==2017:
0025                 numWF += 1
0026                 continue
0027             stepList={}
0028             for specialType in upgradeWFs.keys():
0029                 stepList[specialType] = []
0030             hasHarvest = False
0031             for step in upgradeProperties[year][key]['ScenToRun']:
0032                 stepMaker = makeStepName
0033                 if 'Sim' in step and 'Fast' not in step:
0034                     if 'HLBeamSpot' in step:
0035                         if '14TeV' in frag:
0036                             step = 'GenSimHLBeamSpot14'
0037                         if 'CloseByParticle' in frag or 'CE_E' in frag or 'CE_H' in frag:
0038                             step = 'GenSimHLBeamSpotHGCALCloseBy'
0039                     stepMaker = makeStepNameSim
0040                 elif 'Gen' in step:
0041                     stepMaker = makeStepNameSim
0042                 
0043                 if 'HARVEST' in step: hasHarvest = True
0044 
0045                 for specialType,specialWF in upgradeWFs.items():
0046                     if (specialType != 'baseline') and ( ('PU' in step and step.replace('PU','') in specialWF.PU) or (step in specialWF.steps) ):
0047                         stepList[specialType].append(stepMaker(key,frag[:-4],step,specialWF.suffix))
0048                         # hack to add an extra step
0049                         if 'ProdLike' in specialType:
0050                             if 'Reco' in step: # handles both Reco, RecoFakeHLT and RecoGlobal
0051                                 stepWoFakeHLT = step.replace('FakeHLT','') # ignore "FakeHLT" from step
0052                                 stepList[specialType].append(stepMaker(key,frag[:-4],stepWoFakeHLT.replace('RecoGlobal','MiniAOD').replace('RecoNano','MiniAOD').replace('Reco','MiniAOD'),specialWF.suffix))
0053                                 if 'RecoNano' in stepWoFakeHLT:
0054                                     stepList[specialType].append(stepMaker(key,frag[:-4],stepWoFakeHLT.replace('RecoNano','Nano'),specialWF.suffix))
0055                         # hack to add extra HLT75e33 step for Phase-2
0056                         if 'HLT75e33' in specialType:
0057                             if 'RecoGlobal' in step:
0058                                 stepList[specialType].append(stepMaker(key,frag[:-4],step.replace('RecoGlobal','HLT75e33'),specialWF.suffix))
0059                         # similar hacks for premixing
0060                         if 'PMX' in specialType:
0061                             if 'GenSim' in step:
0062                                 s = step.replace('GenSim','Premix')+'PU' # later processing requires to have PU here
0063                                 if step in specialWF.PU:
0064                                     stepMade = stepMaker(key,'PREMIX',s,specialWF.suffix)
0065                                     # append for combined
0066                                     if 'S2' in specialType: stepList[specialType].append(stepMade)
0067                                     # replace for s1
0068                                     else: stepList[specialType][-1] = stepMade
0069                     else:
0070                         stepList[specialType].append(stepMaker(key,frag[:-4],step,''))
0071 
0072             for specialType,specialWF in upgradeWFs.items():
0073                 # remove other steps for premixS1
0074                 if specialType=="PMXS1":
0075                     stepList[specialType] = stepList[specialType][:1]
0076                 specialWF.workflow(workflows, numWF, info.dataset, stepList[specialType], key, hasHarvest)
0077 
0078             numWF+=1