ml4eft.preproc.lhe_reader.Kinematics
ml4eft.preproc.lhe_reader.Kinematics#
- class ml4eft.preproc.lhe_reader.Kinematics(particle)[source]#
Bases:
pylhe.LHEParticle
LHE kinematics class
- __init__(particle)[source]#
Loads and combines particles as read from a LHE file
- Parameters
particle (
pylhe.LHEParticle
) – LHE particle object
Examples
We consider \(pp\rightarrow ZH \rightarrow \ell^+\ell^-b\bar{b}\;\) as a simple example
>>> import pylhe >>> lhe_init = pylhe.read_lhe_init(path_to_lhe)
Loop over the events in the LHE file and append kinematics
>>> events = [] >>> for e in pylhe.read_lhe(path_to_lhe): ... incoming_part = [] ... # create particle instances ... for part in e.particles: ... if part.id in [11, 13]: # e^- or \mu^- ... l1 = lhe.Kinematics(part) ... elif part.id in [-11, -13]: # e^+ or \mu^+ ... l2 = lhe.Kinematics(part) ... elif part.id == 5: # b ... b = lhe.Kinematics(part) ... elif part.id == -5: #bbar ... bbar = lhe.Kinematics(part) ... ... # Particle systems can be created by adding the separate particle instances ... ll = l1 + l2 # dilepton system ... bb = b + bbar # b bbar sytem ... events.append([l1.get_pt(), l2.get_pt(), ll.get_invariant_mass()])
events
now contains the requested kinematics for all events in the LHE file
Methods
__init__
(particle)Loads and combines particles as read from a LHE file
add_system
(dict)Returns a class instance of
pylhe.LHEParticle
fromstring
(string)Returns the invariant mass in GeV
get_p
()Returns the magnitude of the 3-momentum
get_phi
()Returns the azimuthal angle in radians with respect to the x-axis
Returns the pseudorapidity \(\eta\)
get_pt
()Returns the transverse momentum in GeV
Returns the rapidity \(Y\)
Returns the scattering angle in radians with respect to the beam-axis
mothers
()Attributes
fieldnames
- classmethod add_system(dict)[source]#
Returns a class instance of
pylhe.LHEParticle
- Parameters
dict (dict) – Combined particle dictionary
- Returns
Kinematics object of the combined system
- Return type
- get_p()[source]#
Returns the magnitude of the 3-momentum
- Returns
Magnitude of the 3-momentum
- Return type
- get_phi()[source]#
Returns the azimuthal angle in radians with respect to the x-axis
- Returns
phi – Azimuthal angle with respect to the y-axis in the transverse plane
- Return type
- get_pseudorapidity()[source]#
Returns the pseudorapidity \(\eta\)
- Returns
eta – Pseudorapidity
- Return type