CMS 3D CMS Logo

List of all members | Public Member Functions | Static Public Attributes
upgradeWorkflowComponents.UpgradeWorkflowPremix Class Reference
Inheritance diagram for upgradeWorkflowComponents.UpgradeWorkflowPremix:
upgradeWorkflowComponents.UpgradeWorkflow upgradeWorkflowComponents.UpgradeWorkflowAdjustPU upgradeWorkflowComponents.UpgradeWorkflowPremixProdLike

Public Member Functions

def condition (self, fragment, stepList, key, hasHarvest)
 
def setup_ (self, step, stepName, stepDict, k, properties)
 
def setupPU_ (self, step, stepName, stepDict, k, properties)
 
def workflow_ (self, workflows, num, fragment, stepList, key)
 
- Public Member Functions inherited from upgradeWorkflowComponents.UpgradeWorkflow
def __init__ (self, steps, PU, suffix, offset)
 
def condition (self, fragment, stepList, key, hasHarvest)
 
def getStepName (self, step, extra="")
 
def getStepNamePU (self, step, extra="")
 
def init (self, stepDict)
 
def preventReuse (self, stepName, stepDict, k)
 
def setup (self, stepDict, k, properties)
 
def setup_ (self, step, stepName, stepDict, k, properties)
 
def setupPU (self, stepDict, k, properties)
 
def setupPU_ (self, step, stepName, stepDict, k, properties)
 
def workflow (self, workflows, num, fragment, stepList, key, hasHarvest)
 
def workflow_ (self, workflows, num, fragment, stepList, key)
 

Static Public Attributes

 offset
 
 PU
 
 steps
 
 suffix
 

Additional Inherited Members

- Public Attributes inherited from upgradeWorkflowComponents.UpgradeWorkflow
 allowReuse
 
 offset
 
 PU
 
 steps
 
 suffix
 

Detailed Description

Definition at line 2489 of file upgradeWorkflowComponents.py.

Member Function Documentation

◆ condition()

def upgradeWorkflowComponents.UpgradeWorkflowPremix.condition (   self,
  fragment,
  stepList,
  key,
  hasHarvest 
)

Definition at line 2591 of file upgradeWorkflowComponents.py.

References any(), and upgradeWorkflowComponents.UpgradeWorkflow.suffix.

2591  def condition(self, fragment, stepList, key, hasHarvest):
2592  if not 'PU' in key:
2593  return False
2594  if not any(y in key for y in ['2021', '2023', '2024', '2026']):
2595  return False
2596  if self.suffix.endswith("S1"):
2597  return "NuGun" in fragment
2598  return True
bool any(const std::vector< T > &v, const T &what)
Definition: ECalSD.cc:37

◆ setup_()

def upgradeWorkflowComponents.UpgradeWorkflowPremix.setup_ (   self,
  step,
  stepName,
  stepDict,
  k,
  properties 
)

Definition at line 2490 of file upgradeWorkflowComponents.py.

2490  def setup_(self, step, stepName, stepDict, k, properties):
2491  # just copy steps
2492  stepDict[stepName][k] = merge([stepDict[step][k]])
Definition: merge.py:1

◆ setupPU_()

def upgradeWorkflowComponents.UpgradeWorkflowPremix.setupPU_ (   self,
  step,
  stepName,
  stepDict,
  k,
  properties 
)

Definition at line 2493 of file upgradeWorkflowComponents.py.

References upgradeWorkflowComponents.UpgradeWorkflow.getStepName(), createfilelist.int, join(), submitPVValidationJobs.split(), and upgradeWorkflowComponents.UpgradeWorkflow.suffix.

2493  def setupPU_(self, step, stepName, stepDict, k, properties):
2494  # fastsim version
2495  if 'FS' in k:
2496  # setup for stage 1 fastsim
2497  if "Gen" in stepName:
2498  stepNamePmx = stepName.replace('Gen','Premix')
2499  if not stepNamePmx in stepDict: stepDict[stepNamePmx] = {}
2500  stepDict[stepNamePmx][k] = merge([
2501  {
2502  '-s': 'GEN,SIM,RECOBEFMIX,DIGI:pdigi_valid',
2503  '--fast':'',
2504  '--datatier': 'PREMIX',
2505  '--eventcontent': 'PREMIX',
2506  '--procModifiers': 'premix_stage1'
2507  },
2508  stepDict[stepName][k]
2509  ])
2510  if "ProdLike" in self.suffix:
2511  # todo
2512  pass
2513  # setup for stage 2 fastsim
2514  elif "FastSimRun3" in step:
2515  # go back to non-PU step version
2516  d = merge([stepDict[self.getStepName(step)][k]])
2517  if d is None: return
2518  tmpsteps = []
2519  for s in d["-s"].split(","):
2520  if s == "DIGI" or "DIGI:" in s:
2521  tmpsteps.extend([s, "DATAMIX"])
2522  else:
2523  tmpsteps.append(s)
2524  d = merge([{"-s" : ",".join(tmpsteps),
2525  "--datamix" : "PreMix"},
2526  d])
2527  if "--procModifiers" in d:
2528  d["--procModifiers"] += ",premix_stage2"
2529  else:
2530  d["--procModifiers"] = "premix_stage2"
2531  # for combined stage1+stage2
2532  if "_PMXS1S2" in self.suffix:
2533  d = merge([digiPremixLocalPileup, d])
2534  stepDict[stepName][k] = d
2535  elif "HARVESTFastRun3" in step:
2536  # increment input step number
2537  stepDict[stepName][k] = merge([{'--filein':'file:step3_inDQM.root'},stepDict[stepName][k]])
2538  else:
2539  # setup for stage 1
2540  if "GenSim" in stepName:
2541  stepNamePmx = stepName.replace('GenSim','Premix')
2542  if not stepNamePmx in stepDict: stepDict[stepNamePmx] = {}
2543  stepDict[stepNamePmx][k] = merge([
2544  {
2545  '-s': 'GEN,SIM,DIGI:pdigi_valid',
2546  '--datatier': 'PREMIX',
2547  '--eventcontent': 'PREMIX',
2548  '--procModifiers': 'premix_stage1'
2549  },
2550  stepDict[stepName][k]
2551  ])
2552  if "ProdLike" in self.suffix:
2553  stepDict[stepNamePmx][k] = merge([{'-s': 'GEN,SIM,DIGI'},stepDict[stepNamePmx][k]])
2554  # setup for stage 2
2555  elif "Digi" in step or "Reco" in step:
2556  # go back to non-PU step version
2557  d = merge([stepDict[self.getStepName(step)][k]])
2558  if d is None: return
2559  if "Digi" in step:
2560  tmpsteps = []
2561  for s in d["-s"].split(","):
2562  if s == "DIGI" or "DIGI:" in s:
2563  tmpsteps.extend([s, "DATAMIX"])
2564  else:
2565  tmpsteps.append(s)
2566  d = merge([{"-s" : ",".join(tmpsteps),
2567  "--datamix" : "PreMix",
2568  "--procModifiers": "premix_stage2"},
2569  d])
2570  # for combined stage1+stage2
2571  if "_PMXS1S2" in self.suffix:
2572  d = merge([digiPremixLocalPileup, d])
2573  elif "Reco" in step:
2574  if "--procModifiers" in d:
2575  d["--procModifiers"] += ",premix_stage2"
2576  else:
2577  d["--procModifiers"] = "premix_stage2"
2578  stepDict[stepName][k] = d
2579  # separate nano step now only used in ProdLike workflows for Run3/Phase2
2580  elif "Nano"==step:
2581  # go back to non-PU step version
2582  d = merge([stepDict[self.getStepName(step)][k]])
2583  if "_PMXS1S2" in self.suffix and "--filein" in d:
2584  filein = d["--filein"]
2585  m = re.search("step(?P<ind>\\d+)", filein)
2586  if m:
2587  d["--filein"] = filein.replace(m.group(), "step%d"%(int(m.group("ind"))+1))
2588  stepDict[stepName][k] = d
2589  # run2/3 WFs use Nano (not NanoPU) in PU WF
2590  stepDict[self.getStepName(step)][k] = merge([d])
Definition: merge.py:1
static std::string join(char **cmd)
Definition: RemoteFile.cc:21

◆ workflow_()

def upgradeWorkflowComponents.UpgradeWorkflowPremix.workflow_ (   self,
  workflows,
  num,
  fragment,
  stepList,
  key 
)

Definition at line 2599 of file upgradeWorkflowComponents.py.

References python.rootplot.root2matplotlib.replace(), and upgradeWorkflowComponents.UpgradeWorkflow.suffix.

2599  def workflow_(self, workflows, num, fragment, stepList, key):
2600  fragmentTmp = fragment
2601  if self.suffix.endswith("S1"):
2602  fragmentTmp = 'PREMIXUP' + key[2:].replace("PU", "").replace("Design", "") + '_PU25'
2603  super(UpgradeWorkflowPremix,self).workflow_(workflows, num, fragmentTmp, stepList, key)
2604 # Premix stage1
2605 upgradeWFs['PMXS1'] = UpgradeWorkflowPremix(
def replace(string, replacements)

Member Data Documentation

◆ offset

upgradeWorkflowComponents.UpgradeWorkflowPremix.offset
static

Definition at line 2615 of file upgradeWorkflowComponents.py.

◆ PU

upgradeWorkflowComponents.UpgradeWorkflowPremix.PU
static

Definition at line 2608 of file upgradeWorkflowComponents.py.

◆ steps

upgradeWorkflowComponents.UpgradeWorkflowPremix.steps
static

Definition at line 2606 of file upgradeWorkflowComponents.py.

◆ suffix

upgradeWorkflowComponents.UpgradeWorkflowPremix.suffix
static

Definition at line 2614 of file upgradeWorkflowComponents.py.