2 from PhysicsTools.HeppyCore.statistics.tree
import Tree
as Tree
8 if hasattr(other,
'integer'):
21 def add(self, trigger, run, lumi):
22 nEv = self.dict.setdefault( (trigger, run, lumi),
MyInteger(0) )
27 for rlt, count
in self.dict.iteritems():
28 lines.append(
': '.
join( [str(rlt), str(count)] ))
29 return '\n'.
join(lines)
31 def write(self, dirName, fileName='RLTInfo.root'):
32 f = TFile(
'/'.
join( [dirName, fileName]),
'RECREATE')
33 t = Tree(
'RLTInfo',
'HLT/Run/Lumi information')
37 t.var(
'trigger', int )
38 for rlt, count
in self.dict.iteritems():
40 t.fill(
'lumi', rlt[2])
41 t.fill(
'counts', count.integer)
46 if __name__ ==
'__main__':
49 rltinfo.add(
'HLT1', 128, 1)
50 rltinfo.add(
'HLT1', 128, 1)
51 rltinfo.add(
'HLT1', 128, 2)
52 rltinfo.add(
'HLT1', 129, 2)
53 rltinfo.add(
'HLT2', 129, 2)
55 for rlt, count
in rltinfo.dict.iteritems():
static std::string join(char **cmd)