src
JetMETCorrections
MCJet
plugins
JetUtilMC.h
Go to the documentation of this file.
1
#ifndef JETUTILMC_H
2
#define JETUTILMC_H
3
4
#include <cmath>
5
#include <TMath.h>
6
namespace
{
7
class
PtGreater
{
8
public
:
9
template
<
typename
T>
10
bool
operator()
(
const
T
&
i
,
const
T
&
j
) {
11
return
(
i
.pt() >
j
.pt());
12
}
13
};
14
15
inline
double
Phi_0_2pi(
double
x
) {
16
while
(
x
>= 2 *
M_PI
)
17
x
-= 2 *
M_PI
;
18
while
(
x
< 0.)
19
x
+= 2 *
M_PI
;
20
return
x
;
21
}
22
23
inline
double
Phi_mpi_pi(
double
x
) {
24
while
(
x
>=
M_PI
)
25
x
-= 2 *
M_PI
;
26
while
(
x
< -
M_PI
)
27
x
+= 2 *
M_PI
;
28
return
x
;
29
}
30
31
inline
double
dPhi
(
double
phi1,
double
phi2) {
32
phi1 = Phi_0_2pi(phi1);
33
phi2 = Phi_0_2pi(phi2);
34
return
Phi_mpi_pi(phi1 - phi2);
35
}
36
37
inline
double
radius
(
double
eta1
,
double
phi1,
double
eta2
,
double
phi2) {
38
const
double
TWOPI
= 2.0 *
M_PI
;
39
40
phi1 = Phi_0_2pi(phi1);
41
phi2 = Phi_0_2pi(phi2);
42
43
double
dphi = Phi_0_2pi(phi1 - phi2);
44
dphi =
TMath::Min
(dphi,
TWOPI
- dphi);
45
double
deta =
eta1
-
eta2
;
46
47
return
sqrt
(deta * deta + dphi * dphi);
48
}
49
50
template
<
typename
T1,
typename
T2>
51
double
radius
(
const
T1&
t1
,
const
T2&
t2
) {
52
return
radius
(
t1
->eta(),
t1
->phi(),
t2
->eta(),
t2
->phi());
53
}
54
}
// namespace
55
56
#endif
mps_fire.i
i
Definition:
mps_fire.py:429
dqmiolumiharvest.j
j
Definition:
dqmiolumiharvest.py:66
HLT_2024v11_cff.dPhi
dPhi
Definition:
HLT_2024v11_cff.py:10659
RandomServiceHelper.t1
t1
Definition:
RandomServiceHelper.py:256
CosmicsPD_Skims.radius
radius
Definition:
CosmicsPD_Skims.py:135
mathSSE::sqrt
T sqrt(T t)
Definition:
SSEVec.h:19
TWOPI
#define TWOPI
Definition:
DQMSourcePi0.cc:318
HLT_2024v11_cff.eta2
eta2
Definition:
HLT_2024v11_cff.py:14645
M_PI
#define M_PI
Definition:
BXVectorInputProducer.cc:50
HLT_2024v11_cff.eta1
eta1
Definition:
HLT_2024v11_cff.py:14644
METSkim_cff.Min
Min
Definition:
METSkim_cff.py:34
x
float x
Definition:
beamSpotDipStandalone.cc:55
PtGreater
Definition:
SusyDQM.h:42
T
long double T
Definition:
Basic3DVectorLD.h:48
PtGreater::operator()
bool operator()(const T &i, const T &j)
Definition:
SusyDQM.h:45
RandomServiceHelper.t2
t2
Definition:
RandomServiceHelper.py:257
Generated for CMSSW Reference Manual by
1.8.14