Fork me on GitHub

source: git/external/fastjet/plugins/D0RunICone/HepEntityIpre96.h@ 239e1d0

ImprovedOutputFile Timing dual_readout llp 3.3.3pre11
Last change on this file since 239e1d0 was d7d2da3, checked in by pavel <pavel@…>, 12 years ago

move branches/ModularDelphes to trunk

  • Property mode set to 100644
File size: 3.2 KB
Line 
1#ifndef D0RunIconeJets_HepEntityPre96_class
2#define D0RunIconeJets_HepEntityPre96_class
3
4#include "inline_maths.h"
5#include "HepEntityI.h"
6#include <fastjet/internal/base.hh>
7
8FASTJET_BEGIN_NAMESPACE
9
10namespace d0runi{
11
12//Author: Lars Sonnenschein 25/Feb/2010
13//This is an example class fulfilling the minimal requirements needed by the
14//D0 RunI cone jet algorithm implementation prior to 1996, which is an inlined template class
15//See FERMILAB-Pub-97-242-E for details
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// 2011-11-14 Gregory Soyez <soyez@fastjet.fr>
30//
31// * removed some harmless warnings coming with the -Wshadow gcc option
32//
33// 2011-10-06 Gregory Soyez <soyez@fastjet.fr>
34//
35// * put the code in the fastjet::d0runi namespace
36
37class HepEntityIpre96 : public HepEntityI {
38
39 public:
40
41 HepEntityIpre96() {
42 Et=0.;
43 eta=0.;
44 phi=0.;
45 Ex=0.;
46 Ey=0.;
47 Ez=0.;
48 index = -1;
49 phi_pre96=0.;
50 eta_pre96=0.;
51
52 return;
53 }
54
55
56 HepEntityIpre96(double E_in, double px_in, double py_in, double pz_in,
57 int index_in = -1) : index(index_in) {
58 //Snowmass Et scheme
59 double pt = sqrt(px_in*px_in+py_in*py_in);
60 double p = sqrt(pt*pt+pz_in*pz_in);
61 phi = inline_maths::phi(px_in,py_in);
62 double theta = asin(pt/p);
63 eta = inline_maths::eta(theta);
64
65 Et = E_in*sin(theta);
66
67 phi_pre96 = phi;
68 eta_pre96 = eta;
69
70 Ex = Et*cos(phi_pre96);
71 Ey = Et*sin(phi_pre96);
72 Ez = Et*sinh(eta_pre96);
73
74 return;
75 }
76
77
78 inline double px() const {
79 return Et*cos(phi_pre96);
80 }
81
82 inline double py() const {
83 return Et*sin(phi_pre96);
84 }
85
86 inline double pz() const {
87 return Et*sinh(eta_pre96);
88 }
89
90 inline double E() const {
91 return Et*cosh(eta_pre96);
92 }
93
94
95 inline void Add(const HepEntityIpre96 el) {
96 //assumes Et, eta and phi stored accurately
97 double w2 = el.Et;
98 Et += el.Et;
99 w2 /= Et;
100
101 eta += w2*(el.eta - eta);
102 phi += w2*inline_maths::delta_phi(el.phi, phi);
103
104
105 Ex += el.Ex;
106 Ey += el.Ey;
107 Ez += el.Ez;
108 phi_pre96 = atan2(Ey, Ex);
109 double theta_pre96 = atan2(sqrt(Ex*Ex+Ey*Ey),Ez);
110 eta_pre96 = -log(tan(theta_pre96/2.));
111
112 return;
113 }
114
115
116 inline void Fill(double E_in, double px_in, double py_in, double pz_in, int index_in) {
117 double pt = sqrt(px_in*px_in+py_in*py_in);
118 double p = sqrt(pt*pt+pz_in*pz_in);
119 phi = inline_maths::phi(px_in,py_in);
120 double theta = asin(pt/p);
121 eta = inline_maths::eta(theta);
122
123 Et = E_in*sin(theta);
124
125
126 phi_pre96 = phi;
127 eta_pre96 = eta;
128
129 Ex = Et*cos(phi_pre96);
130 Ey = Et*sin(phi_pre96);
131 Ez = Et*sinh(eta_pre96);
132
133 index = index_in;
134
135 return;
136 }
137
138
139 double Ex;
140 double Ey;
141 double Ez;
142 int index;
143 double phi_pre96;
144 double eta_pre96;
145
146 private:
147
148
149
150};
151//end of class HepEntityIpre96;
152
153} // end of namespace d0runi
154
155FASTJET_END_NAMESPACE
156
157#endif
Note: See TracBrowser for help on using the repository browser.