Fireworks
ParticleFlow
src
FWLegoEvePFCandidate.cc
Go to the documentation of this file.
1
#include "TEveCaloData.h"
2
3
#include "
Fireworks/Core/interface/Context.h
"
4
#include "
Fireworks/Core/interface/FWViewContext.h
"
5
#include "
Fireworks/Core/interface/FWViewEnergyScale.h
"
6
#include "
Fireworks/ParticleFlow/interface/FWLegoEvePFCandidate.h
"
7
#include "
DataFormats/ParticleFlowCandidate/interface/PFCandidate.h
"
8
#include "
Fireworks/Core/interface/fwLog.h
"
9
10
FWLegoEvePFCandidate::FWLegoEvePFCandidate
(
const
reco::PFCandidate
& iData,
11
const
FWViewContext
* vc,
12
const
fireworks::Context
& context)
13
: m_energy(0.
f
), m_et(0.
f
) {
14
m_et
= iData.
et
();
15
m_energy
= iData.
energy
();
16
17
float
base
= 0.001;
// flour offset 1%
18
19
// first vertical line , which is et/energy
20
FWViewEnergyScale
* caloScale = vc->
getEnergyScale
();
21
float
val
= caloScale->
getPlotEt
() ?
m_et
:
m_energy
;
22
AddLine(iData.
eta
(), iData.
phi
(),
base
, iData.
eta
(), iData.
phi
(),
base
+
val
* caloScale->
getScaleFactorLego
());
23
24
AddMarker(0, 1.
f
);
25
SetMarkerStyle(3);
26
SetMarkerSize(0.01);
27
SetDepthTest(
false
);
28
29
// circle pt
30
const
unsigned
int
nLineSegments = 20;
31
float
circleScalingFactor = 50;
32
const
double
jetRadius = iData.
pt
() / circleScalingFactor;
33
34
for
(
unsigned
int
iphi
= 0;
iphi
< nLineSegments; ++
iphi
) {
35
AddLine(iData.
eta
() + jetRadius *
cos
(2 *
M_PI
/ nLineSegments *
iphi
),
36
iData.
phi
() + jetRadius *
sin
(2 *
M_PI
/ nLineSegments *
iphi
),
37
base
,
38
iData.
eta
() + jetRadius *
cos
(2 *
M_PI
/ nLineSegments * (
iphi
+ 1)),
39
iData.
phi
() + jetRadius *
sin
(2 *
M_PI
/ nLineSegments * (
iphi
+ 1)),
40
base
);
41
}
42
}
43
44
void
FWLegoEvePFCandidate::updateScale
(
const
FWViewContext
* vc,
const
fireworks::Context
& context) {
45
FWViewEnergyScale
* caloScale = vc->
getEnergyScale
();
46
float
val
= caloScale->
getPlotEt
() ?
m_et
:
m_energy
;
47
48
// printf("update scale %f \n", getScale(vc, context)); fflush(stdout);
49
float
scaleFac = caloScale->
getScaleFactorLego
();
50
// resize first line
51
TEveChunkManager::iterator li(GetLinePlex());
52
li.next();
53
TEveStraightLineSet::Line_t&
l
= *(TEveStraightLineSet::Line_t*)li();
54
l
.fV2[2] =
l
.fV1[2] +
val
* scaleFac;
55
56
// move end point
57
TEveChunkManager::iterator mi(GetMarkerPlex());
58
mi.next();
59
TEveStraightLineSet::Marker_t&
m
= *(TEveStraightLineSet::Marker_t*)mi();
60
m
.fV[2] =
l
.fV2[2];
61
}
fireworks::Context
Definition:
Context.h:41
f
double f[11][100]
Definition:
MuScleFitUtils.cc:78
PFCandidate.h
FWLegoEvePFCandidate.h
FWViewEnergyScale::getPlotEt
bool getPlotEt() const
Definition:
FWViewEnergyScale.h:47
reco::LeafCandidate::pt
double pt() const final
transverse momentum
Definition:
LeafCandidate.h:146
funct::sin
Sin< T >::type sin(const T &t)
Definition:
Sin.h:22
LEDCalibrationChannels.iphi
iphi
Definition:
LEDCalibrationChannels.py:64
FWViewContext.h
funct::cos
Cos< T >::type cos(const T &t)
Definition:
Cos.h:22
visualization-live-secondInstance_cfg.m
m
Definition:
visualization-live-secondInstance_cfg.py:72
FWLegoEvePFCandidate::m_energy
float m_energy
Definition:
FWLegoEvePFCandidate.h:25
FWLegoEvePFCandidate::FWLegoEvePFCandidate
FWLegoEvePFCandidate(const reco::PFCandidate &pfc, const FWViewContext *, const fireworks::Context &)
Definition:
FWLegoEvePFCandidate.cc:10
FWViewEnergyScale::getScaleFactorLego
float getScaleFactorLego() const
Definition:
FWViewEnergyScale.h:45
reco::LeafCandidate::eta
double eta() const final
momentum pseudorapidity
Definition:
LeafCandidate.h:152
FWLegoEvePFCandidate::updateScale
void updateScale(const FWViewContext *, const fireworks::Context &)
Definition:
FWLegoEvePFCandidate.cc:44
M_PI
#define M_PI
Definition:
BXVectorInputProducer.cc:49
fwLog.h
FWViewContext
Definition:
FWViewContext.h:32
cmsLHEtoEOSManager.l
l
Definition:
cmsLHEtoEOSManager.py:204
reco::LeafCandidate::et
double et() const final
transverse energy
Definition:
LeafCandidate.h:127
heppy_batch.val
val
Definition:
heppy_batch.py:351
reco::LeafCandidate::phi
double phi() const final
momentum azimuthal angle
Definition:
LeafCandidate.h:148
FWLegoEvePFCandidate::m_et
float m_et
Definition:
FWLegoEvePFCandidate.h:26
FWViewEnergyScale
Definition:
FWViewEnergyScale.h:34
reco::LeafCandidate::energy
double energy() const final
energy
Definition:
LeafCandidate.h:125
reco::PFCandidate
Particle reconstructed by the particle flow algorithm.
Definition:
PFCandidate.h:41
FWViewEnergyScale.h
newFWLiteAna.base
base
Definition:
newFWLiteAna.py:92
FWViewContext::getEnergyScale
FWViewEnergyScale * getEnergyScale() const
Definition:
FWViewContext.cc:25
Context.h
Generated for CMSSW Reference Manual by
1.8.16