CMS 3D CMS Logo

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

#include <FWTrackHitsDetailView.h>

Inheritance diagram for FWTrackHitsDetailView:
FWDetailViewGL< reco::Track > CSGActionSupervisor FWDetailView< reco::Track > FWDetailViewBase

Public Member Functions

 FWTrackHitsDetailView ()
 
void pickCameraCenter ()
 
void rnrLabels ()
 
void setBackgroundColor (Color_t) override
 
void transparencyChanged (int)
 
 ~FWTrackHitsDetailView () override
 
- Public Member Functions inherited from FWDetailViewGL< reco::Track >
 FWDetailViewGL ()
 
void init (TEveWindowSlot *) override
 
void setBackgroundColor (Color_t) override
 
TGLViewer * viewerGL () const
 
 ~FWDetailViewGL () override
 
- Public Member Functions inherited from FWDetailView< reco::Track >
void build (const FWModelId &iID, const void *iData) override
 
 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 ()
 

Protected Attributes

TEveElementList * m_hits
 
TEveElementList * m_moduleLabels
 
TEveElementList * m_modules
 
TGSlider * m_slider
 
FWIntValueListenerm_sliderListener
 
- Protected Attributes inherited from FWDetailViewGL< reco::Track >
TEveScene * m_eveScene
 
TEveViewer * m_eveViewer
 
TGCompositeFrame * m_guiFrame
 
TCanvas * m_infoCanvas
 
- Protected Attributes inherited from CSGActionSupervisor
std::vector< CSGAction * > m_actionList
 

Private Member Functions

void addHits (const reco::Track &track, const FWEventItem *iItem, TEveElement *trkList, bool addNearbyHits)
 
void addModules (const reco::Track &track, const FWEventItem *iItem, TEveElement *trkList, bool addLostHits)
 
void addTrackerHits3D (std::vector< TVector3 > &points, class TEveElementList *tList, Color_t color, int size)
 
void build (const FWModelId &id, const reco::Track *) override
 
 FWTrackHitsDetailView (const FWTrackHitsDetailView &)=delete
 
void makeLegend (void)
 
const FWTrackHitsDetailViewoperator= (const FWTrackHitsDetailView &)=delete
 
void setTextInfo (const FWModelId &id, const reco::Track *) override
 

Private Attributes

TLegend * m_legend
 

Additional Inherited Members

- Static Public Member Functions inherited from FWDetailView< reco::Track >
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 &)
 

Detailed Description

Definition at line 17 of file FWTrackHitsDetailView.h.

Constructor & Destructor Documentation

FWTrackHitsDetailView::FWTrackHitsDetailView ( )

Definition at line 43 of file FWTrackHitsDetailView.cc.

43  :
44  m_modules(nullptr),
45  m_moduleLabels(nullptr),
46  m_hits(nullptr),
47  m_slider(nullptr),
49  m_legend(nullptr)
50 {}
TEveElementList * m_modules
TEveElementList * m_moduleLabels
FWIntValueListener * m_sliderListener
FWTrackHitsDetailView::~FWTrackHitsDetailView ( )
override

Definition at line 52 of file FWTrackHitsDetailView.cc.

53 {
54 }
FWTrackHitsDetailView::FWTrackHitsDetailView ( const FWTrackHitsDetailView )
privatedelete

Member Function Documentation

void FWTrackHitsDetailView::addHits ( const reco::Track track,
const FWEventItem iItem,
TEveElement *  trkList,
bool  addNearbyHits 
)
private

Definition at line 321 of file FWTrackHitsDetailView.cc.

References fireworks::addSiStripClusters(), addTrackerHits3D(), FWDisplayProperties::color(), FWEventItem::defaultDisplayProperties(), fireworks::pushNearbyPixelHits(), fireworks::pushPixelHits(), and RecoTauPiZeroBuilderPlugins_cfi::strips.

Referenced by build().

325 {
326  std::vector<TVector3> pixelPoints;
327  fireworks::pushPixelHits( pixelPoints, *iItem, track );
328  TEveElementList* pixels = new TEveElementList( "Pixels" );
329  trkList->AddElement( pixels );
330  if( addNearbyHits )
331  {
332  // get the extra hits
333  std::vector<TVector3> pixelExtraPoints;
334  fireworks::pushNearbyPixelHits( pixelExtraPoints, *iItem, track );
335  // draw first the others
336  addTrackerHits3D( pixelExtraPoints, pixels, kRed, 1 );
337  // then the good ones, so they're on top
338  addTrackerHits3D( pixelPoints, pixels, kGreen, 1 );
339  }
340  else
341  {
342  // just add those points with the default color
343  addTrackerHits3D( pixelPoints, pixels, iItem->defaultDisplayProperties().color(), 1 );
344  }
345 
346  // strips
347  TEveElementList* strips = new TEveElementList( "Strips" );
348  trkList->AddElement( strips );
349  fireworks::addSiStripClusters( iItem, track, strips, addNearbyHits, false );
350 }
const FWDisplayProperties & defaultDisplayProperties() const
Definition: FWEventItem.cc:453
void addTrackerHits3D(std::vector< TVector3 > &points, class TEveElementList *tList, Color_t color, int size)
Color_t color() const
void pushPixelHits(std::vector< TVector3 > &pixelPoints, const FWEventItem &iItem, const reco::Track &t)
Definition: TrackUtils.cc:582
void addSiStripClusters(const FWEventItem *iItem, const reco::Track &t, class TEveElement *tList, bool addNearbyClusters, bool master)
Definition: TrackUtils.cc:358
void pushNearbyPixelHits(std::vector< TVector3 > &pixelPoints, const FWEventItem &iItem, const reco::Track &t)
Definition: TrackUtils.cc:524
void FWTrackHitsDetailView::addModules ( const reco::Track track,
const FWEventItem iItem,
TEveElement *  trkList,
bool  addLostHits 
)
private

Definition at line 355 of file FWTrackHitsDetailView.cc.

References TrackingRecHit::bad, PXFDetId::blade(), FWDisplayProperties::color(), MuonSubdetId::CSC, FWEventItem::defaultDisplayProperties(), DetId::det(), PXFDetId::disk(), MuonSubdetId::DT, fwLog, MuonSubdetId::GEM, FWGeometry::getEveShape(), FWEventItem::getGeom(), electrons_cff::ids, TrackingRecHit::inactive, TrackingRecHit::inactive_inner, TrackingRecHit::inactive_outer, fireworks::info(), fwlog::kInfo, PXBDetId::ladder(), PVValHelper::ladder, PXBDetId::layer(), MuonSubdetId::ME0, TrackingRecHit::missing, TrackingRecHit::missing_inner, TrackingRecHit::missing_outer, PXBDetId::module(), PXFDetId::module(), DetId::Muon, dataset::name, PXFDetId::panel(), PixelSubdetector::PixelBarrel, PixelSubdetector::PixelEndcap, DetId::rawId(), reco::Track::recHitsBegin(), reco::Track::recHitsEnd(), MuonSubdetId::RPC, edm::second(), PXFDetId::side(), DetId::subdetId(), SiStripDetId::TEC, SiStripDetId::TIB, SiStripDetId::TID, SiStripDetId::TOB, DetId::Tracker, and TrackingRecHit::valid.

Referenced by build().

359 {
360  std::set<unsigned int> ids;
361  for( trackingRecHit_iterator recIt = track.recHitsBegin(), recItEnd = track.recHitsEnd();
362  recIt != recItEnd; ++recIt )
363  {
364  DetId detid = (*recIt)->geographicalId();
365  if( !addLostHits && !(*recIt)->isValid()) continue;
366  if( detid.rawId() != 0 )
367  {
368  TString name("");
369  switch( detid.det())
370  {
371  case DetId::Tracker:
372  switch( detid.subdetId())
373  {
374  case SiStripDetId::TIB:
375  name = "TIB ";
376  break;
377  case SiStripDetId::TOB:
378  name = "TOB ";
379  break;
380  case SiStripDetId::TID:
381  name = "TID ";
382  break;
383  case SiStripDetId::TEC:
384  name = "TEC ";
385  break;
387  name = "Pixel Barrel ";
388  {
389  PXBDetId idid = PXBDetId( detid.rawId() );
390  unsigned int layer = idid.layer();
391  unsigned int ladder = idid.ladder();
392  unsigned int module = idid.module();
393 
394  name += TString::Format( ": Layer=%u, Ladder=%u, Module=%u \n",
395  layer, ladder, module );
396  }
397  break;
399  name = "Pixel Endcap ";
400  {
401  PXFDetId idid = PXFDetId( detid.rawId() );
402  unsigned int side = idid.side();
403  unsigned int disk = idid.disk();
404  unsigned int blade = idid.blade();
405  unsigned int panel = idid.panel();
406  unsigned int module = idid.module();
407 
408  name += TString::Format( ": Side=%u, Disk=%u, Blade=%u, Panel=%u, Module=%u \n",
409  side, disk, blade, panel, module );
410  }
411 
412  default:
413  break;
414  }
415  break;
416 
417  case DetId::Muon:
418  switch( detid.subdetId())
419  {
420  case MuonSubdetId::DT:
421  name = "DT";
422  detid = DetId( DTChamberId( detid )); // get rid of layer bits
423  break;
424  case MuonSubdetId::CSC:
425  name = "CSC";
426  break;
427  case MuonSubdetId::RPC:
428  name = "RPC";
429  break;
430  case MuonSubdetId::GEM:
431  name = "GEM";
432  break;
433  case MuonSubdetId::ME0:
434  name = "ME0";
435  break;
436  default:
437  break;
438  }
439  break;
440  default:
441  break;
442  }
443  if( ! ids.insert( detid.rawId()).second ) continue;
444  if( iItem->getGeom())
445  {
446  TEveGeoShape* shape = iItem->getGeom()->getEveShape( detid );
447  if( nullptr != shape )
448  {
449  shape->SetMainTransparency( 65 );
450  shape->SetPickable( kTRUE );
451  switch(( *recIt )->type())
452  {
454  shape->SetMainColor( iItem->defaultDisplayProperties().color());
455  break;
459  name += "LOST ";
460  shape->SetMainColor( kRed );
461  break;
465  name += "INACTIVE ";
466  shape->SetMainColor( 28 );
467  break;
468  case TrackingRecHit::bad:
469  name += "BAD ";
470  shape->SetMainColor( 218 );
471  break;
472  }
473  shape->SetTitle( name + ULong_t( detid.rawId()));
474  trkList->AddElement( shape );
475  }
476  else
477  {
478  fwLog( fwlog::kInfo ) << "Failed to get shape extract for a tracking rec hit: "
479  << "\n" << fireworks::info( detid ) << std::endl;
480  }
481  }
482  }
483  }
484 }
const FWDisplayProperties & defaultDisplayProperties() const
Definition: FWEventItem.cc:453
unsigned int panel() const
panel id
Definition: PXFDetId.h:52
static const int GEM
Definition: MuonSubdetId.h:15
unsigned int ladder() const
ladder id
Definition: PXBDetId.h:39
unsigned int layer() const
layer id
Definition: PXBDetId.h:35
Color_t color() const
unsigned int blade() const
blade id
Definition: PXFDetId.h:48
uint32_t rawId() const
get the raw id
Definition: DetId.h:43
U second(std::pair< T, U > const &p)
static const int ME0
Definition: MuonSubdetId.h:16
static const int CSC
Definition: MuonSubdetId.h:13
TEveGeoShape * getEveShape(unsigned int id) const
Definition: FWGeometry.cc:259
unsigned int module() const
det id
Definition: PXBDetId.h:43
unsigned int module() const
det id
Definition: PXFDetId.h:56
trackingRecHit_iterator recHitsBegin() const
Iterator to first hit on the track.
Definition: Track.h:104
int subdetId() const
get the contents of the subdetector field (not cast into any detector&#39;s numbering enum) ...
Definition: DetId.h:37
unsigned int disk() const
disk id
Definition: PXFDetId.h:43
Definition: DetId.h:18
#define fwLog(_level_)
Definition: fwLog.h:50
static const int RPC
Definition: MuonSubdetId.h:14
std::string info(const DetId &)
Definition: TrackUtils.cc:663
unsigned int side() const
positive or negative id
Definition: PXFDetId.h:38
static const int DT
Definition: MuonSubdetId.h:12
Detector det() const
get the detector field from this detid
Definition: DetId.h:35
Definition: vlib.h:208
const FWGeometry * getGeom() const
Definition: FWEventItem.cc:683
trackingRecHit_iterator recHitsEnd() const
Iterator to last hit on the track.
Definition: Track.h:109
void FWTrackHitsDetailView::addTrackerHits3D ( std::vector< TVector3 > &  points,
class TEveElementList *  tList,
Color_t  color,
int  size 
)
private

Definition at line 302 of file FWTrackHitsDetailView.cc.

Referenced by addHits().

303 {
304  // !AT this is detail view specific, should move to track hits
305  // detail view
306 
307  TEvePointSet* pointSet = new TEvePointSet();
308  pointSet->SetMarkerSize(size);
309  pointSet->SetMarkerStyle(4);
310  pointSet->SetPickable(kTRUE);
311  pointSet->SetTitle("Pixel Hits");
312  pointSet->SetMarkerColor(color);
313 
314  for( std::vector<TVector3>::const_iterator it = points.begin(), itEnd = points.end(); it != itEnd; ++it) {
315  pointSet->SetNextPoint(it->x(), it->y(), it->z());
316  }
317  tList->AddElement(pointSet);
318 }
size
Write out results.
void FWTrackHitsDetailView::build ( const FWModelId id,
const reco::Track track 
)
overrideprivatevirtual

Implements FWDetailView< reco::Track >.

Definition at line 57 of file FWTrackHitsDetailView.cc.

References mps_fire::action, CSGAction::activated, addHits(), addModules(), b, MessageLogger_cfi::cerr, create_public_lumi_plots::color, FWDetailViewBase::context(), CSGAction::createTextButton(), end, reco::Track::extra(), f, CaloRecHitAuxSetter::getField(), mps_fire::i, edm::Ref< C, T, F >::isAvailable(), FWDetailViewBase::item(), FWDetailViewGL< reco::Track >::m_eveScene, FWDetailViewGL< reco::Track >::m_guiFrame, m_hits, m_moduleLabels, m_modules, m_slider, m_sliderListener, makeLegend(), dataset::name, AlCaHLTBitMon_ParallelJobs::p, pickCameraCenter(), fireworks::prepareTrack(), rnrLabels(), setTextInfo(), CSGAction::setToolTip(), RecoTauValidation_cfi::text, transparencyChanged(), FWIntValueListener::valueChanged_, and FWDetailViewGL< reco::Track >::viewerGL().

58 {
59  {
60  TGCompositeFrame* f = new TGVerticalFrame(m_guiFrame);
61  m_guiFrame->AddFrame(f);
62  f->AddFrame(new TGLabel(f, "Module Transparency:"), new TGLayoutHints(kLHintsLeft, 2, 2, 0, 0));
63  m_slider = new TGHSlider(f, 120, kSlider1 | kScaleNo);
64  f->AddFrame(m_slider, new TGLayoutHints(kLHintsTop | kLHintsLeft, 2, 2, 1, 4));
65  m_slider->SetRange(0, 100);
66  m_slider->SetPosition(75);
67 
69  TQObject::Connect(m_slider, "PositionChanged(Int_t)", "FWIntValueListenerBase", m_sliderListener, "setValue(Int_t)");
71  }
72 
73  {
74  CSGAction* action = new CSGAction(this, "Show Module Labels");
75  TGCheckButton* b = new TGCheckButton(m_guiFrame, "Show Module Labels" );
76  b->SetState(kButtonUp, false);
77  m_guiFrame->AddFrame(b, new TGLayoutHints( kLHintsNormal, 2, 3, 1, 4));
78  TQObject::Connect(b, "Clicked()", "CSGAction", action, "activate()");
79  action->activated.connect(sigc::mem_fun(this, &FWTrackHitsDetailView::rnrLabels));
80  }
81  {
82  CSGAction* action = new CSGAction(this, " Pick Camera Center ");
83  action->createTextButton(m_guiFrame, new TGLayoutHints( kLHintsNormal, 2, 0, 1, 4));
84  action->setToolTip("Click on object in viewer to set camera center.");
85  action->activated.connect(sigc::mem_fun(this, &FWTrackHitsDetailView::pickCameraCenter));
86  }
87  makeLegend();
88 
89  TGCompositeFrame* p = (TGCompositeFrame*)m_guiFrame->GetParent();
90  p->MapSubwindows();
91  p->Layout();
92 
93  m_modules = new TEveElementList( "Modules" );
94  m_eveScene->AddElement( m_modules );
95  m_moduleLabels = new TEveElementList( "Modules" );
96  m_eveScene->AddElement( m_moduleLabels );
97  m_hits = new TEveElementList( "Hits" );
98  m_eveScene->AddElement( m_hits );
99  if( track->extra().isAvailable())
100  {
101  addModules( *track, id.item(), m_modules, true );
102  addHits( *track, id.item(), m_hits, true );
103  }
104  for( TEveElement::List_i i = m_modules->BeginChildren(), end = m_modules->EndChildren(); i != end; ++i )
105  {
106  TEveGeoShape* gs = dynamic_cast<TEveGeoShape*>(*i);
107  if (gs == nullptr && (*i != nullptr)) {
108  std::cerr << "Got a " << typeid(**i).name() << ", expecting TEveGeoShape. ignoring (it must be the clusters)." << std::endl;
109  continue;
110  }
111  gs->SetMainTransparency(75);
112  gs->SetPickable(kFALSE);
113 
114  TString name = gs->GetElementTitle();
115  if (!name.Contains("BAD") && !name.Contains("INACTIVE") && !name.Contains("LOST")) {
116  gs->SetMainColor(kBlue);
117  }
118  TEveText* text = new TEveText(name.Data());
119  text->PtrMainTrans()->SetFrom(gs->RefMainTrans().Array());
120  text->SetFontMode(TGLFont::kPixmap);
121  text->SetFontSize(12);
122  m_moduleLabels->AddElement(text);
123  }
124  m_moduleLabels->SetRnrChildren(false);
125 
126  TEveTrackPropagator* prop = new TEveTrackPropagator();
127  prop->SetMagFieldObj(item()->context().getField(), false);
128  prop->SetStepper(TEveTrackPropagator::kRungeKutta);
129  prop->SetMaxR(123);
130  prop->SetMaxZ(300);
131  prop->SetMaxStep(1);
132  TEveTrack* trk = fireworks::prepareTrack( *track, prop );
133  trk->MakeTrack();
134  trk->SetLineWidth(2);
135  trk->SetTitle( "Track and its ref states" );
136  prop->SetRnrDaughters(kTRUE);
137  prop->SetRnrReferences(kTRUE);
138  prop->SetRnrDecay(kTRUE);
139  prop->SetRnrFV(kTRUE);
140  trk->SetMainColor(id.item()->defaultDisplayProperties().color());
141  m_eveScene->AddElement(trk);
142 
143  viewerGL()->SetStyle(TGLRnrCtx::kOutline);
144  viewerGL()->SetDrawCameraCenter(kTRUE);
145  viewerGL()->ResetCamerasAfterNextUpdate();
146  viewerGL()->UpdateScene(kFALSE);
147  gEve->Redraw3D();
148 
149  setTextInfo(id, track);
150 }
bool isAvailable() const
Definition: Ref.h:577
void setTextInfo(const FWModelId &id, const reco::Track *) override
TEveElementList * m_modules
TGLViewer * viewerGL() const
const TrackExtraRef & extra() const
reference to "extra" object
Definition: Track.h:189
unsigned getField(const uint32_t u, const unsigned mask, const unsigned offset)
TEveTrack * prepareTrack(const reco::Track &track, TEveTrackPropagator *propagator, const std::vector< TEveVector > &extraRefPoints=std::vector< TEveVector >())
Definition: TrackUtils.cc:69
const FWEventItem * item()
sigc::signal< void > activated
Definition: CSGAction.h:88
void addHits(const reco::Track &track, const FWEventItem *iItem, TEveElement *trkList, bool addNearbyHits)
void createTextButton(TGCompositeFrame *p, TGLayoutHints *l=nullptr, Int_t id=-1, GContext_t norm=TGButton::GetDefaultGC()(), FontStruct_t font=TGTextButton::GetDefaultFontStruct(), UInt_t option=kRaisedFrame|kDoubleBorder)
Definition: CSGAction.cc:126
const fireworks::Context & context() const
void setToolTip(const std::string &tip)
Definition: CSGAction.cc:116
sigc::signal< void, Int_t > valueChanged_
TGCompositeFrame * m_guiFrame
double f[11][100]
#define end
Definition: vmac.h:39
TEveElementList * m_moduleLabels
double b
Definition: hdecay.h:120
void addModules(const reco::Track &track, const FWEventItem *iItem, TEveElement *trkList, bool addLostHits)
FWIntValueListener * m_sliderListener
Definition: AbsArchive.cc:53
void FWTrackHitsDetailView::makeLegend ( void  )
private

Definition at line 260 of file FWTrackHitsDetailView.cc.

References reco::ParticleMasses::kPlus, listHistos::legend, and m_legend.

Referenced by build().

261 {
262  m_legend = new TLegend( 0.01, 0.01, 0.99, 0.99, nullptr, "NDC" );
263  m_legend->SetFillColor(kWhite);
264  m_legend->SetTextSize( 0.07 );
265  m_legend->SetBorderSize( 0 );
266  m_legend->SetMargin( 0.15 );
267  m_legend->SetEntrySeparation( 0.01 );
268 
269  TEveStraightLineSet *legend = new TEveStraightLineSet( "siStripCluster" );
270  legend->SetLineWidth( 3 );
271  legend->SetLineColor( kGreen );
272  m_legend->AddEntry( legend, "Exact SiStripCluster", "l");
273 
274  TEveStraightLineSet *legend2 = new TEveStraightLineSet( "siStripCluster2" );
275  legend2->SetLineWidth( 3 );
276  legend2->SetLineColor( kRed );
277  m_legend->AddEntry( legend2, "Extra SiStripCluster", "l");
278 
279  TEveStraightLineSet *legend3 = new TEveStraightLineSet( "refStates" );
280  legend3->SetDepthTest( kFALSE );
281  legend3->SetMarkerColor( kYellow );
282  legend3->SetMarkerStyle( kPlus );
283  legend3->SetMarkerSize( 2 );
284  m_legend->AddEntry( legend3, "Inner/Outermost States", "p");
285 
286  TEveStraightLineSet *legend4 = new TEveStraightLineSet( "vertex" );
287  legend4->SetDepthTest( kFALSE );
288  legend4->SetMarkerColor( kRed );
289  legend4->SetMarkerStyle( kFullDotLarge );
290  legend4->SetMarkerSize( 2 );
291  m_legend->AddEntry( legend4, "Vertex", "p");
292 
293  TEveStraightLineSet *legend5 = new TEveStraightLineSet( "cameraCenter" );
294  legend5->SetDepthTest( kFALSE );
295  legend5->SetMarkerColor( kCyan );
296  legend5->SetMarkerStyle( kFullDotLarge );
297  legend5->SetMarkerSize( 2 );
298  m_legend->AddEntry( legend5, "Camera center", "p");
299 }
const double kPlus
Definition: ParticleMasses.h:8
const FWTrackHitsDetailView& FWTrackHitsDetailView::operator= ( const FWTrackHitsDetailView )
privatedelete
void FWTrackHitsDetailView::pickCameraCenter ( )

Definition at line 169 of file FWTrackHitsDetailView.cc.

References FWDetailViewGL< reco::Track >::viewerGL().

Referenced by build().

170 {
171  viewerGL()->PickCameraCenter();
172 }
TGLViewer * viewerGL() const
void FWTrackHitsDetailView::rnrLabels ( )

Definition at line 487 of file FWTrackHitsDetailView.cc.

References m_moduleLabels, and REGISTER_FWDETAILVIEW.

Referenced by build().

488 {
489  m_moduleLabels->SetRnrChildren(!m_moduleLabels->GetRnrChildren());
490  gEve->Redraw3D();
491 }
TEveElementList * m_moduleLabels
void FWTrackHitsDetailView::setBackgroundColor ( Color_t  col)
overridevirtual

Reimplemented from FWDetailViewBase.

Definition at line 153 of file FWTrackHitsDetailView.cc.

References mps_fire::i, m_moduleLabels, FWColorManager::setColorSetViewer(), FWDetailViewGL< reco::Track >::viewerGL(), and x.

Referenced by Vispa.Plugins.EdmBrowser.EventContentView.LabelItem::__init__().

154 {
155  // Callback for cmsShow change of background
156 
158 
159  // adopt label colors to background, this should be implemneted in TEveText
160  if (m_moduleLabels)
161  {
162  Color_t x = viewerGL()->GetRnrCtx()->ColorSet().Foreground().GetColorIndex();
163  for (TEveElement::List_i i=m_moduleLabels->BeginChildren(); i!=m_moduleLabels->EndChildren(); ++i)
164  (*i)->SetMainColor(x);
165  }
166 }
TGLViewer * viewerGL() const
TEveElementList * m_moduleLabels
col
Definition: cuy.py:1008
static Bool_t setColorSetViewer(TGLViewer *, Color_t)
void FWTrackHitsDetailView::setTextInfo ( const FWModelId id,
const reco::Track track 
)
overrideprivatevirtual

Implements FWDetailView< reco::Track >.

Definition at line 185 of file FWTrackHitsDetailView.cc.

References reco::TrackBase::charge(), FWDetailViewBase::drawCanvasBox(), FWDetailViewBase::drawCanvasDot(), reco::TrackBase::eta(), diffTreeTool::index, FWDetailViewBase::item(), FWDetailViewGL< reco::Track >::m_infoCanvas, m_legend, ecalBarrelClusterFastTimer_cfi::modelName, reco::TrackBase::phi(), reco::TrackBase::pt(), alignCSCRings::r, diffTwoXMLs::r2, x, and y.

Referenced by build().

186 {
187  m_infoCanvas->cd();
188 
189  float_t x = 0.02;
190  float y = 0.95;
191 
192  TLatex* latex = new TLatex( x, y, "" );
193  const double textsize( 0.07 );
194  latex->SetTextSize( 2*textsize );
195 
196  latex->DrawLatex( x, y, id.item()->modelName( id.index()).c_str());
197  y -= latex->GetTextSize()*0.6;
198 
199  latex->SetTextSize( textsize );
200  float lineH = latex->GetTextSize()*0.6;
201 
202  latex->DrawLatex( x, y, Form( " P_{T} = %.1f GeV, #eta = %0.2f, #varphi = %0.2f",
203  track->pt(), track->eta(), track->phi()));
204  y -= lineH;
205 
206  if( track->charge() > 0 )
207  latex->DrawLatex( x, y, " charge = +1" );
208  else
209  latex->DrawLatex( x, y, " charge = -1" );
210  y -= lineH;
211  y -= lineH;
212 
213  latex->DrawLatex( x, y, "Track modules:");
214  y -= lineH;
215 
216  Double_t pos[4];
217  pos[0] = x+0.05;
218  pos[2] = x+0.20;
219  Double_t boxH = 0.25*textsize;
220 
221  pos[1] = y; pos[3] = pos[1] + boxH;
222  FWDetailViewBase::drawCanvasBox( pos, kBlue );
223  latex->DrawLatex( x + 0.25, y, "Module" );
224  y -= lineH;
225 
226  pos[1] = y; pos[3] = pos[1] + boxH;
227  FWDetailViewBase::drawCanvasBox( pos, kRed );
228  latex->DrawLatex( x + 0.25, y, "LOST Module" );
229  y -= lineH;
230 
231  pos[1] = y; pos[3] = pos[1] + boxH;
233  latex->DrawLatex( x + 0.25, y, "INACTIVE Module" );
234  y -= lineH;
235 
236  pos[1] = y; pos[3] = pos[1] + boxH;
238  latex->DrawLatex( x + 0.25, y, "BAD Module" );
239  y -= lineH;
240 
241  Float_t r = 0.01;
242  Float_t r2 = 0.02;
243  y -= lineH;
244  drawCanvasDot( x + r2, y, r2, kGreen );
245  y -= r;
246  latex->DrawLatex( x + 3 * r2, y, "Pixel Hits" );
247  y -= lineH;
248 
249  drawCanvasDot( x + r2, y, r2, kRed);
250  y -= r;
251  latex->DrawLatex( x + 3 * r2, y, "Extra Pixel Hits" );
252  y -= lineH;
253 
254  m_legend->SetY2(y);
255  m_legend->Draw();
256  m_legend = nullptr; // Deleted together with TPad.
257 }
const FWEventItem * item()
double phi() const
azimuthal angle of momentum vector
Definition: TrackBase.h:645
double eta() const
pseudorapidity of momentum vector
Definition: TrackBase.h:651
double pt() const
track transverse momentum
Definition: TrackBase.h:621
static void drawCanvasDot(Float_t x, Float_t y, Float_t r, Color_t)
int charge() const
track electric charge
Definition: TrackBase.h:567
static void drawCanvasBox(Double_t *pos, Color_t fillCol, Int_t fillType=0, bool bg=kTRUE)
void FWTrackHitsDetailView::transparencyChanged ( int  x)

Definition at line 175 of file FWTrackHitsDetailView.cc.

References mps_fire::i, and m_modules.

Referenced by build().

176 {
177  for (TEveElement::List_i i=m_modules->BeginChildren(); i!=m_modules->EndChildren(); ++i)
178  {
179  (*i)->SetMainTransparency(x);
180  }
181  gEve->Redraw3D();
182 }
TEveElementList * m_modules

Member Data Documentation

TEveElementList* FWTrackHitsDetailView::m_hits
protected

Definition at line 33 of file FWTrackHitsDetailView.h.

Referenced by build().

TLegend* FWTrackHitsDetailView::m_legend
private

Definition at line 63 of file FWTrackHitsDetailView.h.

Referenced by makeLegend(), and setTextInfo().

TEveElementList* FWTrackHitsDetailView::m_moduleLabels
protected

Definition at line 32 of file FWTrackHitsDetailView.h.

Referenced by build(), rnrLabels(), and setBackgroundColor().

TEveElementList* FWTrackHitsDetailView::m_modules
protected

Definition at line 31 of file FWTrackHitsDetailView.h.

Referenced by build(), and transparencyChanged().

TGSlider* FWTrackHitsDetailView::m_slider
protected

Definition at line 34 of file FWTrackHitsDetailView.h.

Referenced by build().

FWIntValueListener* FWTrackHitsDetailView::m_sliderListener
protected

Definition at line 35 of file FWTrackHitsDetailView.h.

Referenced by build().