ATLAS Offline Software
Loading...
Searching...
No Matches
python.slimHLTBSFile Namespace Reference

Functions

 hi16 (word)
 lo16 (word)
 reducedLARFEB (data)
 reducedTILE (data)
 modify (event)

Variables

 input_file = sys.argv[1]
 output_file = sys.argv[2]
 input = eformat.istream([input_file])
 dr = EventStorage.pickDataReader(input_file)
 output
 tmp_file_name = output.last_filename()

Detailed Description

slimHLTBSFile.py

Module for removing raw and time/quality information from LAr data,
raw digits from Tile data, preprocessor information from L1Calo data and
pre-existing L2 and EF results. None of this information is currently used by
the HLT and removing it reduces file size by up to a factor 4.

Note that this requires datafiles to have energy readings

Function Documentation

◆ hi16()

python.slimHLTBSFile.hi16 ( word)

Definition at line 21 of file slimHLTBSFile.py.

21def hi16(word):
22 return (word&0xffff0000)>>16
23

◆ lo16()

python.slimHLTBSFile.lo16 ( word)

Definition at line 24 of file slimHLTBSFile.py.

24def lo16(word):
25 return word&0xffff
26

◆ modify()

python.slimHLTBSFile.modify ( event)

Definition at line 55 of file slimHLTBSFile.py.

55def modify(event):
56 new_event=eformat.write.FullEventFragment()
57 new_event.copy_header(event)
58 for rob in event:
59 newrob=eformat.write.ROBFragment(rob)
60 if rob.source_id().human_detector()=='TDAQ_CALO_PREPROC':
61 continue
62 if rob.source_id().human_detector()=='TDAQ_LVL2':
63 continue
64 if rob.source_id().human_detector()=='TDAQ_EVENT_FILTER':
65 continue
66 if rob.source_id().human_group()=="TILECAL":
67 data = rob.rod_data()
68 newdata=reducedTILE(data)
69 newrob.rod_data(newdata)
70
71 if rob.source_id().human_group()=="LAR" and rob.rod_minor_version()==11:
72 #should check that it really is physics format
73 data = rob.rod_data()
74 newdata=reducedLARFEB(data)
75 if len(data)>data[0]:
76 newdata+=[data[data[0]+ii] for ii in range(7)] #middle "ROD" header
77 data=data[data[0]+7:]
78 newdata+=reducedLARFEB(data)
79 newrob.rod_data(newdata)
80 new_event.append(newrob)
81 return new_event.readonly()
82

◆ reducedLARFEB()

python.slimHLTBSFile.reducedLARFEB ( data)

Definition at line 27 of file slimHLTBSFile.py.

27def reducedLARFEB(data):
28 sizeenergy=lo16(data[3])
29 offenergy=hi16(data[3])
30 nsamples=lo16(data[7])
31 radd=(nsamples+1)//2
32 total=18-8+83+radd+3
33 if total>data[0] or sizeenergy==0:
34 return [data[ii] for ii in range(data[0])]
35 newdata=[data[ii] for ii in range(total-3)+range(data[0]-3,data[0])] #one should actually recalculate checksum
36 newdata[0]=total
37 newdata[3]=(18<<16)+83+radd
38 newdata[4]=0 #no quality
39 newdata[5]=0 #no samples
40 for ii in range(offenergy,offenergy+9):
41 newdata[ii]=0 #zero masks
42 return newdata
43

◆ reducedTILE()

python.slimHLTBSFile.reducedTILE ( data)

Definition at line 44 of file slimHLTBSFile.py.

44def reducedTILE(data):
45 idx=0
46 newdata=[]
47 while idx<len(data):
48 size=data[idx+1]
49 type=data[idx+2]>>16&0xff
50 if type>1:
51 newdata+=[data[ii] for ii in range(idx,idx+size)]
52 idx+=size
53 return newdata
54

Variable Documentation

◆ dr

python.slimHLTBSFile.dr = EventStorage.pickDataReader(input_file)

Definition at line 91 of file slimHLTBSFile.py.

◆ input

python.slimHLTBSFile.input = eformat.istream([input_file])

Definition at line 90 of file slimHLTBSFile.py.

◆ input_file

python.slimHLTBSFile.input_file = sys.argv[1]

Definition at line 87 of file slimHLTBSFile.py.

◆ output

python.slimHLTBSFile.output
Initial value:
1= eformat.ostream(core_name="subset",
2 run_number=dr.runNumber(),
3 trigger_type=dr.triggerType(),
4 detector_mask=dr.detectorMask(),
5 beam_type=dr.beamType(),
6 beam_energy=dr.beamEnergy())

Definition at line 92 of file slimHLTBSFile.py.

◆ output_file

python.slimHLTBSFile.output_file = sys.argv[2]

Definition at line 88 of file slimHLTBSFile.py.

◆ tmp_file_name

python.slimHLTBSFile.tmp_file_name = output.last_filename()

Definition at line 100 of file slimHLTBSFile.py.