FastJet 3.0.2
HepEntity.h
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 //
00017 // This file is distributed with FastJet under the terms of the GNU
00018 // General Public License (v2). Permission to do so has been granted
00019 // by Lars Sonnenschein and the D0 collaboration (see COPYING for
00020 // details)
00021 //
00022 // History of changes in FastJet compared tothe original version of
00023 // HepEntity.h
00024 //
00025 // 2011-12-13  Gregory Soyez  <soyez@fastjet.fr>
00026 // 
00027 //        * added license information
00028 //
00029 // 2009-01-17  Gregory Soyez  <soyez@fastjet.fr>
00030 //
00031 //        * put the code in the fastjet::d0 namespace
00032 //
00033 // 2007-12-14  Gavin Salam  <salam@lpthe.jussieu.fr>
00034 // 
00035 //        * added an index member
00036 
00037 class HepEntity {
00038 
00039  public:
00040 
00041   HepEntity() {
00042     E=0.;
00043     px=0.;
00044     py=0.;
00045     pz=0.;
00046     index = -1;
00047     return;
00048   }
00049 
00050 
00051   HepEntity(double E_in, double px_in, double py_in, double pz_in, int index_in = -1) : 
00052     E(E_in), px(px_in), py(py_in), pz(pz_in), index(index_in) {
00053     return;
00054   }
00055 
00056 
00057     HepEntity(const HepEntity& in) : E(in.E), px(in.px), py(in.py), pz(in.pz), index(in.index) {
00058     return;
00059   }
00060 
00061   
00062   inline double y() const {
00063     return inline_maths::y(E,pz);
00064   }
00065 
00066 
00067   inline double phi() const {
00068      return inline_maths::phi(px,py);
00069   }
00070 
00071 
00072   inline double pT() const {
00073      return sqrt(inline_maths::sqr(px)+inline_maths::sqr(py));
00074   }
00075 
00076 
00077   inline void p4vec(float* p) const {
00078     p[0] = px;
00079     p[1] = py;
00080     p[2] = pz;
00081     p[3] = E;
00082     return;
00083   }
00084 
00085   inline void Add(const HepEntity el) {
00086     E += el.E;
00087     px += el.px;
00088     py += el.py;
00089     pz += el.pz;
00090     return;
00091   }
00092 
00093   inline void Fill(double E_in, double px_in, double py_in, double pz_in, int index_in = -1) {
00094     E = E_in;
00095     px = px_in;
00096     py = py_in;
00097     pz = pz_in;
00098     index = index_in;
00099     return;
00100   }
00101 
00102 
00103   double E;
00104   double px;
00105   double py;
00106   double pz;
00107   int    index;
00108 
00109  private:
00110 
00111 
00112 
00113 };
00114 //end of class HepEntity;
00115 
00116 
00117 }  // namespace d0
00118 
00119 FASTJET_END_NAMESPACE
00120 
00121 #endif
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends