src
L1Trigger
L1THGCal
src
backend
HGCalMulticluster_SA.cc
Go to the documentation of this file.
1
#include "
L1Trigger/L1THGCal/interface/backend/HGCalMulticluster_SA.h
"
2
3
#include <cmath>
4
5
using namespace
l1thgcfirmware
;
6
7
HGCalMulticluster::HGCalMulticluster
(
const
HGCalCluster
& tc,
float
fraction
) {
8
HGCalMulticluster
();
9
addConstituent
(tc,
true
,
fraction
);
10
}
11
12
void
HGCalMulticluster::addConstituent
(
const
HGCalCluster
& tc,
bool
updateCentre,
float
fraction
) {
13
// If no constituents, set seedMiptPt to cluster mipPt
14
if
(
constituents_
.empty()) {
15
// seedMipPt_ = cMipPt;
16
if
(!updateCentre) {
17
centre_x_
= tc.
x
();
18
centre_y_
= tc.
y
();
19
centre_z_
= tc.
z
();
20
}
21
}
22
// UpdateP4AndPosition
23
updateP4AndPosition
(tc, updateCentre,
fraction
);
24
25
constituents_
.emplace_back(tc);
26
}
27
28
void
HGCalMulticluster::updateP4AndPosition
(
const
HGCalCluster
& tc,
bool
updateCentre,
float
fraction
) {
29
// Get cluster mipPt
30
double
cMipt = tc.
mipPt
() *
fraction
;
31
double
cPt = tc.
pt
() *
fraction
;
32
if
(updateCentre) {
33
float
clusterCentre_x =
centre_x_
*
mipPt_
+ tc.
x
() * cMipt;
34
float
clusterCentre_y =
centre_y_
*
mipPt_
+ tc.
y
() * cMipt;
35
float
clusterCentre_z =
centre_z_
*
mipPt_
+ tc.
z
() * cMipt;
// Check this!
36
37
if
((
mipPt_
+ cMipt) > 0) {
38
clusterCentre_x /= (
mipPt_
+ cMipt);
39
clusterCentre_y /= (
mipPt_
+ cMipt);
40
clusterCentre_z /= (
mipPt_
+ cMipt);
41
}
42
centre_x_
= clusterCentre_x;
43
centre_y_
= clusterCentre_y;
44
centre_z_
= clusterCentre_z;
45
46
if
(
centre_z_
!= 0) {
47
centreProj_x_
=
centre_x_
/
std::abs
(
centre_z_
);
48
centreProj_y_
=
centre_y_
/
std::abs
(
centre_z_
);
49
centreProj_z_
=
centre_z_
/
std::abs
(
centre_z_
);
50
}
51
}
52
53
mipPt_
+= cMipt;
54
sumPt_
+= cPt;
55
}
l1thgcfirmware::HGCalMulticluster::sumPt_
float sumPt_
Definition:
HGCalMulticluster_SA.h:46
l1thgcfirmware::HGCalCluster::y
float y() const
Definition:
HGCalCluster_SA.h:34
HLT_2023v12_cff.fraction
fraction
Definition:
HLT_2023v12_cff.py:38118
l1thgcfirmware::HGCalMulticluster::HGCalMulticluster
HGCalMulticluster()
Definition:
HGCalMulticluster_SA.h:12
l1thgcfirmware::HGCalMulticluster::centreProj_y_
float centreProj_y_
Definition:
HGCalMulticluster_SA.h:42
l1thgcfirmware::HGCalCluster
Definition:
HGCalCluster_SA.h:8
l1thgcfirmware::HGCalCluster::z
float z() const
Definition:
HGCalCluster_SA.h:35
funct::abs
Abs< T >::type abs(const T &t)
Definition:
Abs.h:22
l1thgcfirmware::HGCalMulticluster::centreProj_x_
float centreProj_x_
Definition:
HGCalMulticluster_SA.h:41
l1thgcfirmware::HGCalCluster::mipPt
float mipPt() const
Definition:
HGCalCluster_SA.h:41
l1thgcfirmware::HGCalMulticluster::centreProj_z_
float centreProj_z_
Definition:
HGCalMulticluster_SA.h:43
l1thgcfirmware::HGCalCluster::pt
float pt() const
Definition:
HGCalCluster_SA.h:40
l1thgcfirmware::HGCalMulticluster::updateP4AndPosition
void updateP4AndPosition(const l1thgcfirmware::HGCalCluster &tc, bool updateCentre=true, float fraction=1.)
Definition:
HGCalMulticluster_SA.cc:28
l1thgcfirmware::HGCalCluster::x
float x() const
Definition:
HGCalCluster_SA.h:33
l1thgcfirmware::HGCalMulticluster::centre_x_
float centre_x_
Definition:
HGCalMulticluster_SA.h:37
l1thgcfirmware
Definition:
HGCalCluster_SA.h:6
l1thgcfirmware::HGCalMulticluster::mipPt_
float mipPt_
Definition:
HGCalMulticluster_SA.h:45
l1thgcfirmware::HGCalMulticluster::addConstituent
void addConstituent(const l1thgcfirmware::HGCalCluster &tc, bool updateCentre=true, float fraction=1.)
Definition:
HGCalMulticluster_SA.cc:12
l1thgcfirmware::HGCalMulticluster::centre_z_
float centre_z_
Definition:
HGCalMulticluster_SA.h:39
l1thgcfirmware::HGCalMulticluster::constituents_
std::vector< l1thgcfirmware::HGCalCluster > constituents_
Definition:
HGCalMulticluster_SA.h:48
l1thgcfirmware::HGCalMulticluster::centre_y_
float centre_y_
Definition:
HGCalMulticluster_SA.h:38
HGCalMulticluster_SA.h
Generated for CMSSW Reference Manual by
1.8.14