CMS 3D CMS Logo

Classes | Functions
Utils Namespace Reference

Classes

class  LoadPrerequisiteSource
 

Functions

def addMonitoring (process)
 
def dictIO (options, args)
 
def dqmIOSource (args)
 
def dqmSeq (args, default)
 
def gtNameAndConnect (globalTag, args)
 
def harvestingMode (process, datasetName, args, rANDl=True)
 
def stepALCAPRODUCER (skims)
 
def stepSKIMPRODUCER (PhysicsSkims)
 
def validateProcess (process)
 

Detailed Description

_Utils_

Module containing some utility tools

Function Documentation

◆ addMonitoring()

def Utils.addMonitoring (   process)
_addMonitoring_

Add the monitoring services to the process provided
in order to write out performance summaries to the framework job report

Definition at line 38 of file Utils.py.

38 def addMonitoring(process):
39  """
40  _addMonitoring_
41 
42  Add the monitoring services to the process provided
43  in order to write out performance summaries to the framework job report
44  """
45  import FWCore.ParameterSet.Config as cms
46 
47  process.SimpleMemoryCheck = cms.Service("SimpleMemoryCheck",
48  jobReportOutputOnly = cms.untracked.bool(True)
49  )
50  process.Timing = cms.Service("Timing",
51  summaryOnly = cms.untracked.bool(True)
52  )
53 
54  return process
55 
56 

Referenced by Reco.Reco.expressProcessing(), Impl.AlCa.AlCa.expressProcessing(), and Reco.Reco.promptReco().

◆ dictIO()

def Utils.dictIO (   options,
  args 
)

Definition at line 121 of file Utils.py.

121 def dictIO(options,args):
122  if 'outputs' in args:
123  options.outputDefinition = args['outputs'].__str__()
124  else:
125  writeTiers = args.get('writeTiers', [])
126  options.eventcontent = ','.join(writeTiers)
127  options.datatier = ','.join(writeTiers)
128 

References TriggerAnalyzer.__str__(), and join().

Referenced by Reco.Reco.expressProcessing(), Impl.DataScouting.DataScouting.promptReco(), Impl.AlCa.AlCa.promptReco(), Reco.Reco.promptReco(), and Reco.Reco.visualizationProcessing().

◆ dqmIOSource()

def Utils.dqmIOSource (   args)

Definition at line 103 of file Utils.py.

103 def dqmIOSource(args):
104  import FWCore.ParameterSet.Config as cms
105  if args.get('newDQMIO', False):
106  return cms.Source("DQMRootSource",
107  fileNames = cms.untracked(cms.vstring())
108  )
109  else:
110  return cms.Source("PoolSource",
111  fileNames = cms.untracked(cms.vstring())
112  )
113 

Referenced by Impl.DataScouting.DataScouting.dqmHarvesting(), Impl.AlCa.AlCa.dqmHarvesting(), and Reco.Reco.dqmHarvesting().

◆ dqmSeq()

def Utils.dqmSeq (   args,
  default 
)

Definition at line 129 of file Utils.py.

129 def dqmSeq(args,default):
130  if 'dqmSeq' in args and len(args['dqmSeq'])!=0:
131  return ':'+('+'.join(args['dqmSeq']))
132  else:
133  return default
134 

References join().

Referenced by Impl.DataScouting.DataScouting.dqmHarvesting(), Reco.Reco.dqmHarvesting(), Reco.Reco.expressProcessing(), and Reco.Reco.promptReco().

◆ gtNameAndConnect()

def Utils.gtNameAndConnect (   globalTag,
  args 
)

Definition at line 135 of file Utils.py.

135 def gtNameAndConnect(globalTag, args):
136  if 'globalTagConnect' in args and args['globalTagConnect'] != '':
137  return globalTag + ','+args['globalTagConnect']
138  # we override here the default in the release which uses the FrontierProd servlet not suited for Tier0 activity
139  return globalTag +',frontier://PromptProd/CMS_CONDITIONS'

Referenced by Impl.AlCa.AlCa.alcaHarvesting(), Reco.Reco.alcaHarvesting(), Impl.DataScouting.DataScouting.dqmHarvesting(), Impl.AlCa.AlCa.dqmHarvesting(), Reco.Reco.dqmHarvesting(), Reco.Reco.expressProcessing(), Impl.AlCa.AlCa.expressProcessing(), Impl.DataScouting.DataScouting.promptReco(), Impl.AlCa.AlCa.promptReco(), Reco.Reco.promptReco(), Reco.Reco.skimming(), and Reco.Reco.visualizationProcessing().

◆ harvestingMode()

def Utils.harvestingMode (   process,
  datasetName,
  args,
  rANDl = True 
)

Definition at line 114 of file Utils.py.

114 def harvestingMode(process, datasetName, args,rANDl=True):
115  import FWCore.ParameterSet.Config as cms
116  if rANDl and (not args.get('newDQMIO', False)):
117  process.source.processingMode = cms.untracked.string('RunsAndLumis')
118  process.dqmSaver.workflow = datasetName
119  process.dqmSaver.saveByLumiSection = 1
120 

Referenced by Impl.DataScouting.DataScouting.dqmHarvesting(), Impl.AlCa.AlCa.dqmHarvesting(), and Reco.Reco.dqmHarvesting().

◆ stepALCAPRODUCER()

def Utils.stepALCAPRODUCER (   skims)
_stepALCAPRODUCER_

Creates and returns the configuration string for the ALCAPRODUCER step
starting from the list of AlcaReco path to be run.

Definition at line 9 of file Utils.py.

9 def stepALCAPRODUCER(skims):
10  """
11  _stepALCAPRODUCER_
12 
13  Creates and returns the configuration string for the ALCAPRODUCER step
14  starting from the list of AlcaReco path to be run.
15 
16  """
17 
18  step = ''
19  if len(skims) >0:
20  step = ',ALCAPRODUCER:'+('+'.join(skims))
21  return step
22 
23 

References join().

Referenced by Reco.Reco.expressProcessing(), Impl.AlCa.AlCa.expressProcessing(), Impl.AlCa.AlCa.promptReco(), and Reco.Reco.promptReco().

◆ stepSKIMPRODUCER()

def Utils.stepSKIMPRODUCER (   PhysicsSkims)
_stepSKIMPRODUCER_

Creates and returns the configuration string for the SKIM step
starting from the list of skims to be run.

Definition at line 24 of file Utils.py.

24 def stepSKIMPRODUCER(PhysicsSkims):
25  """
26  _stepSKIMPRODUCER_
27 
28  Creates and returns the configuration string for the SKIM step
29  starting from the list of skims to be run.
30 
31  """
32 
33  step = ''
34  if len(PhysicsSkims) >0 :
35  step = ',SKIM:'+('+'.join(PhysicsSkims))
36  return step
37 

References join().

Referenced by Reco.Reco.promptReco().

◆ validateProcess()

def Utils.validateProcess (   process)
_validateProcess_

Check attributes of process are appropriate for production
This method returns nothing but will throw a RuntimeError for any issues it finds
likely to cause problems in the production system

Definition at line 57 of file Utils.py.

57 def validateProcess(process):
58  """
59  _validateProcess_
60 
61  Check attributes of process are appropriate for production
62  This method returns nothing but will throw a RuntimeError for any issues it finds
63  likely to cause problems in the production system
64 
65  """
66 
67  schedule=process.schedule_()
68  paths=process.paths_()
69  endpaths=process.endpaths_()
70 
71  # check output mods are in paths and have appropriate settings
72  for outputModName in process.outputModules_().keys():
73  outputMod = getattr(process, outputModName)
74  if not hasattr(outputMod, 'dataset'):
75  msg = "Process contains output module without dataset PSET: %s \n" % outputModName
76  msg += " You need to add this PSET to this module to set dataTier and filterName\n"
77  raise RuntimeError(msg)
78  ds=getattr(outputMod,'dataset')
79  if not hasattr(ds, "dataTier"):
80  msg = "Process contains output module without dataTier parameter: %s \n" % outputModName
81  msg += " You need to add an untracked parameter to the dataset PSET of this module to set dataTier\n"
82  raise RuntimeError(msg)
83 
84  # check module in path or whatever (not sure of exact syntax for endpath)
85  omRun=False
86 
87  if schedule==None:
88  for path in paths:
89  if outputModName in getattr(process,path).moduleNames():
90  omRun=True
91  for path in endpaths:
92  if outputModName in getattr(process,path).moduleNames():
93  omRun=True
94  else:
95  for path in schedule:
96  if outputModName in path.moduleNames():
97  omRun=True
98  if omRun==False:
99  msg = "Output Module %s not in endPath" % outputModName
100  raise RuntimeError(msg)
101 
102 

References relativeConstraints.keys.

Utils.dqmSeq
def dqmSeq(args, default)
Definition: Utils.py:129
join
static std::string join(char **cmd)
Definition: RemoteFile.cc:17
relativeConstraints.keys
keys
Definition: relativeConstraints.py:89
Utils.stepALCAPRODUCER
def stepALCAPRODUCER(skims)
Definition: Utils.py:9
Utils.addMonitoring
def addMonitoring(process)
Definition: Utils.py:38
Utils.dictIO
def dictIO(options, args)
Definition: Utils.py:121
TriggerAnalyzer.__str__
def __str__(self)
Definition: TriggerAnalyzer.py:103
Utils.validateProcess
def validateProcess(process)
Definition: Utils.py:57
Utils.harvestingMode
def harvestingMode(process, datasetName, args, rANDl=True)
Definition: Utils.py:114
Utils.gtNameAndConnect
def gtNameAndConnect(globalTag, args)
Definition: Utils.py:135
Utils.stepSKIMPRODUCER
def stepSKIMPRODUCER(PhysicsSkims)
Definition: Utils.py:24
Utils.dqmIOSource
def dqmIOSource(args)
Definition: Utils.py:103