CMS 3D CMS Logo

FWLegoCandidate.cc
Go to the documentation of this file.
2 
6 
7 //______________________________________________________________________________
9  const FWViewContext *vc, const fireworks::Context &context, float energy, float et, float pt, float eta, float phi)
10  : m_energy(energy), m_et(et), m_pt(pt), m_eta(eta), m_phi(phi) {
11  float base = 0.001; // Floor offset 1%
12 
13  // First vertical line
14  FWViewEnergyScale *caloScale = vc->getEnergyScale();
15  float val = caloScale->getPlotEt() ? m_pt : m_energy; // Use pt instead of et
16 
17  AddLine(m_eta, m_phi, base, m_eta, m_phi, base + val * caloScale->getScaleFactorLego());
18 
19  AddMarker(0, 1.f);
20  SetMarkerStyle(3);
21  SetMarkerSize(0.01);
22  SetDepthTest(false);
23 
24  // Circle pt
25  const unsigned int nLineSegments = 20;
26  const double radius = log(1 + m_pt) / log(10) / 30.f;
27  //const double radius = m_pt / 100.f;
28  const double twoPi = 2 * TMath::Pi();
29 
30  for (unsigned int iPhi = 0; iPhi < nLineSegments; ++iPhi) {
31  AddLine(m_eta + radius * cos(twoPi / nLineSegments * iPhi),
32  m_phi + radius * sin(twoPi / nLineSegments * iPhi),
33  base,
34  m_eta + radius * cos(twoPi / nLineSegments * (iPhi + 1)),
35  m_phi + radius * sin(twoPi / nLineSegments * (iPhi + 1)),
36  base);
37  }
38 }
39 
40 //______________________________________________________________________________
42  FWViewEnergyScale *caloScale = vc->getEnergyScale();
43  float val = caloScale->getPlotEt() ? m_pt : m_energy; // Use pt instead of et
44  float scaleFac = caloScale->getScaleFactorLego();
45 
46  // Resize first line
47  TEveChunkManager::iterator li(GetLinePlex());
48  li.next();
49  TEveStraightLineSet::Line_t &l = *(TEveStraightLineSet::Line_t *)li();
50  l.fV2[2] = l.fV1[2] + val * scaleFac;
51 
52  // Move end point (marker)
53  TEveChunkManager::iterator mi(GetMarkerPlex());
54  mi.next();
55  TEveStraightLineSet::Marker_t &m = *(TEveStraightLineSet::Marker_t *)mi();
56  m.fV[2] = l.fV2[2]; // Set to new top of line
57 }
const double Pi
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]
void updateScale(const FWViewContext *vc, const fireworks::Context &)
constexpr double twoPi()
Definition: Pi.h:32