CMS 3D CMS Logo

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

Functions

def getPrescaleTableFromProcessObject
 
def getProcessObjectFromConfDB
 
def queryRR
 

Variables

string action = "append"
 
tuple all_hlt_keys_seen = set(runKeys.values())
 
tuple all_hlt_path_names_seen = set()
 
tuple all_path_names = set(process.paths.keys())
 
list column_names = [ 'run','' ]
 
list csv_output_file = args[0]
 
tuple csv_writer = csv.writer(fout,delimiter=";")
 
list default = []
 
string dest = "pathPatterns"
 
tuple fout = open(csv_output_file,"w")
 
string help = "restrict paths to PATTERN. Note that this can be a single path name or a pattern "
 
list hlt_key = runKeys[run]
 
dictionary hlt_path_names_table = {}
 
int index = 1
 
string metavar = "PATTERN"
 
tuple parser
 
list prescales = prescaleTable[hlt_key]
 
dictionary prescaleTable = {}
 
 previous_hlt_key = None
 
tuple process = getProcessObjectFromConfDB(hlt_key)
 
tuple runKeys = queryRR()
 
tuple runs = sorted(runKeys.keys())
 
list tmp = []
 
list values = [ run , '' ]
 

Function Documentation

def makeHLTPrescaleTable.getPrescaleTableFromProcessObject (   process)
returns a dict of hlt key to vector of prescales
mapping 

Definition at line 55 of file makeHLTPrescaleTable.py.

55 
57  """ returns a dict of hlt key to vector of prescales
58  mapping """
59 
60  retval = {}
61  for entry in process.PrescaleService.prescaleTable:
62  retval[entry.pathName.value()] = entry.prescales.value()
63 
64  return retval
65 
66 #----------------------------------------------------------------------
def makeHLTPrescaleTable.getProcessObjectFromConfDB (   hlt_key)

Definition at line 67 of file makeHLTPrescaleTable.py.

67 
68 def getProcessObjectFromConfDB(hlt_key):
69  # print >> stderr,"\t%s ..." % hlt_key
70  cmd = "edmConfigFromDB --orcoff --configName " + hlt_key
71  # print >> stderr, "cmd=",cmd
72  res = commands.getoutput(cmd)
73 
74  # potentially dangerous: we're running python code here
75  # which we get from an external process (confDB).
76  # we trust that there are no file deletion commands
77  # in the HLT configurations...
78 
79  # for some keys, edmConfigFromDB seems to produce error messages.
80  # just return None in this case
81  try:
82  exec(res)
83  except:
84  return None
85 
86  return process
87 
#----------------------------------------------------------------------
def makeHLTPrescaleTable.queryRR ( )
returns a dict of run number mapping to the HLT key 

Definition at line 88 of file makeHLTPrescaleTable.py.

References cmsRelvalreport.exit.

88 
89 def queryRR():
90  """ returns a dict of run number mapping to the HLT key """
91 
92  stderr.write("Querying run registry for range [%d, %d], group name like %s ...\n" % (options.firstRun, options.lastRun, options.groupName))
93  import xmlrpclib
94  import xml.dom.minidom
95  server = xmlrpclib.ServerProxy(options.rrurl)
96  run_data = server.DataExporter.export('RUN', 'GLOBAL', 'xml_datasets', "{runNumber} >= %d AND {runNumber} <= %d AND {groupName} like '%s' AND {datasetName} = '/Global/Online/ALL'" % (options.firstRun, options.lastRun, options.groupName))
97  ret = {}
98  xml_data = xml.dom.minidom.parseString(run_data)
99  xml_runs = xml_data.documentElement.getElementsByTagName("RUN_DATASET")
100  for xml_run in xml_runs:
101  ret[xml_run.getElementsByTagName("RUN_NUMBER")[0].firstChild.nodeValue] = xml_run.getElementsByTagName("RUN_HLTKEY")[0].firstChild.nodeValue
102  return ret
103 
104 #----------------------------------------------------------------------
105 # main
106 #----------------------------------------------------------------------
107 
# check whether we have a CMSSW environment initalized

Variable Documentation

string makeHLTPrescaleTable.action = "append"

Definition at line 30 of file makeHLTPrescaleTable.py.

tuple makeHLTPrescaleTable.all_hlt_keys_seen = set(runKeys.values())

Definition at line 128 of file makeHLTPrescaleTable.py.

tuple makeHLTPrescaleTable.all_hlt_path_names_seen = set()

Definition at line 122 of file makeHLTPrescaleTable.py.

tuple makeHLTPrescaleTable.all_path_names = set(process.paths.keys())

Definition at line 145 of file makeHLTPrescaleTable.py.

list makeHLTPrescaleTable.column_names = [ 'run','' ]

Definition at line 206 of file makeHLTPrescaleTable.py.

list makeHLTPrescaleTable.csv_output_file = args[0]

Definition at line 48 of file makeHLTPrescaleTable.py.

tuple makeHLTPrescaleTable.csv_writer = csv.writer(fout,delimiter=";")

Definition at line 193 of file makeHLTPrescaleTable.py.

list makeHLTPrescaleTable.default = []

Definition at line 29 of file makeHLTPrescaleTable.py.

string makeHLTPrescaleTable.dest = "pathPatterns"

Definition at line 28 of file makeHLTPrescaleTable.py.

tuple makeHLTPrescaleTable.fout = open(csv_output_file,"w")

Definition at line 191 of file makeHLTPrescaleTable.py.

Referenced by evf::BUEvent.dump(), evf::FUResourceTable.dumpEvent(), DTTrigGeom.dumpLUT(), DTConfigManager.dumpLUTParam(), FittedEntriesManager.MakeHistos(), EcalDCSTowerStatusXMLTranslator.plot(), EcalDAQTowerStatusXMLTranslator.plot(), ZeeCalibration.printStatistics(), MonitorElementMgr.save(), and TestHistoMgr.save().

string makeHLTPrescaleTable.help = "restrict paths to PATTERN. Note that this can be a single path name or a pattern "

Definition at line 32 of file makeHLTPrescaleTable.py.

list makeHLTPrescaleTable.hlt_key = runKeys[run]

Definition at line 213 of file makeHLTPrescaleTable.py.

dictionary makeHLTPrescaleTable.hlt_path_names_table = {}

Definition at line 119 of file makeHLTPrescaleTable.py.

int makeHLTPrescaleTable.index = 1

Definition at line 132 of file makeHLTPrescaleTable.py.

string makeHLTPrescaleTable.metavar = "PATTERN"

Definition at line 31 of file makeHLTPrescaleTable.py.

tuple makeHLTPrescaleTable.parser
Initial value:
1 = OptionParser(usage=
2 """usage: %prog [options] csv_output_fileexamples: %prog out.csv produces a table of ALL runs and ALL paths (can take quite some time) %prog --path='*ele*' --path='*photon*' out.csv select only paths containing 'ele' and 'photon'""")

Definition at line 6 of file makeHLTPrescaleTable.py.

list makeHLTPrescaleTable.prescales = prescaleTable[hlt_key]

Definition at line 263 of file makeHLTPrescaleTable.py.

Referenced by HLTEventAnalyzerAOD.analyzeTrigger(), and edm::service::PrescaleService.configure().

dictionary makeHLTPrescaleTable.prescaleTable = {}

Definition at line 116 of file makeHLTPrescaleTable.py.

makeHLTPrescaleTable.previous_hlt_key = None

Definition at line 189 of file makeHLTPrescaleTable.py.

tuple makeHLTPrescaleTable.process = getProcessObjectFromConfDB(hlt_key)

Definition at line 137 of file makeHLTPrescaleTable.py.

tuple makeHLTPrescaleTable.runKeys = queryRR()

Definition at line 112 of file makeHLTPrescaleTable.py.

tuple makeHLTPrescaleTable.runs = sorted(runKeys.keys())

Definition at line 124 of file makeHLTPrescaleTable.py.

list makeHLTPrescaleTable.tmp = []

Definition at line 166 of file makeHLTPrescaleTable.py.

list makeHLTPrescaleTable.values = [ run , '' ]

Definition at line 236 of file makeHLTPrescaleTable.py.

Referenced by edm::helper::Filler< Association< C > >.add(), SiStripSummaryBuilder.analyze(), JetTagMVATrainer.analyze(), TtSemiLepJetCombMVATrainer.analyze(), HcalAutoPedestalValidator.analyze(), HcalPedestalsCheck.analyze(), JetTagMVAExtractor.analyze(), SiStripCMMonitorPlugin.analyze(), JetTagMVATreeTrainer.analyze(), TaggingVariablePlotter.analyzeTag(), HDQMInspector.ApplyConditions(), EnergyLossPlain.average(), WriteOneGeometryFromXML.beginRun(), cond::IOVEditor.bulkAppend(), SiStripUtility.checkME(), SiPixelUtility.checkME(), DigiToRecoNoPU.customise(), DigiToRecoPU.customise(), ProcessFromBareGEN_cff.customise(), ErrorsAnalyzer.drawHistograms(), ErrorsPropagationAnalyzer.drawHistograms(), CastorDbASCIIIO.dumpCastorObject(), dumpHcalObject(), CastorDbXml.dumpObject(), HcalDbXml.dumpObject(), SimpleValueVectorVariable< TYPE >.eval(), evaluateTtFullHadSignalSel(), evaluateTtSemiLepSignalSel(), edm::helper::Filler< Association< C > >.fill(), PFElectronTranslator.fillMVAValueMap(), GoodSeedProducer.fillPreIdRefValueMap(), PFElectronTranslator.fillSCRefValueMap(), FsmwClusterizer1DNameSpace.fsmw(), MuonErrorMatrix.getFast(), metsig::SignAlgoResolutions.getfunc(), HcalDbOnline.getObject(), HcalDbPoolOCCI.getObjectGeneric(), PerformancePayloadFromTFormula.getResult(), edm::MultiAssociation< C >.getValues(), gen::JetMatchingMadgraph.init(), lhef::JetMatchingMadgraph.init(), PhysicsTools::MVAModuleHelper< Record, Object, Filler >.init(), edm::helper::Filler< Association< C > >.insert(), EnergyLossPlain.logTruncate(), MuonErrorMatrix.MuonErrorMatrix(), PhysicsTools::MVAModuleHelper< Record, Object, Filler >.operator()(), EnergyLossPlain.optimal(), pos::PixelCalibConfiguration.PixelCalibConfiguration(), EnergyLossPlain.process(), DDLRotationByAxis.processElement(), magneticfield::VolumeBasedMagneticFieldESProducer.produce(), AssociationVector2ValueMap< KeyRefProd, CVal >.produce(), TtSemiLepJetCombMVAComputer.produce(), SoftElectronCandProducer.produce(), ElectronIDExternalProducer< algo >.produce(), MuonSelectionTypeValueMapProducer.produce(), ColinsSoperVariablesComputer.produce(), ObjectMultiplicityCounter< T >.produce(), CosmicsMuonIdProducer.produce(), OtherObjectVariableComputer< T >.produce(), NearbyCandCountComputer.produce(), ElectronConversionRejectionVars.produce(), EcalGlobalShowerContainmentCorrectionsVsEtaESProducer.produce(), EcalShowerContainmentCorrectionsESProducer.produce(), DeltaRNearestObjectComputer< T >.produce(), CocoaAnalyzer.ReadXMLFile(), DTOccupancyTest.runOccupancyTest(), FWTriggerTableView.saveImageTo(), DQMHistoryServiceBase.scanTreeAndFillSummary(), GenEventInfoProduct.setBinningValues(), sistrip::FEDStripData::ChannelData.setMedians(), DDLMaterial.setReference(), DDLSolid.setReference(), python.XML2Python.TreeBuilder.topLevel(), XML2Python.TreeBuilder.topLevel(), PhysicsTools::MVAModuleHelper< Record, Object, Filler >.train(), EnergyLossPlain.truncate(), and CombinedKinematicConstraint.value().