Main Page
Namespaces
Classes
Package Documentation
All
Classes
Namespaces
Files
Functions
Variables
Typedefs
Enumerations
Enumerator
Properties
Friends
Macros
Groups
Pages
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
dqmiolumiharvest.j
tuple j
Definition:
dqmiolumiharvest.py:66
mps_fire.i
i
Definition:
mps_fire.py:428
siStripFEDMonitor_P5_cff.Min
tuple Min
Definition:
siStripFEDMonitor_P5_cff.py:55
HLT_FULL_cff.eta2
tuple eta2
Definition:
HLT_FULL_cff.py:14111
mathSSE::sqrt
T sqrt(T t)
Definition:
SSEVec.h:19
M_PI
#define M_PI
Definition:
BXVectorInputProducer.cc:50
TWOPI
const float TWOPI
2.0 * PI
Definition:
IceTypes.h:23
x
float x
Definition:
beamSpotDipStandalone.cc:55
PtGreater
Definition:
SusyDQM.h:42
HLT_FULL_cff.eta1
tuple eta1
Definition:
HLT_FULL_cff.py:14110
T
long double T
Definition:
Basic3DVectorLD.h:48
CosmicsPD_Skims.radius
tuple radius
Definition:
CosmicsPD_Skims.py:135
PtGreater::operator()
bool operator()(const T &i, const T &j)
Definition:
SusyDQM.h:45
Generated for CMSSW Reference Manual by
1.8.5