Page MenuHomeHEPForge

EventShapes2.icc
No OneTemporary

EventShapes2.icc

// -*- C++ -*-
//
// EventShapes2.icc is a part of Herwig++ - A multi-purpose Monte Carlo event generator
// Copyright (C) 2002-2007 The Herwig Collaboration
//
// Herwig++ is licenced under version 2 of the GPL, see COPYING for details.
// Please respect the MCnet academic guidelines, see GUIDELINES for details.
//
//
// This is the implementation of the inlined member functions of
// the EventShapes2 class.
//
namespace Herwig {
inline EventShapes2::EventShapes2()
: _omthr(""), _maj(""), _min(""), _obl(""), _sph(""), _apl(""), _pla(""),
_c(""), _d(""), _mhi(""), _mlo(""), _mdiff(""), _bmax(""),
_bmin(""), _bsum(""), _bdiff("")
{}
inline IBPtr EventShapes2::clone() const {
return new_ptr(*this);
}
inline IBPtr EventShapes2::fullclone() const {
return new_ptr(*this);
}
// If needed, insert default implementations of virtual function defined
// in the InterfacedBase class here (using ThePEG-interfaced-impl in Emacs).
inline double EventShapes2::thrust() {
checkThrust();
return _thrust[0];
}
inline double EventShapes2::thrustMajor() {
checkThrust();
return _thrust[1];
}
inline double EventShapes2::thrustMinor() {
checkThrust();
return _thrust[2];
}
inline double EventShapes2::oblateness() {
checkThrust();
return _thrust[1]-_thrust[2];
}
inline Axis EventShapes2::thrustAxis() {
checkThrust();
return _thrustAxis[0];
}
inline Axis EventShapes2::majorAxis() {
checkThrust();
return _thrustAxis[1];
}
inline Axis EventShapes2::minorAxis() {
checkThrust();
return _thrustAxis[2];
}
inline void EventShapes2::reset(const tPVector &part)
{
_pv.resize(part.size());
for(unsigned int ix=0;ix<part.size();++ix) _pv[ix]=part[ix]->momentum();
_thrustDone = false;
_spherDone = false;
_linTenDone = false;
_hemDone = false;
_useCmBoost = false;
}
inline double EventShapes2::sphericity() {
checkSphericity();
return 3./2.*(_spher[1]+_spher[2]);
}
inline double EventShapes2::aplanarity() {
checkSphericity();
return 3./2.*_spher[2];
}
inline double EventShapes2::planarity() {
checkSphericity();
return _spher[1]-_spher[2];
}
inline Axis EventShapes2::sphericityAxis() {
checkSphericity();
return _spherAxis[0];
}
inline vector<double> EventShapes2::sphericityEigenValues() {
checkSphericity();
return _spher;
}
inline vector<Axis> EventShapes2::sphericityEigenVectors() {
checkSphericity();
return _spherAxis;
}
inline vector<double> EventShapes2::linTenEigenValues() {
checkLinTen();
return _linTen;
}
inline vector<Axis> EventShapes2::linTenEigenVectors() {
checkLinTen();
return _linTenAxis;
}
inline double EventShapes2::CParameter() {
checkLinTen();
return 3.*(_linTen[0]*_linTen[1]+_linTen[1]*_linTen[2]
+_linTen[2]*_linTen[0]);
}
inline double EventShapes2::DParameter() {
checkLinTen();
return 27.*(_linTen[0]*_linTen[1]*_linTen[2]);
}
inline double EventShapes2::Mhigh2() {
checkHemispheres();
return _mPlus;
}
inline double EventShapes2::Mlow2() {
checkHemispheres();
return _mMinus;
}
inline double EventShapes2::Mdiff2() {
checkHemispheres();
return _mPlus-_mMinus;
}
inline double EventShapes2::Bmax() {
checkHemispheres();
return _bPlus;
}
inline double EventShapes2::Bmin() {
checkHemispheres();
return _bMinus;
}
inline double EventShapes2::Bsum() {
checkHemispheres();
return _bPlus+_bMinus;
}
inline double EventShapes2::Bdiff() {
checkHemispheres();
return _bPlus-_bMinus;
}
inline void EventShapes2::checkLinTen() {
if (!_linTenDone) {
_linTenDone = true;
diagonalizeTensors(true, _useCmBoost);
}
}
inline void EventShapes2::checkSphericity() {
if (!_spherDone) {
_spherDone = true;
diagonalizeTensors(false, _useCmBoost);
}
}
inline void EventShapes2::checkThrust() {
if (!_thrustDone) {
_thrustDone = true;
calculateThrust();
}
}
inline void EventShapes2::checkHemispheres() {
if (!_hemDone) {
_hemDone = true;
calcHemisphereMasses();
}
}
inline void EventShapes2::calcHemisphereMasses() {
Lorentz5Momentum pos, neg;
Energy pden(0.*MeV),epos(0.*MeV),eneg(0.*MeV);
for(unsigned int ix=0;ix<_pv.size();++ix)
{
if(_pv[ix].vect() * thrustAxis() > 0.*MeV)
{
pos += _pv[ix];
epos += _pv[ix].perp(thrustAxis());
}
else
{
neg += _pv[ix];
eneg += _pv[ix].perp(thrustAxis());
}
pden += _pv[ix].vect().mag();
}
// denominator and masses
Energy2 den(sqr(pos.e()+neg.e()));
_mPlus = pos.m2()/den;
_mMinus = neg.m2()/den;
if (_mPlus < _mMinus) swap(_mPlus, _mMinus);
// jet broadening
_bPlus = 0.5*epos/pden;
_bMinus = 0.5*eneg/pden;
if (_bPlus < _bMinus) swap(_bPlus, _bMinus);
}
inline double EventShapes2::getX(const Lorentz5Momentum & p,
const Energy & Ebeam) {
return(Ebeam > 0*MeV ? double(p.vect().mag()/Ebeam) : -1.);
}
inline double EventShapes2::getXi(const Lorentz5Momentum & p,
const Energy & Ebeam) {
return((Ebeam > 0*MeV && p.vect().mag() > 0*MeV) ?
log(Ebeam/p.vect().mag()) : -1.);
}
inline Energy EventShapes2::getPt(const Lorentz5Momentum & p) {
return p.perp();
}
inline double EventShapes2::getRapidity(const Lorentz5Momentum & p) {
return (p.t() > p.z() ? p.rapidity() : 1e99);
}
inline Energy EventShapes2::ptInT(const Lorentz5Momentum & p) {
checkThrust();
return p.vect()*_thrustAxis[1];
}
inline Energy EventShapes2::ptOutT(const Lorentz5Momentum & p) {
checkThrust();
return p.vect()*_thrustAxis[2];
}
inline double EventShapes2::yT(const Lorentz5Momentum & p) {
checkThrust();
return (p.t() > p.vect()*_thrustAxis[0] ?
p.rapidity(_thrustAxis[0]) : 1e99);
}
inline Energy EventShapes2::ptInS(const Lorentz5Momentum & p) {
checkSphericity();
return p.vect()*_spherAxis[1];
}
inline Energy EventShapes2::ptOutS(const Lorentz5Momentum & p) {
checkSphericity();
return p.vect()*_spherAxis[2];
}
inline double EventShapes2::yS(const Lorentz5Momentum & p) {
checkSphericity();
return (p.t() > p.vect()*_spherAxis[0] ?
p.rapidity(_spherAxis[0]) : 1e99);
}
}

File Metadata

Mime Type
text/plain
Expires
Wed, May 14, 10:21 AM (1 d, 11 h)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
5111099
Default Alt Text
EventShapes2.icc (5 KB)

Event Timeline