CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
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 ()
 
virtual void setBackgroundColor (Color_t)
 
void transparencyChanged (int)
 
virtual ~FWTrackHitsDetailView ()
 
- Public Member Functions inherited from FWDetailViewGL< reco::Track >
 FWDetailViewGL ()
 
virtual void init (TEveWindowSlot *)
 
TGLViewer * viewerGL () const
 
virtual ~FWDetailViewGL ()
 
- Public Member Functions inherited from FWDetailView< reco::Track >
 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 *)
 
 FWTrackHitsDetailView (const FWTrackHitsDetailView &)
 
void makeLegend (void)
 
const FWTrackHitsDetailViewoperator= (const FWTrackHitsDetailView &)
 
void setTextInfo (const FWModelId &id, const reco::Track *)
 

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 40 of file FWTrackHitsDetailView.cc.

40  :
41  m_modules(0),
42  m_moduleLabels(0),
43  m_hits(0),
44  m_slider(0),
46  m_legend(0)
47 {}
TEveElementList * m_modules
TEveElementList * m_moduleLabels
FWIntValueListener * m_sliderListener
FWTrackHitsDetailView::~FWTrackHitsDetailView ( )
virtual

Definition at line 49 of file FWTrackHitsDetailView.cc.

50 {
51 }
FWTrackHitsDetailView::FWTrackHitsDetailView ( const FWTrackHitsDetailView )
private

Member Function Documentation

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

Definition at line 318 of file FWTrackHitsDetailView.cc.

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

Referenced by build().

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

Definition at line 352 of file FWTrackHitsDetailView.cc.

References TrackingRecHit::bad, PXFDetId::blade(), FWDisplayProperties::color(), MuonSubdetId::CSC, FWEventItem::defaultDisplayProperties(), DetId::det(), cond::rpcobgas::detid, PXFDetId::disk(), MuonSubdetId::DT, DTChamberId, fwLog, FWGeometry::getEveShape(), FWEventItem::getGeom(), TrackingRecHit::inactive, fireworks::info(), fwlog::kInfo, PXBDetId::ladder(), PXBDetId::layer(), TrackingRecHit::missing, PXBDetId::module(), PXFDetId::module(), DetId::Muon, mergeVDriftHistosByStation::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().

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

Definition at line 299 of file FWTrackHitsDetailView.cc.

Referenced by addHits().

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

Implements FWDetailView< reco::Track >.

Definition at line 54 of file FWTrackHitsDetailView.cc.

References alignCSCRings::action, CSGAction::activated, addHits(), addModules(), b, dtNoiseDBValidation_cfg::cerr, create_public_lumi_plots::color, FWDetailViewBase::context(), CSGAction::createTextButton(), end, reco::Track::extra(), f, 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(), mergeVDriftHistosByStation::name, AlCaHLTBitMon_ParallelJobs::p, pickCameraCenter(), fireworks::prepareTrack(), rnrLabels(), setTextInfo(), CSGAction::setToolTip(), runonSM::text, transparencyChanged(), FWIntValueListener::valueChanged_, and FWDetailViewGL< reco::Track >::viewerGL().

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

Definition at line 257 of file FWTrackHitsDetailView.cc.

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

Referenced by build().

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

Definition at line 166 of file FWTrackHitsDetailView.cc.

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

Referenced by build().

167 {
168  viewerGL()->PickCameraCenter();
169 }
TGLViewer * viewerGL() const
void FWTrackHitsDetailView::rnrLabels ( )

Definition at line 474 of file FWTrackHitsDetailView.cc.

References m_moduleLabels.

Referenced by build().

475 {
476  m_moduleLabels->SetRnrChildren(!m_moduleLabels->GetRnrChildren());
477  gEve->Redraw3D();
478 }
TEveElementList * m_moduleLabels
void FWTrackHitsDetailView::setBackgroundColor ( Color_t  col)
virtual

Reimplemented from FWDetailViewGL< reco::Track >.

Definition at line 150 of file FWTrackHitsDetailView.cc.

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

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

151 {
152  // Callback for cmsShow change of background
153 
155 
156  // adopt label colors to background, this should be implemneted in TEveText
157  if (m_moduleLabels)
158  {
159  Color_t x = viewerGL()->GetRnrCtx()->ColorSet().Foreground().GetColorIndex();
160  for (TEveElement::List_i i=m_moduleLabels->BeginChildren(); i!=m_moduleLabels->EndChildren(); ++i)
161  (*i)->SetMainColor(x);
162  }
163 }
int i
Definition: DBlmapReader.cc:9
TGLViewer * viewerGL() const
TEveElementList * m_moduleLabels
static Bool_t setColorSetViewer(TGLViewer *, Color_t)
Definition: DDAxes.h:10
void FWTrackHitsDetailView::setTextInfo ( const FWModelId id,
const reco::Track track 
)
privatevirtual

Implements FWDetailView< reco::Track >.

Definition at line 182 of file FWTrackHitsDetailView.cc.

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

Referenced by build().

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

Definition at line 172 of file FWTrackHitsDetailView.cc.

References i, and m_modules.

Referenced by build().

173 {
174  for (TEveElement::List_i i=m_modules->BeginChildren(); i!=m_modules->EndChildren(); ++i)
175  {
176  (*i)->SetMainTransparency(x);
177  }
178  gEve->Redraw3D();
179 }
int i
Definition: DBlmapReader.cc:9
TEveElementList * m_modules
Definition: DDAxes.h:10

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