1#ifndef D0RunIconeJets_HepEntity_class
2#define D0RunIconeJets_HepEntity_class
4#include "inline_maths.h"
5#include <fastjet/internal/base.hh>
48 HepEntityI(
double E_in,
double px_in,
double py_in,
double pz_in,
49 int index_in = -1) : index(index_in) {
51 double pt = sqrt(px_in*px_in+py_in*py_in);
52 double p = sqrt(pt*pt+pz_in*pz_in);
53 phi = inline_maths::phi(px_in,py_in);
54 double theta = asin(pt/p);
55 eta = inline_maths::eta(theta);
64 HepEntityI(
const HepEntityI& in) : Et(in.Et), eta(in.eta), phi(in.phi), index(in.index) {
71 inline double pT()
const {
75 inline double px()
const {
79 inline double py()
const {
83 inline double pz()
const {
87 inline double E()
const {
92 inline void p4vec(
float* p)
const {
101 inline void Add(
const HepEntityI el) {
107 eta += w2*(el.eta - eta);
108 phi += w2*inline_maths::delta_phi(el.phi, phi);
114 inline void Fill(
double E_in,
double px_in,
double py_in,
double pz_in,
int index_in) {
115 double pt = sqrt(px_in*px_in+py_in*py_in);
116 double p = sqrt(pt*pt+pz_in*pz_in);
117 phi = inline_maths::phi(px_in,py_in);
118 double theta = asin(pt/p);
119 eta = inline_maths::eta(theta);
121 Et = E_in*sin(theta);
double theta(const PseudoJet &a, const PseudoJet &b)
returns the angle between a and b