ATLAS Offline Software
Classes | Functions | Variables
trigbs_findevent Namespace Reference

Classes

class  StoreTime
 

Functions

def fmtEvent (e, showTime=False)
 
def main ()
 

Variables

 __author__
 

Function Documentation

◆ fmtEvent()

def trigbs_findevent.fmtEvent (   e,
  showTime = False 
)

Definition at line 16 of file trigbs_findevent.py.

16 def 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()

def trigbs_findevent.main ( )

Definition at line 28 of file trigbs_findevent.py.

28 def 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('-t', '--time', action=StoreTime, nargs='*',
41  help='Nanosecond time stamp (seconds:nanoseconds)')
42 
43  parser.add_argument('-s', '--save', metavar='OUTFILE', nargs='?', action='store', const='trigbs_findevent',
44  help='Save selected events in OUTFILE')
45 
46  parser.add_argument('-v', '--verbose', action='store_true',
47  help='Be verbose')
48 
49  args = parser.parse_args()
50 
51  ofs = None
52  if args.save is not None:
53  ofs = eformat.ostream(core_name=args.save)
54 
55  for f in args.file:
56  ifs = eformat.istream(f)
57  if args.verbose:
58  print('==%s' % f)
59  for e in ifs:
60  found = True
61  if args.globalid is not None and e.global_id() not in args.globalid:
62  found = False
63  if args.lvl1id is not None and e.lvl1_id() not in args.lvl1id:
64  found = False
65  if args.time is not None and (e.bc_time_seconds(),e.bc_time_nanoseconds()) not in args.time:
66  found = False
67  if found:
68  print('%s %s' % (f,fmtEvent(e,args.time is not None)))
69  if ofs:
70  ofs.write(e)
71 

Variable Documentation

◆ __author__

trigbs_findevent.__author__
private

Definition at line 10 of file trigbs_findevent.py.

trigbs_findevent.fmtEvent
def fmtEvent(e, showTime=False)
Definition: trigbs_findevent.py:16
trigbs_findevent.main
def main()
Definition: trigbs_findevent.py:28
Muon::print
std::string print(const MuPatSegment &)
Definition: MuonTrackSteering.cxx:28