CMS 3D CMS Logo

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

Functions

def format
 
def getDictFromObject
 
def getPieceFromObject
 

Variables

string action = "store_true"
 
tuple cFile = re.sub(r'_C$', r'.C', re.sub(r'\.so$','', shlib))
 
list diff = diffColl[index]
 
tuple diffColl = getPieceFromObject(tree, name+'.diff')
 
tuple diffContRE = re.compile(r'^class goDiffCont_(\w+)')
 
int epsilon = 1
 
list firstOnly = firstOnlyColl[index]
 
tuple firstOnlyColl = getPieceFromObject(tree, name + '.firstOnly')
 
string help = "Show deltas when difference is large enough."
 
tuple index = getDictFromObject(firstOnly, indexSingleDict)
 
dictionary indexDoubleDict = {'index':'index', 'delta_index':'delta_index'}
 
dictionary indexSingleDict = {'index':'index'}
 
tuple info = getDictFromObject(firstOnly, infoSingleDict)
 
dictionary infoDoubleDict = {}
 
dictionary infoSingleDict = {}
 
tuple match = diffContRE.search(line)
 
string name = ''
 
tuple parser = optparse.OptionParser("Usage: %prog bla.root lib.so var1 [var2]")
 
tuple rootfile = ROOT.TFile.Open(rootFilename)
 
tuple rootFilename = args.pop(0)
 
tuple runevent = getDictFromObject(tree, runeventDict, 'runevent')
 
dictionary runeventDict = {'Run':'run', 'Event':'event'}
 
list secondOnly = secondOnlyColl[index]
 
tuple secondOnlyColl = getPieceFromObject(tree, name + '.secondOnly')
 
tuple shlib = args.pop(0)
 
tuple size = tree.GetEntries()
 
tuple source = open(cFile, 'r')
 
tuple stringSet = set()
 
tuple tree = rootfile.Get('diffTree')
 
tuple typeFoundSet = set()
 
dictionary variableREDict = {}
 
 variables = args
 
list working = []
 

Function Documentation

def diffTreeTool.format (   objDict,
  label,
  spacing = 9,
  firstOnly = False 
)
return a formatted string for given object

Definition at line 28 of file diffTreeTool.py.

References funct.abs().

Referenced by edm::ThinnedAssociationsHelper.addAssociation(), RPCSummaryMapHisto.book(), RPCRollMapHisto.bookBarrel(), RPCRollMapHisto.bookEndcap(), RPCTTUMonitor.bookHistograms(), GlobalTest.bookHistograms(), RPCMonitorDigi.bookRollME(), RPCMonitorDigi.bookSectorRingME(), RPCMonitorDigi.bookWheelDiskME(), sistrip::MeasureLA.calibration_key(), RPCNameHelper.chamberName(), RPCEventSummary.clientOperation(), sistrip::RawToDigiUnpacker.createDigis(), sistrip::DigiToRaw.createFedBuffers_(), RPCRecHitProbabilityClient.dqmEndJob(), SiPixelLorentzAnglePCLHarvester.dqmEndJob(), RPCEventSummary.dqmEndLuminosityBlock(), RPCRawDataCountsHistoMaker.emptyReadoutErrorHisto(), RPCRawDataCountsHistoMaker.emptyReadoutErrorMapHisto(), RPCRawDataCountsHistoMaker.emptyRecordTypeHisto(), CalibrationScanSummaryFactory.extract(), CalibrationSummaryFactory.extract(), SummaryPlotFactory< CommissioningAnalysis * >.fill(), RPCChamberQuality.fillMonitorElements(), RPCBookFolderStructure.folderStructure(), RPCDqmClient.getMonitorElements(), RPCFEDIntegrity.labelBins(), main(), edm::service::IgProfService.makeDump(), RPCChamberQuality.myBooker(), RPCDaqInfo.myBooker(), RPCDataCertification.myBooker(), RPCDCSSummary.myBooker(), RPCMonitorDigi.performSourceOperation(), FWTriggerTableView.saveImageTo(), FWTableView.saveImageTo(), edm.validateLooper(), sistrip::EnsembleCalibrationLA.write_ensembles_text(), cmsswFiletrace.writeoutput(), edm::writeParameterValue.writeValue(), edm::writeParameterValue.writeValueInVector(), edm::writeParameterValue.writeValueInVectorWithSpace(), and edm::writeParameterValue.writeVector().

28 
29 def format (objDict, label, spacing=9, firstOnly = False):
30  '''return a formatted string for given object'''
31  value = objDict[label]
32  if firstOnly:
33  diff = 0.
34  else:
35  diff = objDict['delta_' + label]
36 
37  problem = False
38  if isinstance (value, float):
39  formatString = '%%%d.%df' % (spacing, spacing - 5)
40  retval = formatString % value
41  if abs(diff) > epsilon:
42  if options.delta:
43  retval += ' [' + formatString % (diff) + ']'
44  else:
45  retval += ' (' + formatString % (value + diff) + ')'
46  elif not firstOnly:
47  retval += ' ' * (spacing + 3)
48  return retval
49  else:
50  formatString = '%%%ds' % spacing
51  retval = formatString % value
52  if diff:
53  if isinstance (value, str):
54  retval += ' (' + formatString % diff + ')'
55  elif options.delta:
56  retval += ' [' + formatString % diff + ']'
57  else:
58  retval += ' (' + formatString % (value + diff) + ')'
59  elif not firstOnly:
60  retval += ' ' * (spacing + 3)
61  return retval
62 
Abs< T >::type abs(const T &t)
Definition: Abs.h:22
def diffTreeTool.getDictFromObject (   obj,
  varDict,
  prefix = '' 
)
Given a object and a prefix, fills an return dictionary with the
proper values

Definition at line 17 of file diffTreeTool.py.

17 
18 def getDictFromObject (obj, varDict, prefix = ''):
19  """Given a object and a prefix, fills an return dictionary with the
20  proper values"""
21  if prefix:
22  obj = getPieceFromObject (obj, prefix)
23  retval = {}
24  for key, description in varDict.items():
25  retval[key] = getPieceFromObject (obj, description)
26  return retval
27 
def getDictFromObject
Definition: diffTreeTool.py:17
def diffTreeTool.getPieceFromObject (   obj,
  description 
)
Returns piece from object 

Definition at line 12 of file diffTreeTool.py.

12 
13 def getPieceFromObject (obj, description):
14  """Returns piece from object """
15  parsed = GenObject.parseVariableTofill (description)
16  return GenObject.evaluateFunction (obj, parsed)
def getPieceFromObject
Definition: diffTreeTool.py:12

Variable Documentation

string diffTreeTool.action = "store_true"

Definition at line 66 of file diffTreeTool.py.

tuple diffTreeTool.cFile = re.sub(r'_C$', r'.C', re.sub(r'\.so$','', shlib))

Definition at line 82 of file diffTreeTool.py.

list diffTreeTool.diff = diffColl[index]

Definition at line 196 of file diffTreeTool.py.

tuple diffTreeTool.diffColl = getPieceFromObject(tree, name+'.diff')

Definition at line 187 of file diffTreeTool.py.

tuple diffTreeTool.diffContRE = re.compile(r'^class goDiffCont_(\w+)')

Definition at line 88 of file diffTreeTool.py.

int diffTreeTool.epsilon = 1

Definition at line 10 of file diffTreeTool.py.

list diffTreeTool.firstOnly = firstOnlyColl[index]

Definition at line 160 of file diffTreeTool.py.

tuple diffTreeTool.firstOnlyColl = getPieceFromObject(tree, name + '.firstOnly')

Definition at line 151 of file diffTreeTool.py.

string diffTreeTool.help = "Show deltas when difference is large enough."

Definition at line 67 of file diffTreeTool.py.

tuple diffTreeTool.index = getDictFromObject(firstOnly, indexSingleDict)

Definition at line 161 of file diffTreeTool.py.

dictionary diffTreeTool.indexDoubleDict = {'index':'index', 'delta_index':'delta_index'}

Definition at line 137 of file diffTreeTool.py.

dictionary diffTreeTool.indexSingleDict = {'index':'index'}

Definition at line 136 of file diffTreeTool.py.

tuple diffTreeTool.info = getDictFromObject(firstOnly, infoSingleDict)

Definition at line 163 of file diffTreeTool.py.

dictionary diffTreeTool.infoDoubleDict = {}

Definition at line 139 of file diffTreeTool.py.

dictionary diffTreeTool.infoSingleDict = {}

Definition at line 138 of file diffTreeTool.py.

tuple diffTreeTool.match = diffContRE.search(line)

Definition at line 101 of file diffTreeTool.py.

tuple diffTreeTool.name = ''

Definition at line 97 of file diffTreeTool.py.

tuple diffTreeTool.parser = optparse.OptionParser("Usage: %prog bla.root lib.so var1 [var2]")

Definition at line 64 of file diffTreeTool.py.

tuple diffTreeTool.rootfile = ROOT.TFile.Open(rootFilename)

Definition at line 128 of file diffTreeTool.py.

tuple diffTreeTool.rootFilename = args.pop(0)

Definition at line 76 of file diffTreeTool.py.

tuple diffTreeTool.runevent = getDictFromObject(tree, runeventDict, 'runevent')

Definition at line 148 of file diffTreeTool.py.

dictionary diffTreeTool.runeventDict = {'Run':'run', 'Event':'event'}

Definition at line 135 of file diffTreeTool.py.

list diffTreeTool.secondOnly = secondOnlyColl[index]

Definition at line 178 of file diffTreeTool.py.

tuple diffTreeTool.secondOnlyColl = getPieceFromObject(tree, name + '.secondOnly')

Definition at line 169 of file diffTreeTool.py.

tuple diffTreeTool.shlib = args.pop(0)

Definition at line 77 of file diffTreeTool.py.

tuple diffTreeTool.size = tree.GetEntries()

Definition at line 134 of file diffTreeTool.py.

tuple diffTreeTool.source = open(cFile, 'r')

Definition at line 94 of file diffTreeTool.py.

tuple diffTreeTool.stringSet = set()

Definition at line 95 of file diffTreeTool.py.

tuple diffTreeTool.tree = rootfile.Get('diffTree')

Definition at line 131 of file diffTreeTool.py.

tuple diffTreeTool.typeFoundSet = set()

Definition at line 96 of file diffTreeTool.py.

dictionary diffTreeTool.variableREDict = {}

Definition at line 90 of file diffTreeTool.py.

diffTreeTool.variables = args

Definition at line 78 of file diffTreeTool.py.

list diffTreeTool.working = []

Definition at line 117 of file diffTreeTool.py.