CMS 3D CMS Logo

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

#include <FWLegoCandidate.h>

Inheritance diagram for FWLegoCandidate:

Public Member Functions

 FWLegoCandidate (const FWViewContext *vc, const fireworks::Context &context, float et, float energy, float pt, float eta, float phi)
 
 FWLegoCandidate ()
 
void updateScale (const FWViewContext *vc, const fireworks::Context &)
 
virtual ~FWLegoCandidate ()
 

Private Member Functions

 FWLegoCandidate (const FWLegoCandidate &)
 
const FWLegoCandidateoperator= (const FWLegoCandidate &)
 

Private Attributes

float m_energy
 
float m_et
 
float m_eta
 
float m_phi
 
float m_pt
 

Detailed Description

Definition at line 29 of file FWLegoCandidate.h.

Constructor & Destructor Documentation

FWLegoCandidate::FWLegoCandidate ( const FWViewContext vc,
const fireworks::Context context,
float  et,
float  energy,
float  pt,
float  eta,
float  phi 
)

Definition at line 8 of file FWLegoCandidate.cc.

References runEdmFileComparison::base, funct::cos(), f, FWViewContext::getEnergyScale(), FWViewEnergyScale::getPlotEt(), FWViewEnergyScale::getScaleFactorLego(), cmsBatch::log, m_energy, m_eta, m_phi, m_pt, Pi, TCMET_cfi::radius, funct::sin(), Geom::twoPi(), and heppy_batch::val.

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 }
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]
base
Make Sure CMSSW is Setup ##.
et
define resolution functions of each parameter
constexpr double twoPi()
Definition: Pi.h:32
bool getPlotEt() const
FWLegoCandidate::FWLegoCandidate ( )
inline

Definition at line 35 of file FWLegoCandidate.h.

35 {}
virtual FWLegoCandidate::~FWLegoCandidate ( )
inlinevirtual

Definition at line 36 of file FWLegoCandidate.h.

36 {}
FWLegoCandidate::FWLegoCandidate ( const FWLegoCandidate )
private

Member Function Documentation

const FWLegoCandidate& FWLegoCandidate::operator= ( const FWLegoCandidate )
private
void FWLegoCandidate::updateScale ( const FWViewContext vc,
const fireworks::Context context 
)

Definition at line 45 of file FWLegoCandidate.cc.

References FWViewContext::getEnergyScale(), FWViewEnergyScale::getPlotEt(), FWViewEnergyScale::getScaleFactorLego(), checklumidiff::l, funct::m, m_energy, m_pt, and heppy_batch::val.

Referenced by FWCandidateHGCalLegoProxyBuilder::scaleProduct(), FWPFCandidatesLegoProxyBuilder::scaleProduct(), FWCandidateLegoProxyBuilder::scaleProduct(), FWPFPatJetLegoProxyBuilder< T >::scaleProduct(), FWPFClusterLegoProxyBuilder::scaleProduct(), and FWPFBlockProxyBuilder::scaleProduct().

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

Member Data Documentation

float FWLegoCandidate::m_energy
private

Definition at line 46 of file FWLegoCandidate.h.

Referenced by FWLegoCandidate(), and updateScale().

float FWLegoCandidate::m_et
private

Definition at line 47 of file FWLegoCandidate.h.

float FWLegoCandidate::m_eta
private

Definition at line 49 of file FWLegoCandidate.h.

Referenced by FWLegoCandidate().

float FWLegoCandidate::m_phi
private

Definition at line 50 of file FWLegoCandidate.h.

Referenced by FWLegoCandidate().

float FWLegoCandidate::m_pt
private

Definition at line 48 of file FWLegoCandidate.h.

Referenced by FWLegoCandidate(), and updateScale().