CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
List of all members | Public Member Functions | Static Public Member Functions | Public Attributes
confdb.HLTProcess Class Reference
Inheritance diagram for confdb.HLTProcess:

Public Member Functions

def __init__
 
def customize
 
def dump
 
def getPathList
 
def getRawConfigurationFromDB
 
def specificCustomize
 

Static Public Member Functions

def consolidateNegativeList
 
def consolidatePositiveList
 
def expandWildcards
 

Public Attributes

 config
 
 converter
 
 data
 
 labels
 
 options
 
 parent
 
 source
 

Detailed Description

Definition at line 21 of file confdb.py.

Constructor & Destructor Documentation

def confdb.HLTProcess.__init__ (   self,
  configuration 
)

Definition at line 23 of file confdb.py.

23 
24  def __init__(self, configuration):
25  self.config = configuration
26  self.data = None
27  self.source = []
28  self.parent = []
29 
30  self.options = {
31  'essources' : [],
32  'esmodules' : [],
33  'modules' : [],
34  'sequences' : [],
35  'services' : [],
36  'paths' : [],
37  'psets' : [],
38  'blocks' : [],
39  }
40 
41  self.labels = {}
42  if self.config.fragment:
43  self.labels['process'] = 'fragment.'
44  self.labels['dict'] = 'fragment.__dict__'
45  else:
46  self.labels['process'] = 'process.'
47  self.labels['dict'] = 'process.__dict__'
48 
49  if self.config.online:
50  self.labels['connect'] = 'frontier://(proxyurl=http://localhost:3128)(serverurl=http://localhost:8000/FrontierOnProd)(serverurl=http://localhost:8000/FrontierOnProd)(retrieve-ziplevel=0)'
51  else:
52  self.labels['connect'] = 'frontier://FrontierProd'
53 
54  if self.config.prescale and (self.config.prescale.lower() != 'none'):
55  self.labels['prescale'] = self.config.prescale
56 
57  # get the configuration from ConfdB
58  from confdbOfflineConverter import OfflineConverter
59  self.converter = OfflineConverter(database = self.config.menu.db)
60  self.buildPathList()
61  self.buildOptions()
63  self.customize()
64 
def getRawConfigurationFromDB
Definition: confdb.py:65

Member Function Documentation

def confdb.HLTProcess.consolidateNegativeList (   elements)
static

Definition at line 128 of file confdb.py.

129  def consolidateNegativeList(elements):
130  # consolidate a list of path exclusions and re-inclusions
131  # the result is the list of paths to be removed from the dump
132  result = set()
133  for element in elements:
134  if element[0] == '-':
135  result.add( element )
136  else:
137  result.discard( '-' + element )
138  return sorted( element for element in result )
def consolidateNegativeList
Definition: confdb.py:128
def confdb.HLTProcess.consolidatePositiveList (   elements)
static

Definition at line 140 of file confdb.py.

141  def consolidatePositiveList(elements):
142  # consolidate a list of path selection and re-exclusions
143  # the result is the list of paths to be included in the dump
144  result = set()
145  for element in elements:
146  if element[0] == '-':
147  result.discard( element[1:] )
148  else:
149  result.add( element )
150  return sorted( element for element in result )
151 
def consolidatePositiveList
Definition: confdb.py:140
def confdb.HLTProcess.customize (   self)

Definition at line 197 of file confdb.py.

References python.multivaluedict.MyUserList.data, CombinedSVCalibration.data, CombinedTauTagCalibration.data, DOTExport.DotProducer.data, TrackProbabilityCalibration.data, ElectronLikelihoodCalibration.data, CSCTMBScope.data, confdb.HLTProcess.data, CondIter< DataT >.data, QGLikelihoodObject.data, dqmTnP::AbstractFitter.data, LASModuleProfile.data, cond::IOVProxyData.data, QGLikelihoodSystematicsObject.data, GeometryComparisonPlotter.data, TkLasBeam.data, EcalGlobalShowerContainmentCorrectionsVsEta::Coefficients.data, edm::MapOfVectors< K, T >::Iter.data, edm::DetSet< T >.data, @563.data, EcalShowerContainmentCorrections::Coefficients.data, cscdqm::Cache.data, DQMNet::Bucket.data, python.DBCopy.DBCopy.data, conddblib.Payload.data, and confdb.HLTProcess.specificCustomize().

198  def customize(self):
199 
200  # adapt the source to the current scenario
201  if not self.config.fragment:
202  self.build_source()
203 
204  # manual override some parameters
205  if self.config.type in ('HIon', ):
206  if self.config.data:
207  if not self.config.fragment:
208  self._fix_parameter( type = 'InputTag', value = 'rawDataCollector', replace = 'rawDataRepacker')
209 
210 # if self.config.type in ('HIon', ):
# self.data += """
def confdb.HLTProcess.dump (   self)

Definition at line 153 of file confdb.py.

References python.multivaluedict.MyUserList.data, CombinedSVCalibration.data, CombinedTauTagCalibration.data, DOTExport.DotProducer.data, TrackProbabilityCalibration.data, ElectronLikelihoodCalibration.data, CSCTMBScope.data, confdb.HLTProcess.data, CondIter< DataT >.data, QGLikelihoodObject.data, dqmTnP::AbstractFitter.data, LASModuleProfile.data, cond::IOVProxyData.data, QGLikelihoodSystematicsObject.data, GeometryComparisonPlotter.data, TkLasBeam.data, EcalGlobalShowerContainmentCorrectionsVsEta::Coefficients.data, edm::MapOfVectors< K, T >::Iter.data, edm::DetSet< T >.data, @563.data, EcalShowerContainmentCorrections::Coefficients.data, cscdqm::Cache.data, DQMNet::Bucket.data, python.DBCopy.DBCopy.data, conddblib.Payload.data, Utilities.InputTagLabelSet.labels, confdb.HLTProcess.labels, ecaldqm::binning::AxisSpecs.labels, and svgfig.Ticks.labels.

154  def dump(self):
155  self.data = self.data % self.labels
156  if self.config.fragment:
157  self.data = re.sub( r'\bprocess\b', 'fragment', self.data )
158  self.data = re.sub( r'\bProcess\b', 'ProcessFragment', self.data )
159  return self.data
160 
def confdb.HLTProcess.expandWildcards (   globs,
  collection 
)
static

Definition at line 112 of file confdb.py.

References python.rootplot.root2matplotlib.replace().

113  def expandWildcards(globs, collection):
114  # expand a list of unix-style wildcards matching a given collection
115  # wildcards with no matches are silently discarded
116  matches = []
117  for glob in globs:
118  negate = ''
119  if glob[0] == '-':
120  negate = '-'
121  glob = glob[1:]
122  # translate a unix-style glob expression into a regular expression
123  filter = re.compile(r'^' + glob.replace('?', '.').replace('*', '.*').replace('[!', '[^') + r'$')
124  matches.extend( negate + element for element in collection if filter.match(element) )
125  return matches
126 
def expandWildcards
Definition: confdb.py:112
def confdb.HLTProcess.getPathList (   self)

Definition at line 85 of file confdb.py.

85 
86  def getPathList(self):
87  if self.config.menu.run:
88  args = ['--runNumber', self.config.menu.run]
89  else:
90  args = ['--configName', self.config.menu.name]
91  args.extend( (
92  '--cff',
93  '--noedsources',
94  '--noes',
95  '--noservices',
96  '--nosequences',
97  '--nomodules'
98  ) )
99 
100  data, err = self.converter.query( *args )
101  if 'ERROR' in err or 'Exhausted Resultset' in err or 'CONFIG_NOT_FOUND' in err:
102  print "%s: error while retriving the list of paths from the HLT menu" % os.path.basename(sys.argv[0])
103  print
104  print err
105  print
106  sys.exit(1)
107  filter = re.compile(r' *= *cms.(End)?Path.*')
108  paths = [ filter.sub('', line) for line in data.splitlines() if filter.search(line) ]
109  return paths
110 
def confdb.HLTProcess.getRawConfigurationFromDB (   self)

Definition at line 65 of file confdb.py.

References python.multivaluedict.MyUserList.data, CombinedSVCalibration.data, CombinedTauTagCalibration.data, DOTExport.DotProducer.data, TrackProbabilityCalibration.data, ElectronLikelihoodCalibration.data, CSCTMBScope.data, confdb.HLTProcess.data, CondIter< DataT >.data, QGLikelihoodObject.data, dqmTnP::AbstractFitter.data, LASModuleProfile.data, cond::IOVProxyData.data, QGLikelihoodSystematicsObject.data, GeometryComparisonPlotter.data, TkLasBeam.data, EcalGlobalShowerContainmentCorrectionsVsEta::Coefficients.data, edm::MapOfVectors< K, T >::Iter.data, edm::DetSet< T >.data, @563.data, EcalShowerContainmentCorrections::Coefficients.data, cscdqm::Cache.data, DQMNet::Bucket.data, python.DBCopy.DBCopy.data, conddblib.Payload.data, and join().

65 
66  def getRawConfigurationFromDB(self):
67  if self.config.menu.run:
68  args = ['--runNumber', self.config.menu.run]
69  else:
70  args = ['--configName', self.config.menu.name ]
71  args.append('--noedsources')
72  for key, vals in self.options.iteritems():
73  if vals:
74  args.extend(('--'+key, ','.join(vals)))
75 
76  data, err = self.converter.query( *args )
77  if 'ERROR' in err or 'Exhausted Resultset' in err or 'CONFIG_NOT_FOUND' in err:
78  print "%s: error while retriving the HLT menu" % os.path.basename(sys.argv[0])
79  print
80  print err
81  print
82  sys.exit(1)
83  self.data = data
84 
static std::string join(char **cmd)
Definition: RemoteFile.cc:18
def getRawConfigurationFromDB
Definition: confdb.py:65
def confdb.HLTProcess.specificCustomize (   self)

Definition at line 162 of file confdb.py.

References python.multivaluedict.MyUserList.data, CombinedSVCalibration.data, CombinedTauTagCalibration.data, DOTExport.DotProducer.data, TrackProbabilityCalibration.data, ElectronLikelihoodCalibration.data, CSCTMBScope.data, confdb.HLTProcess.data, CondIter< DataT >.data, QGLikelihoodObject.data, dqmTnP::AbstractFitter.data, LASModuleProfile.data, cond::IOVProxyData.data, QGLikelihoodSystematicsObject.data, GeometryComparisonPlotter.data, TkLasBeam.data, EcalGlobalShowerContainmentCorrectionsVsEta::Coefficients.data, edm::MapOfVectors< K, T >::Iter.data, edm::DetSet< T >.data, @563.data, EcalShowerContainmentCorrections::Coefficients.data, cscdqm::Cache.data, DQMNet::Bucket.data, python.DBCopy.DBCopy.data, conddblib.Payload.data, confdb.HLTProcess.source, lhef::XMLDocument.source, DQMNet::Peer.source, Config.Process.source, gen::Hydjet2Hadronizer.source, condformats_serialization_generate.SerializationCodeGenerator.source, and BeautifulSoup.ResultSet.source.

Referenced by confdb.HLTProcess.customize().

163  def specificCustomize(self):
164  # specific customizations now live in HLTrigger.Configuration.customizeHLTforALL.customizeHLTforAll(.,.)
165  if self.config.fragment:
166  self.data += """
167 # add specific customizations
168 from HLTrigger.Configuration.customizeHLTforALL import customizeHLTforAll
169 fragment = customizeHLTforAll(fragment)
170 """
171  else:
172  if self.config.type=="Fake":
173  prefix = "run1"
174  else:
175  prefix = "run2"
176  _gtData = "auto:"+prefix+"_hlt_"+self.config.type
177  _gtMc = "auto:"+prefix+"_mc_" +self.config.type
178  self.data += """
179 # add specific customizations
180 _customInfo = {}
181 _customInfo['menuType' ]= "%s"
182 _customInfo['globalTags']= {}
183 _customInfo['globalTags'][True ] = "%s"
184 _customInfo['globalTags'][False] = "%s"
185 _customInfo['inputFiles']={}
186 _customInfo['inputFiles'][True] = "file:RelVal_Raw_%s_DATA.root"
187 _customInfo['inputFiles'][False] = "file:RelVal_Raw_%s_MC.root"
188 _customInfo['maxEvents' ]= %s
189 _customInfo['globalTag' ]= "%s"
190 _customInfo['inputFile' ]= %s
191 _customInfo['realData' ]= %s
192 from HLTrigger.Configuration.customizeHLTforALL import customizeHLTforAll
193 process = customizeHLTforAll(process,_customInfo)
194 """ % (self.config.type,_gtData,_gtMc,self.config.type,self.config.type,self.config.events,self.config.globaltag,self.source,self.config.data)
195 
def specificCustomize
Definition: confdb.py:162

Member Data Documentation

confdb.HLTProcess.config

Definition at line 24 of file confdb.py.

confdb.HLTProcess.converter

Definition at line 58 of file confdb.py.

confdb.HLTProcess.data

Definition at line 25 of file confdb.py.

Referenced by cuy.FindIssue.__init__(), confdb.HLTProcess.customize(), confdb.HLTProcess.dump(), confdb.HLTProcess.getRawConfigurationFromDB(), and confdb.HLTProcess.specificCustomize().

confdb.HLTProcess.labels

Definition at line 40 of file confdb.py.

Referenced by confdb.HLTProcess.dump().

confdb.HLTProcess.options

Definition at line 29 of file confdb.py.

Referenced by betterConfigParser.BetterConfigParser.__updateDict(), betterConfigParser.BetterConfigParser.checkInput(), DOTExport.DotExport.export(), and DOTExport.DotExport.write_output().

confdb.HLTProcess.parent

Definition at line 27 of file confdb.py.

Referenced by BeautifulSoup.PageElement._invert(), Vispa.Gui.ConnectableWidget.ConnectableWidget.addMenuEntry(), Vispa.Views.LineDecayView.LineDecayContainer.applyFilter(), Vispa.Views.BoxDecayView.BoxDecayContainer.arrangeUsingRelations(), Vispa.Views.BoxDecayView.BoxDecayContainer.autolayoutAlgorithm(), Vispa.Gui.ZoomableScrollableWidgetOwner.ZoomableScrollableWidgetOwner.autosizeScrollArea(), Vispa.Views.BoxDecayView.BoxDecayContainer.autosizeScrollArea(), Vispa.Gui.PortWidget.PortWidget.connectionPoint(), Vispa.Main.StartupScreen.StartupScreen.createDescriptionWidget(), Vispa.Views.BoxDecayView.BoxDecayContainer.dataAccessor(), Vispa.Views.LineDecayView.LineDecayContainer.dataAccessor(), Vispa.Views.LineDecayView.DecayLine.dataAccessor(), Vispa.Views.LineDecayView.LineDecayContainer.delete(), Vispa.Views.LineDecayView.DecayNode.delete(), Vispa.Views.LineDecayView.DecayLine.delete(), Vispa.Gui.VispaWidget.VispaWidget.delete(), Vispa.Gui.VispaWidget.VispaWidget.dragWidget(), Vispa.Share.ImageExporter.ImageExporter.exportImageDialog(), Vispa.Views.LineDecayView.DecayLine.extendedSize(), argparse.HelpFormatter._Section.format_help(), python.rootplot.argparse.HelpFormatter._Section.format_help(), Vispa.Gui.VispaWidget.VispaWidget.keyPressEvent(), Vispa.Gui.MenuWidget.MenuWidget.leaveEvent(), Vispa.Gui.ConnectableWidget.ConnectableWidget.leaveEvent(), Vispa.Gui.PortWidget.PortWidget.moduleParent(), Vispa.Gui.WidgetContainer.WidgetContainer.mouseDoubleClickEvent(), Vispa.Gui.VispaWidget.VispaWidget.mouseDoubleClickEvent(), Vispa.Gui.PortConnection.PointToPointConnection.mousePressEvent(), Vispa.Gui.VispaWidget.VispaWidget.mousePressEvent(), Vispa.Views.LineDecayView.ParticleWidget.mousePressEvent(), Vispa.Views.LineDecayView.DecayNode.move(), Vispa.Views.LineDecayView.LineDecayContainer.noDecorationsMode(), Vispa.Views.LineDecayView.LineDecayContainer.operationId(), Vispa.Views.LineDecayView.DecayLine.paint(), Vispa.Gui.VispaWidget.VispaWidget.paintEvent(), Vispa.Gui.ConnectableWidget.ConnectableWidget.positionizeMenuWidget(), Vispa.Views.LineDecayView.DecayLine.qtLineStyle(), Vispa.Views.WidgetView.WidgetView.restoreSelection(), Vispa.Views.WidgetView.WidgetView.select(), Vispa.Gui.PortConnection.PointToPointConnection.select(), Vispa.Gui.VispaWidget.VispaWidget.select(), Vispa.Views.LineDecayView.LineDecayContainer.select(), Vispa.Views.LineDecayView.LineDecayContainer.sizeHint(), Vispa.Views.LineDecayView.LineDecayContainer.tabController(), Vispa.Views.BoxDecayView.BoxDecayContainer.toggleCollapsed(), Vispa.Views.LineDecayView.DecayNode.unite(), Vispa.Views.PropertyView.PropertyView.valueChanged(), Vispa.Views.BoxDecayView.BoxDecayContainer.widgetByObject(), Vispa.Gui.VispaWidgetOwner.VispaWidgetOwner.widgetDoubleClicked(), and Vispa.Gui.VispaWidgetOwner.VispaWidgetOwner.widgetDragged().

confdb.HLTProcess.source

Definition at line 26 of file confdb.py.

Referenced by confdb.HLTProcess.specificCustomize().