Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2024-10-04 22:54:35

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 ## ... but we don't need all the flavors for the GenOnly
0020 def notForGenOnly(key,specialType):
0021     return "GenOnly" in key and specialType != 'baseline'
0022 
0023 for year in upgradeKeys:
0024     for i,key in enumerate(upgradeKeys[year]):
0025         numWF=numWFAll[year][i]
0026         for frag,info in upgradeFragments.items():
0027             # phase2-specific fragments are skipped in phase1
0028             if ("CE_E" in frag or "CE_H" in frag) and year==2017:
0029                 numWF += 1
0030                 continue
0031             stepList={}
0032             for specialType in upgradeWFs.keys():
0033                 if notForGenOnly(key,specialType):
0034                     continue
0035                 stepList[specialType] = []
0036             hasHarvest = False
0037             for step in upgradeProperties[year][key]['ScenToRun']:
0038                 stepMaker = makeStepName
0039                 if 'Sim' in step and 'Fast' not in step and step != "Sim":
0040                     if 'HLBeamSpot' in step:
0041                         if '14TeV' in frag:
0042                             step = 'GenSimHLBeamSpot14'
0043                         if 'CloseByParticle' in frag or 'CE_E' in frag or 'CE_H' in frag:
0044                             step = 'GenSimHLBeamSpotHGCALCloseBy'
0045                     stepMaker = makeStepNameSim
0046                 elif 'Gen' in step:
0047                     if 'HLBeamSpot' in step:
0048                         if '14TeV' in frag:
0049                             step = 'GenHLBeamSpot14'
0050                     stepMaker = makeStepNameSim
0051                 
0052                 if 'HARVEST' in step: hasHarvest = True
0053 
0054                 for specialType,specialWF in upgradeWFs.items():
0055 
0056                     if notForGenOnly(key,specialType): ## we don't need all the flavors for the GEN
0057                         continue 
0058 
0059                     if (specialType != 'baseline') and ( ('PU' in step and step.replace('PU','') in specialWF.PU) or (step in specialWF.steps) ):
0060                         stepList[specialType].append(stepMaker(key,frag[:-4],step,specialWF.suffix))
0061                         # hack to add an extra step
0062                         if 'ProdLike' in specialType:
0063                             if 'Reco' in step: # handles both Reco, RecoFakeHLT and RecoGlobal
0064                                 stepWoFakeHLT = step.replace('FakeHLT','') # ignore "FakeHLT" from step
0065                                 stepList[specialType].append(stepMaker(key,frag[:-4],stepWoFakeHLT.replace('RecoGlobal','MiniAOD').replace('RecoNano','MiniAOD').replace('Reco','MiniAOD'),specialWF.suffix))
0066                                 if 'RecoNano' in stepWoFakeHLT:
0067                                     stepList[specialType].append(stepMaker(key,frag[:-4],stepWoFakeHLT.replace('RecoNano','Nano'),specialWF.suffix))
0068                         # hack to add extra HLT75e33 step for Phase-2
0069                         if 'HLT75e33' in specialType:
0070                             if 'RecoGlobal' in step:
0071                                 stepList[specialType].append(stepMaker(key,frag[:-4],step.replace('RecoGlobal','HLT75e33'),specialWF.suffix))
0072                         # similar hacks for premixing
0073                         if 'PMX' in specialType:
0074                             if 'GenSim' in step or 'Gen' in step:
0075                                 s = step.replace('GenSim','Premix').replace('Gen','Premix')+'PU' # later processing requires to have PU here
0076                                 if step in specialWF.PU:
0077                                     stepMade = stepMaker(key,'PREMIX',s,specialWF.suffix)
0078                                     # append for combined
0079                                     if 'S2' in specialType: stepList[specialType].append(stepMade)
0080                                     # replace for s1
0081                                     else: stepList[specialType][-1] = stepMade
0082                     else:
0083                         stepList[specialType].append(stepMaker(key,frag[:-4],step,''))
0084 
0085             for specialType,specialWF in upgradeWFs.items():
0086                 # remove other steps for premixS1
0087                 if notForGenOnly(key,specialType):
0088                     continue
0089                 if specialType=="PMXS1":
0090                     stepList[specialType] = stepList[specialType][:1]
0091                 specialWF.workflow(workflows, numWF, info.dataset, stepList[specialType], key, hasHarvest)
0092 
0093             numWF+=1