Documentation of 'hephysics.particle.LParticle' Java class.
LParticle
hephysics.particle

Class LParticle

  • All Implemented Interfaces:
    java.io.Serializable, java.lang.Comparable<LParticle>
    Direct Known Subclasses:
    HEParticle


    public class LParticle
    extends HepLorentzVector
    implements java.lang.Comparable<LParticle>, java.io.Serializable
    A class representing a Lorentz particle. It is based on four-Lorentz vector and extends HepLorentzVector. A particle can be represented by either (px,py,pz,E) or (x,y,z,time). In addition, you can define name, mass,charge and a parent particle as an object.
    See Also:
    Serialized Form
    • Constructor Detail

      • LParticle

        public LParticle()
        Define a dummy particle. Set Px,Py,Pz,mass to zero.
      • LParticle

        public LParticle(java.lang.String name)
        Define a particle with a name. Set Px,Py,Pz,mass to zero.
        Parameters:
        name - particle name
      • LParticle

        public LParticle(java.lang.String name,
                         double mass)
        Define a particle with a name and mass. Set Px,Py,Pz to zero.
        Parameters:
        name - particle name
        mass - mass
      • LParticle

        public LParticle(double px,
                         double py,
                         double pz)
        Define a 3-momentum or X,Y,Z position. Energy and mass are set to 0.
        Parameters:
        px - Px (or X_)
        py - Py (or Y)
        pz - Pz (or Z)
      • LParticle

        public LParticle(double px,
                         double py,
                         double pz,
                         double energy,
                         double mass)
        Define a particle in momentum or coordinate space.
        Parameters:
        px - Px (or X position)
        py - Py (or Y position)
        pz - Pz (or Z position)
        energy - energy (or time)
        mass - mass
      • LParticle

        public LParticle(double px,
                         double py,
                         double pz,
                         double energy)
        Define a particle in momentum or 4-space time. Mass is set to 0
        Parameters:
        px - Px or X position
        py - Py or Y position
        pz - Pz or Z position
        energy - energy or time
      • LParticle

        public LParticle(java.lang.String name,
                         double px,
                         double py,
                         double pz,
                         double energy,
                         double mass)
        Define a Lorentz particle in momentum or coordinate space.
        Parameters:
        name - Name of particle
        px - px (or X)
        py - py (or Y)
        pz - pz (or Z)
        energy - energy or time
        mass - mass
    • Method Detail

      • setPxPyPz

        public void setPxPyPz(double px,
                              double py,
                              double pz)
        Set Px,Py,Pz (or x,y,z)
        Parameters:
        px -
        py -
        pz -
      • setPxPyPzE

        public void setPxPyPzE(double px,
                               double py,
                               double pz,
                               double e)
        Set Px,Py,Pz and energy of a particle
        Parameters:
        px - Px momentum
        py - Py momentum
        pz - Pz momentum
        e - energy
      • setXYZT

        public void setXYZT(double x,
                            double y,
                            double z,
                            double t)
        Set x,y,z and time for a particle (vertex position)
        Parameters:
        x - X position
        y - Y position
        z - Z position
        t - time
      • setParent

        public void setParent(LParticle parent)
        Set a parent particle
        Parameters:
        parent - parent particle
      • scalePxPyPzE

        public void scalePxPyPzE(double scale)
        Scale all components (Px,Py,Px,E) by a factor C. Keep mass unchanged. This means all components are multiplied by this factor.
        Parameters:
        scale - factor used to multiply Px,Py,Pz,E components.
      • scaleXYZT

        public void scaleXYZT(double scale)
        Scale all components (X,Y,Z,T) by a factor This means all components are multiplied by this factor.
        Parameters:
        scale - factor used to multiply X,Y,Z,T components.
      • dividePxPyPzE

        public void dividePxPyPzE(double scale)
        Divide all components (Px,Py,Px,E) by a factor C. Useful for varints (integer) representation.
        Parameters:
        scale - factor used to divide Px,Py,Pz,E
      • getParent

        public LParticle getParent()
        Get a parent particle
        Returns:
        parent
      • add

        public void add(LParticle another)
        Add 2 particle
        Parameters:
        another - particle to be edded
      • getMass

        public double getMass()
        Get a mass
        Returns:
        mass
      • mass

        public double mass()
        Get a mass
        Returns:
        mass
      • getName

        public java.lang.String getName()
        Get a name
        Returns:
        name
      • setMass

        public void setMass(double mass)
        Set a mass
        Parameters:
        mass - Mass
      • setThetaPhiP

        public void setThetaPhiP(double theta,
                                 double phi,
                                 double P)
        Set HepLorentzVector using theta angle, phi and total momentum P. e = sqrt(P*P + mass*mass);
        pX = P*sin(theta)*cos(phi);
        pY = P*sin(theta)*sin(phi);
        pZ = P*cos(theta);

        Parameters:
        theta - theta
        phi - phi
        P - momentum
      • setPtEtaPhiE

        public void setPtEtaPhiE(double pt,
                                 double eta,
                                 double phi,
                                 double e)
        Set 4-momentum of a particle using transverse momentum (pt), pseudorapidity (Eta) and azimuthal angle (phi) and energy.

        Parameters:
        pt - transverse momentum of a particle.
        eta - eta (pseudorapidity) .
        phi - azimuthal angle
        e - energy
      • setPtEtaPhiM

        public void setPtEtaPhiM(double pt,
                                 double eta,
                                 double phi,
                                 double m)
        Set 4-momentum of a particle using transverse momentum (pt), pseudorapidity (eta) and azimuthal angle (phi) and mass (m). In this case, the energy is Math.sqrt(px*px+py*py+pz*pz-m*m).

        Parameters:
        pt - transverse momentum of a particle.
        eta - eta (pseudorapidity) .
        phi - azimuthal angle
        m - mass
      • abs

        public double abs()
        Magnitude
        Returns:
      • setCharge

        public void setCharge(double charge)
        Set charge
        Parameters:
        charge - charge
      • getCharge

        public double getCharge()
        Get charge
        Returns:
      • angle

        public double angle(LParticle momentum)
        Angle between 2 vectors in rad
        Parameters:
        momentum - parent particle
        Returns:
        angle in rad
      • calcMass

        public double calcMass()
        Get calculated mass as sqrt(e*e-px**2-py**2-pz**2)
        Returns:
      • twoBodyDecay

        public void twoBodyDecay(LParticle prod1,
                                 LParticle prod2,
                                 boolean randomRotate)
        Evaluates 4-vector of decay product in the rest frame of parent.
        Parameters:
        prod1 - first decay product
        prod2 - second decay product
        randomRotate - is Phi randomly rotated?
      • boost

        public void boost(LParticle parent)
        Lorentz Boost
        Parameters:
        parent - parent particle
      • print

        public void print()
        Print particle
      • doc

        public void doc()
        Show online documentation.
      • compareTo

        public int compareTo(LParticle o)
        Comparator. using perp2 for comparison (in increasing order)
        Specified by:
        compareTo in interface java.lang.Comparable<LParticle>
        Parameters:
        o -
        Returns:

DMelt 3.0 © DataMelt by jWork.ORG