Fireworks
ParticleFlow
src
FWPFClusterRPZUtils.cc
Go to the documentation of this file.
1
#include "
Fireworks/ParticleFlow/interface/FWPFClusterRPZUtils.h
"
2
3
//______________________________________________________________________________
4
TEveScalableStraightLineSet *
FWPFClusterRPZUtils::buildRhoPhiClusterLineSet
(
const
reco::PFCluster
&cluster,
5
const
FWViewContext
*vc,
6
float
r
) {
7
float
energy
,
et
;
8
TEveVector centre = TEveVector(cluster.
x
(), cluster.
y
(), cluster.
z
());
9
10
energy
= cluster.
energy
();
11
et
=
FWPFMaths::calculateEt
(centre,
energy
);
12
13
return
buildRhoPhiClusterLineSet
(cluster, vc,
energy
,
et
,
r
);
14
}
15
16
//______________________________________________________________________________
17
TEveScalableStraightLineSet *
FWPFClusterRPZUtils::buildRhoPhiClusterLineSet
(
18
const
reco::PFCluster
&cluster,
const
FWViewContext
*vc,
float
e
,
float
et
,
float
r
) {
19
TEveScalableStraightLineSet *
ls
=
new
TEveScalableStraightLineSet(
"rhophiCluster"
);
20
TEveVector vec;
21
float
size
= 1.f;
// Stored in scale
22
double
phi
;
23
24
vec = TEveVector(cluster.
x
(), cluster.
y
(), cluster.
z
());
25
phi
= vec.Phi();
26
27
FWViewEnergyScale
*energyScale = vc->
getEnergyScale
();
28
ls
->SetLineWidth(4);
29
30
ls
->SetScaleCenter(
r
*
cos
(
phi
),
r
*
sin
(
phi
), 0);
31
ls
->AddLine(
r
*
cos
(
phi
),
r
*
sin
(
phi
), 0, (
r
+
size
) *
cos
(
phi
), (
r
+
size
) *
sin
(
phi
), 0);
32
ls
->SetScale(energyScale->
getScaleFactor3D
() * (energyScale->
getPlotEt
() ?
et
:
e
));
33
34
return
ls
;
35
}
36
37
//______________________________________________________________________________
38
TEveScalableStraightLineSet *
FWPFClusterRPZUtils::buildRhoZClusterLineSet
(
39
const
reco::PFCluster
&cluster,
const
FWViewContext
*vc,
float
caloTransAngle,
float
r
,
float
z
) {
40
float
energy
,
et
;
41
TEveVector centre = TEveVector(cluster.
x
(), cluster.
y
(), cluster.
z
());
42
43
energy
= cluster.
energy
();
44
et
=
FWPFMaths::calculateEt
(centre,
energy
);
45
46
return
buildRhoZClusterLineSet
(cluster, vc, caloTransAngle,
energy
,
et
,
r
,
z
);
47
}
48
49
//______________________________________________________________________________
50
TEveScalableStraightLineSet *
FWPFClusterRPZUtils::buildRhoZClusterLineSet
(
51
const
reco::PFCluster
&cluster,
const
FWViewContext
*vc,
float
caloTransAngle,
float
e
,
float
et
,
float
r
,
float
z
) {
52
float
size
= 1.f;
// Stored in scale
53
float
offr = 4;
54
float
ecalZ =
z
+ offr /
tan
(caloTransAngle);
55
double
theta
,
phi
;
56
double
rad(0);
57
TEveVector vec;
58
TEveScalableStraightLineSet *
ls
=
new
TEveScalableStraightLineSet(
"rhoZCluster"
);
59
60
vec = TEveVector(cluster.
x
(), cluster.
y
(), cluster.
z
());
61
phi
= vec.Phi();
62
theta
= vec.Theta();
63
64
FWViewEnergyScale
*caloScale = vc->
getEnergyScale
();
65
ls
->SetLineWidth(4);
66
67
if
(
theta
< caloTransAngle ||
TMath::Pi
() -
theta
< caloTransAngle)
68
rad = ecalZ / fabs(
cos
(
theta
));
69
else
70
rad =
r
/
sin
(
theta
);
71
72
ls
->SetScaleCenter(0., (
phi
> 0 ? rad * fabs(
sin
(
theta
)) : -rad * fabs(
sin
(
theta
))), rad *
cos
(
theta
));
73
ls
->AddLine(0.,
74
(
phi
> 0 ? rad * fabs(
sin
(
theta
)) : -rad * fabs(
sin
(
theta
))),
75
rad *
cos
(
theta
),
76
0.,
77
(
phi
> 0 ? (rad +
size
) * fabs(
sin
(
theta
)) : -(rad +
size
) * fabs(
sin
(
theta
))),
78
(rad +
size
) *
cos
(
theta
));
79
ls
->SetScale(caloScale->
getScaleFactor3D
() * (caloScale->
getPlotEt
() ?
et
:
e
));
80
81
return
ls
;
82
}
eostools.ls
def ls(path, rec=False)
Definition:
eostools.py:349
reco::CaloCluster::y
double y() const
y coordinate of cluster centroid
Definition:
CaloCluster.h:175
detailsBasic3DVector::z
float float float z
Definition:
extBasic3DVector.h:14
FWPFClusterRPZUtils::buildRhoPhiClusterLineSet
TEveScalableStraightLineSet * buildRhoPhiClusterLineSet(const reco::PFCluster &, const FWViewContext *, float r)
Definition:
FWPFClusterRPZUtils.cc:4
reco::CaloCluster::z
double z() const
z coordinate of cluster centroid
Definition:
CaloCluster.h:178
FWViewEnergyScale::getPlotEt
bool getPlotEt() const
Definition:
FWViewEnergyScale.h:47
funct::sin
Sin< T >::type sin(const T &t)
Definition:
Sin.h:22
FWPFClusterRPZUtils.h
reco::PFCluster::energy
double energy() const
cluster energy
Definition:
PFCluster.h:78
FWPFMaths::calculateEt
float calculateEt(const TEveVector ¢re, float e)
Definition:
FWPFMaths.cc:115
funct::cos
Cos< T >::type cos(const T &t)
Definition:
Cos.h:22
DDAxes::z
FWPFClusterRPZUtils::buildRhoZClusterLineSet
TEveScalableStraightLineSet * buildRhoZClusterLineSet(const reco::PFCluster &, const FWViewContext *, float caloTransAngle, float r, float z)
Definition:
FWPFClusterRPZUtils.cc:38
theta
Geom::Theta< T > theta() const
Definition:
Basic3DVectorLD.h:150
HCALHighEnergyHPDFilter_cfi.energy
energy
Definition:
HCALHighEnergyHPDFilter_cfi.py:5
funct::tan
Tan< T >::type tan(const T &t)
Definition:
Tan.h:22
EgHLTOffHistBins_cfi.et
et
Definition:
EgHLTOffHistBins_cfi.py:8
FWViewContext
Definition:
FWViewContext.h:32
alignCSCRings.r
r
Definition:
alignCSCRings.py:93
DDAxes::phi
FWViewEnergyScale::getScaleFactor3D
float getScaleFactor3D() const
Definition:
FWViewEnergyScale.h:44
reco::PFCluster
Particle flow cluster, see clustering algorithm in PFClusterAlgo.
Definition:
PFCluster.h:46
FWViewEnergyScale
Definition:
FWViewEnergyScale.h:34
Pi
const double Pi
Definition:
CosmicMuonParameters.h:18
FWViewContext::getEnergyScale
FWViewEnergyScale * getEnergyScale() const
Definition:
FWViewContext.cc:25
reco::CaloCluster::x
double x() const
x coordinate of cluster centroid
Definition:
CaloCluster.h:172
findQualityFiles.size
size
Write out results.
Definition:
findQualityFiles.py:443
MillePedeFileConverter_cfg.e
e
Definition:
MillePedeFileConverter_cfg.py:37
Generated for CMSSW Reference Manual by
1.8.16