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 ()
 
 FWTrackHitsDetailView (const FWTrackHitsDetailView &)=delete
 
const FWTrackHitsDetailViewoperator= (const FWTrackHitsDetailView &)=delete
 
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
 
 FWDetailViewBase (const FWDetailViewBase &)=delete
 
const FWEventItemitem ()
 
const FWDetailViewBaseoperator= (const FWDetailViewBase &)=delete
 
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 ()
 
 CSGActionSupervisor (const CSGActionSupervisor &)=delete
 
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)
 
const CSGActionSupervisoroperator= (const CSGActionSupervisor &)=delete
 
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
 
void makeLegend (void)
 
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() [1/2]

FWTrackHitsDetailView::FWTrackHitsDetailView ( )

Definition at line 40 of file FWTrackHitsDetailView.cc.

41  : m_modules(nullptr),
42  m_moduleLabels(nullptr),
43  m_hits(nullptr),
44  m_slider(nullptr),
46  m_legend(nullptr) {}
TEveElementList * m_modules
TEveElementList * m_moduleLabels
FWIntValueListener * m_sliderListener

◆ ~FWTrackHitsDetailView()

FWTrackHitsDetailView::~FWTrackHitsDetailView ( )
override

Definition at line 48 of file FWTrackHitsDetailView.cc.

48 {}

◆ FWTrackHitsDetailView() [2/2]

FWTrackHitsDetailView::FWTrackHitsDetailView ( const FWTrackHitsDetailView )
delete

Member Function Documentation

◆ addHits()

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

Definition at line 305 of file FWTrackHitsDetailView.cc.

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

Referenced by build().

308  {
309  std::vector<TVector3> pixelPoints;
310  fireworks::pushPixelHits(pixelPoints, *iItem, track);
311  TEveElementList* pixels = new TEveElementList("Pixels");
312  trkList->AddElement(pixels);
313  if (addNearbyHits) {
314  // get the extra hits
315  std::vector<TVector3> pixelExtraPoints;
316  fireworks::pushNearbyPixelHits(pixelExtraPoints, *iItem, track);
317  // draw first the others
318  addTrackerHits3D(pixelExtraPoints, pixels, kRed, 1);
319  // then the good ones, so they're on top
320  addTrackerHits3D(pixelPoints, pixels, kGreen, 1);
321  } else {
322  // just add those points with the default color
323  addTrackerHits3D(pixelPoints, pixels, iItem->defaultDisplayProperties().color(), 1);
324  }
325 
326  // strips
327  TEveElementList* strips = new TEveElementList("Strips");
328  trkList->AddElement(strips);
329  fireworks::addSiStripClusters(iItem, track, strips, addNearbyHits, false);
330 }
void addTrackerHits3D(std::vector< TVector3 > &points, class TEveElementList *tList, Color_t color, int size)
const FWDisplayProperties & defaultDisplayProperties() const
Definition: FWEventItem.cc:403
void pushPixelHits(std::vector< TVector3 > &pixelPoints, const FWEventItem &iItem, const reco::Track &t)
Definition: TrackUtils.cc:533
void addSiStripClusters(const FWEventItem *iItem, const reco::Track &t, class TEveElement *tList, bool addNearbyClusters, bool master)
Definition: TrackUtils.cc:336
strips
#turn off noise in all subdetectors simHcalUnsuppressedDigis.doNoise = False mix.digitizers.hcal.doNoise = False simEcalUnsuppressedDigis.doNoise = False mix.digitizers.ecal.doNoise = False simEcalUnsuppressedDigis.doESNoise = False simSiPixelDigis.AddNoise = False mix.digitizers.pixel.AddNoise = False simSiStripDigis.Noise = False mix.digitizers.strip.AddNoise = False
Definition: DigiDM_cff.py:32
void pushNearbyPixelHits(std::vector< TVector3 > &pixelPoints, const FWEventItem &iItem, const reco::Track &t)
Definition: TrackUtils.cc:480

◆ addModules()

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

Definition at line 334 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, Skims_PA_cff::name, TrackerTopology::print(), DetId::rawId(), MuonSubdetId::RPC, edm::second(), DetId::subdetId(), HLT_2022v12_cff::track, DetId::Tracker, and TrackingRecHit::valid.

Referenced by build().

337  {
338  std::set<unsigned int> ids;
339  for (trackingRecHit_iterator recIt = track.recHitsBegin(), recItEnd = track.recHitsEnd(); recIt != recItEnd;
340  ++recIt) {
341  DetId detid = (*recIt)->geographicalId();
342  if (!addLostHits && !(*recIt)->isValid())
343  continue;
344  if (detid.rawId() != 0) {
345  TString name("");
346  switch (detid.det()) {
347  case DetId::Tracker:
348  name = iItem->getGeom()->getTrackerTopology()->print(detid);
349  break;
350 
351  case DetId::Muon:
352  switch (detid.subdetId()) {
353  case MuonSubdetId::DT:
354  name = "DT";
355  detid = DetId(DTChamberId(detid)); // get rid of layer bits
356  break;
357  case MuonSubdetId::CSC:
358  name = "CSC";
359  break;
360  case MuonSubdetId::RPC:
361  name = "RPC";
362  break;
363  case MuonSubdetId::GEM:
364  name = "GEM";
365  break;
366  case MuonSubdetId::ME0:
367  name = "ME0";
368  break;
369  default:
370  break;
371  }
372  break;
373  default:
374  break;
375  }
376  if (!ids.insert(detid.rawId()).second)
377  continue;
378  if (iItem->getGeom()) {
379  TEveGeoShape* shape = iItem->getGeom()->getEveShape(detid);
380  if (nullptr != shape) {
381  shape->SetMainTransparency(65);
382  shape->SetPickable(kTRUE);
383  switch ((*recIt)->type()) {
385  shape->SetMainColor(iItem->defaultDisplayProperties().color());
386  break;
390  name += "LOST ";
391  shape->SetMainColor(kRed);
392  break;
396  name += "INACTIVE ";
397  shape->SetMainColor(28);
398  break;
399  case TrackingRecHit::bad:
400  name += "BAD ";
401  shape->SetMainColor(218);
402  break;
403  }
404  shape->SetTitle(name + ULong_t(detid.rawId()));
405  trkList->AddElement(shape);
406  } else {
407  fwLog(fwlog::kInfo) << "Failed to get shape extract for a tracking rec hit: "
408  << "\n"
409  << fireworks::info(detid) << std::endl;
410  }
411  }
412  }
413  }
414 }
static constexpr int GEM
Definition: MuonSubdetId.h:14
std::string print(DetId detid) const
constexpr Detector det() const
get the detector field from this detid
Definition: DetId.h:46
U second(std::pair< T, U > const &p)
const TrackerTopology * getTrackerTopology() const
Definition: FWGeometry.h:156
const FWDisplayProperties & defaultDisplayProperties() const
Definition: FWEventItem.cc:403
static constexpr int ME0
Definition: MuonSubdetId.h:15
constexpr int subdetId() const
get the contents of the subdetector field (not cast into any detector&#39;s numbering enum) ...
Definition: DetId.h:48
Definition: DetId.h:17
TEveGeoShape * getEveShape(unsigned int id) const
Definition: FWGeometry.cc:318
const FWGeometry * getGeom() const
Definition: FWEventItem.cc:548
#define fwLog(_level_)
Definition: fwLog.h:45
constexpr uint32_t rawId() const
get the raw id
Definition: DetId.h:57
static constexpr int RPC
Definition: MuonSubdetId.h:13
std::string info(const DetId &)
Definition: TrackUtils.cc:599
static constexpr int DT
Definition: MuonSubdetId.h:11
static constexpr int CSC
Definition: MuonSubdetId.h:12

◆ addTrackerHits3D()

void FWTrackHitsDetailView::addTrackerHits3D ( std::vector< TVector3 > &  points,
class TEveElementList *  tList,
Color_t  color,
int  size 
)
private

Definition at line 285 of file FWTrackHitsDetailView.cc.

References HLT_FULL_cff::points, and findQualityFiles::size.

Referenced by addHits().

288  {
289  // !AT this is detail view specific, should move to track hits
290  // detail view
291 
292  TEvePointSet* pointSet = new TEvePointSet();
293  pointSet->SetMarkerSize(size);
294  pointSet->SetMarkerStyle(4);
295  pointSet->SetPickable(kTRUE);
296  pointSet->SetTitle("Pixel Hits");
297  pointSet->SetMarkerColor(color);
298 
299  for (std::vector<TVector3>::const_iterator it = points.begin(), itEnd = points.end(); it != itEnd; ++it) {
300  pointSet->SetNextPoint(it->x(), it->y(), it->z());
301  }
302  tList->AddElement(pointSet);
303 }
size
Write out results.

◆ build()

void FWTrackHitsDetailView::build ( const FWModelId id,
const reco::Track track 
)
overrideprivatevirtual

Implements FWDetailView< reco::Track >.

Definition at line 50 of file FWTrackHitsDetailView.cc.

References writedatasetfile::action, addHits(), addModules(), b, EcnaPython_AdcPeg12_S1_10_R170298_1_0_150_Dee0::cerr, FWDetailViewBase::context(), mps_fire::end, f, CaloRecHitAuxSetter::getField(), mps_fire::i, FWDetailViewBase::item(), FWDetailViewGL< reco::Track >::m_eveScene, FWDetailViewGL< reco::Track >::m_guiFrame, m_hits, m_moduleLabels, m_modules, m_slider, m_sliderListener, makeLegend(), Skims_PA_cff::name, AlCaHLTBitMon_ParallelJobs::p, pickCameraCenter(), fireworks::prepareTrack(), rnrLabels(), setTextInfo(), submitPVValidationJobs::text, HLT_2022v12_cff::track, transparencyChanged(), FWIntValueListener::valueChanged_, and FWDetailViewGL< reco::Track >::viewerGL().

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

◆ makeLegend()

void FWTrackHitsDetailView::makeLegend ( void  )
private

Definition at line 245 of file FWTrackHitsDetailView.cc.

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

Referenced by build().

245  {
246  m_legend = new TLegend(0.01, 0.01, 0.99, 0.99, nullptr, "NDC");
247  m_legend->SetFillColor(kWhite);
248  m_legend->SetTextSize(0.07);
249  m_legend->SetBorderSize(0);
250  m_legend->SetMargin(0.15);
251  m_legend->SetEntrySeparation(0.01);
252 
253  TEveStraightLineSet* legend = new TEveStraightLineSet("siStripCluster");
254  legend->SetLineWidth(3);
255  legend->SetLineColor(kGreen);
256  m_legend->AddEntry(legend, "Exact SiStripCluster", "l");
257 
258  TEveStraightLineSet* legend2 = new TEveStraightLineSet("siStripCluster2");
259  legend2->SetLineWidth(3);
260  legend2->SetLineColor(kRed);
261  m_legend->AddEntry(legend2, "Extra SiStripCluster", "l");
262 
263  TEveStraightLineSet* legend3 = new TEveStraightLineSet("refStates");
264  legend3->SetDepthTest(kFALSE);
265  legend3->SetMarkerColor(kYellow);
266  legend3->SetMarkerStyle(kPlus);
267  legend3->SetMarkerSize(2);
268  m_legend->AddEntry(legend3, "Inner/Outermost States", "p");
269 
270  TEveStraightLineSet* legend4 = new TEveStraightLineSet("vertex");
271  legend4->SetDepthTest(kFALSE);
272  legend4->SetMarkerColor(kRed);
273  legend4->SetMarkerStyle(kFullDotLarge);
274  legend4->SetMarkerSize(2);
275  m_legend->AddEntry(legend4, "Vertex", "p");
276 
277  TEveStraightLineSet* legend5 = new TEveStraightLineSet("cameraCenter");
278  legend5->SetDepthTest(kFALSE);
279  legend5->SetMarkerColor(kCyan);
280  legend5->SetMarkerStyle(kFullDotLarge);
281  legend5->SetMarkerSize(2);
282  m_legend->AddEntry(legend5, "Camera center", "p");
283 }
const double kPlus
Definition: ParticleMasses.h:8

◆ operator=()

const FWTrackHitsDetailView& FWTrackHitsDetailView::operator= ( const FWTrackHitsDetailView )
delete

◆ pickCameraCenter()

void FWTrackHitsDetailView::pickCameraCenter ( )

Definition at line 159 of file FWTrackHitsDetailView.cc.

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

Referenced by build().

159 { viewerGL()->PickCameraCenter(); }
TGLViewer * viewerGL() const

◆ rnrLabels()

void FWTrackHitsDetailView::rnrLabels ( )

Definition at line 416 of file FWTrackHitsDetailView.cc.

References m_moduleLabels.

Referenced by build().

416  {
417  m_moduleLabels->SetRnrChildren(!m_moduleLabels->GetRnrChildren());
418  gEve->Redraw3D();
419 }
TEveElementList * m_moduleLabels

◆ setBackgroundColor()

void FWTrackHitsDetailView::setBackgroundColor ( Color_t  col)
overridevirtual

Reimplemented from FWDetailViewBase.

Definition at line 146 of file FWTrackHitsDetailView.cc.

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

146  {
147  // Callback for cmsShow change of background
148 
150 
151  // adopt label colors to background, this should be implemneted in TEveText
152  if (m_moduleLabels) {
153  Color_t x = viewerGL()->GetRnrCtx()->ColorSet().Foreground().GetColorIndex();
154  for (TEveElement::List_i i = m_moduleLabels->BeginChildren(); i != m_moduleLabels->EndChildren(); ++i)
155  (*i)->SetMainColor(x);
156  }
157 }
TGLViewer * viewerGL() const
TEveElementList * m_moduleLabels
col
Definition: cuy.py:1009
static Bool_t setColorSetViewer(TGLViewer *, Color_t)

◆ setTextInfo()

void FWTrackHitsDetailView::setTextInfo ( const FWModelId id,
const reco::Track track 
)
overrideprivatevirtual

Implements FWDetailView< reco::Track >.

Definition at line 168 of file FWTrackHitsDetailView.cc.

References FWDetailViewBase::drawCanvasBox(), FWDetailViewBase::drawCanvasDot(), FWDetailViewBase::item(), FWDetailViewGL< reco::Track >::m_infoCanvas, m_legend, ecalBarrelClusterFastTimer_cfi::modelName, alignCSCRings::r, diffTwoXMLs::r2, HLT_2022v12_cff::track, x, and y.

Referenced by build().

168  {
169  m_infoCanvas->cd();
170 
171  float_t x = 0.02;
172  float y = 0.95;
173 
174  TLatex* latex = new TLatex(x, y, "");
175  const double textsize(0.07);
176  latex->SetTextSize(2 * textsize);
177 
178  latex->DrawLatex(x, y, id.item()->modelName(id.index()).c_str());
179  y -= latex->GetTextSize() * 0.6;
180 
181  latex->SetTextSize(textsize);
182  float lineH = latex->GetTextSize() * 0.6;
183 
184  latex->DrawLatex(
185  x, y, Form(" P_{T} = %.1f GeV, #eta = %0.2f, #varphi = %0.2f", track->pt(), track->eta(), track->phi()));
186  y -= lineH;
187 
188  if (track->charge() > 0)
189  latex->DrawLatex(x, y, " charge = +1");
190  else
191  latex->DrawLatex(x, y, " charge = -1");
192  y -= lineH;
193  y -= lineH;
194 
195  latex->DrawLatex(x, y, "Track modules:");
196  y -= lineH;
197 
198  Double_t pos[4];
199  pos[0] = x + 0.05;
200  pos[2] = x + 0.20;
201  Double_t boxH = 0.25 * textsize;
202 
203  pos[1] = y;
204  pos[3] = pos[1] + boxH;
206  latex->DrawLatex(x + 0.25, y, "Module");
207  y -= lineH;
208 
209  pos[1] = y;
210  pos[3] = pos[1] + boxH;
212  latex->DrawLatex(x + 0.25, y, "LOST Module");
213  y -= lineH;
214 
215  pos[1] = y;
216  pos[3] = pos[1] + boxH;
218  latex->DrawLatex(x + 0.25, y, "INACTIVE Module");
219  y -= lineH;
220 
221  pos[1] = y;
222  pos[3] = pos[1] + boxH;
224  latex->DrawLatex(x + 0.25, y, "BAD Module");
225  y -= lineH;
226 
227  Float_t r = 0.01;
228  Float_t r2 = 0.02;
229  y -= lineH;
230  drawCanvasDot(x + r2, y, r2, kGreen);
231  y -= r;
232  latex->DrawLatex(x + 3 * r2, y, "Pixel Hits");
233  y -= lineH;
234 
235  drawCanvasDot(x + r2, y, r2, kRed);
236  y -= r;
237  latex->DrawLatex(x + 3 * r2, y, "Extra Pixel Hits");
238  y -= lineH;
239 
240  m_legend->SetY2(y);
241  m_legend->Draw();
242  m_legend = nullptr; // Deleted together with TPad.
243 }
const FWEventItem * item()
static void drawCanvasDot(Float_t x, Float_t y, Float_t r, Color_t)
static void drawCanvasBox(Double_t *pos, Color_t fillCol, Int_t fillType=0, bool bg=kTRUE)

◆ transparencyChanged()

void FWTrackHitsDetailView::transparencyChanged ( int  x)

Definition at line 161 of file FWTrackHitsDetailView.cc.

References mps_fire::i, m_modules, and x.

Referenced by build().

161  {
162  for (TEveElement::List_i i = m_modules->BeginChildren(); i != m_modules->EndChildren(); ++i) {
163  (*i)->SetMainTransparency(x);
164  }
165  gEve->Redraw3D();
166 }
TEveElementList * m_modules

Member Data Documentation

◆ m_hits

TEveElementList* FWTrackHitsDetailView::m_hits
protected

Definition at line 32 of file FWTrackHitsDetailView.h.

Referenced by build().

◆ m_legend

TLegend* FWTrackHitsDetailView::m_legend
private

Definition at line 52 of file FWTrackHitsDetailView.h.

Referenced by makeLegend(), and setTextInfo().

◆ m_moduleLabels

TEveElementList* FWTrackHitsDetailView::m_moduleLabels
protected

Definition at line 31 of file FWTrackHitsDetailView.h.

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

◆ m_modules

TEveElementList* FWTrackHitsDetailView::m_modules
protected

Definition at line 30 of file FWTrackHitsDetailView.h.

Referenced by build(), and transparencyChanged().

◆ m_slider

TGSlider* FWTrackHitsDetailView::m_slider
protected

Definition at line 33 of file FWTrackHitsDetailView.h.

Referenced by build().

◆ m_sliderListener

FWIntValueListener* FWTrackHitsDetailView::m_sliderListener
protected

Definition at line 34 of file FWTrackHitsDetailView.h.

Referenced by build().