CMS 3D CMS Logo

Public Member Functions | Private Attributes

FWLegoEvePFCandidate Class Reference

#include <FWLegoEvePFCandidate.h>

List of all members.

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

                                                                                                                                 :
   m_energy(0.f),
   m_et(0.f)
{
   m_et =  iData.et();
   m_energy = iData.energy();

   float base = 0.001; // flour offset 1%

   // first vertical  line , which is et/energy
   FWViewEnergyScale* caloScale = vc->getEnergyScale();
   float val = caloScale->getPlotEt() ?  m_et : m_energy;
   AddLine(iData.eta(),iData.phi(), base, 
           iData.eta(),iData.phi(), base + val*caloScale->getScaleFactorLego());


   AddMarker(0, 1.f);
   SetMarkerStyle(3); 
   SetMarkerSize(0.01); 
   SetDepthTest(false);

   // circle pt
   const unsigned int nLineSegments = 20;
   float circleScalingFactor = 50;
   const double jetRadius = iData.pt()/circleScalingFactor;
  
   for ( unsigned int iphi = 0; iphi < nLineSegments; ++iphi ) {
      AddLine(iData.eta()+jetRadius*cos(2*M_PI/nLineSegments*iphi),
              iData.phi()+jetRadius*sin(2*M_PI/nLineSegments*iphi),
              base,
              iData.eta()+jetRadius*cos(2*M_PI/nLineSegments*(iphi+1)),
              iData.phi()+jetRadius*sin(2*M_PI/nLineSegments*(iphi+1)),
              base);
   }
}

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.

{
   FWViewEnergyScale* caloScale = vc->getEnergyScale();
   float val = caloScale->getPlotEt() ?  m_et : m_energy;

   // printf("update scale %f \n", getScale(vc, context)); fflush(stdout);
   float scaleFac =  caloScale->getScaleFactorLego();
   // resize first line
   TEveChunkManager::iterator li(GetLinePlex());
   li.next();
   TEveStraightLineSet::Line_t& l = * (TEveStraightLineSet::Line_t*) li(); 
   l.fV2[2] = l.fV1[2] + val*scaleFac;

   // move end point
   TEveChunkManager::iterator mi(GetMarkerPlex());
   mi.next();
   TEveStraightLineSet::Marker_t& m = * (TEveStraightLineSet::Marker_t*) mi();
   m.fV[2] =  l.fV2[2];
}

Member Data Documentation

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