Skip to content

Instantly share code, notes, and snippets.

@kdungs
Created November 28, 2014 08:57
Show Gist options
  • Save kdungs/4cd53e962ff7aa664917 to your computer and use it in GitHub Desktop.
Save kdungs/4cd53e962ff7aa664917 to your computer and use it in GitHub Desktop.
Extract streamer information for LHCb HLT1 Muon Streamers from TCK. The resulting JSON is put into https://github.com/kdungs/lhcb-hltflow via the `--config` option.
#!/usr/bin/env python
import json
import TCKUtils.utils as ut
TCK = 0x6A1710
streamers = [
'Hlt1TrackMuonUnit',
'Hlt1DiMuonHighMassStreamer',
'Hlt1DiMuonLowMassStreamer',
'Hlt1SingleMuonHighPTStreamer',
'Hlt1SingleMuonNoIPStreamer'
]
tree = ut.getConfigTree(TCK)
codes = [{'name': streamer.replace('Streamer', ''),
'code': tree.leafs()[streamer].props['Code']}
for streamer in streamers]
with open('hlt1streamers.json', 'w') as jsonfile:
json.dump(codes, jsonfile)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment