@@ -41,7 +41,7 @@ def get_muon_list_out(emu_product, mu_type, vhdl_dict):
4141 return mulist
4242
4343
44- def get_muon_list (emu_product , mu_type , vhdl_dict , check = False ):
44+ def get_muon_list (emu_product , mu_type , vhdl_dict , bx , check = False ):
4545 nexpected = 18
4646 if mu_type == "BARREL" :
4747 nexpected = 36
@@ -51,7 +51,7 @@ def get_muon_list(emu_product, mu_type, vhdl_dict, check=False):
5151 link_offset = vhdl_dict [mu_type + "_LOW" ]
5252 for mu in emu_product :
5353 loc_link = mu .link ()- link_offset
54- mu_tmp = Muon (vhdl_dict , mu_type = "IN" , obj = mu )
54+ mu_tmp = Muon (vhdl_dict , mu_type = "IN" , obj = mu , bx = bx )
5555 # only take muons from the right side of the detector
5656 if mu_type .endswith ("POS" ) and mu_tmp .etaBits < 0 :
5757 continue
@@ -61,10 +61,13 @@ def get_muon_list(emu_product, mu_type, vhdl_dict, check=False):
6161 # because we don't book all 72*3 muons but only 18*3/36*3
6262 loc_link = mu .link ()- link_offset
6363 if mulist [loc_link * 3 ].ptBits == 0 :
64+ mu_tmp .setBunchCounter (0 )
6465 mulist [loc_link * 3 ] = mu_tmp
6566 elif mulist [loc_link * 3 + 1 ].ptBits == 0 :
67+ mu_tmp .setBunchCounter (1 )
6668 mulist [loc_link * 3 + 1 ] = mu_tmp
6769 elif mulist [loc_link * 3 + 2 ].ptBits == 0 :
70+ mu_tmp .setBunchCounter (2 )
6871 mulist [loc_link * 3 + 2 ] = mu_tmp
6972
7073 if check :
@@ -160,13 +163,13 @@ def main():
160163 imd_prod = imd_handle .product ()
161164 imdmuons = get_muon_list_out (imd_prod , "IMD" , vhdl_dict )
162165 emu_bar_muons = bar_handle .product ()
163- bar_muons = get_muon_list (emu_bar_muons , "BARREL" , vhdl_dict )
166+ bar_muons = get_muon_list (emu_bar_muons , "BARREL" , vhdl_dict , i )
164167 emu_ovl_muons = ovl_handle .product ()
165- ovlp_muons = get_muon_list (emu_ovl_muons , "OVL_POS" , vhdl_dict )
166- ovln_muons = get_muon_list (emu_ovl_muons , "OVL_NEG" , vhdl_dict )
168+ ovlp_muons = get_muon_list (emu_ovl_muons , "OVL_POS" , vhdl_dict , i )
169+ ovln_muons = get_muon_list (emu_ovl_muons , "OVL_NEG" , vhdl_dict , i )
167170 emu_fwd_muons = fwd_handle .product ()
168- fwdp_muons = get_muon_list (emu_fwd_muons , "FWD_POS" , vhdl_dict )
169- fwdn_muons = get_muon_list (emu_fwd_muons , "FWD_NEG" , vhdl_dict )
171+ fwdp_muons = get_muon_list (emu_fwd_muons , "FWD_POS" , vhdl_dict , i )
172+ fwdn_muons = get_muon_list (emu_fwd_muons , "FWD_NEG" , vhdl_dict , i )
170173
171174 conversion_time = time .time () - evt_start - get_label_time
172175 input_buffer .writeFrameBasedInputBX (bar_muons , fwdp_muons , fwdn_muons , ovlp_muons , ovln_muons , calo_sums )
0 commit comments