ATLAS Offline Software
Functions | Variables
trigbs_truncateEvents Namespace Reference

Functions

def readEvent (file)
 
def corruptEvent (event, badList)
 

Variables

 inFile
 
 input_file
 
 mode
 
 outFile
 
 output_file
 
 cnt
 
 binvalues
 
 event
 
 corrupt
 

Function Documentation

◆ corruptEvent()

def trigbs_truncateEvents.corruptEvent (   event,
  badList 
)

Definition at line 22 of file trigbs_truncateEvents.py.

22 def corruptEvent(event,badList):
23  newEvent=array.array('I')
24  headerSize=event[4+2]
25  robIdx=4+headerSize
26  #copy header - we will adjust size at the end
27  newEvent.fromlist(event.tolist()[0:robIdx])
28  reducedWords=0
29  while robIdx<len(event):
30  rob=event[robIdx:robIdx+event[robIdx+1]]
31  #corrupt rob
32  id=rob[4]
33  if (id >= badList[0]) and (id<=badList[1]):
34  print('Found rob to be truncated: %08x - org length %d' % (id,len(rob)))
35  if (len(rob)>50): #don't truncate basically empty fragments
36  newrob=array.array('I',rob[0:len(rob)-20])
37  reducedWords+=20
38  newrob[1]-=20
39  newrob[6]|=(1<<27)|8 #mark as truncated
40  #make sure trailer is messed up
41  newrob[-1]=0xfe77efdd
42  newrob[-2]=0xfe77efdd
43  newrob[-3]=0xfe77efdd
44  rob=newrob
45  else:
46  print('good rob %08x' % id)
47 # newEvent.fromlist(rob.tolist())
48  newEvent.extend(rob)
49  robIdx+=event[robIdx+1]
50  newEvent[3]-=4*reducedWords
51  newEvent[5]-=reducedWords
52  return newEvent
53 
54 input_file=sys.argv[1]
55 output_file=sys.argv[2]
56 

◆ readEvent()

def trigbs_truncateEvents.readEvent (   file)

Definition at line 10 of file trigbs_truncateEvents.py.

10 def readEvent(file):
11  event = array.array('I')
12  event.read(file, 4)
13  if event[0]!=0x1234cccc:
14  inFile.seek(-16,1)
15  return None
16 # for val in event:
17 # print '%08x' % val
18 
19  event.read(file, event[3]/4)
20  return event
21 

Variable Documentation

◆ binvalues

trigbs_truncateEvents.binvalues

Definition at line 63 of file trigbs_truncateEvents.py.

◆ cnt

trigbs_truncateEvents.cnt

Definition at line 61 of file trigbs_truncateEvents.py.

◆ corrupt

trigbs_truncateEvents.corrupt

Definition at line 77 of file trigbs_truncateEvents.py.

◆ event

trigbs_truncateEvents.event

Definition at line 71 of file trigbs_truncateEvents.py.

◆ inFile

trigbs_truncateEvents.inFile

Definition at line 57 of file trigbs_truncateEvents.py.

◆ input_file

trigbs_truncateEvents.input_file

Definition at line 57 of file trigbs_truncateEvents.py.

◆ mode

trigbs_truncateEvents.mode

Definition at line 57 of file trigbs_truncateEvents.py.

◆ outFile

trigbs_truncateEvents.outFile

Definition at line 58 of file trigbs_truncateEvents.py.

◆ output_file

trigbs_truncateEvents.output_file

Definition at line 58 of file trigbs_truncateEvents.py.

trigbs_truncateEvents.readEvent
def readEvent(file)
Definition: trigbs_truncateEvents.py:10
trigbs_truncateEvents.corruptEvent
def corruptEvent(event, badList)
Definition: trigbs_truncateEvents.py:22
Muon::print
std::string print(const MuPatSegment &)
Definition: MuonTrackSteering.cxx:28