ATLAS Offline Software
Loading...
Searching...
No Matches
trigbs_rd1Only.py
Go to the documentation of this file.
1#!/usr/bin/env python
2
3# Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration
4"""
5Module for applying L1 prescales to the input data
6
7Used as a "-Z" plugin to athenaMT/PT:
8athenaMT/PT -Z TrigByteStreamTools.trigbs_prescaleL1 ...
9"""
10
11import cppyy
12cppyy.load_library('libTrigByteStreamToolsDict')
13
14def ints2bits(info):
15 if type(info)==int:
16 info=[info]
17 bits=[]
18 cnt=0
19 for word in info:
20 for i in range(32):
21 if word&(1<<i):
22 bits+=[cnt]
23 cnt+=1
24 return bits
25
26def modify(event):
27 """filter out events not triggered by L1_RD1_FILLED (bit 63) """
28
29 L1TAV=ints2bits(event.lvl1_trigger_info()[16:24])
30 if 63 in L1TAV:
31 #print 'ACCEPTED'
32 return event
33 else:
34 #print 'REJECTED'
35 return False
36