test
CMS 3D CMS Logo

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

Functions

def root2map
 

Variables

string oname = "%s/%s"
 
tuple parser
 
tuple summary = root2map(a,options.jsonAnalyzer,options.treeName)
 

Function Documentation

def heppy_report.root2map (   dir,
  ana,
  treename 
)

Definition at line 5 of file heppy_report.py.

References bitset_utilities.append(), and list().

5 
6 def root2map(dir,ana,treename):
7  import ROOT
8  tfile = ROOT.TFile.Open("%s/%s/%s.root"%(dir,ana,treename))
9  if not tfile:
10  print "Error: dir %s does not contain %s/%s.root" % (dir,ana,treename)
11  return None
12  tree = tfile.Get(treename)
13  if not tree:
14  print "Error: rootfile %s/%s/%s.root does not contain a TTree %s" % (dir,ana,treename,treename)
15  return None
16  jsonind = {}
17  for e in xrange(tree.GetEntries()):
18  tree.GetEntry(e)
19  run,lumi = tree.run, tree.lumi
20  if run not in jsonind:
21  jsonind[run] = [lumi]
22  else:
23  jsonind[run].append(lumi)
24  # remove duplicates
25  for run in jsonind:
26  jsonind[run] = list(set(jsonind[run]))
27 
28  nruns = len(jsonind)
29  nlumis = sum(len(v) for v in jsonind.itervalues())
30  jsonmap = {}
31  for r,lumis in jsonind.iteritems():
32  if len(lumis) == 0: continue # shouldn't happen
33  lumis.sort()
34  ranges = [ [ lumis[0], lumis[0] ] ]
35  for lumi in lumis[1:]:
36  if lumi == ranges[-1][1] + 1:
37  ranges[-1][1] = lumi
38  else:
39  ranges.append([lumi,lumi])
40  jsonmap[r] = ranges
41  return (jsonmap, nruns, nlumis)
boost::dynamic_bitset append(const boost::dynamic_bitset<> &bs1, const boost::dynamic_bitset<> &bs2)
this method takes two bitsets bs1 and bs2 and returns result of bs2 appended to the end of bs1 ...
How EventSelector::AcceptEvent() decides whether to accept an event for output otherwise it is excluding the probing of A single or multiple positive and the trigger will pass if any such matching triggers are PASS or EXCEPTION[A criterion thatmatches no triggers at all is detected and causes a throw.] A single negative with an expectation of appropriate bit checking in the decision and the trigger will pass if any such matching triggers are FAIL or EXCEPTION A wildcarded negative criterion that matches more than one trigger in the trigger list("!*","!HLTx*"if it matches 2 triggers or more) will accept the event if all the matching triggers are FAIL.It will reject the event if any of the triggers are PASS or EXCEPTION(this matches the behavior of"!*"before the partial wildcard feature was incorporated).Triggers which are in the READY state are completely ignored.(READY should never be returned since the trigger paths have been run

Variable Documentation

string heppy_report.oname = "%s/%s"

Definition at line 55 of file heppy_report.py.

Referenced by CocoaDaqReaderRoot.BuildMeasurementsFromOptAlign(), OpticalObjectMgr.findOptOs(), Model.readMeasurementsFromFile(), and CocoaDaqReaderText.ReadNextEvent().

tuple heppy_report.parser
Initial value:
1 = OptionParser(usage='%prog <target_directories> [options]',
2  description='Check the output of the JSONAnalyzer and produce a json file of the processed runs and lumisections')

Definition at line 43 of file heppy_report.py.

tuple heppy_report.summary = root2map(a,options.jsonAnalyzer,options.treeName)

Definition at line 53 of file heppy_report.py.