CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
Classes | Functions
Utils Namespace Reference

Classes

class  LoadPrerequisiteSource
 

Functions

def addMonitoring
 
def dictIO
 
def dqmIOSource
 
def dqmSeq
 
def gtNameAndConnect
 
def harvestingMode
 
def stepALCAPRODUCER
 
def stepSKIMPRODUCER
 
def validateProcess
 

Function Documentation

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.

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

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

Definition at line 123 of file Utils.py.

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().

124 def dictIO(options,args):
125  if 'outputs' in args:
126  options.outputDefinition = args['outputs'].__str__()
127  else:
128  writeTiers = args.get('writeTiers', [])
129  options.eventcontent = ','.join(writeTiers)
130  options.datatier = ','.join(writeTiers)
def dictIO
Definition: Utils.py:123
static std::string join(char **cmd)
Definition: RemoteFile.cc:18
def Utils.dqmIOSource (   args)

Definition at line 103 of file Utils.py.

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

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

Definition at line 131 of file Utils.py.

References join().

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

132 def dqmSeq(args,default):
133  if 'dqmSeq' in args and len(args['dqmSeq'])!=0:
134  return ':'+('+'.join(args['dqmSeq']))
135  else:
136  return default
def dqmSeq
Definition: Utils.py:131
static std::string join(char **cmd)
Definition: RemoteFile.cc:18
def Utils.gtNameAndConnect (   globalTag,
  args 
)

Definition at line 137 of file Utils.py.

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

138 def gtNameAndConnect(globalTag, args):
139  if 'globalTagConnect' in args and args['globalTagConnect'] != '':
140  return globalTag + ','+args['globalTagConnect']
141  # we override here the default in the release which uses the FrontierProd servlet not suited for Tier0 activity
142  return globalTag +',frontier://PromptProd/CMS_CONDITIONS'
def gtNameAndConnect
Definition: Utils.py:137
def Utils.harvestingMode (   process,
  datasetName,
  args,
  rANDl = True 
)

Definition at line 114 of file Utils.py.

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

115 def harvestingMode(process, datasetName, args,rANDl=True):
116  import FWCore.ParameterSet.Config as cms
117  if rANDl and (not args.get('newDQMIO', False)):
118  process.source.processingMode = cms.untracked.string('RunsAndLumis')
119  process.dqmSaver.workflow = datasetName
120  process.dqmSaver.saveByLumiSection = 1
121  if 'referenceFile' in args and args.get('referenceFile', ''):
122  process.DQMStore.referenceFileName = cms.untracked.string(args['referenceFile'])
def harvestingMode
Definition: Utils.py:114
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.

References join().

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

9 
10 def stepALCAPRODUCER(skims):
11  """
12  _stepALCAPRODUCER_
13 
14  Creates and returns the configuration string for the ALCAPRODUCER step
15  starting from the list of AlcaReco path to be run.
16 
17  """
18 
19  step = ''
20  if len(skims) >0:
21  step = ',ALCAPRODUCER:'+('+'.join(skims))
22  return step
23 
def stepALCAPRODUCER
Definition: Utils.py:9
static std::string join(char **cmd)
Definition: RemoteFile.cc:18
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.

References join().

Referenced by Reco.Reco.promptReco().

24 
25 def stepSKIMPRODUCER(PhysicsSkims):
26  """
27  _stepSKIMPRODUCER_
28 
29  Creates and returns the configuration string for the SKIM step
30  starting from the list of skims to be run.
31 
32  """
33 
34  step = ''
35  if len(PhysicsSkims) >0 :
36  step = ',SKIM:'+('+'.join(PhysicsSkims))
37  return step
def stepSKIMPRODUCER
Definition: Utils.py:24
static std::string join(char **cmd)
Definition: RemoteFile.cc:18
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.

References relativeConstraints.keys.

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