File: HepEntityIpre96.h

package info (click to toggle)
fastjet 3.0.6%2Bdfsg-3
  • links: PTS, VCS
  • area: main
  • in suites: bullseye, buster, stretch
  • size: 9,468 kB
  • ctags: 3,766
  • sloc: cpp: 21,498; sh: 10,546; fortran: 673; makefile: 518; ansic: 131
file content (157 lines) | stat: -rw-r--r-- 3,241 bytes parent folder | download | duplicates (5)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
#ifndef  D0RunIconeJets_HepEntityPre96_class
#define  D0RunIconeJets_HepEntityPre96_class

#include "inline_maths.h"
#include "HepEntityI.h"
#include <fastjet/internal/base.hh>

FASTJET_BEGIN_NAMESPACE

namespace d0runi{

//Author: Lars Sonnenschein 25/Feb/2010
//This is an example class fulfilling the minimal requirements needed by the
//D0 RunI cone jet algorithm implementation prior to 1996, which is an inlined template class
//See FERMILAB-Pub-97-242-E for details

// This file is distributed with FastJet under the terms of the GNU
// General Public License (v2). Permission to do so has been granted
// by Lars Sonnenschein and the D0 collaboration (see COPYING for
// details)
//
// History of changes in FastJet compared tothe original version of
// HepEntity.h
//
// 2011-12-13  Gregory Soyez  <soyez@fastjet.fr>
// 
//        * added license information
//
// 2011-11-14  Gregory Soyez  <soyez@fastjet.fr>
//
//         * removed some harmless warnings coming with the -Wshadow gcc option
// 
// 2011-10-06  Gregory Soyez  <soyez@fastjet.fr>
//
//        * put the code in the fastjet::d0runi namespace

class HepEntityIpre96 : public HepEntityI {

 public:

  HepEntityIpre96() {
    Et=0.;
    eta=0.;
    phi=0.;
    Ex=0.;
    Ey=0.;
    Ez=0.;
    index = -1;
    phi_pre96=0.;
    eta_pre96=0.;

    return;
  }


 HepEntityIpre96(double E_in, double px_in, double py_in, double pz_in,
		 int index_in = -1) : index(index_in) {
   //Snowmass Et scheme    
    double pt = sqrt(px_in*px_in+py_in*py_in);
    double p = sqrt(pt*pt+pz_in*pz_in);
    phi = inline_maths::phi(px_in,py_in);
    double theta = asin(pt/p);
    eta = inline_maths::eta(theta);

    Et = E_in*sin(theta);

    phi_pre96 = phi;
    eta_pre96 = eta;

    Ex = Et*cos(phi_pre96);
    Ey = Et*sin(phi_pre96);
    Ez = Et*sinh(eta_pre96);
  
    return;
  }


  inline double px() const {
    return Et*cos(phi_pre96);
  }

  inline double py() const {
    return Et*sin(phi_pre96);
  }

  inline double pz() const {
    return Et*sinh(eta_pre96);
  }
  
  inline double E() const {
    return Et*cosh(eta_pre96);
  }
  
 
  inline void Add(const HepEntityIpre96 el) {
    //assumes Et, eta and phi stored accurately
    double w2 = el.Et;
    Et += el.Et;
    w2 /= Et;
    
    eta += w2*(el.eta - eta);
    phi += w2*inline_maths::delta_phi(el.phi, phi); 


    Ex += el.Ex;
    Ey += el.Ey;
    Ez += el.Ez;
    phi_pre96 = atan2(Ey, Ex);
    double theta_pre96 = atan2(sqrt(Ex*Ex+Ey*Ey),Ez);
    eta_pre96 = -log(tan(theta_pre96/2.));

    return; 
  }


  inline void Fill(double E_in, double px_in, double py_in, double pz_in, int index_in) {
    double pt = sqrt(px_in*px_in+py_in*py_in);
    double p = sqrt(pt*pt+pz_in*pz_in);
    phi = inline_maths::phi(px_in,py_in);
    double theta = asin(pt/p);
    eta = inline_maths::eta(theta);

    Et = E_in*sin(theta);

    
    phi_pre96 = phi;
    eta_pre96 = eta;

    Ex = Et*cos(phi_pre96);
    Ey = Et*sin(phi_pre96);
    Ez = Et*sinh(eta_pre96);

    index = index_in;

    return;
  }


  double Ex;
  double Ey;
  double Ez;
  int index;
  double phi_pre96;
  double eta_pre96;

 private:



};
//end of class HepEntityIpre96;

} // end of namespace d0runi

FASTJET_END_NAMESPACE

#endif