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.

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.

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 }
base
Main Program
Definition: newFWLiteAna.py:92
Sin< T >::type sin(const T &t)
Definition: Sin.h:22
bool getPlotEt() const
float getScaleFactorLego() const
FWViewEnergyScale * getEnergyScale() const
Cos< T >::type cos(const T &t)
Definition: Cos.h:22
double f[11][100]
#define M_PI

Member Function Documentation

◆ updateScale()

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

Definition at line 44 of file FWLegoEvePFCandidate.cc.

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

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 }
bool getPlotEt() const
float getScaleFactorLego() const
FWViewEnergyScale * getEnergyScale() const

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().