FastJet 3.0.1
|
00001 #ifndef D0RunIIconeJets_HepEntity_class 00002 #define D0RunIIconeJets_HepEntity_class 00003 00004 #include "inline_maths.h" 00005 00006 #include <fastjet/internal/base.hh> 00007 00008 FASTJET_BEGIN_NAMESPACE 00009 00010 namespace d0{ 00011 00012 //Author: Lars Sonnenschein 28/Mar/2007 00013 //This is an example class fulfilling the minimal requirements needed by the 00014 //D0 RunII cone jet algorithm implementation, which is an inlined template class 00015 00016 // History of changes in FastJet compared tothe original version of 00017 // HepEntity.h 00018 // 00019 // 2009-01-17 Gregory Soyez <soyez@fastjet.fr> 00020 // 00021 // * put the code in the fastjet::d0 namespace 00022 // 00023 // 2007-12-14 Gavin Salam <salam@lpthe.jussieu.fr> 00024 // 00025 // * added an index member 00026 00027 class HepEntity { 00028 00029 public: 00030 00031 HepEntity() { 00032 E=0.; 00033 px=0.; 00034 py=0.; 00035 pz=0.; 00036 index = -1; 00037 return; 00038 } 00039 00040 00041 HepEntity(double E_in, double px_in, double py_in, double pz_in, int index_in = -1) : 00042 E(E_in), px(px_in), py(py_in), pz(pz_in), index(index_in) { 00043 return; 00044 } 00045 00046 00047 HepEntity(const HepEntity& in) : E(in.E), px(in.px), py(in.py), pz(in.pz), index(in.index) { 00048 return; 00049 } 00050 00051 00052 inline double y() const { 00053 return inline_maths::y(E,pz); 00054 } 00055 00056 00057 inline double phi() const { 00058 return inline_maths::phi(px,py); 00059 } 00060 00061 00062 inline double pT() const { 00063 return sqrt(inline_maths::sqr(px)+inline_maths::sqr(py)); 00064 } 00065 00066 00067 inline void p4vec(float* p) const { 00068 p[0] = px; 00069 p[1] = py; 00070 p[2] = pz; 00071 p[3] = E; 00072 return; 00073 } 00074 00075 inline void Add(const HepEntity el) { 00076 E += el.E; 00077 px += el.px; 00078 py += el.py; 00079 pz += el.pz; 00080 return; 00081 } 00082 00083 inline void Fill(double E_in, double px_in, double py_in, double pz_in, int index_in = -1) { 00084 E = E_in; 00085 px = px_in; 00086 py = py_in; 00087 pz = pz_in; 00088 index = index_in; 00089 return; 00090 } 00091 00092 00093 double E; 00094 double px; 00095 double py; 00096 double pz; 00097 int index; 00098 00099 private: 00100 00101 00102 00103 }; 00104 //end of class HepEntity; 00105 00106 00107 } // namespace d0 00108 00109 FASTJET_END_NAMESPACE 00110 00111 #endif