ATLAS Offline Software
Loading...
Searching...
No Matches
trigbs_dumpPrescaleBits Namespace Reference

Functions

 my_dump (bsfile)
 my_comp (f1, f2)

Variables

str __doc__
 optparser
 default
 help
 action
 opt
 args
 res = hltResult()
dict featureSizes = {}
dict stats = {}
 HLTChain = cppyy.makeClass('HLT::Chain')

Function Documentation

◆ my_comp()

trigbs_dumpPrescaleBits.my_comp ( f1,
f2 )

Definition at line 77 of file trigbs_dumpPrescaleBits.py.

77def my_comp(f1, f2):
78 import pprint
79
80 one = cPickle.load(open(f1, "rb"))
81 two = cPickle.load(open(f2, "rb"))
82 print('.. eventdumps read in correctly %s %s' % (f1, f2))
83
84 if one == two:
85 print(".. the prescale bits are the same")
86 else:
87 diff=False
88 kone = set(one.keys())
89 ktwo = set(two.keys())
90 if kone != ktwo:
91 print(".... the event sets are different in the two files; one has: %d two has: %d events" % (len(kone), len(ktwo)))
92 print(".... will compare only events present in both sets")
93 komon = kone & ktwo
94 for k in komon:
95 if one[k] != two[k]:
96 print(".. event difference global_id: %d l1_id: %d, fmt: chain_counter: PS bit,... " % k)
97 print(".. event in file: %s " % opt.one)
98 pprint.pprint(one[k])
99 print(".. event in file: %s" % opt.two)
100 pprint.pprint(two[k])
101 diff=True
102 if not diff:
103 print('.. prescale bits are the same in all %d common events ' % len(komon))
104 else:
105 print('.. there are differences !')
106
107
108
void print(char *figname, TCanvas *c1)
STL class.

◆ my_dump()

trigbs_dumpPrescaleBits.my_dump ( bsfile)
Runs the dumping routines

Definition at line 43 of file trigbs_dumpPrescaleBits.py.

43def my_dump(bsfile):
44 """Runs the dumping routines"""
45
46 # open a file
47 print("="*100)
48 print("Opening %s" % bsfile)
49
50
51 events = {}
52
53 input = eformat.istream(bsfile)
54 subdet = eformat.helper.SubDetector.TDAQ_EVENT_FILTER if opt.ef else eformat.helper.SubDetector.TDAQ_LVL2
55
56 for event in input:
57 ev = ( event.global_id(), event.lvl1_id() )
58
59 chains = {}
60 for f in event.children():
61 if f.source_id().subdetector_id() == subdet:
62 res.load(f)
63 chains_data = list(res.getChainResult())
64 #nchains = chains_data[0]
65 for c in chains_data[1:]:
66 chain = HLTChain(c)
67 chains[chain.getChainCounter()] = chain.isPrescaled()
68 break
69
70 events[ev] = chains
71
72 output = open(opt.pickle, "wb")
73 cPickle.dump(events, output)
74 output.close()
75
76

Variable Documentation

◆ __doc__

str trigbs_dumpPrescaleBits.__doc__
private
Initial value:
1= """\
2Dumping HLT chains PS bit vs the chain counter and vs the L1 event number
3"""

Definition at line 5 of file trigbs_dumpPrescaleBits.py.

◆ action

trigbs_dumpPrescaleBits.action

Definition at line 21 of file trigbs_dumpPrescaleBits.py.

◆ args

trigbs_dumpPrescaleBits.args

Definition at line 33 of file trigbs_dumpPrescaleBits.py.

◆ default

trigbs_dumpPrescaleBits.default

Definition at line 18 of file trigbs_dumpPrescaleBits.py.

◆ featureSizes

dict trigbs_dumpPrescaleBits.featureSizes = {}

Definition at line 39 of file trigbs_dumpPrescaleBits.py.

◆ help

trigbs_dumpPrescaleBits.help

Definition at line 19 of file trigbs_dumpPrescaleBits.py.

◆ HLTChain

trigbs_dumpPrescaleBits.HLTChain = cppyy.makeClass('HLT::Chain')

Definition at line 41 of file trigbs_dumpPrescaleBits.py.

◆ opt

trigbs_dumpPrescaleBits.opt

Definition at line 33 of file trigbs_dumpPrescaleBits.py.

◆ optparser

trigbs_dumpPrescaleBits.optparser
Initial value:
1= optparse.OptionParser(usage = "%prog [options] FILES",
2 description = __doc__)

Definition at line 15 of file trigbs_dumpPrescaleBits.py.

◆ res

trigbs_dumpPrescaleBits.res = hltResult()

Definition at line 37 of file trigbs_dumpPrescaleBits.py.

◆ stats

dict trigbs_dumpPrescaleBits.stats = {}

Definition at line 40 of file trigbs_dumpPrescaleBits.py.