CMS 3D CMS Logo

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