Currently, we define muons from secondary vertices (in wremnants/production/muon_selection.py) requiring
goodMuonsSelection += "Muon_sip3d > 4.0 && wrem::hasMatchDR2(Muon_correctedEta,Muon_correctedPhi,SV_eta[goodSV],SV_phi[goodSV], 0.01)"
with "goodSV" secondary vertices defined as
df = df.Define(f"goodSV", f"SV_dlenSig > {dlenSig} && SV_ntracks >= {ntracks}")
with the default values set to dlenSig=4.0, ntracks=0
This definition could be modified to something like:
df = df.Define("Muon_goodSV", "ROOT::VecOps::Take(goodSV, Muon_svIdx, 0)")
goodMuonsSelection += " && Muon_sip3d > 4.0 && Muon_goodSV"
Muon_svIdx does the match in a different way, by requiring that the muon inner track was used to form the selected secondary vertex (if the track was used in multiple secondary vertices, the first is used). It does not use any geomatrical DR matching.
This definition is physically more correct, but the first time it was implemented it was giving unexpected results, so it should be investigated again with care
In the currently used selection, if kept, one could also set SV_ntracks >= 1, since at least one track should have existed to form the vertex (but most likely the actual number was even larger).
Currently, we define muons from secondary vertices (in wremnants/production/muon_selection.py) requiring
with "goodSV" secondary vertices defined as
df = df.Define(f"goodSV", f"SV_dlenSig > {dlenSig} && SV_ntracks >= {ntracks}")with the default values set to dlenSig=4.0, ntracks=0
This definition could be modified to something like:
Muon_svIdx does the match in a different way, by requiring that the muon inner track was used to form the selected secondary vertex (if the track was used in multiple secondary vertices, the first is used). It does not use any geomatrical DR matching.
This definition is physically more correct, but the first time it was implemented it was giving unexpected results, so it should be investigated again with care
In the currently used selection, if kept, one could also set SV_ntracks >= 1, since at least one track should have existed to form the vertex (but most likely the actual number was even larger).