CMS 3D CMS Logo

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

Classes

class  ConfigBuilder
 
class  Options
 

Functions

def addALCAPaths
 
def addOutputModule
 
def dumpPython
 
def filesFromDASQuery
 
def getConfigsForScenario
 
def getDefaultTrigger
 
def getHelp
 
def installFilteredStream
 
def installPromptReco
 

Variables

string __default = 'GRun'
 
string __source__ = "$Source: /cvs/CMSSW/CMSSW/Configuration/PyReleaseValidation/python/ConfigBuilder.py,v $"
 
dictionary __triggerTable
 
string __version__ = "$Revision: 1.303.2.6 $"
 
tuple defaultOptions = Options()
 
 promptReco = installPromptReco
 

Function Documentation

def ConfigBuilder.addALCAPaths (   process,
  listOfALCANames,
  definitionFile = "Configuration/StandardSequences/AlCaRecoStreams_cff" 
)
_addALCAPaths_

Function to add alignment&calibration sequences to an existing process

Definition at line 1647 of file ConfigBuilder.py.

1648 def addALCAPaths(process, listOfALCANames, definitionFile = "Configuration/StandardSequences/AlCaRecoStreams_cff"):
1649  """
1650  _addALCAPaths_
1651 
1652  Function to add alignment&calibration sequences to an existing process
1653  """
1654  __import__(definitionFile)
1655  definitionModule = sys.modules[definitionFile]
1656  process.extend(definitionModule)
1657 
1658  for alca in listOfALCANames:
1659  streamName = "ALCARECOStream%s" % alca
1660  stream = getattr(definitionModule, streamName)
1661  for path in stream.paths:
1662  schedule.append(path)
1663 
1664  return
def ConfigBuilder.addOutputModule (   process,
  tier,
  content 
)
_addOutputModule_

Function to add an output module to a given process with given data tier and event content

Definition at line 1618 of file ConfigBuilder.py.

Referenced by Impl.HeavyIons.HeavyIons.expressProcessing(), and Impl.HeavyIons.HeavyIons.promptReco().

1619 def addOutputModule(process, tier, content):
1620  """
1621  _addOutputModule_
1622 
1623  Function to add an output module to a given process with given data tier and event content
1624  """
1625  print "WARNING. this method will not be supported any more SOON, please use --eventcontent --datatier field to drive the output module definitions"
1626 
1627  moduleName = "output%s%s" % (tier, content)
1628  pathName = "%sPath" % moduleName
1629  contentName = "%sEventContent" % content
1630  contentAttr = getattr(process, contentName)
1631  setattr(process, moduleName,
1632  cms.OutputModule("PoolOutputModule",
1633  contentAttr,
1634  fileName = cms.untracked.string('%s.root' % moduleName),
1635  dataset = cms.untracked.PSet(
1636  dataTier = cms.untracked.string(tier),
1637  ),
1638  )
1639  )
1640  print getattr(process,moduleName)
1641  # put it in an EndPath and put the EndPath into the schedule
1642  setattr(process, pathName, cms.EndPath(getattr(process,moduleName)) )
1643  process.schedule.append(getattr(process, pathName))
1644 
1645  return
1646 
def ConfigBuilder.dumpPython (   process,
  name 
)

Definition at line 55 of file ConfigBuilder.py.

Referenced by python.EnablePSetHistory.new_recurseDumpModifications_(), and SequenceTypes.TestModuleCommand.testCopyAndExclude().

55 
56 def dumpPython(process,name):
57  theObject = getattr(process,name)
58  if isinstance(theObject,cms.Path) or isinstance(theObject,cms.EndPath) or isinstance(theObject,cms.Sequence):
59  return "process."+name+" = " + theObject.dumpPython("process")
60  elif isinstance(theObject,_Module) or isinstance(theObject,cms.ESProducer):
61  return "process."+name+" = " + theObject.dumpPython()+"\n"
62  else:
63  return "process."+name+" = " + theObject.dumpPython()+"\n"
def ConfigBuilder.filesFromDASQuery (   query,
  s = None 
)

Definition at line 64 of file ConfigBuilder.py.

References split.

Referenced by ConfigBuilder.ConfigBuilder.filesFromOption().

64 
65 def filesFromDASQuery(query,s=None):
66  import os
67  import FWCore.ParameterSet.Config as cms
68  prim=[]
69  sec=[]
70  print "the query is",query
71  for line in os.popen('das_client.py --query "%s"'%(query)):
72  if line.count(".root")>=2:
73  #two files solution...
74  entries=line.replace("\n","").split()
75  if not entries[0] in prim:
76  prim.append(entries[0])
77  if not entries[1] in sec:
78  sec.append(entries[1])
79  elif (line.find(".root")!=-1):
80  entry=line.replace("\n","")
81  if not entry in prim:
82  prim.append(entry)
83  if s:
84  if not hasattr(s,"fileNames"):
85  s.fileNames=cms.untracked.vstring(prim)
86  else:
87  s.fileNames.extend(prim)
88  if len(sec)!=0:
89  if not hasattr(s,"secondaryFileNames"):
90  s.secondaryFileNames=cms.untracked.vstring(sec)
91  else:
92  s.secondaryFileNames.extend(sec)
93  print "found files: ",prim
94  if len(sec)!=0:
95  print "found parent files:",sec
96  return (prim,sec)
double split
Definition: MVATrainer.cc:139
def ConfigBuilder.getConfigsForScenario (   sequence = None)
Retrieves the list of files needed to run a given trigger menu.
If no trigger or an invalid trigger is given, use the default one. 

Definition at line 38 of file ConfigBuilder.py.

Referenced by ConfigBuilder.ConfigBuilder.prepare_L1().

38 
39 def getConfigsForScenario(sequence = None):
40  """
41  Retrieves the list of files needed to run a given trigger menu.
42  If no trigger or an invalid trigger is given, use the default one.
43  """
44 
45  if not sequence:
46  # no trigger was specified, use the default one
47  trigger = __default
48  else:
49  # check if the specified trigger is valid
50  trigger = sequence
51  if trigger not in __triggerTable:
52  print 'An unsupported trigger has been requested: %s' % sequence
53  print 'The default one will be used instead: %s' % __default
54  print 'The supported triggers are:'
55  for key in __triggerTable.iterkeys():
56  print '\t%s' % key
57  print
58  trigger = __default
59 
60  return __triggerTable[trigger]
61 
def getConfigsForScenario
def ConfigBuilder.getDefaultTrigger ( )
Retrieves the default trigger name

Definition at line 24 of file ConfigBuilder.py.

24 
25 def getDefaultTrigger():
26  """
27  Retrieves the default trigger name
28  """
29  return __default
30 
def ConfigBuilder.getHelp ( )
Retrieves the list of available triggers

Definition at line 31 of file ConfigBuilder.py.

31 
32 def getHelp():
33  """
34  Retrieves the list of available triggers
35  """
36  return __triggerTable.iterkeys()
37 
def ConfigBuilder.installFilteredStream (   process,
  schedule,
  streamName,
  definitionFile = "Configuration/StandardSequences/AlCaRecoStreams_cff" 
)

Definition at line 1573 of file ConfigBuilder.py.

1574 def installFilteredStream(process, schedule, streamName, definitionFile = "Configuration/StandardSequences/AlCaRecoStreams_cff" ):
1575 
1576  __import__(definitionFile)
1577  definitionModule = sys.modules[definitionFile]
1578  process.extend(definitionModule)
1579  stream = getattr(definitionModule,streamName)
1580  output = cms.OutputModule("PoolOutputModule")
1581  output.SelectEvents = stream.selectEvents
1582  output.outputCommands = stream.content
1583  output.dataset = cms.untracked.PSet( dataTier = stream.dataTier)
1584  setattr(process,streamName,output)
1585  for path in stream.paths:
1586  schedule.append(path)
1587 
def ConfigBuilder.installPromptReco (   process,
  recoOutputModule,
  aodOutputModule = None 
)
_promptReco_

Method to install the standard PromptReco configuration into
a basic process containing source and output modules.

process is the CMS Process instance to be populated

recoOutputModule is the output module used to write the
RECO data tier

aodOutputModule is the output module used to write
the AOD data tier, if this is not none, any AOD sequences
should be added.

Definition at line 1588 of file ConfigBuilder.py.

1589 def installPromptReco(process, recoOutputModule, aodOutputModule = None):
1590  """
1591  _promptReco_
1592 
1593  Method to install the standard PromptReco configuration into
1594  a basic process containing source and output modules.
1595 
1596  process is the CMS Process instance to be populated
1597 
1598  recoOutputModule is the output module used to write the
1599  RECO data tier
1600 
1601  aodOutputModule is the output module used to write
1602  the AOD data tier, if this is not none, any AOD sequences
1603  should be added.
1604  """
1605  cb = ConfigBuilder(defaultOptions, process = process)
1606  cb._options.step = 'RAW2DIGI,RECO'
1607  cb.addStandardSequences()
1608  cb.addConditions()
1609  process.load(cb.EVTCONTDefault)
1610  recoOutputModule.eventContent = process.RECOEventContent
1611  if aodOutputModule != None:
1612  aodOutputModule.eventContent = process.AODEventContent
1613  return process
1614 

Variable Documentation

string ConfigBuilder.__default = 'GRun'

Definition at line 21 of file ConfigBuilder.py.

string ConfigBuilder.__source__ = "$Source: /cvs/CMSSW/CMSSW/Configuration/PyReleaseValidation/python/ConfigBuilder.py,v $"

Definition at line 4 of file ConfigBuilder.py.

dictionary ConfigBuilder.__triggerTable
Initial value:
1 = {
2 
3  # HLT trigger table for the 2009 STARTUP 8E29 menu
4  '8E29': (
5  'FastSimulation/Configuration/HLT_8E29_cff',
6  ),
7 
8  # HLT trigger table for the 2009 Global Run menu
9  'GRun': (
10  'FastSimulation/Configuration/HLT_GRun_cff',
11  ),
12 
13  # HLT trigger table for the 2009 STARTUP 1E31 menu
14  '1E31': (
15  'FastSimulation/Configuration/HLT_1E31_cff',
16  )
17 }

Definition at line 2 of file ConfigBuilder.py.

string ConfigBuilder.__version__ = "$Revision: 1.303.2.6 $"

Definition at line 3 of file ConfigBuilder.py.

tuple ConfigBuilder.defaultOptions = Options()

Definition at line 15 of file ConfigBuilder.py.

ConfigBuilder.promptReco = installPromptReco

Definition at line 1615 of file ConfigBuilder.py.