Main Page
Namespaces
Classes
Package Documentation
DataFormats
L1THGCal
src
ClusterShapes.cc
Go to the documentation of this file.
1
#include "
DataFormats/L1THGCal/interface/ClusterShapes.h
"
2
#include <cmath>
3
4
using namespace
l1t
;
5
6
ClusterShapes
ClusterShapes::operator+
(
const
ClusterShapes
&
x
)
7
{
8
ClusterShapes
cs
(*
this
);
// copy constructor
9
cs +=
x
;
10
return
cs
;
11
}
12
13
14
void
ClusterShapes::operator +=
(
const
ClusterShapes
&
x
){
15
16
sum_e_
+= x.
sum_e_
;
17
sum_e2_
+= x.
sum_e2_
;
18
sum_logE_
+= x.
sum_logE_
;
19
n_
+= x.
n_
;
20
21
sum_w_
+= x.
sum_w_
;
22
23
emax_
= (
emax_
> x.
emax_
) ?
emax_
: x.
emax_
;
24
25
// mid-point
26
sum_eta_
+= x.
sum_eta_
;
27
sum_phi_0_
+= x.
sum_phi_0_
;
//
28
sum_phi_1_
+= x.
sum_phi_1_
;
//
29
sum_r_
+= x.
sum_r_
;
30
31
// square
32
sum_eta2_
+= x.
sum_eta2_
;
33
sum_phi2_0_
+= x.
sum_phi2_0_
;
34
sum_phi2_1_
+= x.
sum_phi2_1_
;
35
sum_r2_
+= x.
sum_r2_
;
36
37
// off diagonal
38
sum_eta_r_
+= x.
sum_eta_r_
;
39
sum_r_phi_0_
+= x.
sum_r_phi_0_
;
40
sum_r_phi_1_
+= x.
sum_r_phi_1_
;
41
sum_eta_phi_0_
+= x.
sum_eta_phi_0_
;
42
sum_eta_phi_1_
+= x.
sum_eta_phi_1_
;
43
44
}
45
46
47
// -------------- CLUSTER SHAPES ---------------
48
void
ClusterShapes::Init
(
float
e
,
float
eta
,
float
phi
,
float
r
){
49
if
(e<=0 )
return
;
50
sum_e_
=
e
;
51
sum_e2_
= e*
e
;
52
sum_logE_
=
std::log
(e);
53
54
float
w
=
e
;
55
56
n_
=1;
57
58
sum_w_
=
w
;
59
60
sum_phi_0_
= w *(
phi
);
61
sum_phi_1_
= w* (phi +
M_PI
);
62
sum_r_
= w *
r
;
63
sum_eta_
= w *
eta
;
64
65
//--
66
sum_r2_
+= w * (r*
r
);
67
sum_eta2_
+= w * (eta*
eta
);
68
sum_phi2_0_
+= w * (phi*
phi
);
69
sum_phi2_1_
+= w * (phi+
M_PI
)*(phi+
M_PI
);
70
71
// -- off diagonal
72
sum_eta_r_
+= w * (r*
eta
);
73
sum_r_phi_0_
+= w* (r *
phi
);
74
sum_r_phi_1_
+= w* r *(phi +
M_PI
);
75
sum_eta_phi_0_
+= w* (eta *
phi
);
76
sum_eta_phi_1_
+= w* eta * (phi+
M_PI
);
77
78
}
79
// ------
80
float
ClusterShapes::Eta
()
const
{
return
sum_eta_
/
sum_w_
;}
81
float
ClusterShapes::R
()
const
{
return
sum_r_
/
sum_w_
;}
82
83
float
ClusterShapes::SigmaEtaEta
()
const
{
return
sum_eta2_
/
sum_w_
-
Eta
()*
Eta
();}
84
85
float
ClusterShapes::SigmaRR
()
const
{
return
sum_r2_
/
sum_w_
-
R
() *
R
();}
86
87
88
float
ClusterShapes::SigmaPhiPhi
()
const
{
89
float
phi_0 = (
sum_phi_0_
/
sum_w_
);
90
float
phi_1 = (
sum_phi_1_
/
sum_w_
);
91
float
spp_0 =
sum_phi2_0_
/
sum_w_
- phi_0*phi_0;
92
float
spp_1 =
sum_phi2_1_
/
sum_w_
- phi_1*phi_1;
93
94
if
(spp_0 < spp_1 )
95
{
96
isPhi0_
=
true
;
97
return
spp_0;
98
}
99
else
100
{
101
isPhi0_
=
false
;
102
return
spp_1;
103
}
104
}
105
106
float
ClusterShapes::Phi
()
const
{
107
SigmaPhiPhi
();
//update phi
108
if
(
isPhi0_
)
return
(
sum_phi_0_
/
sum_w_
);
109
else
return
(
sum_phi_1_
/
sum_w_
);
110
}
111
112
113
// off - diagonal
114
float
ClusterShapes::SigmaEtaR
()
const
{
return
-(
sum_eta_r_
/
sum_w_
-
Eta
() *
R
()) ;}
115
116
float
ClusterShapes::SigmaEtaPhi
()
const
{
117
SigmaPhiPhi
() ;
// decide which phi use, update phi
118
119
if
(
isPhi0_
)
120
return
-(
sum_eta_phi_0_
/
sum_w_
-
Eta
()*(
sum_phi_0_
/
sum_w_
));
121
else
122
return
-(
sum_eta_phi_1_
/
sum_w_
-
Eta
()*(
sum_phi_1_
/
sum_w_
));
123
}
124
125
float
ClusterShapes::SigmaRPhi
()
const
{
126
SigmaPhiPhi
() ;
// decide which phi use, update phi
127
if
(
isPhi0_
)
128
return
-(
sum_r_phi_0_
/
sum_w_
-
R
() *(
sum_phi_0_
/
sum_w_
));
129
else
130
return
-(
sum_r_phi_1_
/
sum_w_
-
R
() * (
sum_phi_1_
/
sum_w_
));
131
}
132
l1t::ClusterShapes::sum_r_
float sum_r_
Definition:
ClusterShapes.h:20
l1t::ClusterShapes::sum_w_
float sum_w_
Definition:
ClusterShapes.h:18
fwrapper::cs
auto_ptr< ClusterSequence > cs
Definition:
fastjetfortran_madfks.cc:45
stringResolutionProvider_cfi.eta
eta
Definition:
stringResolutionProvider_cfi.py:14
w
const double w
Definition:
UKUtility.cc:23
l1t::ClusterShapes::sum_r_phi_0_
float sum_r_phi_0_
Definition:
ClusterShapes.h:32
l1t::ClusterShapes::SigmaPhiPhi
float SigmaPhiPhi() const
Definition:
ClusterShapes.cc:88
l1t::ClusterShapes::sum_eta_phi_0_
float sum_eta_phi_0_
Definition:
ClusterShapes.h:34
l1t::ClusterShapes::SigmaEtaR
float SigmaEtaR() const
Definition:
ClusterShapes.cc:114
l1t::ClusterShapes::sum_eta2_
float sum_eta2_
Definition:
ClusterShapes.h:25
l1t
delete x;
Definition:
CaloConfig.h:22
l1t::ClusterShapes::Init
void Init(float e, float eta, float phi, float r=0.)
Definition:
ClusterShapes.cc:48
MillePedeFileConverter_cfg.e
e
Definition:
MillePedeFileConverter_cfg.py:37
l1t::ClusterShapes::sum_phi2_0_
float sum_phi2_0_
Definition:
ClusterShapes.h:27
l1t::ClusterShapes::sum_eta_phi_1_
float sum_eta_phi_1_
Definition:
ClusterShapes.h:35
DDAxes::phi
l1t::ClusterShapes::SigmaRR
float SigmaRR() const
Definition:
ClusterShapes.cc:85
l1t::ClusterShapes::sum_r_phi_1_
float sum_r_phi_1_
Definition:
ClusterShapes.h:33
l1t::ClusterShapes::Eta
float Eta() const
Definition:
ClusterShapes.cc:80
l1t::ClusterShapes
Definition:
ClusterShapes.h:9
l1t::ClusterShapes::sum_eta_r_
float sum_eta_r_
Definition:
ClusterShapes.h:31
l1t::ClusterShapes::sum_eta_
float sum_eta_
Definition:
ClusterShapes.h:19
l1t::ClusterShapes::SigmaRPhi
float SigmaRPhi() const
Definition:
ClusterShapes.cc:125
l1t::ClusterShapes::operator+
ClusterShapes operator+(const ClusterShapes &)
Definition:
ClusterShapes.cc:6
l1t::ClusterShapes::sum_phi2_1_
float sum_phi2_1_
Definition:
ClusterShapes.h:28
l1t::ClusterShapes::isPhi0_
bool isPhi0_
Definition:
ClusterShapes.h:38
l1t::ClusterShapes::SigmaEtaEta
float SigmaEtaEta() const
Definition:
ClusterShapes.cc:83
l1t::ClusterShapes::sum_r2_
float sum_r2_
Definition:
ClusterShapes.h:26
M_PI
#define M_PI
Definition:
BXVectorInputProducer.cc:51
l1t::ClusterShapes::sum_phi_0_
float sum_phi_0_
Definition:
ClusterShapes.h:22
alignCSCRings.r
r
Definition:
alignCSCRings.py:92
l1t::ClusterShapes::SigmaEtaPhi
float SigmaEtaPhi() const
Definition:
ClusterShapes.cc:116
l1t::ClusterShapes::sum_phi_1_
float sum_phi_1_
Definition:
ClusterShapes.h:23
cmsBatch.log
log
Definition:
cmsBatch.py:341
l1t::ClusterShapes::emax_
float emax_
Definition:
ClusterShapes.h:16
l1t::ClusterShapes::R
float R() const
Definition:
ClusterShapes.cc:81
l1t::ClusterShapes::sum_logE_
float sum_logE_
Definition:
ClusterShapes.h:13
l1t::ClusterShapes::sum_e_
float sum_e_
Definition:
ClusterShapes.h:11
l1t::ClusterShapes::operator+=
void operator+=(const ClusterShapes &)
Definition:
ClusterShapes.cc:14
DDAxes::x
ClusterShapes.h
l1t::ClusterShapes::Phi
float Phi() const
Definition:
ClusterShapes.cc:106
l1t::ClusterShapes::sum_e2_
float sum_e2_
Definition:
ClusterShapes.h:12
l1t::ClusterShapes::n_
int n_
Definition:
ClusterShapes.h:14
Generated for CMSSW Reference Manual by
1.8.11