CMS 3D CMS Logo

List of all members | Public Member Functions | Private Attributes
FWLegoEvePFCandidate Class Reference

#include <FWLegoEvePFCandidate.h>

Inheritance diagram for FWLegoEvePFCandidate:

Public Member Functions

 FWLegoEvePFCandidate (const reco::PFCandidate &pfc, const FWViewContext *, const fireworks::Context &)
 
void updateScale (const FWViewContext *, const fireworks::Context &)
 

Private Attributes

float m_energy
 
float m_et
 

Detailed Description

Definition at line 19 of file FWLegoEvePFCandidate.h.

Constructor & Destructor Documentation

◆ FWLegoEvePFCandidate()

FWLegoEvePFCandidate::FWLegoEvePFCandidate ( const reco::PFCandidate pfc,
const FWViewContext vc,
const fireworks::Context context 
)

Definition at line 10 of file FWLegoEvePFCandidate.cc.

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 }

References newFWLiteAna::base, funct::cos(), reco::LeafCandidate::energy(), reco::LeafCandidate::et(), reco::LeafCandidate::eta(), f, FWViewContext::getEnergyScale(), FWViewEnergyScale::getPlotEt(), FWViewEnergyScale::getScaleFactorLego(), LEDCalibrationChannels::iphi, m_energy, m_et, M_PI, reco::LeafCandidate::phi(), reco::LeafCandidate::pt(), funct::sin(), and heppy_batch::val.

Member Function Documentation

◆ updateScale()

void FWLegoEvePFCandidate::updateScale ( const FWViewContext vc,
const fireworks::Context context 
)

Definition at line 44 of file FWLegoEvePFCandidate.cc.

44  {
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 }

References FWViewContext::getEnergyScale(), FWViewEnergyScale::getPlotEt(), FWViewEnergyScale::getScaleFactorLego(), cmsLHEtoEOSManager::l, visualization-live-secondInstance_cfg::m, m_energy, m_et, and heppy_batch::val.

Member Data Documentation

◆ m_energy

float FWLegoEvePFCandidate::m_energy
private

Definition at line 25 of file FWLegoEvePFCandidate.h.

Referenced by FWLegoEvePFCandidate(), and updateScale().

◆ m_et

float FWLegoEvePFCandidate::m_et
private

Definition at line 26 of file FWLegoEvePFCandidate.h.

Referenced by FWLegoEvePFCandidate(), and updateScale().

f
double f[11][100]
Definition: MuScleFitUtils.cc:78
FWViewEnergyScale::getPlotEt
bool getPlotEt() const
Definition: FWViewEnergyScale.h:47
funct::sin
Sin< T >::type sin(const T &t)
Definition: Sin.h:22
LEDCalibrationChannels.iphi
iphi
Definition: LEDCalibrationChannels.py:64
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:79
FWLegoEvePFCandidate::m_energy
float m_energy
Definition: FWLegoEvePFCandidate.h:25
FWViewEnergyScale::getScaleFactorLego
float getScaleFactorLego() const
Definition: FWViewEnergyScale.h:45
M_PI
#define M_PI
Definition: BXVectorInputProducer.cc:49
cmsLHEtoEOSManager.l
l
Definition: cmsLHEtoEOSManager.py:204
heppy_batch.val
val
Definition: heppy_batch.py:351
FWLegoEvePFCandidate::m_et
float m_et
Definition: FWLegoEvePFCandidate.h:26
FWViewEnergyScale
Definition: FWViewEnergyScale.h:34
newFWLiteAna.base
base
Definition: newFWLiteAna.py:92
FWViewContext::getEnergyScale
FWViewEnergyScale * getEnergyScale() const
Definition: FWViewContext.cc:25