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

Classes

class  StoreTime

Functions

 fmtEvent (e, showTime=False)
 main ()

Variables

str __author__ = "Frank Winklmeier"

Detailed Description

Find event in FILE(s).

If no event identifier(s) are specified on the command line all events are printed.
In addition one can save the selected events into a new file.

Function Documentation

◆ fmtEvent()

trigbs_findevent.fmtEvent ( e,
showTime = False )

Definition at line 16 of file trigbs_findevent.py.

16def fmtEvent(e,showTime=False):
17 if showTime:
18 time = ' time=%d:%d' % (e.bc_time_seconds(),e.bc_time_nanoseconds())
19 else:
20 time = ''
21 return '[run=%d lb=%d l1id=%d gid=%d%s]' % (e.run_no(),e.lumi_block(),e.lvl1_id(),e.global_id(),time)
22

◆ main()

trigbs_findevent.main ( )

Definition at line 28 of file trigbs_findevent.py.

28def main():
29 parser = argparse.ArgumentParser(description=__doc__)
30
31 parser.add_argument('-f', '--file', metavar='FILE', nargs='*', default=[],
32 help='file name')
33
34 parser.add_argument('-g', '--globalid', type=int, action='store', nargs='*',
35 help='Global event ID')
36
37 parser.add_argument('-l', '--lvl1id', type=int, action='store', nargs='*',
38 help='LVL1 ID')
39
40 parser.add_argument('--lb', type=int, action='store', nargs='*',
41 help='Lumiblock')
42
43 parser.add_argument('-t', '--time', action=StoreTime, nargs='*',
44 help='Nanosecond time stamp (seconds:nanoseconds)')
45
46 parser.add_argument('-s', '--save', metavar='OUTFILE', nargs='?', action='store', const='trigbs_findevent',
47 help='Save selected events in OUTFILE')
48
49 parser.add_argument('-v', '--verbose', action='store_true',
50 help='Be verbose')
51
52 args = parser.parse_args()
53
54 ofs = None
55 if args.save is not None:
56 ofs = eformat.ostream(core_name=args.save)
57
58 for f in args.file:
59 ifs = eformat.istream(f)
60 if args.verbose:
61 print('==%s' % f)
62 for e in ifs:
63 found = True
64 if args.globalid is not None and e.global_id() not in args.globalid:
65 found = False
66 if args.lvl1id is not None and e.lvl1_id() not in args.lvl1id:
67 found = False
68 if args.lb is not None and e.lumi_block() not in args.lb:
69 found = False
70 if args.time is not None and (e.bc_time_seconds(),e.bc_time_nanoseconds()) not in args.time:
71 found = False
72 if found:
73 print('%s %s' % (f,fmtEvent(e,args.time is not None)))
74 if ofs:
75 ofs.write(e)
76
void print(char *figname, TCanvas *c1)
int main()
Definition hello.cxx:18

Variable Documentation

◆ __author__

str trigbs_findevent.__author__ = "Frank Winklmeier"
private

Definition at line 10 of file trigbs_findevent.py.