Thor functors for perpendicular momentum
(hope this is the right place since it looks like all the functors live in this project)
I'm thinking about developing Moore selections for Bs2* tagging, and it would be good to be able to compute the momentum of a track perpendicular to the direction between a primary and secondary vertex. At some point will need to consider if it makes sense to make full candidates or just have extra outputs for this use case, but for this issue I wanted to focus on the selections needed. There are a few possible ways to proceed, so it would be good to get some input.
With functors for the full components PX, PY, PZ and BPV VD X, Y, Z this can be calculated for a combination with access to the child particles. I think only BPVVDZ is available at the moment. I'm not sure if this would also need additional math functions to act on functors. This was essentially done in stripping with LoKi using a "preambulo" like
[
from LoKiPhys.decorators import *
, dx = (ACHILD(VFASPF(VX),1)-ACHILD(BPV(VX),1))
, dy = (ACHILD(VFASPF(VY),1)-ACHILD(BPV(VY),1))
, dz = (ACHILD(VFASPF(VZ),1)-ACHILD(BPV(VZ),1))
, norm = (max(sqrt(dx*dx+dy*dy+dz*dz),0))
, B_xdir = ((dx)/norm)
, B_ydir = ((dy)/norm)
, B_zdir = ((dz)/norm)
, pcos = (B_xdir*ACHILD(PX,2) + B_ydir*ACHILD(PY,2) + B_zdir*ACHILD(PZ,2))
, Km_pperp = sqrt(ACHILD(P2,2) - pow(pcos,2))
]
In any event it would be good I think to have all the component functors added, and I think that should be easy enough. But it may be good to have the full calculation accessible in a single functor in case it's useful in other contexts. I'm not quite sure how to get started with that, though.
Thanks for any help you can offer!