FastJet  3.1.0-beta.1
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Groups Pages
HepEntity.h
1 #ifndef D0RunIIconeJets_HepEntity_class
2 #define D0RunIIconeJets_HepEntity_class
3 
4 #include "inline_maths.h"
5 
6 #include <fastjet/internal/base.hh>
7 
8 FASTJET_BEGIN_NAMESPACE
9 
10 namespace d0{
11 
12 //Author: Lars Sonnenschein 28/Mar/2007
13 //This is an example class fulfilling the minimal requirements needed by the
14 //D0 RunII cone jet algorithm implementation, which is an inlined template class
15 //
16 //
17 // This file is distributed with FastJet under the terms of the GNU
18 // General Public License (v2). Permission to do so has been granted
19 // by Lars Sonnenschein and the D0 collaboration (see COPYING for
20 // details)
21 //
22 // History of changes in FastJet compared tothe original version of
23 // HepEntity.h
24 //
25 // 2011-12-13 Gregory Soyez <soyez@fastjet.fr>
26 //
27 // * added license information
28 //
29 // 2009-01-17 Gregory Soyez <soyez@fastjet.fr>
30 //
31 // * put the code in the fastjet::d0 namespace
32 //
33 // 2007-12-14 Gavin Salam <salam@lpthe.jussieu.fr>
34 //
35 // * added an index member
36 
37 class HepEntity {
38 
39  public:
40 
41  HepEntity() {
42  E=0.;
43  px=0.;
44  py=0.;
45  pz=0.;
46  index = -1;
47  return;
48  }
49 
50 
51  HepEntity(double E_in, double px_in, double py_in, double pz_in, int index_in = -1) :
52  E(E_in), px(px_in), py(py_in), pz(pz_in), index(index_in) {
53  return;
54  }
55 
56 
57  HepEntity(const HepEntity& in) : E(in.E), px(in.px), py(in.py), pz(in.pz), index(in.index) {
58  return;
59  }
60 
61 
62  inline double y() const {
63  return inline_maths::y(E,pz);
64  }
65 
66 
67  inline double phi() const {
68  return inline_maths::phi(px,py);
69  }
70 
71 
72  inline double pT() const {
73  return sqrt(inline_maths::sqr(px)+inline_maths::sqr(py));
74  }
75 
76 
77  inline void p4vec(float* p) const {
78  p[0] = px;
79  p[1] = py;
80  p[2] = pz;
81  p[3] = E;
82  return;
83  }
84 
85  inline void Add(const HepEntity el) {
86  E += el.E;
87  px += el.px;
88  py += el.py;
89  pz += el.pz;
90  return;
91  }
92 
93  inline void Fill(double E_in, double px_in, double py_in, double pz_in, int index_in = -1) {
94  E = E_in;
95  px = px_in;
96  py = py_in;
97  pz = pz_in;
98  index = index_in;
99  return;
100  }
101 
102 
103  double E;
104  double px;
105  double py;
106  double pz;
107  int index;
108 
109  private:
110 
111 
112 
113 };
114 //end of class HepEntity;
115 
116 
117 } // namespace d0
118 
119 FASTJET_END_NAMESPACE
120 
121 #endif