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 18 of file FWTrackHitsDetailView.h.

Constructor & Destructor Documentation

FWTrackHitsDetailView::FWTrackHitsDetailView ( )

Definition at line 41 of file FWTrackHitsDetailView.cc.

41  :
42  m_modules(nullptr),
43  m_moduleLabels(nullptr),
44  m_hits(nullptr),
45  m_slider(nullptr),
47  m_legend(nullptr)
48 {}
TEveElementList * m_modules
TEveElementList * m_moduleLabels
FWIntValueListener * m_sliderListener
FWTrackHitsDetailView::~FWTrackHitsDetailView ( )
override

Definition at line 50 of file FWTrackHitsDetailView.cc.

51 {
52 }
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 319 of file FWTrackHitsDetailView.cc.

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

Referenced by build().

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

Definition at line 353 of file FWTrackHitsDetailView.cc.

References TrackingRecHit::bad, FWDisplayProperties::color(), MuonSubdetId::CSC, FWEventItem::defaultDisplayProperties(), DetId::det(), MuonSubdetId::DT, fwLog, MuonSubdetId::GEM, FWGeometry::getEveShape(), FWEventItem::getGeom(), FWGeometry::getTrackerTopology(), TrackingRecHit::inactive, TrackingRecHit::inactive_inner, TrackingRecHit::inactive_outer, fireworks::info(), fwlog::kInfo, MuonSubdetId::ME0, TrackingRecHit::missing, TrackingRecHit::missing_inner, TrackingRecHit::missing_outer, DetId::Muon, dataset::name, TrackerTopology::print(), DetId::rawId(), reco::Track::recHitsBegin(), reco::Track::recHitsEnd(), MuonSubdetId::RPC, edm::second(), DetId::subdetId(), DetId::Tracker, and TrackingRecHit::valid.

Referenced by build().

357 {
358  std::set<unsigned int> ids;
359  for( trackingRecHit_iterator recIt = track.recHitsBegin(), recItEnd = track.recHitsEnd();
360  recIt != recItEnd; ++recIt )
361  {
362  DetId detid = (*recIt)->geographicalId();
363  if( !addLostHits && !(*recIt)->isValid()) continue;
364  if( detid.rawId() != 0 )
365  {
366  TString name("");
367  switch( detid.det())
368  {
369  case DetId::Tracker:
370  name = iItem->getGeom()->getTrackerTopology()->print(detid);
371  break;
372 
373  case DetId::Muon:
374  switch( detid.subdetId())
375  {
376  case MuonSubdetId::DT:
377  name = "DT";
378  detid = DetId( DTChamberId( detid )); // get rid of layer bits
379  break;
380  case MuonSubdetId::CSC:
381  name = "CSC";
382  break;
383  case MuonSubdetId::RPC:
384  name = "RPC";
385  break;
386  case MuonSubdetId::GEM:
387  name = "GEM";
388  break;
389  case MuonSubdetId::ME0:
390  name = "ME0";
391  break;
392  default:
393  break;
394  }
395  break;
396  default:
397  break;
398  }
399  if( ! ids.insert( detid.rawId()).second ) continue;
400  if( iItem->getGeom())
401  {
402  TEveGeoShape* shape = iItem->getGeom()->getEveShape( detid );
403  if( nullptr != shape )
404  {
405  shape->SetMainTransparency( 65 );
406  shape->SetPickable( kTRUE );
407  switch(( *recIt )->type())
408  {
410  shape->SetMainColor( iItem->defaultDisplayProperties().color());
411  break;
415  name += "LOST ";
416  shape->SetMainColor( kRed );
417  break;
421  name += "INACTIVE ";
422  shape->SetMainColor( 28 );
423  break;
424  case TrackingRecHit::bad:
425  name += "BAD ";
426  shape->SetMainColor( 218 );
427  break;
428  }
429  shape->SetTitle( name + ULong_t( detid.rawId()));
430  trkList->AddElement( shape );
431  }
432  else
433  {
434  fwLog( fwlog::kInfo ) << "Failed to get shape extract for a tracking rec hit: "
435  << "\n" << fireworks::info( detid ) << std::endl;
436  }
437  }
438  }
439  }
440 }
const FWDisplayProperties & defaultDisplayProperties() const
Definition: FWEventItem.cc:453
static constexpr int GEM
Definition: MuonSubdetId.h:15
constexpr uint32_t rawId() const
get the raw id
Definition: DetId.h:47
std::string print(DetId detid) const
Color_t color() const
U second(std::pair< T, U > const &p)
TEveGeoShape * getEveShape(unsigned int id) const
Definition: FWGeometry.cc:270
constexpr int subdetId() const
get the contents of the subdetector field (not cast into any detector&#39;s numbering enum) ...
Definition: DetId.h:41
static constexpr int ME0
Definition: MuonSubdetId.h:16
trackingRecHit_iterator recHitsBegin() const
Iterator to first hit on the track.
Definition: Track.h:104
Definition: DetId.h:18
#define fwLog(_level_)
Definition: fwLog.h:50
static constexpr int RPC
Definition: MuonSubdetId.h:14
std::string info(const DetId &)
Definition: TrackUtils.cc:657
const TrackerTopology * getTrackerTopology() const
Definition: FWGeometry.h:129
static constexpr int DT
Definition: MuonSubdetId.h:12
static constexpr int CSC
Definition: MuonSubdetId.h:13
const FWGeometry * getGeom() const
Definition: FWEventItem.cc:683
constexpr Detector det() const
get the detector field from this detid
Definition: DetId.h:39
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 300 of file FWTrackHitsDetailView.cc.

Referenced by addHits().

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

Implements FWDetailView< reco::Track >.

Definition at line 55 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().

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

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

Referenced by build().

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

Definition at line 167 of file FWTrackHitsDetailView.cc.

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

Referenced by build().

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

Definition at line 443 of file FWTrackHitsDetailView.cc.

References m_moduleLabels, and REGISTER_FWDETAILVIEW.

Referenced by build().

444 {
445  m_moduleLabels->SetRnrChildren(!m_moduleLabels->GetRnrChildren());
446  gEve->Redraw3D();
447 }
TEveElementList * m_moduleLabels
void FWTrackHitsDetailView::setBackgroundColor ( Color_t  col)
overridevirtual

Reimplemented from FWDetailViewBase.

Definition at line 151 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__().

152 {
153  // Callback for cmsShow change of background
154 
156 
157  // adopt label colors to background, this should be implemneted in TEveText
158  if (m_moduleLabels)
159  {
160  Color_t x = viewerGL()->GetRnrCtx()->ColorSet().Foreground().GetColorIndex();
161  for (TEveElement::List_i i=m_moduleLabels->BeginChildren(); i!=m_moduleLabels->EndChildren(); ++i)
162  (*i)->SetMainColor(x);
163  }
164 }
TGLViewer * viewerGL() const
TEveElementList * m_moduleLabels
col
Definition: cuy.py:1009
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 183 of file FWTrackHitsDetailView.cc.

References reco::TrackBase::charge(), FWDetailViewBase::drawCanvasBox(), FWDetailViewBase::drawCanvasDot(), reco::TrackBase::eta(), 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().

184 {
185  m_infoCanvas->cd();
186 
187  float_t x = 0.02;
188  float y = 0.95;
189 
190  TLatex* latex = new TLatex( x, y, "" );
191  const double textsize( 0.07 );
192  latex->SetTextSize( 2*textsize );
193 
194  latex->DrawLatex( x, y, id.item()->modelName( id.index()).c_str());
195  y -= latex->GetTextSize()*0.6;
196 
197  latex->SetTextSize( textsize );
198  float lineH = latex->GetTextSize()*0.6;
199 
200  latex->DrawLatex( x, y, Form( " P_{T} = %.1f GeV, #eta = %0.2f, #varphi = %0.2f",
201  track->pt(), track->eta(), track->phi()));
202  y -= lineH;
203 
204  if( track->charge() > 0 )
205  latex->DrawLatex( x, y, " charge = +1" );
206  else
207  latex->DrawLatex( x, y, " charge = -1" );
208  y -= lineH;
209  y -= lineH;
210 
211  latex->DrawLatex( x, y, "Track modules:");
212  y -= lineH;
213 
214  Double_t pos[4];
215  pos[0] = x+0.05;
216  pos[2] = x+0.20;
217  Double_t boxH = 0.25*textsize;
218 
219  pos[1] = y; pos[3] = pos[1] + boxH;
220  FWDetailViewBase::drawCanvasBox( pos, kBlue );
221  latex->DrawLatex( x + 0.25, y, "Module" );
222  y -= lineH;
223 
224  pos[1] = y; pos[3] = pos[1] + boxH;
225  FWDetailViewBase::drawCanvasBox( pos, kRed );
226  latex->DrawLatex( x + 0.25, y, "LOST Module" );
227  y -= lineH;
228 
229  pos[1] = y; pos[3] = pos[1] + boxH;
231  latex->DrawLatex( x + 0.25, y, "INACTIVE Module" );
232  y -= lineH;
233 
234  pos[1] = y; pos[3] = pos[1] + boxH;
236  latex->DrawLatex( x + 0.25, y, "BAD Module" );
237  y -= lineH;
238 
239  Float_t r = 0.01;
240  Float_t r2 = 0.02;
241  y -= lineH;
242  drawCanvasDot( x + r2, y, r2, kGreen );
243  y -= r;
244  latex->DrawLatex( x + 3 * r2, y, "Pixel Hits" );
245  y -= lineH;
246 
247  drawCanvasDot( x + r2, y, r2, kRed);
248  y -= r;
249  latex->DrawLatex( x + 3 * r2, y, "Extra Pixel Hits" );
250  y -= lineH;
251 
252  m_legend->SetY2(y);
253  m_legend->Draw();
254  m_legend = nullptr; // Deleted together with TPad.
255 }
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 173 of file FWTrackHitsDetailView.cc.

References mps_fire::i, and m_modules.

Referenced by build().

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

Member Data Documentation

TEveElementList* FWTrackHitsDetailView::m_hits
protected

Definition at line 34 of file FWTrackHitsDetailView.h.

Referenced by build().

TLegend* FWTrackHitsDetailView::m_legend
private

Definition at line 64 of file FWTrackHitsDetailView.h.

Referenced by makeLegend(), and setTextInfo().

TEveElementList* FWTrackHitsDetailView::m_moduleLabels
protected

Definition at line 33 of file FWTrackHitsDetailView.h.

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

TEveElementList* FWTrackHitsDetailView::m_modules
protected

Definition at line 32 of file FWTrackHitsDetailView.h.

Referenced by build(), and transparencyChanged().

TGSlider* FWTrackHitsDetailView::m_slider
protected

Definition at line 35 of file FWTrackHitsDetailView.h.

Referenced by build().

FWIntValueListener* FWTrackHitsDetailView::m_sliderListener
protected

Definition at line 36 of file FWTrackHitsDetailView.h.

Referenced by build().