#include <Kinematics.h>
|
static unsigned int | calcDeltaPhiBWLegacy (const TCS::GenericTOB *tob1, const TCS::GenericTOB *tob2) |
|
static unsigned int | calcDeltaEtaBWLegacy (const TCS::GenericTOB *tob1, const TCS::GenericTOB *tob2) |
|
static unsigned int | calcInvMassBWLegacy (const TCS::GenericTOB *tob1, const TCS::GenericTOB *tob2) |
|
static unsigned int | calcTMassBWLegacy (const TCS::GenericTOB *tob1, const TCS::GenericTOB *tob2) |
|
static unsigned int | calcDeltaR2BWLegacy (const TCS::GenericTOB *tob1, const TCS::GenericTOB *tob2) |
|
static float | calcCosLegacy (unsigned phi) |
|
static float | calcSinLegacy (unsigned phi) |
|
static unsigned int | calcDeltaPhiBW (const TCS::GenericTOB *tob1, const TCS::GenericTOB *tob2) |
|
static unsigned int | calcDeltaEtaBW (const TCS::GenericTOB *tob1, const TCS::GenericTOB *tob2) |
|
static unsigned int | calcInvMassBW (const TCS::GenericTOB *tob1, const TCS::GenericTOB *tob2) |
|
static unsigned int | calcTMassBW (const TCS::GenericTOB *tob1, const TCS::GenericTOB *tob2) |
|
static unsigned int | calcDeltaR2BW (const TCS::GenericTOB *tob1, const TCS::GenericTOB *tob2) |
|
static unsigned int | calcXi1 (const TCS::GenericTOB *tob1, const TCS::GenericTOB *tob2, unsigned ptShift, unsigned ptScale) |
|
static unsigned int | calcXi2 (const TCS::GenericTOB *tob1, const TCS::GenericTOB *tob2, unsigned ptShift, unsigned ptScale) |
|
static float | calcCos (unsigned phi) |
|
static float | calcSin (unsigned phi) |
|
static unsigned long | quadraticSumBW (int i1, int i2) |
| compute the sum in quadrature of two ints More...
|
|
static unsigned int | calcDeltaPhiLegacy (const TCS::GenericTOB *tob1, const TCS::GenericTOB *tob2) |
|
static unsigned int | calcDeltaEtaLegacy (const TCS::GenericTOB *tob1, const TCS::GenericTOB *tob2) |
|
static unsigned int | calcDeltaR2Legacy (const TCS::GenericTOB *tob1, const TCS::GenericTOB *tob2) |
|
static unsigned int | calcDeltaPhi (const TCS::GenericTOB *tob1, const TCS::GenericTOB *tob2) |
|
static unsigned int | calcDeltaEta (const TCS::GenericTOB *tob1, const TCS::GenericTOB *tob2) |
|
static unsigned int | calcInvMass (const TCS::GenericTOB *tob1, const TCS::GenericTOB *tob2) |
|
static unsigned int | calcTMass (const TCS::GenericTOB *tob1, const TCS::GenericTOB *tob2) |
|
static unsigned int | calcDeltaR2 (const TCS::GenericTOB *tob1, const TCS::GenericTOB *tob2) |
|
Definition at line 18 of file Kinematics.h.
◆ calcCos()
float TSU::Kinematics::calcCos |
( |
unsigned |
phi | ) |
|
|
static |
◆ calcCosLegacy()
float TSU::Kinematics::calcCosLegacy |
( |
unsigned |
phi | ) |
|
|
static |
◆ calcDeltaEta()
◆ calcDeltaEtaBW()
◆ calcDeltaEtaBWLegacy()
◆ calcDeltaEtaLegacy()
◆ calcDeltaPhi()
◆ calcDeltaPhiBW()
◆ calcDeltaPhiBWLegacy()
◆ calcDeltaPhiLegacy()
◆ calcDeltaR2()
Definition at line 266 of file Kinematics.cxx.
270 dphi = 2*
M_PI - dphi;
273 return round ( 40*40 * ((dphi)*(dphi) + (deta)*(deta) )) ;
◆ calcDeltaR2BW()
Definition at line 131 of file Kinematics.cxx.
132 int detaB = std::abs( tob1->
eta() - tob2->
eta() );
133 int dphiB = std::abs( tob1->
phi() - tob2->
phi() );
142 unsigned int bit_dr2 = dphiB*dphiB + detaB*detaB;
◆ calcDeltaR2BWLegacy()
Definition at line 62 of file Kinematics.cxx.
63 int detaB = std::abs( tob1->
eta() - tob2->
eta() );
64 int dphiB = std::abs( tob1->
phi() - tob2->
phi() );
70 unsigned int bit_dr2 = dphiB*dphiB + detaB*detaB;
◆ calcDeltaR2Legacy()
Definition at line 222 of file Kinematics.cxx.
226 dphi = 2*
M_PI - dphi;
228 return round ( 100 * ((dphi)*(dphi) + (deta)*(deta) )) ;
◆ calcInvMass()
Definition at line 244 of file Kinematics.cxx.
248 dphi = 2*
M_PI - dphi;
250 double cosheta = cosh ( deta);
251 double cosphi =
cos ( dphi);
252 double invmass2 = 2*tob1->
Et()*tob2->
Et()*(cosheta - cosphi);
253 return round( invmass2 );
◆ calcInvMassBW()
Definition at line 97 of file Kinematics.cxx.
102 int phi_tob1 = tob1->
phi();
103 int phi_tob2 = tob2->
phi();
104 if ( std::abs(phi_tob1-phi_tob2)>=128 )
106 if(phi_tob1 >= 64) phi_tob1 = phi_tob1-128;
107 if(phi_tob2 >= 64) phi_tob2 = phi_tob2-128;
112 auto bit_invmass2 = bit_Et1*bit_Et2*(bit_cosheta - bit_cosphi)*2;
114 auto u_invmass2 =
static_cast<unsigned long long>(bit_invmass2);
◆ calcInvMassBWLegacy()
Definition at line 34 of file Kinematics.cxx.
38 int phi_tob1 = tob1->
phi();
39 int phi_tob2 = tob2->
phi();
41 if ( std::abs(phi_tob1-phi_tob2)>=64 )
43 if(phi_tob1 >= 32) phi_tob1 = phi_tob1-64;
44 if(phi_tob2 >= 32) phi_tob2 = phi_tob2-64;
49 auto bit_invmass2 = bit_Et1*bit_Et2*(bit_cosheta - bit_cosphi)*2;
50 return static_cast<unsigned>(bit_invmass2) ;
◆ calcSin()
float TSU::Kinematics::calcSin |
( |
unsigned |
phi | ) |
|
|
static |
◆ calcSinLegacy()
float TSU::Kinematics::calcSinLegacy |
( |
unsigned |
phi | ) |
|
|
static |
◆ calcTMass()
Definition at line 256 of file Kinematics.cxx.
259 dphi = 2*
M_PI - dphi;
261 double cosphi =
cos ( dphi);
262 double tmass2 = 2*tob1->
Et()*tob2->
Et()*(1 - cosphi);
263 return round( tmass2 );
◆ calcTMassBW()
Definition at line 122 of file Kinematics.cxx.
127 return static_cast<unsigned>(bit_tmass2) ;
◆ calcTMassBWLegacy()
Definition at line 53 of file Kinematics.cxx.
58 return static_cast<unsigned>(bit_tmass2) ;
◆ calcXi1()
Definition at line 174 of file Kinematics.cxx.
183 auto xi_bit = bit_Et1*bit_eeta1+bit_Et2*bit_eeta2;
185 return static_cast<unsigned>(xi_bit);
◆ calcXi2()
Definition at line 188 of file Kinematics.cxx.
194 auto xi_bit = bit_Et1*bit_eeta1+bit_Et2*bit_eeta2;
196 return static_cast<unsigned>(xi_bit);
◆ quadraticSumBW()
unsigned long TSU::Kinematics::quadraticSumBW |
( |
int |
i1, |
|
|
int |
i2 |
|
) |
| |
|
static |
compute the sum in quadrature of two ints
This function includes an integer square root implementation using a bitwise iterative approach. Square root is computed bit-by-bit (highest significance bits first) and the result is adjusted up- or downwards in each iteration based on whether or not the current result under- or overestimates the value of the sum of squares.
That is the same way in which the sqrt int is implemented in firmware: processor/sources/common/libraries/L1TopoFunctions.vhd --> function sqrt(d : UNSIGNED) return UNSIGNED
Definition at line 146 of file Kinematics.cxx.
147 unsigned int ui1 = i1, ui2=i2;
148 unsigned int a = ui1*ui1 + ui2*ui2;
158 unsigned int bitmask = 0b11111111111111111111111111111111;
159 bitmask >>= (32 - halflength*2);
161 for(
int i = 0;
i < halflength;
i++){
163 left = (
r<<2) + (
a >> (2*halflength-2));
166 r =
sign ? (left + right) : (left - right);
167 sign = ((
r & (1 << (halflength+1) )) > 0) ? 1 : 0;
The documentation for this struct was generated from the following files: