LoKiPhysMC: add custom mc-truth matcher for photons
- add new algorithm MCTuthPhoton to create "custom" MC-truth links for some interesting MC-photons and neutral protoparticles
e.g. build MC-truth for photons from Bs -> phi(1020) gamma decays:
from Configurables import LoKi__MCTruthPhoton as CustomPP2MC
alg = CustomPP2MC('Custom')
alg.EnergyFraction = (0.1,2)
alg.MaxChi2 = 4
##
alg.PropertiesPrint = True
alg.Preambulo = [
"from GaudiKernel.SystemOfUnits import GeV, MeV, cm" ,
]
alg.Code = """
( MCPT > 100 * MeV ) & MCDECTREE ( 'Beauty -> (phi(1020) => K+ K-) ^gamma' )
"""
Or a bit more generic case:
alg.Preambulo = [
"from GaudiKernel.SystemOfUnits import GeV, MeV, cm" ,
"from LoKiCore.functions import in_range"
]
alg.Code = """
( MCPZ > 1 * GeV ) &
( MCPT > 0.1 * GeV ) &
MCFROMDECAYS &
( abs ( MCPX / MCPZ ) < 0.350 ) &
( abs ( MCPY / MCPZ ) < 0.250 ) &
in_range ( -20*cm , MCVFASPF( MCVZ ) , 20*cm )
"""
MC-mathching is performed using the spatial matching of photon direction and LHCb::CaloPosition ( using data on center&spread) using chi2. for inner/middle zones chi2<1 has almost 100% efficiency, for outer zone the distribution is a bit wider, but efficiency for chi2<2 requirement is close to 100%
150 ++----+----+----+----+----+----+----+----+----+----+
|| . . . . . . . . . |
|| . . . . . . . . . |
|| . . . . . . . . . |
|| . . . . . . . . . |
112 ++.................................................+
|| . . . . . . . . . |
|** . . . . . . . . . |
|*** . . . . . . . . . |
|*** . . . . . . . . . |
75 +***...............................................+
|*** . . . . . . . . . |
|*** . . . . . . . . . |
|**** . . . . . . . . . |
|**** . . . . . . . . . |
37.5 +****..............................................+
|*****. . . . . . . . . |
|****** . . . . . . . . |
|********* . . . . . . . . |
|*********** . . . . . . . |
0 *-++----+----+***************************************->*
U
N O
D V
E E
R R
F F
L 0 0 1 1 2 2 3 3 L
O . . . . . . . . O
W 00 4 8 2 6 2 4 8 2 6 4 W
Optionally the criteria on E(mc)/E(calo) can be applied.
Typical usage, e.g. in Bender:
bender_alg = ...
bender_alg.PP2MCs = [
'Relations/Rec/ProtoP/Charged' ,
'Relations/Rec/ProtoP/Upstream' ,
'Relations/Rec/ProtoP/Custom' ]
or for mcMatch utility:
... = mcMatch ( ... , strings( [
'Relations/Rec/ProtoP/Charged' ,
'Relations/Rec/ProtoP/Upstream' ,
'Relations/Rec/ProtoP/Custom' ] ) , ... )