ATLAS Offline Software
Functions | Variables
trigbs_dumpPrescaleBits Namespace Reference

Functions

def my_dump (bsfile)
 
def my_comp (f1, f2)
 

Variables

 __doc__
 
 optparser
 
 usage
 
 description
 
 default
 
 help
 
 action
 
 opt
 
 args
 
 res
 
 featureSizes
 
 stats
 
 HLTChain
 

Function Documentation

◆ my_comp()

def trigbs_dumpPrescaleBits.my_comp (   f1,
  f2 
)

Definition at line 77 of file trigbs_dumpPrescaleBits.py.

77 def 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 

◆ my_dump()

def trigbs_dumpPrescaleBits.my_dump (   bsfile)
Runs the dumping routines

Definition at line 43 of file trigbs_dumpPrescaleBits.py.

43 def 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__

trigbs_dumpPrescaleBits.__doc__
private

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.

◆ description

trigbs_dumpPrescaleBits.description

Definition at line 16 of file trigbs_dumpPrescaleBits.py.

◆ featureSizes

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

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

Definition at line 15 of file trigbs_dumpPrescaleBits.py.

◆ res

trigbs_dumpPrescaleBits.res

Definition at line 37 of file trigbs_dumpPrescaleBits.py.

◆ stats

trigbs_dumpPrescaleBits.stats

Definition at line 40 of file trigbs_dumpPrescaleBits.py.

◆ usage

trigbs_dumpPrescaleBits.usage

Definition at line 15 of file trigbs_dumpPrescaleBits.py.

trigbs_dumpPrescaleBits.my_comp
def my_comp(f1, f2)
Definition: trigbs_dumpPrescaleBits.py:77
trigbs_dumpPrescaleBits.HLTChain
HLTChain
Definition: trigbs_dumpPrescaleBits.py:41
histSizes.list
def list(name, path='/')
Definition: histSizes.py:38
trigbs_dumpPrescaleBits.my_dump
def my_dump(bsfile)
Definition: trigbs_dumpPrescaleBits.py:43
CxxUtils::set
constexpr std::enable_if_t< is_bitmask_v< E >, E & > set(E &lhs, E rhs)
Convenience function to set bits in a class enum bitmask.
Definition: bitmask.h:224
Trk::open
@ open
Definition: BinningType.h:40
Muon::print
std::string print(const MuPatSegment &)
Definition: MuonTrackSteering.cxx:28