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
FWConvTrackHitsDetailView Class Reference

#include <FWConvTrackHitsDetailView.h>

Inheritance diagram for FWConvTrackHitsDetailView:
FWDetailViewGL< reco::Conversion > CSGActionSupervisor FWDetailView< reco::Conversion > FWDetailViewBase

Public Member Functions

 FWConvTrackHitsDetailView ()
 
void pickCameraCenter ()
 
void rnrLabels ()
 
virtual void setBackgroundColor (Color_t)
 
void transparencyChanged (int)
 
virtual ~FWConvTrackHitsDetailView ()
 
- Public Member Functions inherited from FWDetailViewGL< reco::Conversion >
 FWDetailViewGL ()
 
virtual void init (TEveWindowSlot *)
 
TGLViewer * viewerGL () const
 
virtual ~FWDetailViewGL ()
 
- Public Member Functions inherited from FWDetailView< reco::Conversion >
 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::Conversion >
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::Conversion *)
 
 FWConvTrackHitsDetailView (const FWConvTrackHitsDetailView &)
 
void makeLegend (void)
 
const FWConvTrackHitsDetailViewoperator= (const FWConvTrackHitsDetailView &)
 
void setTextInfo (const FWModelId &id, const reco::Conversion *)
 

Private Attributes

TLegend * m_legend
 

Additional Inherited Members

- Static Public Member Functions inherited from FWDetailView< reco::Conversion >
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 FWConvTrackHitsDetailView.h.

Constructor & Destructor Documentation

FWConvTrackHitsDetailView::FWConvTrackHitsDetailView ( )

Definition at line 39 of file FWConvTrackHitsDetailView.cc.

FWConvTrackHitsDetailView::~FWConvTrackHitsDetailView ( )
virtual

Definition at line 48 of file FWConvTrackHitsDetailView.cc.

49 {
50 }
FWConvTrackHitsDetailView::FWConvTrackHitsDetailView ( const FWConvTrackHitsDetailView )
private

Member Function Documentation

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

Definition at line 408 of file FWConvTrackHitsDetailView.cc.

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

Referenced by build().

412 {
413  std::vector<TVector3> pixelPoints;
414  fireworks::pushPixelHits( pixelPoints, *iItem, track );
415  TEveElementList* pixels = new TEveElementList( "Pixels" );
416  trkList->AddElement( pixels );
417  if( addNearbyHits )
418  {
419  // get the extra hits
420  std::vector<TVector3> pixelExtraPoints;
421  fireworks::pushNearbyPixelHits( pixelExtraPoints, *iItem, track );
422  // draw first the others
423  addTrackerHits3D( pixelExtraPoints, pixels, kRed, 1 );
424  // then the good ones, so they're on top
425  addTrackerHits3D( pixelPoints, pixels, kGreen, 1 );
426  }
427  else
428  {
429  // just add those points with the default color
430  addTrackerHits3D( pixelPoints, pixels, iItem->defaultDisplayProperties().color(), 1 );
431  }
432 
433  // strips
434  TEveElementList* strips = new TEveElementList( "Strips" );
435  trkList->AddElement( strips );
436  fireworks::addSiStripClusters( iItem, track, strips, addNearbyHits, false );
437 }
const FWDisplayProperties & defaultDisplayProperties() const
Definition: FWEventItem.cc:451
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 addTrackerHits3D(std::vector< TVector3 > &points, class TEveElementList *tList, Color_t color, int size)
void pushNearbyPixelHits(std::vector< TVector3 > &pixelPoints, const FWEventItem &iItem, const reco::Track &t)
Definition: TrackUtils.cc:566
void FWConvTrackHitsDetailView::addModules ( const reco::Track track,
const FWEventItem iItem,
TEveElement *  trkList,
bool  addLostHits 
)
private

Definition at line 442 of file FWConvTrackHitsDetailView.cc.

References TrackingRecHit::bad, FWDisplayProperties::color(), MuonSubdetId::CSC, FWEventItem::defaultDisplayProperties(), DetId::det(), cond::rpcobgas::detid, MuonSubdetId::DT, DTChamberId, fwLog, FWGeometry::getEveShape(), FWEventItem::getGeom(), TrackingRecHit::inactive, fireworks::info(), fwlog::kInfo, TrackingRecHit::missing, DetId::Muon, mergeVDriftHistosByStation::name, PixelSubdetector::PixelBarrel, PixelSubdetector::PixelEndcap, DetId::rawId(), reco::Track::recHitsBegin(), reco::Track::recHitsEnd(), MuonSubdetId::RPC, edm::second(), DetId::subdetId(), SiStripDetId::TEC, SiStripDetId::TIB, SiStripDetId::TID, SiStripDetId::TOB, DetId::Tracker, and TrackingRecHit::valid.

Referenced by build().

446 {
447  std::set<unsigned int> ids;
448  for( trackingRecHit_iterator recIt = track.recHitsBegin(), recItEnd = track.recHitsEnd();
449  recIt != recItEnd; ++recIt )
450  {
451  DetId detid = (*recIt)->geographicalId();
452  if( !addLostHits && !(*recIt)->isValid()) continue;
453  if( detid.rawId() != 0 )
454  {
455  TString name("");
456  switch( detid.det())
457  {
458  case DetId::Tracker:
459  switch( detid.subdetId())
460  {
461  case SiStripDetId::TIB:
462  name = "TIB ";
463  break;
464  case SiStripDetId::TOB:
465  name = "TOB ";
466  break;
467  case SiStripDetId::TID:
468  name = "TID ";
469  break;
470  case SiStripDetId::TEC:
471  name = "TEC ";
472  break;
474  name = "Pixel Barrel ";
475  break;
477  name = "Pixel Endcap ";
478  default:
479  break;
480  }
481  break;
482 
483  case DetId::Muon:
484  switch( detid.subdetId())
485  {
486  case MuonSubdetId::DT:
487  name = "DT";
488  detid = DetId( DTChamberId( detid )); // get rid of layer bits
489  break;
490  case MuonSubdetId::CSC:
491  name = "CSC";
492  break;
493  case MuonSubdetId::RPC:
494  name = "RPC";
495  break;
496  default:
497  break;
498  }
499  break;
500  default:
501  break;
502  }
503  if( ! ids.insert( detid.rawId()).second ) continue;
504  if( iItem->getGeom())
505  {
506  TEveGeoShape* shape = iItem->getGeom()->getEveShape( detid );
507  if( 0 != shape )
508  {
509  shape->SetMainTransparency( 65 );
510  shape->SetPickable( kTRUE );
511  switch(( *recIt )->type())
512  {
514  shape->SetMainColor( iItem->defaultDisplayProperties().color());
515  break;
517  name += "LOST ";
518  shape->SetMainColor( kRed );
519  break;
521  name += "INACTIVE ";
522  shape->SetMainColor( 28 );
523  break;
524  case TrackingRecHit::bad:
525  name += "BAD ";
526  shape->SetMainColor( 218 );
527  break;
528  }
529  shape->SetTitle( name + ULong_t( detid.rawId()));
530  trkList->AddElement( shape );
531  }
532  else
533  {
534  fwLog( fwlog::kInfo ) << "Failed to get shape extract for a tracking rec hit: "
535  << "\n" << fireworks::info( detid ) << std::endl;
536  }
537  }
538  }
539  }
540 }
const FWDisplayProperties & defaultDisplayProperties() const
Definition: FWEventItem.cc:451
Color_t color() const
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:251
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
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
static const int DT
Definition: MuonSubdetId.h:14
Detector det() const
get the detector field from this detid
Definition: DetId.h:37
const FWGeometry * getGeom() const
Definition: FWEventItem.cc:687
trackingRecHit_iterator recHitsEnd() const
Iterator to last hit on the track.
Definition: Track.h:65
void FWConvTrackHitsDetailView::addTrackerHits3D ( std::vector< TVector3 > &  points,
class TEveElementList *  tList,
Color_t  color,
int  size 
)
private

Definition at line 389 of file FWConvTrackHitsDetailView.cc.

Referenced by addHits().

390 {
391  // !AT this is detail view specific, should move to track hits
392  // detail view
393 
394  TEvePointSet* pointSet = new TEvePointSet();
395  pointSet->SetMarkerSize(size);
396  pointSet->SetMarkerStyle(4);
397  pointSet->SetPickable(kTRUE);
398  pointSet->SetTitle("Pixel Hits");
399  pointSet->SetMarkerColor(color);
400 
401  for( std::vector<TVector3>::const_iterator it = points.begin(), itEnd = points.end(); it != itEnd; ++it) {
402  pointSet->SetNextPoint(it->x(), it->y(), it->z());
403  }
404  tList->AddElement(pointSet);
405 }
tuple size
Write out results.
void FWConvTrackHitsDetailView::build ( const FWModelId id,
const reco::Conversion conv 
)
privatevirtual

Implements FWDetailView< reco::Conversion >.

Definition at line 53 of file FWConvTrackHitsDetailView.cc.

References alignmentValidation::action, CSGAction::activated, addHits(), addModules(), b, benchmark_cfg::cerr, FWDetailViewBase::context(), CSGAction::createTextButton(), end, reco::Track::extra(), f, i, edm::Ref< C, T, F >::isAvailable(), FWDetailViewBase::item(), FWDetailViewGL< reco::Conversion >::m_eveScene, FWDetailViewGL< reco::Conversion >::m_guiFrame, m_hits, m_moduleLabels, m_modules, m_slider, m_sliderListener, mergeVDriftHistosByStation::name, reco::Conversion::nTracks(), L1TEmulatorMonitor_cff::p, pickCameraCenter(), fireworks::prepareTrack(), rnrLabels(), setTextInfo(), CSGAction::setToolTip(), runonSM::text, reco::Conversion::tracks(), transparencyChanged(), FWIntValueListener::valueChanged_, and FWDetailViewGL< reco::Conversion >::viewerGL().

54 {
55  if (conv->nTracks()<2) return;
56  const reco::Track* track0 = conv->tracks().at(0).get();
57  const reco::Track* track1 = conv->tracks().at(1).get();
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, &FWConvTrackHitsDetailView::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, &FWConvTrackHitsDetailView::pickCameraCenter));
86  }
87  //makeLegend(); //it seems there is not much room for this
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( track1->extra().isAvailable())
100  {
101  addModules( *track1, id.item(), m_modules, true );
102  addHits( *track1, id.item(), m_hits, true );
103  }
104  if( track0->extra().isAvailable())
105  {
106  addModules( *track0, id.item(), m_modules, true );
107  addHits( *track0, id.item(), m_hits, true );
108  }
109  for( TEveElement::List_i i = m_modules->BeginChildren(), end = m_modules->EndChildren(); i != end; ++i )
110  {
111  TEveGeoShape* gs = dynamic_cast<TEveGeoShape*>(*i);
112  if (gs == 0 && (*i != 0)) {
113  std::cerr << "Got a " << typeid(**i).name() << ", expecting TEveGeoShape. ignoring (it must be the clusters)." << std::endl;
114  continue;
115  }
116  gs->SetMainTransparency(75);
117  gs->SetPickable(kFALSE);
118 
119  TString name = gs->GetElementTitle();
120  if (!name.Contains("BAD") && !name.Contains("INACTIVE") && !name.Contains("LOST")) {
121  gs->SetMainColor(kBlue);
122  }
123  TEveText* text = new TEveText(name.Data());
124  text->PtrMainTrans()->SetFrom(gs->RefMainTrans().Array());
125  text->SetFontMode(TGLFont::kPixmap);
126  text->SetFontSize(12);
127  m_moduleLabels->AddElement(text);
128  }
129  m_moduleLabels->SetRnrChildren(false);
130 
131  TEveTrackPropagator* prop = new TEveTrackPropagator();
132  prop->SetMagFieldObj(item()->context().getField(), false);
133  prop->SetStepper(TEveTrackPropagator::kRungeKutta);
134  prop->SetMaxR(123);
135  prop->SetMaxZ(300);
136  prop->SetMaxStep(1);
137  prop->SetRnrDaughters(kTRUE);
138  prop->SetRnrReferences(kTRUE);
139  prop->SetRnrDecay(kTRUE);
140  prop->SetRnrFV(kTRUE);
141 
142  TEveTrack* trk1 = fireworks::prepareTrack( *track1, prop );
143  trk1->MakeTrack();
144  trk1->SetLineWidth(2);
145  trk1->SetTitle( "Track 1 and its ref states" );
146  trk1->SetMainColor(id.item()->defaultDisplayProperties().color());
147  m_eveScene->AddElement(trk1);
148 
149  TEveTrack* trk0 = fireworks::prepareTrack( *track0, prop );
150  trk0->MakeTrack();
151  trk0->SetLineWidth(2);
152  trk0->SetTitle( "Track 0 and its ref states" );
153  trk0->SetMainColor(id.item()->defaultDisplayProperties().color());
154  m_eveScene->AddElement(trk0);
155 
156  viewerGL()->SetStyle(TGLRnrCtx::kOutline);
157  viewerGL()->SetDrawCameraCenter(kTRUE);
158  viewerGL()->ResetCamerasAfterNextUpdate();
159  viewerGL()->UpdateScene(kFALSE);
160  gEve->Redraw3D();
161 
162  setTextInfo(id, conv);
163 }
void addModules(const reco::Track &track, const FWEventItem *iItem, TEveElement *trkList, bool addLostHits)
int i
Definition: DBlmapReader.cc:9
const TrackExtraRef & extra() const
reference to &quot;extra&quot; object
Definition: Track.h:97
FWIntValueListener * m_sliderListener
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
bool isAvailable() const
Definition: Ref.h:275
std::vector< edm::RefToBase< reco::Track > > tracks() const
vector of track to base references
Definition: Conversion.cc:180
const fireworks::Context & context() const
void setToolTip(const std::string &tip)
Definition: CSGAction.cc:106
sigc::signal< void, Int_t > valueChanged_
double f[11][100]
tuple text
Definition: runonSM.py:42
#define end
Definition: vmac.h:38
void addHits(const reco::Track &track, const FWEventItem *iItem, TEveElement *trkList, bool addNearbyHits)
unsigned int nTracks() const
Number of tracks= 0,1,2.
Definition: Conversion.h:105
void setTextInfo(const FWModelId &id, const reco::Conversion *)
double b
Definition: hdecay.h:120
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:116
void FWConvTrackHitsDetailView::makeLegend ( void  )
private

Definition at line 347 of file FWConvTrackHitsDetailView.cc.

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

348 {
349  m_legend = new TLegend( 0.01, 0.01, 0.99, 0.99, 0, "NDC" );
350  m_legend->SetFillColor(kWhite);
351  m_legend->SetTextSize( 0.07 );
352  m_legend->SetBorderSize( 0 );
353  m_legend->SetMargin( 0.15 );
354  m_legend->SetEntrySeparation( 0.01 );
355 
356  TEveStraightLineSet *legend = new TEveStraightLineSet( "siStripCluster" );
357  legend->SetLineWidth( 3 );
358  legend->SetLineColor( kGreen );
359  m_legend->AddEntry( legend, "Exact SiStripCluster", "l");
360 
361  TEveStraightLineSet *legend2 = new TEveStraightLineSet( "siStripCluster2" );
362  legend2->SetLineWidth( 3 );
363  legend2->SetLineColor( kRed );
364  m_legend->AddEntry( legend2, "Extra SiStripCluster", "l");
365 
366  TEveStraightLineSet *legend3 = new TEveStraightLineSet( "refStates" );
367  legend3->SetDepthTest( kFALSE );
368  legend3->SetMarkerColor( kYellow );
369  legend3->SetMarkerStyle( kPlus );
370  legend3->SetMarkerSize( 2 );
371  m_legend->AddEntry( legend3, "Inner/Outermost States", "p");
372 
373  TEveStraightLineSet *legend4 = new TEveStraightLineSet( "vertex" );
374  legend4->SetDepthTest( kFALSE );
375  legend4->SetMarkerColor( kRed );
376  legend4->SetMarkerStyle( kFullDotLarge );
377  legend4->SetMarkerSize( 2 );
378  m_legend->AddEntry( legend4, "Vertex", "p");
379 
380  TEveStraightLineSet *legend5 = new TEveStraightLineSet( "cameraCenter" );
381  legend5->SetDepthTest( kFALSE );
382  legend5->SetMarkerColor( kCyan );
383  legend5->SetMarkerStyle( kFullDotLarge );
384  legend5->SetMarkerSize( 2 );
385  m_legend->AddEntry( legend5, "Camera center", "p");
386 }
const FWConvTrackHitsDetailView& FWConvTrackHitsDetailView::operator= ( const FWConvTrackHitsDetailView )
private
void FWConvTrackHitsDetailView::pickCameraCenter ( )

Definition at line 182 of file FWConvTrackHitsDetailView.cc.

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

Referenced by build().

183 {
184  viewerGL()->PickCameraCenter();
185 }
void FWConvTrackHitsDetailView::rnrLabels ( )

Definition at line 543 of file FWConvTrackHitsDetailView.cc.

References m_moduleLabels.

Referenced by build().

544 {
545  m_moduleLabels->SetRnrChildren(!m_moduleLabels->GetRnrChildren());
546  gEve->Redraw3D();
547 }
void FWConvTrackHitsDetailView::setBackgroundColor ( Color_t  col)
virtual

Reimplemented from FWDetailViewGL< reco::Conversion >.

Definition at line 166 of file FWConvTrackHitsDetailView.cc.

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

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

167 {
168  // Callback for cmsShow change of background
169 
171 
172  // adopt label colors to background, this should be implemneted in TEveText
173  if (m_moduleLabels)
174  {
175  Color_t x = viewerGL()->GetRnrCtx()->ColorSet().Foreground().GetColorIndex();
176  for (TEveElement::List_i i=m_moduleLabels->BeginChildren(); i!=m_moduleLabels->EndChildren(); ++i)
177  (*i)->SetMainColor(x);
178  }
179 }
int i
Definition: DBlmapReader.cc:9
static Bool_t setColorSetViewer(TGLViewer *, Color_t)
Definition: DDAxes.h:10
void FWConvTrackHitsDetailView::setTextInfo ( const FWModelId id,
const reco::Conversion conv 
)
privatevirtual

Implements FWDetailView< reco::Conversion >.

Definition at line 198 of file FWConvTrackHitsDetailView.cc.

References reco::TrackBase::charge(), reco::Conversion::conversionVertex(), reco::Conversion::distOfMinimumApproach(), reco::Conversion::dPhiTracksAtVtx(), reco::TrackBase::eta(), reco::HitPattern::getHitPattern(), reco::TrackBase::hitPattern(), getHLTprescales::index, FWDetailViewBase::item(), FWDetailViewGL< reco::Conversion >::m_infoCanvas, reco::HitPattern::numberOfHits(), reco::Conversion::pairCotThetaSeparation(), reco::Conversion::pairMomentum(), reco::TrackBase::phi(), reco::HitPattern::pixelHitFilter(), reco::Vertex::position(), reco::TrackBase::pt(), mathSSE::sqrt(), reco::HitPattern::stripHitFilter(), reco::TrackBase::trackerExpectedHitsInner(), reco::Conversion::tracks(), reco::HitPattern::validHitFilter(), x, reco::Vertex::x(), detailsBasic3DVector::y, reco::Vertex::y(), and reco::Vertex::z().

Referenced by build().

199 {
200  m_infoCanvas->cd();
201 
202  float_t x = 0.02;
203  float y = 0.95;
204 
205  TLatex* latex = new TLatex( x, y, "" );
206  const double textsize( 0.07 );
207  latex->SetTextSize( 2*textsize );
208 
209  latex->DrawLatex( x, y, id.item()->modelName( id.index()).c_str());
210  y -= latex->GetTextSize()*0.6;
211 
212  latex->SetTextSize( textsize );
213  float lineH = latex->GetTextSize()*0.6;
214 
215  latex->DrawLatex( x, y, Form("p_{T}=%.1f GeV, #eta=%0.2f, #varphi=%0.2f",
216  sqrt(conv->pairMomentum().Perp2()), conv->pairMomentum().eta(), conv->pairMomentum().phi() ));
217  y -= lineH;
218  latex->DrawLatex( x, y, Form("vtx=(%.1f, %.1f, %.1f) r=%.1f [cm]",
219  conv->conversionVertex().x(), conv->conversionVertex().y(), conv->conversionVertex().z(),
220  conv->conversionVertex().position().rho() ));
221  y -= lineH;
222  latex->DrawLatex( x, y, Form("#Deltactg#theta=%.3f",
223  conv->pairCotThetaSeparation() ));
224  y -= lineH;
225  latex->DrawLatex( x, y, Form("#Delta#phi_{vtx}=%.3f",
226  conv->dPhiTracksAtVtx() ));
227  y -= lineH;
228  latex->DrawLatex( x, y, Form("dist. min. app.=%.3f cm",
229  conv->distOfMinimumApproach() ));
230  y -= lineH;
231  y -= lineH;
232 
233 
234  const reco::Track* track0 = conv->tracks().at(0).get();
235  latex->DrawLatex( x, y, Form("Trk0 q=%i",track0->charge()));
236  y -= lineH;
237  latex->DrawLatex( x, y, Form( "p_{T}=%.1f GeV, #eta=%0.2f, #varphi=%0.2f",
238  track0->pt(), track0->eta(), track0->phi()));
239  y -= lineH;
240  const reco::HitPattern& p_tk0 = track0->hitPattern();
241  int nvalid_tk0=0, ninvalid_tk0=0, npix_tk0=0, nstrip_tk0=0;
242  for(int i_tk0=0; i_tk0<p_tk0.numberOfHits(); i_tk0++) {
243  uint32_t hit = p_tk0.getHitPattern(i_tk0);
244  if(p_tk0.validHitFilter(hit)) {
245  nvalid_tk0++;
246  if (p_tk0.pixelHitFilter(hit)) npix_tk0++;
247  else if (p_tk0.stripHitFilter(hit)) nstrip_tk0++;
248  } else ninvalid_tk0++;
249  }
250  latex->DrawLatex( x, y, Form( "valid hits: %i (pix. %i, str. %i)", nvalid_tk0, npix_tk0, nstrip_tk0) );
251  y -= lineH;
252  latex->DrawLatex( x, y, Form( "invalid: %i", ninvalid_tk0) );
253  y -= lineH;
254  const reco::HitPattern& p_mhi_tk0 = track0->trackerExpectedHitsInner();
255  int npix_mhi_tk0=0, nstrip_mhi_tk0=0;
256  for(int i_mhi_tk0=0; i_mhi_tk0<p_mhi_tk0.numberOfHits(); i_mhi_tk0++) {
257  uint32_t hit = p_mhi_tk0.getHitPattern(i_mhi_tk0);
258  if (p_mhi_tk0.pixelHitFilter(hit)) npix_mhi_tk0++;
259  else if (p_mhi_tk0.stripHitFilter(hit)) nstrip_mhi_tk0++;
260  }
261  latex->DrawLatex( x, y, Form("miss. inner hits: pix. %i, str. %i", npix_mhi_tk0, nstrip_mhi_tk0) );
262 
263  y -= lineH;
264  y -= lineH;
265  const reco::Track* track1 = conv->tracks().at(1).get();
266  latex->DrawLatex( x, y, Form("Trk1 q=%i",track1->charge()));
267  y -= lineH;
268  latex->DrawLatex( x, y, Form( "p_{T}=%.1f GeV, #eta=%0.2f, #varphi=%0.2f",
269  track1->pt(), track1->eta(), track1->phi()));
270  y -= lineH;
271  const reco::HitPattern& p_tk1 = track1->hitPattern();
272  int nvalid_tk1=0, ninvalid_tk1=0, npix_tk1=0, nstrip_tk1=0;
273  for(int i_tk1=0; i_tk1<p_tk1.numberOfHits(); i_tk1++) {
274  uint32_t hit = p_tk1.getHitPattern(i_tk1);
275  if(p_tk1.validHitFilter(hit)) {
276  nvalid_tk1++;
277  if (p_tk1.pixelHitFilter(hit)) npix_tk1++;
278  else if (p_tk1.stripHitFilter(hit)) nstrip_tk1++;
279  } else ninvalid_tk1++;
280  }
281  latex->DrawLatex( x, y, Form( "valid hits: %i (pix. %i, str. %i)", nvalid_tk1, npix_tk1, nstrip_tk1) );
282  y -= lineH;
283  latex->DrawLatex( x, y, Form( "invalid: %i", ninvalid_tk1) );
284  y -= lineH;
285  const reco::HitPattern& p_mhi_tk1 = track1->trackerExpectedHitsInner();
286  int npix_mhi_tk1=0, nstrip_mhi_tk1=0;
287  for(int i_mhi_tk1=0; i_mhi_tk1<p_mhi_tk1.numberOfHits(); i_mhi_tk1++) {
288  uint32_t hit = p_mhi_tk1.getHitPattern(i_mhi_tk1);
289  if (p_mhi_tk1.pixelHitFilter(hit)) npix_mhi_tk1++;
290  else if (p_mhi_tk1.stripHitFilter(hit)) nstrip_mhi_tk1++;
291  }
292  latex->DrawLatex( x, y, Form("miss. inner hits: pix. %i, str. %i", npix_mhi_tk1, nstrip_mhi_tk1) );
293  y -= lineH;
294  y -= lineH;
295 
296  latex->DrawLatex( x, y, "Placeholder for symbol legend");
297  y -= lineH;
298  latex->DrawLatex( x, y, "and projection buttons");
299 // latex->DrawLatex( x, y, "Track modules:");
300 // y -= lineH;
301 
302 // Double_t pos[4];
303 // pos[0] = x+0.05;
304 // pos[2] = x+0.20;
305 // Double_t boxH = 0.25*textsize;
306 
307 // pos[1] = y; pos[3] = pos[1] + boxH;
308 // FWDetailViewBase::drawCanvasBox( pos, kBlue );
309 // latex->DrawLatex( x + 0.25, y, "Module" );
310 // y -= lineH;
311 
312 // pos[1] = y; pos[3] = pos[1] + boxH;
313 // FWDetailViewBase::drawCanvasBox( pos, kRed );
314 // latex->DrawLatex( x + 0.25, y, "LOST Module" );
315 // y -= lineH;
316 
317 // pos[1] = y; pos[3] = pos[1] + boxH;
318 // FWDetailViewBase::drawCanvasBox( pos, 28 );
319 // latex->DrawLatex( x + 0.25, y, "INACTIVE Module" );
320 // y -= lineH;
321 
322 // pos[1] = y; pos[3] = pos[1] + boxH;
323 // FWDetailViewBase::drawCanvasBox( pos, 218 );
324 // latex->DrawLatex( x + 0.25, y, "BAD Module" );
325 // y -= lineH;
326 
327 // Float_t r = 0.01;
328 // Float_t r2 = 0.02;
329 // y -= lineH;
330 // drawCanvasDot( x + r2, y, r2, kGreen );
331 // y -= r;
332 // latex->DrawLatex( x + 3 * r2, y, "Pixel Hits" );
333 // y -= lineH;
334 
335 // drawCanvasDot( x + r2, y, r2, kRed);
336 // y -= r;
337 // latex->DrawLatex( x + 3 * r2, y, "Extra Pixel Hits" );
338 // y -= lineH;
339 
340 // m_legend->SetY2(y);
341 // m_legend->Draw();
342 // m_legend = 0; // Deleted together with TPad.
343 
344 }
const reco::Vertex & conversionVertex() const
returns the reco conversion vertex
Definition: Conversion.h:101
double y() const
y coordinate
Definition: Vertex.h:97
const FWEventItem * item()
double distOfMinimumApproach() const
Definition: Conversion.h:129
double pairCotThetaSeparation() const
Delta cot(Theta) where Theta is the angle in the (y,z) plane between the two tracks. Original tracks are used.
Definition: Conversion.cc:223
double phi() const
azimuthal angle of momentum vector
Definition: TrackBase.h:139
const Point & position() const
position
Definition: Vertex.h:93
std::vector< edm::RefToBase< reco::Track > > tracks() const
vector of track to base references
Definition: Conversion.cc:180
double eta() const
pseudorapidity of momentum vector
Definition: TrackBase.h:141
T sqrt(T t)
Definition: SSEVec.h:28
double pt() const
track transverse momentum
Definition: TrackBase.h:131
bool stripHitFilter(uint32_t pattern) const
Definition: HitPattern.cc:160
int numberOfHits() const
Definition: HitPattern.cc:312
double z() const
y coordinate
Definition: Vertex.h:99
const HitPattern & trackerExpectedHitsInner() const
Access the hit pattern counting (in the Tracker) the number of expected crossed layers before the fir...
Definition: TrackBase.h:225
const HitPattern & hitPattern() const
Access the hit pattern, indicating in which Tracker layers the track has hits.
Definition: TrackBase.h:223
bool validHitFilter(uint32_t pattern) const
Definition: HitPattern.cc:264
bool pixelHitFilter(uint32_t pattern) const
Definition: HitPattern.cc:138
double x() const
x coordinate
Definition: Vertex.h:95
math::XYZVectorF pairMomentum() const
Conversion tracks momentum from the tracks inner momentum.
Definition: Conversion.cc:237
int charge() const
track electric charge
Definition: TrackBase.h:113
Definition: DDAxes.h:10
uint32_t getHitPattern(int position) const
Definition: HitPattern.cc:86
double dPhiTracksAtVtx() const
Definition: Conversion.cc:328
void FWConvTrackHitsDetailView::transparencyChanged ( int  x)

Definition at line 188 of file FWConvTrackHitsDetailView.cc.

References i, and m_modules.

Referenced by build().

189 {
190  for (TEveElement::List_i i=m_modules->BeginChildren(); i!=m_modules->EndChildren(); ++i)
191  {
192  (*i)->SetMainTransparency(x);
193  }
194  gEve->Redraw3D();
195 }
int i
Definition: DBlmapReader.cc:9
Definition: DDAxes.h:10

Member Data Documentation

TEveElementList* FWConvTrackHitsDetailView::m_hits
protected

Definition at line 33 of file FWConvTrackHitsDetailView.h.

Referenced by build().

TLegend* FWConvTrackHitsDetailView::m_legend
private

Definition at line 61 of file FWConvTrackHitsDetailView.h.

Referenced by makeLegend().

TEveElementList* FWConvTrackHitsDetailView::m_moduleLabels
protected

Definition at line 32 of file FWConvTrackHitsDetailView.h.

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

TEveElementList* FWConvTrackHitsDetailView::m_modules
protected

Definition at line 31 of file FWConvTrackHitsDetailView.h.

Referenced by build(), and transparencyChanged().

TGSlider* FWConvTrackHitsDetailView::m_slider
protected

Definition at line 34 of file FWConvTrackHitsDetailView.h.

Referenced by build().

FWIntValueListener* FWConvTrackHitsDetailView::m_sliderListener
protected

Definition at line 35 of file FWConvTrackHitsDetailView.h.

Referenced by build().