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 197 of file confdb.py.

References CombinedSVCalibration.data, CombinedTauTagCalibration.data, DOTExport.DotProducer.data, TrackProbabilityCalibration.data, ElectronLikelihoodCalibration.data, CSCTMBScope.data, confdb.HLTProcess.data, dqm::DQMFileSaverOnline::SnapshotFiles.data, QGLikelihoodObject.data, dqmTnP::AbstractFitter.data, LASModuleProfile.data, QGLikelihoodSystematicsObject.data, TkLasBeam.data, GeometryComparisonPlotter.data, EcalGlobalShowerContainmentCorrectionsVsEta::Coefficients.data, edm::MapOfVectors< K, T >::Iter.data, edm::DetSet< T >.data, @571.data, EcalShowerContainmentCorrections::Coefficients.data, cscdqm::Cache.data, DQMNet::Bucket.data, conddblib.Payload.data, validation.Sample.overrideGlobalTag(), 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 149 of file confdb.py.

References CombinedSVCalibration.data, CombinedTauTagCalibration.data, DOTExport.DotProducer.data, TrackProbabilityCalibration.data, ElectronLikelihoodCalibration.data, CSCTMBScope.data, confdb.HLTProcess.data, dqm::DQMFileSaverOnline::SnapshotFiles.data, QGLikelihoodObject.data, dqmTnP::AbstractFitter.data, LASModuleProfile.data, QGLikelihoodSystematicsObject.data, TkLasBeam.data, GeometryComparisonPlotter.data, EcalGlobalShowerContainmentCorrectionsVsEta::Coefficients.data, edm::MapOfVectors< K, T >::Iter.data, edm::DetSet< T >.data, @571.data, EcalShowerContainmentCorrections::Coefficients.data, cscdqm::Cache.data, DQMNet::Bucket.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 CombinedSVCalibration.data, DOTExport.DotProducer.data, CombinedTauTagCalibration.data, TrackProbabilityCalibration.data, ElectronLikelihoodCalibration.data, CSCTMBScope.data, confdb.HLTProcess.data, dqm::DQMFileSaverOnline::SnapshotFiles.data, QGLikelihoodObject.data, dqmTnP::AbstractFitter.data, LASModuleProfile.data, QGLikelihoodSystematicsObject.data, TkLasBeam.data, GeometryComparisonPlotter.data, EcalGlobalShowerContainmentCorrectionsVsEta::Coefficients.data, edm::MapOfVectors< K, T >::Iter.data, edm::DetSet< T >.data, @571.data, EcalShowerContainmentCorrections::Coefficients.data, cscdqm::Cache.data, DQMNet::Bucket.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 CombinedSVCalibration.data, CombinedTauTagCalibration.data, DOTExport.DotProducer.data, TrackProbabilityCalibration.data, ElectronLikelihoodCalibration.data, CSCTMBScope.data, confdb.HLTProcess.data, dqm::DQMFileSaverOnline::SnapshotFiles.data, QGLikelihoodObject.data, dqmTnP::AbstractFitter.data, LASModuleProfile.data, QGLikelihoodSystematicsObject.data, TkLasBeam.data, GeometryComparisonPlotter.data, EcalGlobalShowerContainmentCorrectionsVsEta::Coefficients.data, edm::MapOfVectors< K, T >::Iter.data, edm::DetSet< T >.data, @571.data, EcalShowerContainmentCorrections::Coefficients.data, cscdqm::Cache.data, DQMNet::Bucket.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,"%s")
166 """ % (self.config.type)
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,"%s",_customInfo)
190 """ % (self.config.type,_gtData,_gtMc,self.config.type,self.config.type,self.config.events,self.config.globaltag,self.source,self.config.data,self.config.type)
191 
192  self.data += """
193 from HLTrigger.Configuration.customizeHLTforCMSSW import customizeHLTforCMSSW
194 process = customizeHLTforCMSSW(process,"%s")
195 """ % (self.config.type)
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__(), data_sources.node.__str__(), data_sources.json_list.as_dicts(), data_sources.json_list.as_table(), confdb.HLTProcess.customize(), confdb.HLTProcess.dump(), confdb.HLTProcess.getRawConfigurationFromDB(), data_sources.json_list.last(), 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(), edmIntegrityCheck.IntegrityCheck.query(), cmsswPreprocessor.CmsswPreprocessor.run(), production_tasks.BaseDataset.run(), production_tasks.GenerateMask.run(), production_tasks.RunCMSBatch.run(), production_tasks.MonitorJobs.run(), production_tasks.CheckJobStatus.run(), production_tasks.CleanJobFiles.run(), 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(), edmIntegrityCheck.PublishToFileSystem.get(), 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(), edmIntegrityCheck.PublishToFileSystem.publish(), 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().