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(version = self.config.menu.version, database = self.config.menu.database)
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 124 of file confdb.py.

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

Definition at line 136 of file confdb.py.

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

Definition at line 193 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, dqm::DQMFileSaverOnline::SnapshotFiles.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, @566.data, EcalShowerContainmentCorrections::Coefficients.data, cscdqm::Cache.data, DQMNet::Bucket.data, python.DBCopy.DBCopy.data, conddblib.Payload.data, and confdb.HLTProcess.specificCustomize().

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

Definition at line 149 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, dqm::DQMFileSaverOnline::SnapshotFiles.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, @566.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.

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

Definition at line 108 of file confdb.py.

References python.rootplot.root2matplotlib.replace().

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

Definition at line 83 of file confdb.py.

83 
84  def getPathList(self):
85  if self.config.menu.run:
86  args = ['--runNumber', self.config.menu.run]
87  else:
88  args = ['--configName', self.config.menu.name]
89  args.extend( (
90  '--cff',
91  '--noedsources',
92  '--noes',
93  '--noservices',
94  '--nosequences',
95  '--nomodules'
96  ) )
97 
98  data, err = self.converter.query( *args )
99  if 'ERROR' in err or 'Exhausted Resultset' in err or 'CONFIG_NOT_FOUND' in err:
100  sys.stderr.write("%s: error while retrieving the list of paths from the HLT menu\n\n" % os.path.basename(sys.argv[0]))
101  sys.stderr.write(err + "\n\n")
102  sys.exit(1)
103  filter = re.compile(r' *= *cms.(End)?Path.*')
104  paths = [ filter.sub('', line) for line in data.splitlines() if filter.search(line) ]
105  return paths
106 
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, dqm::DQMFileSaverOnline::SnapshotFiles.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, @566.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  sys.stderr.write("%s: error while retrieving the HLT menu\n\n" % os.path.basename(sys.argv[0]))
79  sys.stderr.write(err + "\n\n")
80  sys.exit(1)
81  self.data = data
82 
static std::string join(char **cmd)
Definition: RemoteFile.cc:18
def getRawConfigurationFromDB
Definition: confdb.py:65
def confdb.HLTProcess.specificCustomize (   self)

Definition at line 158 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, dqm::DQMFileSaverOnline::SnapshotFiles.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, @566.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().

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

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