siscone is hosted by Hepforge, IPPP Durham

The SISCone Jet Algorithm

Version 3.0.6



SISCone 3.0.6
momentum.h
1// -*- C++ -*-
3// File: momentum.h //
4// Description: header file for 4-momentum class Cmomentum //
5// This file is part of the SISCone project. //
6// For more details, see http://projects.hepforge.org/siscone //
7// //
8// Copyright (c) 2006 Gavin Salam and Gregory Soyez //
9// //
10// This program is free software; you can redistribute it and/or modify //
11// it under the terms of the GNU General Public License as published by //
12// the Free Software Foundation; either version 2 of the License, or //
13// (at your option) any later version. //
14// //
15// This program is distributed in the hope that it will be useful, //
16// but WITHOUT ANY WARRANTY; without even the implied warranty of //
17// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the //
18// GNU General Public License for more details. //
19// //
20// You should have received a copy of the GNU General Public License //
21// along with this program; if not, write to the Free Software //
22// Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA //
23// //
24// $Revision:: $//
25// $Date:: $//
27
28#ifndef __VECTOR_H__
29#define __VECTOR_H__
30
31#include <vector>
32#include <math.h>
33#include "reference.h"
34#include "geom_2d.h"
35#include "defines.h"
36
37namespace siscone{
38
50 public:
52 Cmomentum();
53
55 Cmomentum(double _px, double _py, double _pz, double _E);
56
58 Cmomentum(double _eta, double _phi, Creference _ref);
59
61 ~Cmomentum();
62
64 inline double perp() const {return sqrt(perp2());}
65
67 inline double perp2() const {return px*px+py*py;}
68
70 inline double mass() const {return sqrt(mass2());}
71
73 inline double mass2() const {return perpmass2()-perp2();}
74
76 inline double perpmass() const {return sqrt((E-pz)*(E+pz));}
77
79 inline double perpmass2() const {return (E-pz)*(E+pz);}
80
82 inline double Et() const {return E/sqrt(1.0+pz*pz/perp2());}
83
85 inline double Et2() const {return E*E/(1.0+pz*pz/perp2());}
86
89
92 const Cmomentum operator + (const Cmomentum &v);
93
97
101
107 void build_etaphi();
108
109 double px;
110 double py;
111 double pz;
112 double E;
113
114 double eta;
115 double phi;
117 int index;
118
120 // the following part is used for checksums //
123};
124
127bool operator < (const Cmomentum &v1, const Cmomentum &v2);
128
130bool momentum_eta_less(const Cmomentum &v1, const Cmomentum &v2);
131
133bool momentum_pt_less(const Cmomentum &v1, const Cmomentum &v2);
134
135
137// some handy utilities //
139
144inline double get_distance(double eta, double phi, Cmomentum *v){
145 double dx, dy;
146
147 dx = eta - v->eta;
148 dy = fabs(phi - v->phi);
149 if (dy>M_PI)
150 dy -= twopi;
151
152 return dx*dx+dy*dy;
153}
154
155}
156
157#endif
base class for dynamic coordinates management
Definition: momentum.h:49
Cmomentum & operator+=(const Cmomentum &v)
incrementation of vectors !!! WARNING !!! no updating of eta and phi !!!
Definition: momentum.cpp:104
double Et2() const
computes transverse energy (squared)
Definition: momentum.h:85
~Cmomentum()
default dtor
Definition: momentum.cpp:74
double mass2() const
computes m^2
Definition: momentum.h:73
double perp2() const
computes pT^2
Definition: momentum.h:67
const Cmomentum operator+(const Cmomentum &v)
addition of vectors !!! WARNING !!! no updating of eta and phi !!!
Definition: momentum.cpp:96
Creference ref
reference number for the vector
Definition: momentum.h:122
double perpmass2() const
transverse mass squared, mt^2 = pt^2+m^2 = E^2 - pz^2
Definition: momentum.h:79
int index
internal particle number
Definition: momentum.h:117
double eta
particle pseudo-rapidity
Definition: momentum.h:114
double Et() const
computes transverse energy
Definition: momentum.h:82
Cmomentum & operator-=(const Cmomentum &v)
decrementation of vectors !!! WARNING !!! no updating of eta and phi !!!
Definition: momentum.cpp:118
void build_etaphi()
build eta-phi from 4-momentum info !!! WARNING !!! !!! computing eta and phi is time-consuming !...
Definition: momentum.cpp:134
double py
y-momentum
Definition: momentum.h:110
int parent_index
particle number in the parent list
Definition: momentum.h:116
double mass() const
computes m
Definition: momentum.h:70
double px
x-momentum
Definition: momentum.h:109
Cmomentum & operator=(const Cmomentum &v)
assignment of vectors
Definition: momentum.cpp:80
double E
energy
Definition: momentum.h:112
double pz
z-momentum
Definition: momentum.h:111
double perp() const
computes pT
Definition: momentum.h:64
Cmomentum()
default ctor
Definition: momentum.cpp:42
double phi
particle azimuthal angle
Definition: momentum.h:115
double perpmass() const
transverse mass, mt = sqrt(pt^2+m^2) = sqrt(E^2 - pz^2)
Definition: momentum.h:76
references used for checksums.
Definition: reference.h:43
const double twopi
definition of 2*M_PI which is useful a bit everyhere!
Definition: defines.h:114

The SISCone project has been developed by Gavin Salam and Gregory Soyez
Documentation generated on Tue Jun 20 2023 18:08:37 for SISCone by  Doxygen 1.9.4