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

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

Referenced by build().

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

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

358 {
359  std::set<unsigned int> ids;
360  for( trackingRecHit_iterator recIt = track.recHitsBegin(), recItEnd = track.recHitsEnd();
361  recIt != recItEnd; ++recIt )
362  {
363  DetId detid = (*recIt)->geographicalId();
364  if( !addLostHits && !(*recIt)->isValid()) continue;
365  if( detid.rawId() != 0 )
366  {
367  TString name("");
368  switch( detid.det())
369  {
370  case DetId::Tracker:
371  name = iItem->getGeom()->getTrackerTopology()->print(detid);
372  break;
373 
374  case DetId::Muon:
375  switch( detid.subdetId())
376  {
377  case MuonSubdetId::DT:
378  name = "DT";
379  detid = DetId( DTChamberId( detid )); // get rid of layer bits
380  break;
381  case MuonSubdetId::CSC:
382  name = "CSC";
383  break;
384  case MuonSubdetId::RPC:
385  name = "RPC";
386  break;
387  case MuonSubdetId::GEM:
388  name = "GEM";
389  break;
390  case MuonSubdetId::ME0:
391  name = "ME0";
392  break;
393  default:
394  break;
395  }
396  break;
397  default:
398  break;
399  }
400  if( ! ids.insert( detid.rawId()).second ) continue;
401  if( iItem->getGeom())
402  {
403  TEveGeoShape* shape = iItem->getGeom()->getEveShape( detid );
404  if( nullptr != shape )
405  {
406  shape->SetMainTransparency( 65 );
407  shape->SetPickable( kTRUE );
408  switch(( *recIt )->type())
409  {
411  shape->SetMainColor( iItem->defaultDisplayProperties().color());
412  break;
416  name += "LOST ";
417  shape->SetMainColor( kRed );
418  break;
422  name += "INACTIVE ";
423  shape->SetMainColor( 28 );
424  break;
425  case TrackingRecHit::bad:
426  name += "BAD ";
427  shape->SetMainColor( 218 );
428  break;
429  }
430  shape->SetTitle( name + ULong_t( detid.rawId()));
431  trkList->AddElement( shape );
432  }
433  else
434  {
435  fwLog( fwlog::kInfo ) << "Failed to get shape extract for a tracking rec hit: "
436  << "\n" << fireworks::info( detid ) << std::endl;
437  }
438  }
439  }
440  }
441 }
const FWDisplayProperties & defaultDisplayProperties() const
Definition: FWEventItem.cc:456
static constexpr int GEM
Definition: MuonSubdetId.h:15
constexpr uint32_t rawId() const
get the raw id
Definition: DetId.h:50
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:298
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:109
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:675
const TrackerTopology * getTrackerTopology() const
Definition: FWGeometry.h:133
static constexpr int DT
Definition: MuonSubdetId.h:12
static constexpr int CSC
Definition: MuonSubdetId.h:13
const FWGeometry * getGeom() const
Definition: FWEventItem.cc:686
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:114
void FWTrackHitsDetailView::addTrackerHits3D ( std::vector< TVector3 > &  points,
class TEveElementList *  tList,
Color_t  color,
int  size 
)
private

Definition at line 301 of file FWTrackHitsDetailView.cc.

Referenced by addHits().

302 {
303  // !AT this is detail view specific, should move to track hits
304  // detail view
305 
306  TEvePointSet* pointSet = new TEvePointSet();
307  pointSet->SetMarkerSize(size);
308  pointSet->SetMarkerStyle(4);
309  pointSet->SetPickable(kTRUE);
310  pointSet->SetTitle("Pixel Hits");
311  pointSet->SetMarkerColor(color);
312 
313  for( std::vector<TVector3>::const_iterator it = points.begin(), itEnd = points.end(); it != itEnd; ++it) {
314  pointSet->SetNextPoint(it->x(), it->y(), it->z());
315  }
316  tList->AddElement(pointSet);
317 }
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 writedatasetfile::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  const auto & rhs = *(*(i));
106  if (gs == nullptr && (*i != nullptr)) {
107  std::cerr << "Got a " << typeid(rhs).name() << ", expecting TEveGeoShape. ignoring (it must be the clusters)." << std::endl;
108  continue;
109  }
110  gs->SetMainTransparency(75);
111  gs->SetPickable(kFALSE);
112 
113  TString name = gs->GetElementTitle();
114  if (!name.Contains("BAD") && !name.Contains("INACTIVE") && !name.Contains("LOST")) {
115  gs->SetMainColor(kBlue);
116  }
117  TEveText* text = new TEveText(name.Data());
118  text->PtrMainTrans()->SetFrom(gs->RefMainTrans().Array());
119  text->SetFontMode(TGLFont::kPixmap);
120  text->SetFontSize(12);
121  m_moduleLabels->AddElement(text);
122  }
123  m_moduleLabels->SetRnrChildren(false);
124 
125  TEveTrackPropagator* prop = new TEveTrackPropagator();
126  prop->SetMagFieldObj(item()->context().getField(), false);
127  prop->SetStepper(TEveTrackPropagator::kRungeKutta);
128  prop->SetMaxR(123);
129  prop->SetMaxZ(300);
130  prop->SetMaxStep(1);
131  TEveTrack* trk = fireworks::prepareTrack( *track, prop );
132  trk->MakeTrack();
133  trk->SetLineWidth(2);
134  trk->SetTitle( "Track and its ref states" );
135  prop->SetRnrDaughters(kTRUE);
136  prop->SetRnrReferences(kTRUE);
137  prop->SetRnrDecay(kTRUE);
138  prop->SetRnrFV(kTRUE);
139  trk->SetMainColor(id.item()->defaultDisplayProperties().color());
140  m_eveScene->AddElement(trk);
141 
142  viewerGL()->SetStyle(TGLRnrCtx::kOutline);
143  viewerGL()->SetDrawCameraCenter(kTRUE);
144  viewerGL()->ResetCamerasAfterNextUpdate();
145  viewerGL()->UpdateScene(kFALSE);
146  gEve->Redraw3D();
147 
148  setTextInfo(id, track);
149 }
bool isAvailable() const
Definition: Ref.h:575
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:194
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:45
void FWTrackHitsDetailView::makeLegend ( void  )
private

Definition at line 259 of file FWTrackHitsDetailView.cc.

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

Referenced by build().

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

Definition at line 168 of file FWTrackHitsDetailView.cc.

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

Referenced by build().

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

Definition at line 444 of file FWTrackHitsDetailView.cc.

References m_moduleLabels, and REGISTER_FWDETAILVIEW.

Referenced by build().

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

Reimplemented from FWDetailViewBase.

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

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

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

Definition at line 174 of file FWTrackHitsDetailView.cc.

References mps_fire::i, and m_modules.

Referenced by build().

175 {
176  for (TEveElement::List_i i=m_modules->BeginChildren(); i!=m_modules->EndChildren(); ++i)
177  {
178  (*i)->SetMainTransparency(x);
179  }
180  gEve->Redraw3D();
181 }
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().