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.284.2.4 $"
 
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 1608 of file ConfigBuilder.py.

1609 def addALCAPaths(process, listOfALCANames, definitionFile = "Configuration/StandardSequences/AlCaRecoStreams_cff"):
1610  """
1611  _addALCAPaths_
1612 
1613  Function to add alignment&calibration sequences to an existing process
1614  """
1615  __import__(definitionFile)
1616  definitionModule = sys.modules[definitionFile]
1617  process.extend(definitionModule)
1618 
1619  for alca in listOfALCANames:
1620  streamName = "ALCARECOStream%s" % alca
1621  stream = getattr(definitionModule, streamName)
1622  for path in stream.paths:
1623  schedule.append(path)
1624 
1625  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 1579 of file ConfigBuilder.py.

1580 def addOutputModule(process, tier, content):
1581  """
1582  _addOutputModule_
1583 
1584  Function to add an output module to a given process with given data tier and event content
1585  """
1586  print "WARNING. this method will not be supported any more SOON, please use --eventcontent --datatier field to drive the output module definitions"
1587 
1588  moduleName = "output%s%s" % (tier, content)
1589  pathName = "%sPath" % moduleName
1590  contentName = "%sEventContent" % content
1591  contentAttr = getattr(process, contentName)
1592  setattr(process, moduleName,
1593  cms.OutputModule("PoolOutputModule",
1594  contentAttr,
1595  fileName = cms.untracked.string('%s.root' % moduleName),
1596  dataset = cms.untracked.PSet(
1597  dataTier = cms.untracked.string(tier),
1598  ),
1599  )
1600  )
1601  print getattr(process,moduleName)
1602  # put it in an EndPath and put the EndPath into the schedule
1603  setattr(process, pathName, cms.EndPath(getattr(process,moduleName)) )
1604  process.schedule.append(getattr(process, pathName))
1605 
1606  return
1607 
def ConfigBuilder.dumpPython (   process,
  name 
)

Definition at line 50 of file ConfigBuilder.py.

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

50 
51 def dumpPython(process,name):
52  theObject = getattr(process,name)
53  if isinstance(theObject,cms.Path) or isinstance(theObject,cms.EndPath) or isinstance(theObject,cms.Sequence):
54  return "process."+name+" = " + theObject.dumpPython("process")
55  elif isinstance(theObject,_Module) or isinstance(theObject,cms.ESProducer):
56  return "process."+name+" = " + theObject.dumpPython()+"\n"
57  else:
58  return "process."+name+" = " + theObject.dumpPython()+"\n"
def ConfigBuilder.filesFromDASQuery (   query,
  s = None 
)

Definition at line 59 of file ConfigBuilder.py.

References split.

Referenced by ConfigBuilder.ConfigBuilder.filesFromOption().

59 
60 def filesFromDASQuery(query,s=None):
61  import os
62  import FWCore.ParameterSet.Config as cms
63  prim=[]
64  sec=[]
65  print "the query is",query
66  for line in os.popen('das_client.py --query "%s"'%(query)):
67  if line.count(".root")>=2:
68  #two files solution...
69  entries=line.replace("\n","").split()
70  if not entries[0] in prim:
71  prim.append(entries[0])
72  if not entries[1] in sec:
73  sec.append(entries[1])
74  elif (line.find(".root")!=-1):
75  entry=line.replace("\n","")
76  if not entry in prim:
77  prim.append(entry)
78  if s:
79  if not hasattr(s,"fileNames"):
80  s.fileNames=cms.untracked.vstring(prim)
81  else:
82  s.fileNames.extend(prim)
83  if len(sec)!=0:
84  if not hasattr(s,"secondaryFileNames"):
85  s.secondaryFileNames=cms.untracked.vstring(sec)
86  else:
87  s.secondaryFileNames.extend(sec)
88  print "found files: ",prim
89  if len(sec)!=0:
90  print "found parent files:",sec
91  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 1534 of file ConfigBuilder.py.

1535 def installFilteredStream(process, schedule, streamName, definitionFile = "Configuration/StandardSequences/AlCaRecoStreams_cff" ):
1536 
1537  __import__(definitionFile)
1538  definitionModule = sys.modules[definitionFile]
1539  process.extend(definitionModule)
1540  stream = getattr(definitionModule,streamName)
1541  output = cms.OutputModule("PoolOutputModule")
1542  output.SelectEvents = stream.selectEvents
1543  output.outputCommands = stream.content
1544  output.dataset = cms.untracked.PSet( dataTier = stream.dataTier)
1545  setattr(process,streamName,output)
1546  for path in stream.paths:
1547  schedule.append(path)
1548 
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 1549 of file ConfigBuilder.py.

1550 def installPromptReco(process, recoOutputModule, aodOutputModule = None):
1551  """
1552  _promptReco_
1553 
1554  Method to install the standard PromptReco configuration into
1555  a basic process containing source and output modules.
1556 
1557  process is the CMS Process instance to be populated
1558 
1559  recoOutputModule is the output module used to write the
1560  RECO data tier
1561 
1562  aodOutputModule is the output module used to write
1563  the AOD data tier, if this is not none, any AOD sequences
1564  should be added.
1565  """
1566  cb = ConfigBuilder(defaultOptions, process = process)
1567  cb._options.step = 'RAW2DIGI,RECO'
1568  cb.addStandardSequences()
1569  cb.addConditions()
1570  process.load(cb.EVTCONTDefault)
1571  recoOutputModule.eventContent = process.RECOEventContent
1572  if aodOutputModule != None:
1573  aodOutputModule.eventContent = process.AODEventContent
1574  return process
1575 

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.284.2.4 $"

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 1576 of file ConfigBuilder.py.