ATLAS Offline Software
Functions | Variables
trigbs_createHLTBSTestFile Namespace Reference

Functions

def modify (event)
 

Variables

 id
 
 lumi
 
 runno
 
 runs
 
 input_file
 
 output_file
 
 input
 
 dr
 
 output
 
 core_name
 
 run_number
 
 trigger_type
 
 detector_mask
 
 beam_type
 
 beam_energy
 
 tmp_file_name
 

Function Documentation

◆ modify()

def trigbs_createHLTBSTestFile.modify (   event)
Fills in the MUCTPi ROB).

Definition at line 25 of file trigbs_createHLTBSTestFile.py.

25 def modify(event):
26  """Fills in the MUCTPi ROB)."""
27  global id
28  global runs
29  global runno
30  global lumi
31  id+=1
32 
33  map=[[eformat.helper.SubDetector.TDAQ_MUON_CTP_INTERFACE,0,1]]
34  DaqRobs=[None]*len(map)
35 
36  for rob in event:
37  cnt=0
38  for match in map:
39  if rob.source_id()==eformat.helper.SourceIdentifier(match[0],match[1]):
40  DaqRobs[cnt]=rob
41  cnt+=1
42 
43 
44  #work around corrupted events:
45  #new_event=eformat.write.FullEventFragment(event)
46  new_event=eformat.write.FullEventFragment()
47  new_event.copy_header(event)
48  if not event.run_no() in runs:
49  runs.append(event.run_no())
50  lumi+=1
51  new_event.run_no(runno) #fake it to avoid complaints and get latest conditions
52  new_event.lumi_block(lumi)
53  new_event.lvl1_id(id)
54  new_event.global_id(id)
55  for rob in event:
56  keep=True
57  for match in map:
58  if rob.source_id()==eformat.helper.SourceIdentifier(match[0],match[2]):
59  keep=False
60  break
61  if keep:
62  newrob=eformat.write.ROBFragment(rob)
63  newrob.rod_lvl1_id(id)
64  newrob.rod_run_no(runno)
65  newrob.checksum_type(0)
66  newrob.rod_lvl1_trigger_type(event.lvl1_trigger_type())
67  if rob.source_id()==eformat.helper.SourceIdentifier(eformat.helper.SubDetector.TDAQ_CTP,1):
68  newrob.rod_detev_type(1<<16|lumi)
69  new_event.append(newrob)
70  for idx in range(len(map)):
71  if DaqRobs[idx]:
72  rob=eformat.write.ROBFragment(DaqRobs[idx])
73  rob.source_id(eformat.helper.SourceIdentifier(map[idx][0],map[idx][2]))
74  rob.rod_lvl1_id(id)
75  rob.rod_run_no(runno)
76  rob.checksum_type(0)
77  rob.rod_lvl1_trigger_type(event.lvl1_trigger_type())
78  if map[idx][0]==eformat.helper.SubDetector.TDAQ_CTP:
79  version=rob.rod_minor_version()&0x1f
80  if version:
81  ctpSkip=(rob.rod_minor_version()>>8)&0x3f
82  else:
83  ctpSkip=(rob.rod_detev_type()>>16)&0x3f
84  data=[DaqRobs[idx].rod_data()[0],DaqRobs[idx].rod_data()[1]]
85  for ii in range(30):
86  data+=[DaqRobs[idx].rod_data()[2+ctpSkip*30+ii]]
87  rob.rod_data(data)
88  if map[idx][0]==eformat.helper.SubDetector.TDAQ_MUON_CTP_INTERFACE:
89  data=[]
90  muctpBC=(DaqRobs[idx].rod_data()[0]>>18)&7
91  for word in DaqRobs[idx].rod_data()[1:]:
92  if (word>>14)&7==muctpBC and (word>>26)&1:
93  data+=[(word&0x3fff)|(((word>>17)&0x1ff)<<14)]
94  if len(data)==0:
95  rob=eformat.write.ROBFragment()
96  rob.copy_header(DaqRobs[idx])
97  rob.source_id(eformat.helper.SourceIdentifier(map[idx][0],map[idx][2]))
98  else:
99  rob.rod_data(data)
100  new_event.append(rob)
101  else:
102  rob=eformat.write.ROBFragment()
103  rob.source_id(eformat.helper.SourceIdentifier(map[idx][0],map[idx][2]))
104  new_event.append(rob)
105  return new_event.readonly()
106 

Variable Documentation

◆ beam_energy

trigbs_createHLTBSTestFile.beam_energy

Definition at line 124 of file trigbs_createHLTBSTestFile.py.

◆ beam_type

trigbs_createHLTBSTestFile.beam_type

Definition at line 123 of file trigbs_createHLTBSTestFile.py.

◆ core_name

trigbs_createHLTBSTestFile.core_name

Definition at line 119 of file trigbs_createHLTBSTestFile.py.

◆ detector_mask

trigbs_createHLTBSTestFile.detector_mask

Definition at line 122 of file trigbs_createHLTBSTestFile.py.

◆ dr

trigbs_createHLTBSTestFile.dr

Definition at line 118 of file trigbs_createHLTBSTestFile.py.

◆ id

trigbs_createHLTBSTestFile.id

Definition at line 21 of file trigbs_createHLTBSTestFile.py.

◆ input

trigbs_createHLTBSTestFile.input

Definition at line 117 of file trigbs_createHLTBSTestFile.py.

◆ input_file

trigbs_createHLTBSTestFile.input_file

Definition at line 113 of file trigbs_createHLTBSTestFile.py.

◆ lumi

trigbs_createHLTBSTestFile.lumi

Definition at line 22 of file trigbs_createHLTBSTestFile.py.

◆ output

trigbs_createHLTBSTestFile.output

Definition at line 119 of file trigbs_createHLTBSTestFile.py.

◆ output_file

trigbs_createHLTBSTestFile.output_file

Definition at line 114 of file trigbs_createHLTBSTestFile.py.

◆ run_number

trigbs_createHLTBSTestFile.run_number

Definition at line 120 of file trigbs_createHLTBSTestFile.py.

◆ runno

trigbs_createHLTBSTestFile.runno

Definition at line 23 of file trigbs_createHLTBSTestFile.py.

◆ runs

trigbs_createHLTBSTestFile.runs

Definition at line 24 of file trigbs_createHLTBSTestFile.py.

◆ tmp_file_name

trigbs_createHLTBSTestFile.tmp_file_name

Definition at line 127 of file trigbs_createHLTBSTestFile.py.

◆ trigger_type

trigbs_createHLTBSTestFile.trigger_type

Definition at line 121 of file trigbs_createHLTBSTestFile.py.

trigbs_createHLTBSTestFile.modify
def modify(event)
Definition: trigbs_createHLTBSTestFile.py:25
plotBeamSpotVxVal.range
range
Definition: plotBeamSpotVxVal.py:195