diff --git a/include/HEJ/EventReader.hh b/include/HEJ/EventReader.hh index f001f6a..5a81e3f 100644 --- a/include/HEJ/EventReader.hh +++ b/include/HEJ/EventReader.hh @@ -1,44 +1,44 @@ /** \file * \brief Header file for event reader interface * * This header defines an abstract base class for reading events from files. * * \authors The HEJ collaboration (see AUTHORS for details) * \date 2019 * \copyright GPLv2 or later */ #pragma once #include <memory> #include <string> #include "LHEF/LHEF.h" namespace HEJ{ class EventData; // Abstract base class for reading events from files struct EventReader { //! Read an event virtual bool read_event() = 0; //! Access header text virtual std::string const & header() const = 0; //! Access run information virtual LHEF::HEPRUP const & heprup() const = 0; //! Access last read event virtual LHEF::HEPEUP const & hepeup() const = 0; virtual ~EventReader() = default; }; //! Factory function for event readers /** - * @param infile The name of the input file - * @returns A pointer to an instance of an EventReader - * for the input file + * @param filename The name of the input file + * @returns A pointer to an instance of an EventReader + * for the input file */ std::unique_ptr<EventReader> make_reader(std::string const & filename); } diff --git a/include/HEJ/HepMC3Interface.hh b/include/HEJ/HepMC3Interface.hh index 610c81c..b4bffeb 100644 --- a/include/HEJ/HepMC3Interface.hh +++ b/include/HEJ/HepMC3Interface.hh @@ -1,81 +1,79 @@ /** \file * \brief Header file for the HepMC3Interface * * \authors The HEJ collaboration (see AUTHORS for details) * \date 2019 * \copyright GPLv2 or later */ #pragma once #include <array> #include <sys/types.h> #include <vector> #include "HEJ/PDG_codes.hh" namespace HepMC3{ class GenCrossSection; class GenEvent; } namespace LHEF{ class HEPRUP; } namespace HEJ{ class Event; class EventParameters; //! This class converts the Events into HepMC3::GenEvents /** * \details The output is depended on the HepMC3 version HEJ is compiled with, * both HepMC3 2 and HepMC3 3 are supported. If HEJ 2 is compiled * without HepMC3 calling this interface will throw an error. * * This interface will also keep track of the cross section of all the events that * being fed into it. */ class HepMC3Interface{ public: HepMC3Interface(LHEF::HEPRUP const &); /** * \brief main function to convert an event into HepMC3::GenEvent * * \param event Event to convert * \param weight_index optional selection of specific weight * (negative value gives central weight) */ HepMC3::GenEvent operator()(Event const & event, ssize_t weight_index = -1); /** * \brief initialise the event kinematics (everything but the weights) * * \param event Event to convert - * \param weight_index optional selection of specific weight - * (negative value gives central weight) */ HepMC3::GenEvent init_kinematics(Event const & event); /** * \brief Sets the central value from \p event to \p out_ev * * \param out_ev HepMC3::GenEvent to write to * \param event Event to convert * \param weight_index optional selection of specific weight * (negative value gives "central") */ void set_central(HepMC3::GenEvent & out_ev, Event const & event, ssize_t weight_index = -1); /** * \brief Add the event \p variations to \p out_ev */ void add_variation(HepMC3::GenEvent & out_ev, std::vector<EventParameters> const & variations); private: std::array<ParticleID,2> beam_particle_; std::array<double,2> beam_energy_; size_t event_count_; double tot_weight_; double tot_weight2_; HepMC3::GenCrossSection cross_section() const; }; } diff --git a/include/HEJ/HepMCInterface.hh b/include/HEJ/HepMCInterface.hh index d32bebd..9101ba9 100644 --- a/include/HEJ/HepMCInterface.hh +++ b/include/HEJ/HepMCInterface.hh @@ -1,81 +1,79 @@ /** \file * \brief Header file for the HepMCInterface * * \authors The HEJ collaboration (see AUTHORS for details) * \date 2019 * \copyright GPLv2 or later */ #pragma once #include <array> #include <sys/types.h> #include <vector> #include "HEJ/PDG_codes.hh" namespace HepMC{ class GenCrossSection; class GenEvent; } namespace LHEF{ class HEPRUP; } namespace HEJ{ class Event; class EventParameters; //! This class converts the Events into HepMC::GenEvents /** * \details The output is depended on the HepMC version HEJ is compiled with, * both HepMC 2 and HepMC 3 are supported. If HEJ 2 is compiled * without HepMC calling this interface will throw an error. * * This interface will also keep track of the cross section of all the events that * being fed into it. */ class HepMCInterface{ public: HepMCInterface(LHEF::HEPRUP const &); /** * \brief main function to convert an event into HepMC::GenEvent * * \param event Event to convert * \param weight_index optional selection of specific weight * (negative value gives central weight) */ HepMC::GenEvent operator()(Event const & event, ssize_t weight_index = -1); /** * \brief initialise the event kinematics (everything but the weights) * * \param event Event to convert - * \param weight_index optional selection of specific weight - * (negative value gives central weight) */ HepMC::GenEvent init_kinematics(Event const & event); /** * \brief Sets the central value from \p event to \p out_ev * * \param out_ev HepMC::GenEvent to write to * \param event Event to convert * \param weight_index optional selection of specific weight * (negative value gives "central") */ void set_central(HepMC::GenEvent & out_ev, Event const & event, ssize_t weight_index = -1); /** * \brief Add the event \p variations to \p out_ev */ void add_variation(HepMC::GenEvent & out_ev, std::vector<EventParameters> const & variations); private: std::array<ParticleID,2> beam_particle_; std::array<double,2> beam_energy_; size_t event_count_; double tot_weight_; double tot_weight2_; HepMC::GenCrossSection cross_section() const; }; } diff --git a/include/HEJ/currents.hh b/include/HEJ/currents.hh index d298592..7780f71 100644 --- a/include/HEJ/currents.hh +++ b/include/HEJ/currents.hh @@ -1,1216 +1,1215 @@ /** * \authors The HEJ collaboration (see AUTHORS for details) * \date 2019 * \copyright GPLv2 or later */ /** \file * \brief Functions computing the square of current contractions. * * This file contains all the necessary functions to compute the current * contractions for all valid HEJ processes. PJETS, H+JETS and W+JETS along * with some unordered counterparts. * * @TODO add a namespace */ #pragma once #include <complex> #include <vector> #include <ostream> #include <CLHEP/Vector/LorentzVector.h> typedef std::complex<double> COM; typedef COM current[4]; typedef CLHEP::HepLorentzVector HLV; //! Square of qQ->qenuQ W+Jets Scattering Current /** * @param p1out Momentum of final state quark * @param plbar Momentum of final state anti-lepton * @param pl Momentum of final state lepton * @param p1in Momentum of initial state quark * @param p2out Momentum of final state quark * @param p2in Momentum of intial state quark * @returns Square of the current contractions for qQ->qenuQ Scattering * * This returns the square of the current contractions in qQ->qenuQ scattering * with an emission of a W Boson. */ double ME_W_qQ (HLV p1out, HLV plbar, HLV pl, HLV p1in, HLV p2out, HLV p2in); //! Square of qbarQ->qbarenuQ W+Jets Scattering Current /** * @param p1out Momentum of final state anti-quark * @param plbar Momentum of final state anti-lepton * @param pl Momentum of final state lepton * @param p1in Momentum of initial state anti-quark * @param p2out Momentum of final state quark * @param p2in Momentum of intial state quark * @returns Square of the current contractions for qbarQ->qbarenuQ Scattering * * This returns the square of the current contractions in qbarQ->qbarenuQ * scattering with an emission of a W Boson. */ double ME_W_qbarQ (HLV p1out, HLV plbar, HLV pl, HLV p1in, HLV p2out, HLV p2in); //! Square of qQbar->qenuQbar W+Jets Scattering Current /** * @param p1out Momentum of final state quark * @param plbar Momentum of final state anti-lepton * @param pl Momentum of final state lepton * @param p1in Momentum of initial state quark * @param p2out Momentum of final state anti-quark * @param p2in Momentum of intial state anti-quark * @returns Square of the current contractions for qQbar->qenuQbar Scattering * * This returns the square of the current contractions in qQbar->qenuQbar * scattering with an emission of a W Boson. */ double ME_W_qQbar (HLV p1out, HLV plbar, HLV pl, HLV p1in, HLV p2out, HLV p2in); //! Square of qbarQbar->qbarenuQbar W+Jets Scattering Current /** * @param p1out Momentum of final state anti-quark * @param plbar Momentum of final state anti-lepton * @param pl Momentum of final state lepton * @param p1in Momentum of initial state anti-quark * @param p2out Momentum of final state anti-quark * @param p2in Momentum of intial state anti-quark * @returns Square of the current contractions for qbarQbar->qbarenuQbar Scattering * * This returns the square of the current contractions in qbarQbar->qbarenuQbar * scattering with an emission of a W Boson. */ double ME_W_qbarQbar (HLV p1out, HLV plbar, HLV pl, HLV p1in, HLV p2out, HLV p2in); //! Square of qg->qenug W+Jets Scattering Current /** * @param p1out Momentum of final state quark * @param plbar Momentum of final state anti-lepton * @param pl Momentum of final state lepton * @param p1in Momentum of initial state quark * @param p2out Momentum of final state gluon * @param p2in Momentum of intial state gluon * @returns Square of the current contractions for qg->qenug Scattering * * This returns the square of the current contractions in qg->qenug scattering * with an emission of a W Boson. */ double ME_W_qg (HLV p1out, HLV plbar, HLV pl, HLV p1in, HLV p2out, HLV p2in); //! Square of qbarg->qbarenug W+Jets Scattering Current /** * @param p1out Momentum of final state anti-quark * @param plbar Momentum of final state anti-lepton * @param pl Momentum of final state lepton * @param p1in Momentum of initial state anti-quark * @param p2out Momentum of final state gluon * @param p2in Momentum of intial state gluon * @returns Square of the current contractions for qbarg->qbarenug Scattering * * This returns the square of the current contractions in qbarg->qbarenug * scattering with an emission of a W Boson. */ double ME_W_qbarg (HLV p1out, HLV plbar, HLV pl, HLV p1in, HLV p2out, HLV p2in); //! qQg Wjets Unordered backwards opposite leg to W /** * @param p1out Momentum of final state quark a * @param p1in Momentum of initial state quark a * @param p2out Momentum of final state quark b * @param p2in Momentum of intial state quark b * @param pg Momentum of final state unordered gluon * @param plbar Momentum of final state anti-lepton * @param pl Momentum of final state lepton * @returns Square of the current contractions for qQ->qQg Scattering * * This returns the square of the current contractions in qQg->qQg scattering * with an emission of a W Boson. */ double ME_W_unob_qQ (HLV p1out, HLV p1in, HLV p2out, HLV p2in, HLV pg, HLV plbar, HLV pl); //! qbarQg Wjets Unordered backwards opposite leg to W /** * @param p1out Momentum of final state anti-quark a * @param p1in Momentum of initial state anti-quark a * @param p2out Momentum of final state quark b * @param p2in Momentum of intial state quark b * @param pg Momentum of final state unordered gluon * @param plbar Momentum of final state anti-lepton * @param pl Momentum of final state lepton * @returns Square of the current contractions for qbarQ->qbarQg Scattering * * This returns the square of the current contractions in qbarQg->qbarQg * scattering with an emission of a W Boson. */ double ME_W_unob_qbarQ (HLV p1out, HLV p1in, HLV p2out, HLV p2in, HLV pg, HLV plbar, HLV pl); //! qQbarg Wjets Unordered backwards opposite leg to W /** * @param p1out Momentum of final state quark a * @param p1in Momentum of initial state quark a * @param p2out Momentum of final state anti-quark b * @param p2in Momentum of intial state anti-quark b * @param pg Momentum of final state unordered gluon * @param plbar Momentum of final state anti-lepton * @param pl Momentum of final state lepton * @returns Square of the current contractions for qQbar->qQbarg Scattering * * This returns the square of the current contractions in qQbarg->qQbarg * scattering with an emission of a W Boson. */ double ME_W_unob_qQbar (HLV p1out, HLV p1in, HLV p2out, HLV p2in, HLV pg, HLV plbar, HLV pl); //! qbarQbarg Wjets Unordered backwards opposite leg to W /** * @param p1out Momentum of final state anti-quark a * @param p1in Momentum of initial state anti-quark a * @param p2out Momentum of final state anti-quark b * @param p2in Momentum of intial state anti-quark b * @param pg Momentum of final state unordered gluon * @param plbar Momentum of final state anti-lepton * @param pl Momentum of final state lepton * @returns Square of the current contractions for qbarQbar->qbarQbarg Scattering * * This returns the square of the current contractions in qbarQbarg->qbarQbarg * scattering with an emission of a W Boson. */ double ME_W_unob_qbarQbar (HLV p1out, HLV p1in, HLV p2out, HLV p2in, HLV pg, HLV plbar, HLV pl); //! Wjets Unordered forwards opposite leg to W /** * @param p1out Momentum of final state quark a * @param p1in Momentum of initial state quark a * @param p2out Momentum of final state quark b * @param p2in Momentum of intial state quark b * @param pg Momentum of final state unordered gluon * @param plbar Momentum of final state anti-lepton * @param pl Momentum of final state lepton * @returns Square of the current contractions for qQ->gqQ Scattering * / * This returns the square of the current contractions in qQg->gqQ scattering * with an emission of a W Boson. */ double ME_W_unof_qQ (HLV p1out, HLV p1in, HLV p2out, HLV p2in, HLV pg, HLV plbar, HLV pl); //! Wjets Unordered forwards opposite leg to W /** * @param p1out Momentum of final state anti-quark a * @param p1in Momentum of initial state anti-quark a * @param p2out Momentum of final state quark b * @param p2in Momentum of intial state quark b * @param pg Momentum of final state unordered gluon * @param plbar Momentum of final state anti-lepton * @param pl Momentum of final state lepton * @returns Square of the current contractions for qbarQ->gqbarQ Scattering * * This returns the square of the current contractions in qbarQg->gqbarQ * scattering with an emission of a W Boson. */ double ME_W_unof_qbarQ (HLV p1out, HLV p1in, HLV p2out, HLV p2in, HLV pg, HLV plbar, HLV pl); //! Wjets Unordered forwards opposite leg to W /** * @param p1out Momentum of final state quark a * @param p1in Momentum of initial state quark a * @param p2out Momentum of final state anti-quark b * @param p2in Momentum of intial state anti-quark b * @param pg Momentum of final state unordered gluon * @param plbar Momentum of final state anti-lepton * @param pl Momentum of final state lepton * @returns Square of the current contractions for qQbar->gqQbar Scattering * * This returns the square of the current contractions in qQbarg->gqQbar * scattering with an emission of a W Boson. */ double ME_W_unof_qQbar (HLV p1out, HLV p1in, HLV p2out, HLV p2in, HLV pg, HLV plbar, HLV pl); //! Wjets Unordered forwards opposite leg to W /** * @param p1out Momentum of final state anti-quark a * @param p1in Momentum of initial state anti-quark a * @param p2out Momentum of final state anti-quark b * @param p2in Momentum of intial state anti-quark b * @param pg Momentum of final state unordered gluon * @param plbar Momentum of final state anti-lepton * @param pl Momentum of final state lepton * @returns Square of the current contractions for qbarQbar->gqbarQbar Scattering * * This returns the square of the current contractions in qbarQbarg->gqbarQbar * scattering with an emission of a W Boson. */ double ME_W_unof_qbarQbar (HLV p1out, HLV p1in, HLV p2out, HLV p2in, HLV pg, HLV plbar, HLV pl); //! W+uno same leg /** * @param p1out Momentum of final state quark a * @param p1in Momentum of initial state quark a * @param p2out Momentum of final state quark b * @param p2in Momentum of intial state quark b * @param pg Momentum of final state unordered gluon * @param plbar Momentum of final state anti-lepton * @param pl Momentum of final state lepton * @returns Square of the current contractions for qQ->qQg Scattering * * This returns the square of the current contractions in gqQ->gqQ scattering * with an emission of a W Boson. */ double ME_Wuno_qQ(HLV p1out, HLV p1in, HLV p2out, HLV p2in, HLV pg, HLV plbar, HLV pl); //! W+uno same leg. quark anti-quark /** * @param p1out Momentum of final state quark a * @param p1in Momentum of initial state quark a * @param p2out Momentum of final state anti-quark b * @param p2in Momentum of intial state anti-quark b * @param pg Momentum of final state unordered gluon * @param plbar Momentum of final state anti-lepton * @param pl Momentum of final state lepton * @returns Square of the current contractions for qQbar->gqQbar Scattering * * This returns the square of the current contractions in gqQbar->gqQbar * scattering with an emission of a W Boson. (Unordered Same Leg) */ double ME_Wuno_qQbar(HLV p1out, HLV p1in, HLV p2out, HLV p2in, HLV pg, HLV plbar, HLV pl); //! W+uno same leg. quark gluon /** * @param p1out Momentum of final state quark a * @param p1in Momentum of initial state quark a * @param p2out Momentum of final state gluon b * @param p2in Momentum of intial state gluon b * @param pg Momentum of final state unordered gluon * @param plbar Momentum of final state anti-lepton * @param pl Momentum of final state lepton * @returns Square of the current contractions for qg->gqg Scattering * * This returns the square of the current contractions in qg->gqg scattering * with an emission of a W Boson. */ double ME_Wuno_qg(HLV p1out, HLV p1in, HLV p2out, HLV p2in, HLV pg, HLV plbar, HLV pl); //! W+uno same leg. anti-quark quark /** * @param p1out Momentum of final state anti-quark a * @param p1in Momentum of initial state anti-quark a * @param p2out Momentum of final state quark b * @param p2in Momentum of intial state quark b * @param pg Momentum of final state unordered gluon * @param plbar Momentum of final state anti-lepton * @param pl Momentum of final state lepton * @returns Square of the current contractions for qbarQ->gqbarQ Scattering * * This returns the square of the current contractions in qbarQ->gqbarQ * scattering with an emission of a W Boson. */ double ME_Wuno_qbarQ(HLV p1out, HLV p1in, HLV p2out, HLV p2in, HLV pg, HLV plbar, HLV pl); //! W+uno same leg. anti-quark anti-quark /** * @param p1out Momentum of final state anti-quark a * @param p1in Momentum of initial state anti-quark a * @param p2out Momentum of final state anti-quark b * @param p2in Momentum of intial state anti-quark b * @param pg Momentum of final state unordered gluon * @param plbar Momentum of final state anti-lepton * @param pl Momentum of final state lepton * @returns Square of the current contractions for qbarQbar->gqbarQbar Scattering * * This returns the square of the current contractions in gqbarQbar->qbarQbar * scattering with an emission of a W Boson. */ double ME_Wuno_qbarQbar(HLV p1out, HLV p1in, HLV p2out, HLV p2in, HLV pg, HLV plbar, HLV pl); //! W+uno same leg. anti-quark gluon /** * @param p1out Momentum of final state anti-quark a * @param p1in Momentum of initial state anti-quark a * @param p2out Momentum of final state gluon b * @param p2in Momentum of intial state gluon b * @param pg Momentum of final state unordered gluon * @param plbar Momentum of final state anti-lepton * @param pl Momentum of final state lepton * @returns Square of the current contractions for ->gqbarg Scattering * * This returns the square of the current contractions in qbarg->gqbarg * scattering with an emission of a W Boson. */ double ME_Wuno_qbarg(HLV p1out, HLV p1in, HLV p2out, HLV p2in, HLV pg, HLV plbar, HLV pl); //! W+Extremal qqx. qxqQ /** * @param pgin Momentum of initial state gluon * @param pqout Momentum of final state quark a * @param plbar Momentum of final state anti-lepton * @param pl Momentum of final state lepton * @param pqbarout Momentum of final state anti-quark a * @param p2out Momentum of initial state anti-quark b * @param p2in Momentum of final state gluon b * @returns Square of the current contractions for ->qbarqQ Scattering * * Calculates the square of the current contractions with extremal qqbar pair * production. This is calculated through the use of crossing symmetry. */ double ME_WExqqx_qbarqQ(HLV pgin, HLV pqout,HLV plbar,HLV pl, HLV pqbarout, HLV p2out, HLV p2in); //! W+Extremal qqx. qqxQ /** * @param pgin Momentum of initial state gluon * @param pqout Momentum of final state quark a * @param plbar Momentum of final state anti-lepton * @param pl Momentum of final state lepton * @param pqbarout Momentum of final state anti-quark a * @param p2out Momentum of initial state anti-quark b * @param p2in Momentum of final state gluon b * @returns Square of the current contractions for ->qqbarQ Scattering * * Calculates the square of the current contractions with extremal qqbar pair * production. This is calculated through the use of crossing symmetry. */ double ME_WExqqx_qqbarQ(HLV pgin, HLV pqout,HLV plbar,HLV pl, HLV pqbarout, HLV p2out, HLV p2in); //! W+Extremal qqx. gg->qxqg /** * @param pgin Momentum of initial state gluon * @param pqout Momentum of final state quark a * @param plbar Momentum of final state anti-lepton * @param pl Momentum of final state lepton * @param pqbarout Momentum of final state anti-quark a * @param p2out Momentum of initial state gluon b * @param p2in Momentum of final state gluon b * @returns Square of the current contractions for gg->qbarqg Scattering * * Calculates the square of the current contractions with extremal qqbar pair * production. This is calculated through the use of crossing symmetry. */ double ME_WExqqx_qbarqg(HLV pgin, HLV pqout,HLV plbar,HLV pl, HLV pqbarout, HLV p2out, HLV p2in); //! W+Extremal qqx. gg->qqxg /** * @param pgin Momentum of initial state gluon * @param pqout Momentum of final state quark a * @param plbar Momentum of final state anti-lepton * @param pl Momentum of final state lepton * @param pqbarout Momentum of final state anti-quark a * @param p2out Momentum of initial state gluon a * @param p2in Momentum of final state gluon b * @returns Square of the current contractions for gg->qqbarg Scattering * * Calculates the square of the current contractions with extremal qqbar pair * production. This is calculated through the use of crossing symmetry. */ double ME_WExqqx_qqbarg(HLV pgin, HLV pqbarout,HLV plbar,HLV pl, HLV pqout, HLV p2out, HLV p2in); //! W+Extremal qqx. gg->qqxg. qqx on forwards leg, W emission backwards leg. /** * @param pa Momentum of initial state (anti-)quark * @param pb Momentum of initial state gluon * @param p1 Momentum of final state (anti-)quark (after W emission) * @param p2 Momentum of final state anti-quark * @param p3 Momentum of final state quark * @param plbar Momentum of final state anti-lepton * @param pl Momentum of final state lepton * @param aqlinepa Is opposite extremal leg to qqx a quark or antiquark line * @returns Square of the current contractions for gq->qqbarqW Scattering * * Calculates the square of the current contractions with extremal qqbar pair * production. This is calculated via current contraction of existing currents. * Assumes qqx split from forwards leg, W emission from backwards leg. * Switch input (pa<->pb, p1<->pn) if calculating forwards qqx. */ double ME_W_Exqqx_QQq(HLV pa, HLV pb, HLV p1, HLV p2, HLV p3,HLV plbar,HLV pl, bool aqlinepa); //! W+Jets qqxCentral. qqx W emission. /** * @param pa Momentum of initial state particle a * @param pb Momentum of initial state particle b * @param pl Momentum of final state lepton * @param plbar Momentum of final state anti-lepton * @param partons Vector of outgoing parton momenta * @param aqlinepa True= pa is anti-quark * @param aqlinepb True= pb is anti-quark * @param qqxmarker Ordering of the qqbar pair produced (qqx vs qxq) * @param nabove Number of lipatov vertices "above" qqbar pair - * @param nbelow Number of lipatov vertices "below" qqbar pair * @returns Square of the current contractions for qq>qQQbarWq Scattering * * Calculates the square of the current contractions with extremal qqbar pair * production. This is calculated through the use of crossing symmetry. */ double ME_WCenqqx_qq(HLV pa, HLV pb,HLV pl,HLV plbar, std::vector<HLV> partons, bool aqlinepa, bool aqlinepb, bool qqxmarker, int nabove); //emission from backwards leg //! W+Jets qqxCentral. W emission from backwards leg. /** * @param ka Momentum of initial state particle a * @param kb Momentum of initial state particle b * @param pl Momentum of final state lepton * @param plbar Momentum of final state anti-lepton * @param partons outgoing parton momenta * @param aqlinepa True= pa is anti-quark * @param aqlinepb True= pb is anti-quark * @param qqxmarker Ordering of the qqbar pair produced (qqx vs qxq) * @param nabove Number of lipatov vertices "above" qqbar pair * @param nbelow Number of lipatov vertices "below" qqbar pair * @param forwards Swap to emission off front leg TODO:remove so args can be const * @returns Square of the current contractions for qq>qQQbarWq Scattering * * Calculates the square of the current contractions with extremal qqbar pair * production. This is calculated through the use of crossing symmetry. */ double ME_W_Cenqqx_qq(HLV ka, HLV kb,HLV pl,HLV plbar, std::vector<HLV> partons, bool aqlinepa, bool aqlinepb, bool qqxmarker, int nabove, int nbelow, bool forwards); //Doing //! Square of qQ->qQ Pure Jets Scattering Current /** * @param p1out Momentum of final state quark * @param p1in Momentum of initial state quark * @param p2out Momentum of final state quark * @param p2in Momentum of intial state quark * @returns Square of the current contractions for qQ->qQ Scattering */ double ME_qQ (HLV p1out, HLV p1in, HLV p2out, HLV p2in); //! Square of qQbar->qQbar Pure Jets Scattering Current /** * @param p1out Momentum of final state quark * @param p1in Momentum of initial state quark * @param p2out Momentum of final state anti-quark * @param p2in Momentum of intial state anti-quark * @returns Square of the current contractions for qQbar->qQbar Scattering * * @note this can be used for qbarQ->qbarQ Scattering by inputting arguments * appropriately. */ double ME_qQbar (HLV p1out, HLV p1in, HLV p2out, HLV p2in); //! Square of qbarQbar->qbarQbar Pure Jets Scattering Current /** * @param p1out Momentum of final state anti-quark * @param p1in Momentum of initial state anti-quark * @param p2out Momentum of final state anti-quark * @param p2in Momentum of intial state anti-quark * @returns Square of the current contractions for qbarQbar->qbarQbar Scattering */ double ME_qbarQbar (HLV p1out, HLV p1in, HLV p2out, HLV p2in); //! Square of qg->qg Pure Jets Scattering Current /** * @param p1out Momentum of final state quark * @param p1in Momentum of initial state quark * @param p2out Momentum of final state gluon * @param p2in Momentum of intial state gluon * @returns Square of the current contractions for qg->qg Scattering * * @note this can be used for gq->gq Scattering by inputting arguments * appropriately. */ double ME_qg (HLV p1out, HLV p1in, HLV p2out, HLV p2in); //! Square of qbarg->qbarg Pure Jets Scattering Current /** * @param p1out Momentum of final state anti-quark * @param p1in Momentum of initial state anti-quark * @param p2out Momentum of final state gluon * @param p2in Momentum of intial state gluon * @returns Square of the current contractions for qbarg->qbarg Scattering * * @note this can be used for gqbar->gqbar Scattering by inputting arguments * appropriately. */ double ME_qbarg (HLV p1out, HLV p1in, HLV p2out, HLV p2in); //! Square of gg->gg Pure Jets Scattering Current /** * @param p1out Momentum of final state gluon * @param p1in Momentum of initial state gluon * @param p2out Momentum of final state gluon * @param p2in Momentum of intial state gluon * @returns Square of the current contractions for gg->gg Scattering */ double ME_gg (HLV p1out, HLV p1in, HLV p2out, HLV p2in); //! Square of gg->gg Higgs+Jets Scattering Current /** * @param p1out Momentum of final state gluon * @param p1in Momentum of initial state gluon * @param p2out Momentum of final state gluon * @param p2in Momentum of intial state gluon * @param q1 Momentum of t-channel propagator before Higgs * @param qH2 Momentum of t-channel propagator after Higgs * @param mt Top quark mass * @param include_bottom Specifies whether bottom corrections are included * @param mb Bottom quark mass * @returns Square of the current contractions for gg->gg Scattering * * g~p1 g~p2 * should be called with q1 meant to be contracted with p2 in first part of vertex * (i.e. if g is backward, q1 is forward) */ double ME_H_gg (HLV p1out, HLV p1in, HLV p2out, HLV p2in, HLV q1, HLV qH2, double mt, bool include_bottom, double mb); //! Square of gq->gq Higgs+Jets Scattering Current with Higgs before Gluon /** * @param p1out Momentum of final state gluon * @param p1in Momentum of initial state gluon * @param p2out Momentum of final state gluon * @param p2in Momentum of intial state gluon * @param pH Momentum of Higgs * @param mt Top quark mass * @param include_bottom Specifies whether bottom corrections are included * @param mb Bottom quark mass * @returns Square of the current contraction */ double ME_Houtside_gq(HLV p1out, HLV p1in, HLV p2out, HLV p2in, HLV pH, double mt, bool include_bottom, double mb); //! Square of qg->qg Higgs+Jets Scattering Current /** * @param p1out Momentum of final state quark * @param p1in Momentum of initial state quark * @param p2out Momentum of final state gluon * @param p2in Momentum of intial state gluon * @param q1 Momentum of t-channel propagator before Higgs * @param qH2 Momentum of t-channel propagator after Higgs * @param mt Top quark mass * @param include_bottom Specifies whether bottom corrections are included * @param mb Bottom quark mass * @returns Square of the current contractions for qg->qg Scattering * * q~p1 g~p2 (i.e. ALWAYS p1 for quark, p2 for gluon) * should be called with q1 meant to be contracted with p2 in first part of vertex * (i.e. if g is backward, q1 is forward) */ double ME_H_qg (HLV p1out, HLV p1in, HLV p2out, HLV p2in, HLV q1, HLV qH2, double mt, bool include_bottom, double mb); //! Square of qbarg->qbarg Higgs+Jets Scattering Current /** * @param p1out Momentum of final state anti-quark * @param p1in Momentum of initial state anti-quark * @param p2out Momentum of final state gluon * @param p2in Momentum of intial state gluon * @param q1 Momentum of t-channel propagator before Higgs * @param qH2 Momentum of t-channel propagator after Higgs * @param mt Top quark mass * @param include_bottom Specifies whether bottom corrections are included * @param mb Bottom quark mass * @returns Square of the current contractions for qbarg->qbarg Scattering * * qbar~p1 g~p2 (i.e. ALWAYS p1 for anti-quark, p2 for gluon) * should be called with q1 meant to be contracted with p2 in first part of vertex * (i.e. if g is backward, q1 is forward) */ double ME_H_qbarg (HLV p1out, HLV p1in, HLV p2out, HLV p2in, HLV q1, HLV qH2, double mt, bool include_bottom, double mb); //! Square of qQ->qQ Higgs+Jets Scattering Current /** * @param p1out Momentum of final state quark * @param p1in Momentum of initial state quark * @param p2out Momentum of final state quark * @param p2in Momentum of intial state quark * @param q1 Momentum of t-channel propagator before Higgs * @param qH2 Momentum of t-channel propagator after Higgs * @param mt Top quark mass * @param include_bottom Specifies whether bottom corrections are included * @param mb Bottom quark mass * @returns Square of the current contractions for qQ->qQ Scattering * * q~p1 Q~p2 (i.e. ALWAYS p1 for quark, p2 for quark) * should be called with q1 meant to be contracted with p2 in first part of vertex * (i.e. if Q is backward, q1 is forward) */ double ME_H_qQ (HLV p1out, HLV p1in, HLV p2out, HLV p2in, HLV q1, HLV qH2, double mt, bool include_bottom, double mb); //! Square of qQbar->qQbar Higgs+Jets Scattering Current /** * @param p1out Momentum of final state quark * @param p1in Momentum of initial state quark * @param p2out Momentum of final state anti-quark * @param p2in Momentum of intial state anti-quark * @param q1 Momentum of t-channel propagator before Higgs * @param qH2 Momentum of t-channel propagator after Higgs * @param mt Top quark mass * @param include_bottom Specifies whether bottom corrections are included * @param mb Bottom quark mass * @returns Square of the current contractions for qQ->qQ Scattering * * q~p1 Qbar~p2 (i.e. ALWAYS p1 for quark, p2 for anti-quark) * should be called with q1 meant to be contracted with p2 in first part of vertex * (i.e. if Qbar is backward, q1 is forward) */ double ME_H_qQbar (HLV p1out, HLV p1in, HLV p2out, HLV p2in, HLV q1, HLV qH2, double mt, bool include_bottom, double mb); //! Square of qbarQ->qbarQ Higgs+Jets Scattering Current /** * @param p1out Momentum of final state anti-quark * @param p1in Momentum of initial state anti-quark * @param p2out Momentum of final state quark * @param p2in Momentum of intial state quark * @param q1 Momentum of t-channel propagator before Higgs * @param qH2 Momentum of t-channel propagator after Higgs * @param mt Top quark mass * @param include_bottom Specifies whether bottom corrections are included * @param mb Bottom quark mass * @returns Square of the current contractions for qbarQ->qbarQ Scattering * * qbar~p1 Q~p2 (i.e. ALWAYS p1 for anti-quark, p2 for quark) * should be called with q1 meant to be contracted with p2 in first part of vertex * (i.e. if Q is backward, q1 is forward) */ double ME_H_qbarQ (HLV p1out, HLV p1in, HLV p2out, HLV p2in, HLV q1, HLV qH2, double mt, bool include_bottom, double mb); //! Square of qbarQbar->qbarQbar Higgs+Jets Scattering Current /** * @param p1out Momentum of final state anti-quark * @param p1in Momentum of initial state anti-quark * @param p2out Momentum of final state anti-quark * @param p2in Momentum of intial state anti-quark * @param q1 Momentum of t-channel propagator before Higgs * @param qH2 Momentum of t-channel propagator after Higgs * @param mt Top quark mass * @param include_bottom Specifies whether bottom corrections are included * @param mb Bottom quark mass * @returns Square of the current contractions for qbarQbar->qbarQbar Scattering * * qbar~p1 Qbar~p2 (i.e. ALWAYS p1 for anti-quark, p2 for anti-quark) * should be called with q1 meant to be contracted with p2 in first part of vertex * (i.e. if Qbar is backward, q1 is forward) */ double ME_H_qbarQbar (HLV p1out, HLV p1in, HLV p2out, HLV p2in, HLV q1, HLV qH2, double mt, bool include_bottom, double mb); //! @name Unordered forward //! @{ //! Square of qQ->gqQ Higgs+Jets Unordered f Scattering Current /** * @param pg Momentum of unordered gluon * @param p1out Momentum of final state quark * @param p1in Momentum of initial state quark * @param p2out Momentum of final state quark * @param p2in Momentum of intial state quark * @param qH1 Momentum of t-channel propagator before Higgs * @param qH2 Momentum of t-channel propagator after Higgs * @param mt Top quark mass * @param include_bottom Specifies whether bottom corrections are included * @param mb Bottom quark mass * @returns Square of the current contractions for qQ->gqQ Scattering * * This construction is taking rapidity order: pg > p1out >> p2out */ double ME_H_unof_qQ (HLV pg, HLV p1out, HLV p1in, HLV p2out, HLV p2in, HLV qH1, HLV qH2, double mt, bool include_bottom, double mb); //! Square of qQbar->gqQbar Higgs+Jets Unordered f Scattering Current /** * @param pg Momentum of unordered gluon * @param p1out Momentum of final state quark * @param p1in Momentum of initial state quark * @param p2out Momentum of final state anti-quark * @param p2in Momentum of intial state anti-quark * @param qH1 Momentum of t-channel propagator before Higgs * @param qH2 Momentum of t-channel propagator after Higgs * @param mt Top quark mass * @param include_bottom Specifies whether bottom corrections are included * @param mb Bottom quark mass * @returns Square of the current contractions for qQbar->gqQbar Scattering * * This construction is taking rapidity order: pg > p1out >> p2out */ double ME_H_unof_qQbar (HLV pg, HLV p1out, HLV p1in, HLV p2out, HLV p2in, HLV qH1, HLV qH2, double mt, bool include_bottom, double mb); //! Square of qbarQ->gqbarQ Higgs+Jets Unordered f Scattering Current /** * @param pg Momentum of unordered gluon * @param p1out Momentum of final state anti-quark * @param p1in Momentum of initial state anti-quark * @param p2out Momentum of final state quark * @param p2in Momentum of intial state quark * @param qH1 Momentum of t-channel propagator before Higgs * @param qH2 Momentum of t-channel propagator after Higgs * @param mt Top quark mass * @param include_bottom Specifies whether bottom corrections are included * @param mb Bottom quark mass * @returns Square of the current contractions for qbarQ->gqbarQ Scattering * * This construction is taking rapidity order: pg > p1out >> p2out */ double ME_H_unof_qbarQ (HLV pg, HLV p1out, HLV p1in, HLV p2out, HLV p2in, HLV qH1, HLV qH2, double mt, bool include_bottom, double mb); //! Square of qbarQbar->gqbarQbar Higgs+Jets Unordered f Scattering Current /** * @param pg Momentum of unordered gluon * @param p1out Momentum of final state anti-quark * @param p1in Momentum of initial state anti-quark * @param p2out Momentum of final state anti-quark * @param p2in Momentum of intial state anti-quark * @param qH1 Momentum of t-channel propagator before Higgs * @param qH2 Momentum of t-channel propagator after Higgs * @param mt Top quark mass * @param include_bottom Specifies whether bottom corrections are included * @param mb Bottom quark mass * @returns Square of the current contractions for qbarQbar->gqbarQbar Scattering * * This construction is taking rapidity order: pg > p1out >> p2out */ double ME_H_unof_qbarQbar (HLV pg, HLV p1out, HLV p1in, HLV p2out, HLV p2in, HLV qH1, HLV qH2, double mt, bool include_bottom, double mb); //! Square of qg->gqg Higgs+Jets Unordered f Scattering Current /** * @param pg Momentum of unordered gluon * @param p1out Momentum of final state quark * @param p1in Momentum of initial state quark * @param p2out Momentum of final state gluon * @param p2in Momentum of intial state gluon * @param qH1 Momentum of t-channel propagator before Higgs * @param qH2 Momentum of t-channel propagator after Higgs * @param mt Top quark mass * @param include_bottom Specifies whether bottom corrections are included * @param mb Bottom quark mass * @returns Square of the current contractions for qg->gqg Scattering * * This construction is taking rapidity order: pg > p1out >> p2out */ double ME_H_unof_qg (HLV pg, HLV p1out, HLV p1in, HLV p2out, HLV p2in, HLV qH1, HLV qH2, double mt, bool include_bottom, double mb); //! Square of qbarg->gqbarg Higgs+Jets Unordered f Scattering Current /** * @param pg Momentum of unordered gluon * @param p1out Momentum of final state anti-quark * @param p1in Momentum of initial state anti-quark * @param p2out Momentum of final state gluon * @param p2in Momentum of intial state gluon * @param qH1 Momentum of t-channel propagator before Higgs * @param qH2 Momentum of t-channel propagator after Higgs * @param mt Top quark mass * @param include_bottom Specifies whether bottom corrections are included * @param mb Bottom quark mass * @returns Square of the current contractions for qbarg->gbarg Scattering * * This construction is taking rapidity order: pg > p1out >> p2out */ double ME_H_unof_qbarg (HLV pg, HLV p1out, HLV p1in, HLV p2out, HLV p2in, HLV qH1, HLV qH2, double mt, bool include_bottom, double mb); //! @} //! @name Unordered backwards //! @{ //! Square of qbarQ->qbarQg Higgs+Jets Unordered b Scattering Current /** * @param p1out Momentum of final state anti-quark * @param p1in Momentum of initial state anti-quark * @param pg Momentum of unordered b gluon * @param p2out Momentum of final state quark * @param p2in Momentum of intial state quark * @param qH1 Momentum of t-channel propagator before Higgs * @param qH2 Momentum of t-channel propagator after Higgs * @param mt Top quark mass * @param include_bottom Specifies whether bottom corrections are included * @param mb Bottom quark mass * @returns Square of the current contractions for qbarQ->qbarQg Scattering * * This construction is taking rapidity order: p1out >> p2out > pg */ double ME_H_unob_qbarQ (HLV p1out, HLV p1in, HLV pg, HLV p2out, HLV p2in, HLV qH1, HLV qH2, double mt, bool include_bottom, double mb); //! Square of qQ->qQg Higgs+Jets Unordered b Scattering Current /** * @param p1out Momentum of final state quark * @param p1in Momentum of initial state quark * @param pg Momentum of unordered b gluon * @param p2out Momentum of final state quark * @param p2in Momentum of intial state quark * @param qH1 Momentum of t-channel propagator before Higgs * @param qH2 Momentum of t-channel propagator after Higgs * @param mt Top quark mass * @param include_bottom Specifies whether bottom corrections are included * @param mb Bottom quark mass * @returns Square of the current contractions for qQ->qQg Scattering * * This construction is taking rapidity order: p1out >> p2out > pg */ double ME_H_unob_qQ (HLV p1out, HLV p1in, HLV pg, HLV p2out, HLV p2in, HLV qH1, HLV qH2, double mt, bool include_bottom, double mb); //! Square of qQbar->qQbarg Higgs+Jets Unordered b Scattering Current /** * @param p1out Momentum of final state quark * @param p1in Momentum of initial state quark * @param pg Momentum of unordered b gluon * @param p2out Momentum of final state anti-quark * @param p2in Momentum of intial state anti-quark * @param qH1 Momentum of t-channel propagator before Higgs * @param qH2 Momentum of t-channel propagator after Higgs * @param mt Top quark mass * @param include_bottom Specifies whether bottom corrections are included * @param mb Bottom quark mass * @returns Square of the current contractions for qQbar->qQbarg Scattering * * This construction is taking rapidity order: p1out >> p2out > pg */ double ME_H_unob_qQbar (HLV p1out, HLV p1in, HLV pg, HLV p2out, HLV p2in, HLV qH1, HLV qH2, double mt, bool include_bottom, double mb); //! Square of qbarQbar->qbarQbarg Higgs+Jets Unordered b Scattering Current /** * @param p1out Momentum of final state anti-quark * @param p1in Momentum of initial state anti-quark * @param pg Momentum of unordered b gluon * @param p2out Momentum of final state anti-quark * @param p2in Momentum of intial state anti-quark * @param qH1 Momentum of t-channel propagator before Higgs * @param qH2 Momentum of t-channel propagator after Higgs * @param mt Top quark mass * @param include_bottom Specifies whether bottom corrections are included * @param mb Bottom quark mass * @returns Square of the current contractions for qbarQbar->qbarQbarg Scattering * * This construction is taking rapidity order: p1out >> p2out > pg */ double ME_H_unob_qbarQbar (HLV p1out, HLV p1in, HLV pg, HLV p2out, HLV p2in, HLV qH1, HLV qH2, double mt, bool include_bottom, double mb); //! Square of gQbar->gQbarg Higgs+Jets Unordered b Scattering Current /** * @param p1out Momentum of final state gluon * @param p1in Momentum of initial state gluon * @param pg Momentum of unordered b gluon * @param p2out Momentum of final state anti-quark * @param p2in Momentum of intial state anti-quark * @param qH1 Momentum of t-channel propagator before Higgs * @param qH2 Momentum of t-channel propagator after Higgs * @param mt Top quark mass * @param include_bottom Specifies whether bottom corrections are included * @param mb Bottom quark mass * @returns Square of the current contractions for gQbar->gQbarg Scattering * * This construction is taking rapidity order: p1out >> p2out > pg */ double ME_H_unob_gQbar (HLV p1out, HLV p1in, HLV pg, HLV p2out, HLV p2in, HLV qH1, HLV qH2, double mt, bool include_bottom, double mb); //! Square of gQ->gQg Higgs+Jets Unordered b Scattering Current /** * @param p1out Momentum of final state gluon * @param p1in Momentum of initial state gluon * @param pg Momentum of unordered b gluon * @param p2out Momentum of final state quark * @param p2in Momentum of intial state quark * @param qH1 Momentum of t-channel propagator before Higgs * @param qH2 Momentum of t-channel propagator after Higgs * @param mt Top quark mass * @param include_bottom Specifies whether bottom corrections are included * @param mb Bottom quark mass * @returns Square of the current contractions for gQ->gQg Scattering * * This construction is taking rapidity order: p1out >> p2out > pg */ double ME_H_unob_gQ (HLV p1out, HLV p1in, HLV pg, HLV p2out, HLV p2in, HLV qH1, HLV qH2, double mt, bool include_bottom, double mb); //! @} //! @name impact factors for Higgs + jet //! @{ //! Implements Eq. (4.22) in \cite DelDuca:2003ba with modifications to incoming plus momenta /** * @param p2 Momentum of Particle 2 * @param p1 Momentum of Particle 1 * @param pH Momentum of Higgs * @returns Value of Eq. (4.22) in \cite DelDuca:2003ba with modifications * * This gives the impact factor. First it determines first whether this is the * case p1p\sim php>>p3p or the opposite */ double C2gHgm(HLV p2, HLV p1, HLV pH); //! Implements Eq. (4.23) in \cite DelDuca:2003ba with modifications to incoming plus momenta /** * @param p2 Momentum of Particle 2 * @param p1 Momentum of Particle 1 * @param pH Momentum of Higgs * @returns Value of Eq. (4.23) in \cite DelDuca:2003ba * * This gives the impact factor. First it determines first whether this is the * case p1p\sim php>>p3p or the opposite */ double C2gHgp(HLV p2, HLV p1, HLV pH); //! Implements Eq. (4.22) in \cite DelDuca:2003ba /** * @param p2 Momentum of Particle 2 * @param p1 Momentum of Particle 1 * @param pH Momentum of Higgs * @returns Value of Eq. (4.22) in \cite DelDuca:2003ba * * This gives the impact factor. First it determines first whether this is the * case p1p\sim php>>p3p or the opposite */ double C2qHqm(HLV p2, HLV p1, HLV pH); //! @} /** \class CCurrent currents.hh "include/HEJ/currents.hh" * \brief This is the a new class structure for currents. */ class CCurrent { public: CCurrent(COM sc0, COM sc1, COM sc2, COM sc3) :c0(sc0),c1(sc1),c2(sc2),c3(sc3) {}; CCurrent(const HLV p) { c0=p.e(); c1=p.px(); c2=p.py(); c3=p.pz(); }; CCurrent() {}; CCurrent operator+(const CCurrent& other); CCurrent operator-(const CCurrent& other); CCurrent operator*(const double x); CCurrent operator*(const COM x); CCurrent operator/(const double x); CCurrent operator/(const COM x); friend std::ostream& operator<<(std::ostream& os, const CCurrent& cur); COM dot(HLV p1); COM dot(CCurrent p1); COM c0,c1,c2,c3; }; /* std::ostream& operator <<(std::ostream& os, const CCurrent& cur); */ CCurrent operator * ( double x, CCurrent& m); CCurrent operator * ( COM x, CCurrent& m); CCurrent operator / ( double x, CCurrent& m); CCurrent operator / ( COM x, CCurrent& m); //! Current <incoming state | mu | outgoing state> /** * This is a wrapper function around \see joi() note helicity flip to * give same answer. */ void jio(HLV pin, bool helin, HLV pout, bool helout, current &cur); //! Current <outgoing state | mu | outgoing state> /** * @param pi bra state momentum * @param heli helicity of pi * @param pj ket state momentum * @param helj helicity of pj. (must be same as heli) * @param cur reference to current which is saved. * * This function is for building <i (out)| mu |j (out)> currents. It * must be called with pi as the bra, and pj as the ket. * * @TODO Remove heli/helj and just have helicity of current as argument. */ void joo(HLV pi, bool heli, HLV pj, bool helj, current &cur); //! Current <outgoing state | mu | incoming state> /** * @param pout bra state momentum * @param helout helicity of pout * @param pin ket state momentum * @param helin helicity of pin. (must be same as helout) * @param cur reference to current which is saved. * * This function is for building <out| mu |in> currents. It must be * called with pout as the bra, and pin as the ket. jio calls this * with flipped helicity * * @TODO Remove helout/helin and just have helicity of current as argument. */ void joi(HLV pout, bool helout, HLV pin, bool helin, current &cur); //! Current <outgoing state | mu | incoming state> /** * This is a wrapper function around the void function of the same name. \see joi */ CCurrent joi (HLV pout, bool helout, HLV pin, bool helin); //! Current <incoming state | mu | outgoing state> /** * This is a wrapper function around the void function of the same name. \see jio */ CCurrent jio (HLV pout, bool helout, HLV pin, bool helin); //! Current <outgoing state | mu | outgoing state> /** * This is a wrapper function around the void function of the same name. \see joo */ CCurrent joo (HLV pout, bool helout, HLV pin, bool helin); inline COM cdot(const current & j1, const current & j2) { return j1[0]*j2[0]-j1[1]*j2[1]-j1[2]*j2[2]-j1[3]*j2[3]; } inline COM cdot(const HLV & p, const current & j1) { return j1[0]*p.e()-j1[1]*p.x()-j1[2]*p.y()-j1[3]*p.z(); } inline void cmult(const COM & factor, const current & j1, current &cur) { cur[0]=factor*j1[0]; cur[1]=factor*j1[1]; cur[2]=factor*j1[2]; cur[3]=factor*j1[3]; } // WHY!?! inline void cadd(const current & j1, const current & j2, const current & j3, const current & j4, const current & j5, current &sum) { sum[0]=j1[0]+j2[0]+j3[0]+j4[0]+j5[0]; sum[1]=j1[1]+j2[1]+j3[1]+j4[1]+j5[1]; sum[2]=j1[2]+j2[2]+j3[2]+j4[2]+j5[2]; sum[3]=j1[3]+j2[3]+j3[3]+j4[3]+j5[3]; } inline void cadd(const current & j1, const current & j2, const current & j3, const current & j4, current &sum) { sum[0] = j1[0] + j2[0] + j3[0] + j4[0]; sum[1] = j1[1] + j2[1] + j3[1] + j4[1]; sum[2] = j1[2] + j2[2] + j3[2] + j4[2]; sum[3] = j1[3] + j2[3] + j3[3] + j4[3]; } inline void cadd(const current & j1, const current & j2, const current & j3, current &sum) { sum[0]=j1[0]+j2[0]+j3[0]; sum[1]=j1[1]+j2[1]+j3[1]; sum[2]=j1[2]+j2[2]+j3[2]; sum[3]=j1[3]+j2[3]+j3[3]; } inline void cadd(const current & j1, const current & j2, current &sum) { sum[0]=j1[0]+j2[0]; sum[1]=j1[1]+j2[1]; sum[2]=j1[2]+j2[2]; sum[3]=j1[3]+j2[3]; } inline double abs2(const COM & a) { return (a*conj(a)).real(); } inline double vabs2(const CCurrent & cur) { return abs2(cur.c0)-abs2(cur.c1)-abs2(cur.c2)-abs2(cur.c3); } inline double vre(const CCurrent & a, const CCurrent & b) { return real(a.c0*conj(b.c0)-a.c1*conj(b.c1)-a.c2*conj(b.c2)-a.c3*conj(b.c3)); } //! @TODO These are not currents and should be moved elsewhere. double K_g(double p1minus, double paminus); double K_g(HLV const & pout, HLV const & pin);