CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
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 21 of file FWLegoEvePFCandidate.h.

Constructor & Destructor Documentation

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

Definition at line 11 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(), m_energy, m_et, M_PI, reco::LeafCandidate::phi(), reco::LeafCandidate::pt(), and funct::sin().

11  :
12  m_energy(0.f),
13  m_et(0.f)
14 {
15  m_et = iData.et();
16  m_energy = iData.energy();
17 
18  float base = 0.001; // flour offset 1%
19 
20  // first vertical line , which is et/energy
21  FWViewEnergyScale* caloScale = vc->getEnergyScale();
22  float val = caloScale->getPlotEt() ? m_et : m_energy;
23  AddLine(iData.eta(),iData.phi(), base,
24  iData.eta(),iData.phi(), base + val*caloScale->getScaleFactorLego());
25 
26 
27  AddMarker(0, 1.f);
28  SetMarkerStyle(3);
29  SetMarkerSize(0.01);
30  SetDepthTest(false);
31 
32  // circle pt
33  const unsigned int nLineSegments = 20;
34  float circleScalingFactor = 50;
35  const double jetRadius = iData.pt()/circleScalingFactor;
36 
37  for ( unsigned int iphi = 0; iphi < nLineSegments; ++iphi ) {
38  AddLine(iData.eta()+jetRadius*cos(2*M_PI/nLineSegments*iphi),
39  iData.phi()+jetRadius*sin(2*M_PI/nLineSegments*iphi),
40  base,
41  iData.eta()+jetRadius*cos(2*M_PI/nLineSegments*(iphi+1)),
42  iData.phi()+jetRadius*sin(2*M_PI/nLineSegments*(iphi+1)),
43  base);
44  }
45 }
tuple base
Main Program
Definition: newFWLiteAna.py:92
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]
#define M_PI
bool getPlotEt() const

Member Function Documentation

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

Definition at line 48 of file FWLegoEvePFCandidate.cc.

References FWViewContext::getEnergyScale(), FWViewEnergyScale::getPlotEt(), FWViewEnergyScale::getScaleFactorLego(), prof2calltree::l, m, m_energy, and m_et.

49 {
50  FWViewEnergyScale* caloScale = vc->getEnergyScale();
51  float val = caloScale->getPlotEt() ? m_et : m_energy;
52 
53  // printf("update scale %f \n", getScale(vc, context)); fflush(stdout);
54  float scaleFac = caloScale->getScaleFactorLego();
55  // resize first line
56  TEveChunkManager::iterator li(GetLinePlex());
57  li.next();
58  TEveStraightLineSet::Line_t& l = * (TEveStraightLineSet::Line_t*) li();
59  l.fV2[2] = l.fV1[2] + val*scaleFac;
60 
61  // move end point
62  TEveChunkManager::iterator mi(GetMarkerPlex());
63  mi.next();
64  TEveStraightLineSet::Marker_t& m = * (TEveStraightLineSet::Marker_t*) mi();
65  m.fV[2] = l.fV2[2];
66 }
FWViewEnergyScale * getEnergyScale() const
float getScaleFactorLego() const
bool getPlotEt() const

Member Data Documentation

float FWLegoEvePFCandidate::m_energy
private

Definition at line 28 of file FWLegoEvePFCandidate.h.

Referenced by FWLegoEvePFCandidate(), and updateScale().

float FWLegoEvePFCandidate::m_et
private

Definition at line 29 of file FWLegoEvePFCandidate.h.

Referenced by FWLegoEvePFCandidate(), and updateScale().