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 Member Functions | Private Attributes
FWPFCandidateDetailView Class Reference

#include <FWPFCandidateDetailView.h>

Inheritance diagram for FWPFCandidateDetailView:
FWDetailViewGL< reco::PFCandidate > CSGActionSupervisor FWDetailView< reco::PFCandidate > FWDetailViewBase

Public Member Functions

 FWPFCandidateDetailView ()
 
virtual ~FWPFCandidateDetailView ()
 
- Public Member Functions inherited from FWDetailViewGL< reco::PFCandidate >
 FWDetailViewGL ()
 
virtual void init (TEveWindowSlot *)
 
virtual void setBackgroundColor (Color_t)
 
TGLViewer * viewerGL () const
 
virtual ~FWDetailViewGL ()
 
- Public Member Functions inherited from FWDetailView< reco::PFCandidate >
virtual void build (const FWModelId &iID, const void *iData)
 
 FWDetailView ()
 
- Public Member Functions inherited from FWDetailViewBase
void build (const FWModelId &)
 
const fireworks::Contextcontext () const
 
const FWEventItemitem ()
 
void setItem (const FWEventItem *x)
 
virtual ~FWDetailViewBase ()
 
- Public Member Functions inherited from CSGActionSupervisor
Bool_t activateMenuEntry (int entry)
 
Bool_t activateToolBarEntry (int entry)
 
void addToActionMap (CSGAction *action)
 
 CSGActionSupervisor ()
 
virtual void defaultAction ()
 
virtual void enableActions (bool enable=true)
 
CSGActiongetAction (const std::string &name)
 
const std::vector< CSGAction * > & getListOfActions () const
 
Long_t getToolTipDelay () const
 
virtual void HandleMenu (Int_t id)
 
void resizeMenu (TGPopupMenu *menu)
 
virtual ~CSGActionSupervisor ()
 

Private Member Functions

void addClusters (const std::vector< reco::PFCluster > *)
 
void addHits (const std::vector< reco::PFRecHit > *)
 
void addTracks (const std::vector< reco::PFRecTrack > *)
 
void build (const FWModelId &id, const reco::PFCandidate *)
 
void buildGLEventScene ()
 
float eta ()
 
float etaMax ()
 
float etaMin ()
 
 FWPFCandidateDetailView (const FWPFCandidateDetailView &)
 
bool isPntInRng (float x, float y)
 
void makeLegend (void)
 
const FWPFCandidateDetailViewoperator= (const FWPFCandidateDetailView &)
 
float phi ()
 
float phiMax ()
 
float phiMin ()
 
void plotEtChanged ()
 
void rangeChanged (int x)
 
void rnrHcalChanged ()
 
void setTextInfo (const FWModelId &id, const reco::PFCandidate *)
 
void voteMaxEtEVal (const std::vector< reco::PFRecHit > *hits)
 

Private Attributes

const reco::PFCandidatem_candidate
 
TEveElementList * m_eventList
 
TLegend * m_legend
 
bool m_plotEt
 
float m_range
 
bool m_rnrHcal
 
TGSlider * m_slider
 
FWIntValueListenerm_sliderListener
 

Additional Inherited Members

- Static Public Member Functions inherited from FWDetailView< reco::PFCandidate >
static std::string classRegisterTypeName ()
 
static std::string classTypeName ()
 
- Static Public Member Functions inherited from FWDetailViewBase
static void drawCanvasBox (Double_t *pos, Color_t fillCol, Int_t fillType=0, bool bg=kTRUE)
 
static void drawCanvasDot (Float_t x, Float_t y, Float_t r, Color_t)
 
- Protected Member Functions inherited from FWDetailViewBase
 FWDetailViewBase (const std::type_info &)
 
- Protected Attributes inherited from FWDetailViewGL< reco::PFCandidate >
TEveScene * m_eveScene
 
TEveViewer * m_eveViewer
 
TGCompositeFrame * m_guiFrame
 
TCanvas * m_infoCanvas
 
- Protected Attributes inherited from CSGActionSupervisor
std::vector< CSGAction * > m_actionList
 

Detailed Description

Definition at line 23 of file FWPFCandidateDetailView.h.

Constructor & Destructor Documentation

FWPFCandidateDetailView::FWPFCandidateDetailView ( )

Definition at line 50 of file FWPFCandidateDetailView.cc.

FWPFCandidateDetailView::~FWPFCandidateDetailView ( )
virtual

Definition at line 61 of file FWPFCandidateDetailView.cc.

62 {
63 }
FWPFCandidateDetailView::FWPFCandidateDetailView ( const FWPFCandidateDetailView )
private

Member Function Documentation

void FWPFCandidateDetailView::addClusters ( const std::vector< reco::PFCluster > *  cluster)
private

Definition at line 313 of file FWPFCandidateDetailView.cc.

References cuy::col, isPntInRng(), eostools::ls(), and m_eventList.

Referenced by buildGLEventScene().

314 {
315  if (!cluster) return;
316 
317  Color_t col = kViolet+9;
318 
319  TEveStraightLineSet* ls = new TEveStraightLineSet("cluster_ls");
320  ls->SetMainColor(col);
321  m_eventList->AddElement(ls);
322 
323  TEvePointSet* ps = new TEvePointSet("cluster_ps");
324  ps->SetMainColor(col);
325  ps->SetMarkerStyle(2);
326  ps->SetMarkerSize(0.005);
327  m_eventList->AddElement(ps);
328 
329  for (std::vector<reco::PFCluster>::const_iterator it = cluster->begin(); it != cluster->end(); ++it)
330  {
331  if (!isPntInRng(it->position().Eta(), it->position().Phi()))
332  continue;
333 
334  ps->SetNextPoint(it->position().Eta(), it->position().Phi(), 0);
335 
336  /*
337  const std::vector< reco::PFRecHitFraction >& fractions = it->recHitFractions();
338  for (std::vector< reco::PFRecHitFraction >::const_iterator fi = fractions.begin(); fi != fractions.end(); ++fi)
339  {
340  // !!! AMT can't get fi->recHitRef().position()
341  // ls->AddLine(it->position().Eta(), it->position().Phi(), 0,
342  // fi->recHitRef().position().Eta(), fi->recHitRef().position().Phi(), 0);
343  }
344  */
345 
346  }
347 }
bool isPntInRng(float x, float y)
def ls
Definition: eostools.py:346
int col
Definition: cuy.py:1008
void FWPFCandidateDetailView::addHits ( const std::vector< reco::PFRecHit > *  hits)
private

Definition at line 384 of file FWPFCandidateDetailView.cc.

References FWPFMaths::calculateEt(), FWDetailViewBase::context(), eta(), fireworks::Context::getMaxEnergyInEvent(), AnalysisDataFormats_SUSYBSMObjects::hc, isPntInRng(), relval_steps::k, m_eventList, m_plotEt, phi(), x, detailsBasic3DVector::y, and detailsBasic3DVector::z.

Referenced by buildGLEventScene().

385 {
386 
387  TEveStraightLineSet* lsOutline = ( TEveStraightLineSet*)m_eventList->FindChild("outlines");
388 
389  TEvePointSet* ps = new TEvePointSet("test");
390  m_eventList->AddElement(ps);
391  ps->SetMainColor(kOrange);
392 
393  for (std::vector<reco::PFRecHit>::const_iterator it = hits->begin(); it != hits->end(); ++it)
394  {
395  const std::vector< math::XYZPoint >& corners = it->getCornersXYZ();
396  if (!isPntInRng(corners[0].eta(), corners[0].phi()))
397  continue;
398 
399  std::vector<TEveVector> hc;
400  for (int k = 0; k < 4; ++k) {
401  hc.push_back(TEveVector(corners[k].eta(), corners[k].phi(), 0));
402  // ps->SetNextPoint(corners[k].eta(),corners[k].phi(),0 ); //debug
403  }
404 
405  WrapTwoPi(hc, corners[0].phi());
406 
407  AddLineToLineSet(lsOutline, hc, 0, 1);
408  AddLineToLineSet(lsOutline, hc, 1, 2);
409  AddLineToLineSet(lsOutline, hc, 2, 3);
410  AddLineToLineSet(lsOutline, hc, 3, 0);
411 
412 
413  // get scaled corners
414  TEveVector centerOfGravity = hc[0] + hc[1] + hc[2] + hc[3];
415  centerOfGravity *= 0.25;
416 
417  std::vector<TEveVector> radialVectors;
418  for (int k = 0; k < 4; ++k)
419  radialVectors.push_back(TEveVector(hc[k] - centerOfGravity));
420 
421  float factor = 1;
422  if (m_plotEt) {
423  float Et = FWPFMaths::calculateEt( TEveVector(corners[0].x(), corners[0].y(), corners[0].z()), it->energy());
424  factor = Et/context().getMaxEnergyInEvent(m_plotEt);
425  }
426  else
427  factor = it->energy()/context().getMaxEnergyInEvent(false);
428 
429 
430  std::vector<TEveVector> scaledCorners;
431  for (int k = 0; k < 4; ++k) {
432  radialVectors[k] *= factor;
433  scaledCorners.push_back(TEveVector(radialVectors[k] + centerOfGravity));
434  }
435 
436  TEveStraightLineSet* ls = ( TEveStraightLineSet*)m_eventList->FindChild(Form("%d_rechit", it->depth() ));
437  AddLineToLineSet(ls, scaledCorners, 0, 1);
438  AddLineToLineSet(ls, scaledCorners, 1, 2);
439  AddLineToLineSet(ls, scaledCorners, 2, 3);
440  // AddLineToLineSet(ls, scaledCorners, 3, 0);
441  TEveStraightLineSet::Line_t* li = AddLineToLineSet(ls, scaledCorners, 3, 0);
442  ls->AddMarker(centerOfGravity, li->fId);
443 
444  }
445 }
bool isPntInRng(float x, float y)
def ls
Definition: eostools.py:346
float float float z
const fireworks::Context & context() const
float getMaxEnergyInEvent(bool isEt) const
Definition: Context.cc:200
float calculateEt(const TEveVector &centre, float e)
Definition: FWPFMaths.cc:115
susybsm::HSCParticleCollection hc
Definition: classes.h:25
Definition: DDAxes.h:10
void FWPFCandidateDetailView::addTracks ( const std::vector< reco::PFRecTrack > *  tracks)
private

AMT trackRef() is a collection !!!

Definition at line 286 of file FWPFCandidateDetailView.cc.

Referenced by buildGLEventScene().

287 {
288  for (std::vector<reco::PFRecTrack>::const_iterator it = tracks->begin(); it != tracks->end(); ++it)
289  {
291  /*
292  if (!isPntInRng(it->trackRef().innerMomentum().Eta(), it->position().Phi()))
293  continue;
294 
295  TEveLine* line = new TEveLine("Track");
296  line->SetMainColor(kYellow);
297  int N = it->nTrajectoryPoints();
298 
299  for (int p = 0 ; p<N; ++p) {
300  pos = track.extrapolatedPoint(p).position();
301 
302  if( pos.Eta() !=0 and pos.Phi() !=0)
303  line->SetNextPoint(pos.Eta(), pos.Phi(), 0);
304  }
305  m_eventList->AddElement(line);
306  */
307 
308  }
309 }
tuple tracks
Definition: testEve_cfg.py:39
void FWPFCandidateDetailView::build ( const FWModelId id,
const reco::PFCandidate candidate 
)
privatevirtual

Implements FWDetailView< reco::PFCandidate >.

Definition at line 167 of file FWPFCandidateDetailView.cc.

References alignCSCRings::action, CSGAction::activated, b, buildGLEventScene(), dtNoiseDBValidation_cfg::cerr, f, FWGUIManager::getCurrentEvent(), FWGUIManager::getGUIManager(), CSGAction::getName(), m_candidate, m_eventList, FWDetailViewGL< reco::PFCandidate >::m_eveScene, FWDetailViewGL< reco::PFCandidate >::m_guiFrame, m_slider, m_sliderListener, makeLegend(), AlCaHLTBitMon_ParallelJobs::p, plotEtChanged(), edm::Handle< T >::product(), rangeChanged(), rnrHcalChanged(), setTextInfo(), FWIntValueListener::valueChanged_, FWDetailViewGL< reco::PFCandidate >::viewerGL(), voteMaxEtEVal(), and cms::Exception::what().

168 {
169  m_candidate = candidate;
170 
171  // ROOT GUI
172  //
173  {
174  TGCompositeFrame* f = new TGVerticalFrame(m_guiFrame);
175  m_guiFrame->AddFrame(f);
176  f->AddFrame(new TGLabel(f, "Rng:"), new TGLayoutHints(kLHintsLeft, 2, 2, 0, 0));
177  m_slider = new TGHSlider(f, 120, kSlider1 | kScaleNo);
178  f->AddFrame(m_slider, new TGLayoutHints(kLHintsTop | kLHintsLeft, 2, 2, 1, 4));
179  m_slider->SetRange(1, 50);
180  m_slider->SetPosition(8);
181 
183  TQObject::Connect(m_slider, "PositionChanged(Int_t)", "FWIntValueListenerBase", m_sliderListener, "setValue(Int_t)");
185  {
186  CSGAction* action = new CSGAction(this, "Scale Et");
187  TGCheckButton* b = new TGCheckButton(m_guiFrame, action->getName().c_str() );
188  b->SetState(kButtonDown, true);
189  m_guiFrame->AddFrame(b, new TGLayoutHints( kLHintsNormal, 2, 3, 1, 4));
190  TQObject::Connect(b, "Clicked()", "CSGAction", action, "activate()");
191  action->activated.connect(sigc::mem_fun(this, &FWPFCandidateDetailView::plotEtChanged));
192  }
193  {
194  CSGAction* action = new CSGAction(this, "RnrHcal");
195  TGCheckButton* b = new TGCheckButton(m_guiFrame, action->getName().c_str() );
196  b->SetState(kButtonDown, true);
197  m_guiFrame->AddFrame(b, new TGLayoutHints( kLHintsNormal, 2, 3, 1, 4));
198  TQObject::Connect(b, "Clicked()", "CSGAction", action, "activate()");
199  action->activated.connect(sigc::mem_fun(this, &FWPFCandidateDetailView::rnrHcalChanged));
200  }
201 
202  }
203  makeLegend();
204  setTextInfo(id, candidate);
205 
206  TGCompositeFrame* p = (TGCompositeFrame*)m_guiFrame->GetParent();
207  p->MapSubwindows();
208  p->Layout();
209 
211  // GL stuff
212 
213 
214  m_candidate = candidate;
215 
216  try {
219  event->getByLabel(edm::InputTag("particleFlowRecHitECAL"), ecalH);
220  if (ecalH.product()) voteMaxEtEVal(ecalH.product());
221 
223  event->getByLabel(edm::InputTag("particleFlowRecHitHCAL"),hcalH);
224  if (hcalH.product()) voteMaxEtEVal(hcalH.product());
225 
227  event->getByLabel(edm::InputTag("particleFlowRecHitHO"),hoH);
228  if (hoH.product()) voteMaxEtEVal(hoH.product());
229 
231  event->getByLabel(edm::InputTag("particleFlowRecHitHF"),hfH);
232  if (hfH.product()) voteMaxEtEVal(hfH.product());
233 
234 
235  }
236  catch(const cms::Exception& iE) {
237  std::cerr << iE.what();
238  }
239 
240  m_eveScene->GetGLScene()->SetSelectable(false);
241  m_eventList = new TEveElementList("PFDetailView");
242  m_eveScene->AddElement(m_eventList);
243 
244 
245  viewerGL()->SetStyle(TGLRnrCtx::kOutline);
246  viewerGL()->SetCurrentCamera(TGLViewer::kCameraOrthoXOY);
247 
248  TGLCameraOverlay* co = viewerGL()->GetCameraOverlay();
249  co->SetShowOrthographic(kTRUE);
250  co->SetOrthographicMode(TGLCameraOverlay::kAxis);
251 
252  viewerGL()->ResetCamerasAfterNextUpdate();
253  try {
255  }
256  catch (...) {
257  printf("unknown exception \n");
258  }
259 
260  viewerGL()->UpdateScene(kFALSE);
261 
262  gEve->Redraw3D();
263 
264  // gEve->AddToListTree(m_eventList, true);//debug, used with --eve option
265 }
const std::string & getName() const
Definition: CSGAction.cc:81
virtual char const * what() const
Definition: Exception.cc:141
FWIntValueListener * m_sliderListener
sigc::signal< void > activated
Definition: CSGAction.h:88
sigc::signal< void, Int_t > valueChanged_
double f[11][100]
void voteMaxEtEVal(const std::vector< reco::PFRecHit > *hits)
const edm::EventBase * getCurrentEvent() const
T const * product() const
Definition: Handle.h:81
static FWGUIManager * getGUIManager()
const reco::PFCandidate * m_candidate
double b
Definition: hdecay.h:120
void setTextInfo(const FWModelId &id, const reco::PFCandidate *)
void FWPFCandidateDetailView::buildGLEventScene ( )
private

Definition at line 451 of file FWPFCandidateDetailView.cc.

References addClusters(), addHits(), addTracks(), dtNoiseDBValidation_cfg::cerr, HLT_25ns14e33_v1_cff::depth, FWGUIManager::getCurrentEvent(), FWGUIManager::getGUIManager(), m_eventList, m_rnrHcal, edm::Handle< T >::product(), and cms::Exception::what().

Referenced by build(), plotEtChanged(), rangeChanged(), and rnrHcalChanged().

452 {
453  if (m_eventList->HasChildren()) m_eventList->DestroyElements();
454 
455 
456  for (int depth = 0; depth < 6; ++depth)
457  {
458  TEveStraightLineSet* ls = new TEveStraightLineSet(Form("%d_rechit", depth));
459 
460  if (depth == 0 ) ls->SetLineColor(kGray);
461  else if (depth == 1 ) ls->SetLineColor(kRed);
462  else if (depth == 2 ) ls->SetLineColor(kGreen);
463  else if (depth == 3 ) ls->SetLineColor(kMagenta);
464  else if (depth == 4 ) ls->SetLineColor(kOrange);
465  else if (depth == 5 ) ls->SetLineColor(kYellow);
466 
467  ls->SetMarkerStyle(1);
468  m_eventList->AddElement(ls);
469  }
470 
471  TEveStraightLineSet* ls = new TEveStraightLineSet("outlines");
472  ls->SetLineColor(kGray);
473  ls->SetMainTransparency(80);
474  m_eventList->AddElement(ls);
475 
476 
478 
479 
480  //
481  // recHits
482  //
483  try {
485  event->getByLabel(edm::InputTag("particleFlowRecHitECAL"), ecalH);
486  addHits(ecalH.product());
487  }
488  catch(const cms::Exception& iE) {
489  std::cerr << iE.what();
490  }
491 
492  if (m_rnrHcal) {
493  try {
495  event->getByLabel(edm::InputTag("particleFlowRecHitHF"), hfH);
496  addHits(hfH.product());
497  }
498  catch(const cms::Exception& iE) {
499  std::cerr << iE.what();
500  }
501 
502 
503  try {
505  event->getByLabel(edm::InputTag("particleFlowRecHitHBHE"),hcalH);
506  addHits(hcalH.product());
507  }
508  catch(const cms::Exception& iE) {
509  std::cerr << iE.what();
510  }
511 
512  try {
514  event->getByLabel(edm::InputTag("particleFlowRecHitHO"),hcalH);
515  addHits(hcalH.product());
516  }
517  catch(const cms::Exception& iE) {
518  std::cerr << iE.what();
519 
520  }
521  }
522 
523 
524  //
525  // clusters
526  //
527  try {
529  event->getByLabel(edm::InputTag("particleFlowClusterECAL"), ecalClustersH);
530  addClusters(ecalClustersH.product());
531  }
532  catch (const cms::Exception& iE) {
533  std::cerr << iE.what();
534  }
535 
536  if (m_rnrHcal) {
537 
538  try {
540  event->getByLabel(edm::InputTag("particleFlowClusterHCAL"), hcalClustersH);
541  addClusters(hcalClustersH.product());
542  }
543  catch (const cms::Exception& iE) {
544  std::cerr << iE.what();
545  }
546 
547  try {
549  event->getByLabel(edm::InputTag("particleFlowClusterHO"), hcalClustersH);
550  addClusters(hcalClustersH.product());
551  }
552  catch (const cms::Exception& iE) {
553  std::cerr << iE.what();
554  }
555 
556 
557 
558  }
559 
560  //
561  // tracks
562  //
563  try {
565  event->getByLabel(edm::InputTag("pfTrack"),trackH);
566  addTracks(trackH.product());
567  }
568  catch (const cms::Exception& iE) {
569  std::cerr << iE.what();
570  }
571 
572 }
virtual char const * what() const
Definition: Exception.cc:141
def ls
Definition: eostools.py:346
const edm::EventBase * getCurrentEvent() const
T const * product() const
Definition: Handle.h:81
static FWGUIManager * getGUIManager()
void addHits(const std::vector< reco::PFRecHit > *)
void addClusters(const std::vector< reco::PFCluster > *)
void addTracks(const std::vector< reco::PFRecTrack > *)
float FWPFCandidateDetailView::eta ( void  )
private

Definition at line 66 of file FWPFCandidateDetailView.cc.

References reco::LeafCandidate::eta(), and m_candidate.

Referenced by Particle.Particle::__str__(), Muon.Muon::absEffAreaIso(), addHits(), etaMax(), etaMin(), Jet.Jet::jetID(), and Jet.Jet::puJetId().

67 {
68  return m_candidate->eta();
69 }
virtual double eta() const
momentum pseudorapidity
const reco::PFCandidate * m_candidate
float FWPFCandidateDetailView::etaMax ( )
inlineprivate

Definition at line 61 of file FWPFCandidateDetailView.h.

References eta(), and m_range.

float FWPFCandidateDetailView::etaMin ( )
inlineprivate

Definition at line 60 of file FWPFCandidateDetailView.h.

References eta(), and m_range.

bool FWPFCandidateDetailView::isPntInRng ( float  x,
float  y 
)
private

Definition at line 76 of file FWPFCandidateDetailView.cc.

References reco::LeafCandidate::eta(), m_candidate, m_range, reco::LeafCandidate::phi(), sd, x, and detailsBasic3DVector::y.

Referenced by addClusters(), and addHits().

77 {
78  float dx = m_candidate->eta() - x;
79  float dy = m_candidate->phi() - y;
80  float sd = TMath::Sqrt(dx*dx + dy*dy);
81  return sd < m_range;
82 }
virtual double eta() const
momentum pseudorapidity
double sd
const reco::PFCandidate * m_candidate
Definition: DDAxes.h:10
virtual double phi() const
momentum azimuthal angle
void FWPFCandidateDetailView::makeLegend ( void  )
private

Definition at line 87 of file FWPFCandidateDetailView.cc.

References m_legend.

Referenced by build().

88 {
89  m_legend = new TLegend( 0.01, 0.01, 0.99, 0.99, 0, "NDC" );
90  m_legend->SetFillColor(kWhite);
91  m_legend->SetTextSize( 0.07 );
92  m_legend->SetBorderSize( 0 );
93  m_legend->SetMargin( 0.15 );
94  m_legend->SetEntrySeparation( 0.01 );
95 }
const FWPFCandidateDetailView& FWPFCandidateDetailView::operator= ( const FWPFCandidateDetailView )
private
float FWPFCandidateDetailView::phi ( void  )
private

Definition at line 71 of file FWPFCandidateDetailView.cc.

References m_candidate, and reco::LeafCandidate::phi().

Referenced by Particle.Particle::__str__(), addHits(), phiMax(), and phiMin().

72 {
73  return m_candidate->phi();
74 }
const reco::PFCandidate * m_candidate
virtual double phi() const
momentum azimuthal angle
float FWPFCandidateDetailView::phiMax ( )
inlineprivate

Definition at line 63 of file FWPFCandidateDetailView.h.

References m_range, and phi().

float FWPFCandidateDetailView::phiMin ( )
inlineprivate

Definition at line 62 of file FWPFCandidateDetailView.h.

References m_range, and phi().

void FWPFCandidateDetailView::plotEtChanged ( )
private

Definition at line 149 of file FWPFCandidateDetailView.cc.

References buildGLEventScene(), and m_plotEt.

Referenced by build().

150 {
151  printf("plotEt = %d \n", m_plotEt);
152  m_plotEt = !m_plotEt;
154 }
void FWPFCandidateDetailView::rangeChanged ( int  x)
private

Definition at line 100 of file FWPFCandidateDetailView.cc.

References buildGLEventScene(), m_eventList, and m_range.

Referenced by build().

101 {
102  static float kSliderRangeFactor = 0.2;
103 
104  m_range = x * kSliderRangeFactor;
105 
107 
108 
109  gEve->Redraw3D();
110 }
Definition: DDAxes.h:10
void FWPFCandidateDetailView::rnrHcalChanged ( )
private

Definition at line 157 of file FWPFCandidateDetailView.cc.

References buildGLEventScene(), and m_rnrHcal.

Referenced by build().

158 {
159  printf("rnrHcal = %d \n", m_rnrHcal);
160  m_rnrHcal = !m_rnrHcal;
162 }
void FWPFCandidateDetailView::setTextInfo ( const FWModelId id,
const reco::PFCandidate track 
)
privatevirtual

Implements FWDetailView< reco::PFCandidate >.

Definition at line 115 of file FWPFCandidateDetailView.cc.

References reco::LeafCandidate::charge(), reco::LeafCandidate::eta(), cmsHarvester::index, FWDetailViewBase::item(), FWDetailViewGL< reco::PFCandidate >::m_infoCanvas, m_legend, reco::LeafCandidate::phi(), reco::LeafCandidate::pt(), x, and detailsBasic3DVector::y.

Referenced by build().

116 {
117  m_infoCanvas->cd();
118 
119  float_t x = 0.02;
120  float y = 0.95;
121 
122  TLatex* latex = new TLatex( x, y, "" );
123  const double textsize( 0.07 );
124  latex->SetTextSize( textsize );
125 
126  latex->DrawLatex( x, y, id.item()->modelName( id.index()).c_str());
127  y -= latex->GetTextSize()*0.6;
128 
129  latex->SetTextSize( textsize );
130  float lineH = latex->GetTextSize()*0.6;
131 
132  latex->DrawLatex( x, y, Form( " P_{T} = %.1f GeV, #eta = %0.2f, #varphi = %0.2f",
133  track->pt(), track->eta(), track->phi()));
134  y -= lineH;
135 
136  if( track->charge() > 0 )
137  latex->DrawLatex( x, y, " charge = +1" );
138  else
139  latex->DrawLatex( x, y, " charge = -1" );
140  y -= lineH;
141  y -= lineH;
142 
143  m_legend->SetY2(y);
144  m_legend->Draw();
145  m_legend = 0; // Deleted together with TPad.
146 }
const FWEventItem * item()
virtual double eta() const
momentum pseudorapidity
virtual double pt() const
transverse momentum
virtual int charge() const
electric charge
Definition: LeafCandidate.h:91
Definition: DDAxes.h:10
virtual double phi() const
momentum azimuthal angle
void FWPFCandidateDetailView::voteMaxEtEVal ( const std::vector< reco::PFRecHit > *  hits)
private

Definition at line 270 of file FWPFCandidateDetailView.cc.

References FWPFMaths::calculateEt(), FWEventItem::context(), FWDetailViewBase::item(), and fireworks::Context::voteMaxEtAndEnergy().

Referenced by build().

271 {
272  if (!hits) return;
273 
274  for (std::vector<reco::PFRecHit>::const_iterator it = hits->begin(); it != hits->end(); ++it)
275  {
276  TEveVector centre(it->position().x(), it->position().y(), it->position().z());
277  float E = it->energy();
278  float Et = FWPFMaths::calculateEt( centre, E );
279  item()->context().voteMaxEtAndEnergy(Et , E );
280  }
281 }
void voteMaxEtAndEnergy(float Et, float energy) const
Definition: Context.cc:184
const FWEventItem * item()
const fireworks::Context & context() const
Definition: FWEventItem.h:126
float calculateEt(const TEveVector &centre, float e)
Definition: FWPFMaths.cc:115

Member Data Documentation

const reco::PFCandidate* FWPFCandidateDetailView::m_candidate
private

Definition at line 67 of file FWPFCandidateDetailView.h.

Referenced by build(), eta(), isPntInRng(), and phi().

TEveElementList* FWPFCandidateDetailView::m_eventList
private
TLegend* FWPFCandidateDetailView::m_legend
private

Definition at line 69 of file FWPFCandidateDetailView.h.

Referenced by makeLegend(), and setTextInfo().

bool FWPFCandidateDetailView::m_plotEt
private

Definition at line 77 of file FWPFCandidateDetailView.h.

Referenced by addHits(), and plotEtChanged().

float FWPFCandidateDetailView::m_range
private

Definition at line 66 of file FWPFCandidateDetailView.h.

Referenced by etaMax(), etaMin(), isPntInRng(), phiMax(), phiMin(), and rangeChanged().

bool FWPFCandidateDetailView::m_rnrHcal
private

Definition at line 80 of file FWPFCandidateDetailView.h.

Referenced by buildGLEventScene(), and rnrHcalChanged().

TGSlider* FWPFCandidateDetailView::m_slider
private

Definition at line 71 of file FWPFCandidateDetailView.h.

Referenced by build().

FWIntValueListener* FWPFCandidateDetailView::m_sliderListener
private

Definition at line 72 of file FWPFCandidateDetailView.h.

Referenced by build().