CMS 3D CMS Logo

List of all members | Public Member Functions | 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

void camera1Callback ()
 
void camera2Callback ()
 
void camera3Callback ()
 
 FWConvTrackHitsDetailView ()
 
void pickCameraCenter ()
 
void rnrHits ()
 
void rnrLabels ()
 
void rnrModules ()
 
void switchProjection ()
 
 ~FWConvTrackHitsDetailView () override
 
- Public Member Functions inherited from FWDetailViewGL< reco::Conversion >
 FWDetailViewGL ()
 
void init (TEveWindowSlot *) override
 
void setBackgroundColor (Color_t) override
 
TGLViewer * viewerGL () const
 
 ~FWDetailViewGL () override
 
- Public Member Functions inherited from FWDetailView< reco::Conversion >
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 ()
 

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 *) override
 
 FWConvTrackHitsDetailView (const FWConvTrackHitsDetailView &)=delete
 
const FWConvTrackHitsDetailViewoperator= (const FWConvTrackHitsDetailView &)=delete
 
void setTextInfo (const FWModelId &id, const reco::Conversion *) override
 

Private Attributes

TEveElement * m_calo3D
 
CSGActionm_camTypeAction
 
TEveElementList * m_hits
 
TLegend * m_legend
 
TEveElementList * m_moduleLabels
 
TEveElementList * m_modules
 
bool m_orthographic
 

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 &)
 
- 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
 

Detailed Description

Definition at line 23 of file FWConvTrackHitsDetailView.h.

Constructor & Destructor Documentation

◆ FWConvTrackHitsDetailView() [1/2]

FWConvTrackHitsDetailView::FWConvTrackHitsDetailView ( )

Definition at line 47 of file FWConvTrackHitsDetailView.cc.

48  : m_modules(nullptr), m_moduleLabels(nullptr), m_hits(nullptr), m_legend(nullptr), m_orthographic(false) {}

◆ ~FWConvTrackHitsDetailView()

FWConvTrackHitsDetailView::~FWConvTrackHitsDetailView ( )
override

Definition at line 50 of file FWConvTrackHitsDetailView.cc.

50 {}

◆ FWConvTrackHitsDetailView() [2/2]

FWConvTrackHitsDetailView::FWConvTrackHitsDetailView ( const FWConvTrackHitsDetailView )
privatedelete

Member Function Documentation

◆ addHits()

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

Definition at line 450 of file FWConvTrackHitsDetailView.cc.

453  {
454  std::vector<TVector3> pixelPoints;
455  fireworks::pushPixelHits(pixelPoints, *iItem, track);
456  TEveElementList* pixels = new TEveElementList("Pixels");
457  trkList->AddElement(pixels);
458  if (addNearbyHits) {
459  // get the extra hits
460  std::vector<TVector3> pixelExtraPoints;
461  fireworks::pushNearbyPixelHits(pixelExtraPoints, *iItem, track);
462  // draw first the others
463  addTrackerHits3D(pixelExtraPoints, pixels, kRed, 1);
464  // then the good ones, so they're on top
465  addTrackerHits3D(pixelPoints, pixels, kGreen, 1);
466  } else {
467  // just add those points with the default color
468  addTrackerHits3D(pixelPoints, pixels, iItem->defaultDisplayProperties().color(), 1);
469  }
470 
471  // strips
472  TEveElementList* strips = new TEveElementList("Strips");
473  trkList->AddElement(strips);
474  fireworks::addSiStripClusters(iItem, track, strips, addNearbyHits, false);
475 }

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

Referenced by build().

◆ addModules()

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

Definition at line 479 of file FWConvTrackHitsDetailView.cc.

482  {
483  std::set<unsigned int> ids;
484  for (trackingRecHit_iterator recIt = track.recHitsBegin(), recItEnd = track.recHitsEnd(); recIt != recItEnd;
485  ++recIt) {
486  DetId detid = (*recIt)->geographicalId();
487  if (!addLostHits && !(*recIt)->isValid())
488  continue;
489  if (detid.rawId() != 0) {
490  TString name("");
491  switch (detid.det()) {
492  case DetId::Tracker:
493  switch (detid.subdetId()) {
494  case SiStripDetId::TIB:
495  name = "TIB ";
496  break;
497  case SiStripDetId::TOB:
498  name = "TOB ";
499  break;
500  case SiStripDetId::TID:
501  name = "TID ";
502  break;
503  case SiStripDetId::TEC:
504  name = "TEC ";
505  break;
507  name = "Pixel Barrel ";
508  break;
510  name = "Pixel Endcap ";
511  default:
512  break;
513  }
514  break;
515 
516  case DetId::Muon:
517  switch (detid.subdetId()) {
518  case MuonSubdetId::DT:
519  name = "DT";
520  detid = DetId(DTChamberId(detid)); // get rid of layer bits
521  break;
522  case MuonSubdetId::CSC:
523  name = "CSC";
524  break;
525  case MuonSubdetId::RPC:
526  name = "RPC";
527  break;
528  default:
529  break;
530  }
531  break;
532  default:
533  break;
534  }
535  if (!ids.insert(detid.rawId()).second)
536  continue;
537  if (iItem->getGeom()) {
538  TEveGeoShape* shape = iItem->getGeom()->getEveShape(detid);
539  if (nullptr != shape) {
540  shape->SetMainTransparency(65);
541  shape->SetPickable(kTRUE);
542  switch ((*recIt)->type()) {
544  shape->SetMainColor(iItem->defaultDisplayProperties().color());
545  break;
549  name += "LOST ";
550  shape->SetMainColor(kRed);
551  break;
555  name += "INACTIVE ";
556  shape->SetMainColor(28);
557  break;
558  case TrackingRecHit::bad:
559  name += "BAD ";
560  shape->SetMainColor(218);
561  break;
562  }
563  shape->SetTitle(name + ULong_t(detid.rawId()));
564  trkList->AddElement(shape);
565  } else {
566  fwLog(fwlog::kInfo) << "Failed to get shape extract for a tracking rec hit: "
567  << "\n"
568  << fireworks::info(detid) << std::endl;
569  }
570  }
571  }
572  }
573 }

References TrackingRecHit::bad, FWDisplayProperties::color(), MuonSubdetId::CSC, FWEventItem::defaultDisplayProperties(), DetId::det(), MuonSubdetId::DT, fwLog, FWGeometry::getEveShape(), FWEventItem::getGeom(), TrackingRecHit::inactive, TrackingRecHit::inactive_inner, TrackingRecHit::inactive_outer, fireworks::info(), fwlog::kInfo, TrackingRecHit::missing, TrackingRecHit::missing_inner, TrackingRecHit::missing_outer, DetId::Muon, Skims_PA_cff::name, PixelSubdetector::PixelBarrel, PixelSubdetector::PixelEndcap, DetId::rawId(), MuonSubdetId::RPC, edm::second(), DetId::subdetId(), SiStripDetId::TEC, SiStripDetId::TIB, SiStripDetId::TID, SiStripDetId::TOB, HLT_FULL_cff::track, DetId::Tracker, and TrackingRecHit::valid.

Referenced by build().

◆ addTrackerHits3D()

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

Definition at line 430 of file FWConvTrackHitsDetailView.cc.

433  {
434  // !AMT this is detail view specific, should move to track hits
435  // detail view
436 
437  TEvePointSet* pointSet = new TEvePointSet();
438  pointSet->SetMarkerSize(size);
439  pointSet->SetMarkerStyle(4);
440  pointSet->SetPickable(kTRUE);
441  pointSet->SetTitle("Pixel Hits");
442  pointSet->SetMarkerColor(color);
443 
444  for (std::vector<TVector3>::const_iterator it = points.begin(), itEnd = points.end(); it != itEnd; ++it) {
445  pointSet->SetNextPoint(it->x(), it->y(), it->z());
446  }
447  tList->AddElement(pointSet);
448 }

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

Referenced by addHits().

◆ build()

void FWConvTrackHitsDetailView::build ( const FWModelId id,
const reco::Conversion conv 
)
overrideprivatevirtual

Implements FWDetailView< reco::Conversion >.

Definition at line 83 of file FWConvTrackHitsDetailView.cc.

83  {
84  if (conv->nTracks() < 2)
85  return;
86  const reco::Track* track0 = conv->tracks().at(0).get();
87  const reco::Track* track1 = conv->tracks().at(1).get();
88 
89  m_guiFrame->AddFrame(new TGLabel(m_guiFrame, "Camera Views:"), new TGLayoutHints(kLHintsLeft, 2, 2, 2, 2));
90 
91  {
92  TGHorizontalFrame* f = new TGHorizontalFrame(m_guiFrame);
93  m_guiFrame->AddFrame(f, new TGLayoutHints(kLHintsExpandX, 2, 0, 0, 0));
94 
95  {
96  CSGAction* action = new CSGAction(this, "Top");
97  TGTextButton* b = new TGTextButton(f, action->getName().c_str());
98  f->AddFrame(b, new TGLayoutHints(kLHintsExpandX));
99  TQObject::Connect(b, "Clicked()", "CSGAction", action, "activate()");
100  b->SetToolTipText("plane normal: track0 x track1");
101  action->activated.connect(sigc::mem_fun(this, &FWConvTrackHitsDetailView::camera1Callback));
102  }
103 
104  {
105  CSGAction* action = new CSGAction(this, "Side");
106  TGTextButton* b = new TGTextButton(f, action->getName().c_str());
107  f->AddFrame(b, new TGLayoutHints(kLHintsExpandX));
108  TQObject::Connect(b, "Clicked()", "CSGAction", action, "activate()");
109  b->SetToolTipText("left fir: track1");
110  action->activated.connect(sigc::mem_fun(this, &FWConvTrackHitsDetailView::camera2Callback));
111  }
112  {
113  CSGAction* action = new CSGAction(this, "Front");
114  TGTextButton* b = new TGTextButton(f, action->getName().c_str());
115  f->AddFrame(b, new TGLayoutHints(kLHintsExpandX));
116  TQObject::Connect(b, "Clicked()", "CSGAction", action, "activate()");
117  action->activated.connect(sigc::mem_fun(this, &FWConvTrackHitsDetailView::camera3Callback));
118  b->SetToolTipText("plane normal: track1 ");
119  }
120  }
121 
122  {
123  m_camTypeAction = new CSGAction(this, " Set Ortographic Projection ");
124  m_camTypeAction->createTextButton(m_guiFrame, new TGLayoutHints(kLHintsExpandX, 2, 0, 1, 4));
126  }
127 
128  {
129  CSGAction* action = new CSGAction(this, "Draw Module");
130  TGCheckButton* b = new TGCheckButton(m_guiFrame, action->getName().c_str());
131  b->SetState(kButtonDown, false);
132  m_guiFrame->AddFrame(b, new TGLayoutHints(kLHintsNormal, 2, 3, 1, 4));
133  TQObject::Connect(b, "Clicked()", "CSGAction", action, "activate()");
134  action->activated.connect(sigc::mem_fun(this, &FWConvTrackHitsDetailView::rnrModules));
135  }
136  {
137  CSGAction* action = new CSGAction(this, "Draw Hits");
138  TGCheckButton* b = new TGCheckButton(m_guiFrame, action->getName().c_str());
139  b->SetState(kButtonDown, false);
140  m_guiFrame->AddFrame(b, new TGLayoutHints(kLHintsNormal, 2, 3, 1, 4));
141  TQObject::Connect(b, "Clicked()", "CSGAction", action, "activate()");
142  action->activated.connect(sigc::mem_fun(this, &FWConvTrackHitsDetailView::rnrHits));
143  }
144 
145  TGCompositeFrame* p = (TGCompositeFrame*)m_guiFrame->GetParent();
146  p->MapSubwindows();
147  p->Layout();
148 
149  m_modules = new TEveElementList("Modules");
150  m_eveScene->AddElement(m_modules);
151  m_moduleLabels = new TEveElementList("Modules");
152  m_eveScene->AddElement(m_moduleLabels);
153  m_hits = new TEveElementList("Hits");
154  m_eveScene->AddElement(m_hits);
155  if (track1->extra().isAvailable()) {
156  addModules(*track1, id.item(), m_modules, true);
157  addHits(*track1, id.item(), m_hits, true);
158  }
159  if (track0->extra().isAvailable()) {
160  addModules(*track0, id.item(), m_modules, true);
161  addHits(*track0, id.item(), m_hits, true);
162  }
163  for (TEveElement::List_i i = m_modules->BeginChildren(), end = m_modules->EndChildren(); i != end; ++i) {
164  TEveGeoShape* gs = dynamic_cast<TEveGeoShape*>(*i);
165  const auto& rhs = *(*(i));
166  if (gs == nullptr && (*i != nullptr)) {
167  std::cerr << "Got a " << typeid(rhs).name() << ", expecting TEveGeoShape. ignoring (it must be the clusters)."
168  << std::endl;
169  continue;
170  }
171  // gs->SetMainTransparency(75);
172  // gs->SetPickable(kFALSE);
173 
174  TString name = gs->GetElementTitle();
175  if (!name.Contains("BAD") && !name.Contains("INACTIVE") && !name.Contains("LOST")) {
176  gs->SetMainColor(kBlue);
177  }
178  TEveText* text = new TEveText(name.Data());
179  text->PtrMainTrans()->SetFrom(gs->RefMainTrans().Array());
180  text->SetFontMode(TGLFont::kPixmap);
181  text->SetFontSize(12);
182  m_moduleLabels->AddElement(text);
183  }
184  m_moduleLabels->SetRnrChildren(false);
185 
186  TEveTrackPropagator* prop = new TEveTrackPropagator();
187  prop->SetMagFieldObj(item()->context().getField(), false);
188  prop->SetStepper(TEveTrackPropagator::kRungeKutta);
189  prop->SetMaxR(123);
190  prop->SetMaxZ(300);
191  prop->SetMaxStep(1);
192  prop->SetRnrDaughters(kTRUE);
193  prop->SetRnrReferences(kTRUE);
194  prop->SetRnrDecay(kTRUE);
195 
196  // first-vertex style
197  prop->SetRnrFV(kTRUE);
198  prop->RefFVAtt().SetMarkerColor(id.item()->defaultDisplayProperties().color());
199  prop->RefFVAtt().SetMarkerSize(0.8);
200 
201  // path-mark style
202  prop->RefPMAtt().SetMarkerSize(0.5);
203  prop->RefPMAtt().SetMarkerColor(id.item()->defaultDisplayProperties().color());
204 
205  TEveTrack* trk1 = fireworks::prepareTrack(*track1, prop);
206  trk1->MakeTrack();
207  trk1->SetLineWidth(2);
208  trk1->SetTitle("Track 1 and its ref states");
209  trk1->SetMainColor(id.item()->defaultDisplayProperties().color());
210  trk1->SetLineStyle(7);
211  m_eveScene->AddElement(trk1);
212 
213  TEveTrack* trk0 = fireworks::prepareTrack(*track0, prop);
214  trk0->MakeTrack();
215  trk0->SetLineWidth(2);
216  trk0->SetTitle("Track 0 and its ref states");
217  trk0->SetMainColor(id.item()->defaultDisplayProperties().color());
218  m_eveScene->AddElement(trk0);
219 
220  // create TEveCalo3D object, fix bounding box
221  {
222  float phi = conv->pairMomentum().phi();
223  float eta = conv->pairMomentum().eta();
224 
225  FWECALCaloDataDetailViewBuilder caloBld(id.item()->getEvent(), id.item()->getGeom(), eta, phi, 30);
226  TEveCaloData* data = caloBld.buildCaloData(false);
227  // AMT!!! this is memory leak, check why it needs to be added
228  TEveCalo3D* calo3d = new TEveCalo3D(data);
229  gEve->AddElement(data);
230  calo3d->SetBarrelRadius(129.00);
231  calo3d->SetEndCapPos(268.36);
232 
233  float theta = TEveCaloData::EtaToTheta(eta);
234  float ext = data->GetMaxVal(true) * calo3d->GetValToHeight();
235  if (TMath::Abs(eta) < calo3d->GetTransitionEta()) {
236  // printf("barrel\n");
237  float x = calo3d->GetBarrelRadius() * TMath::Cos(phi);
238  float y = calo3d->GetBarrelRadius() * TMath::Sin(phi);
239  float z = calo3d->GetBarrelRadius() / TMath::Tan(theta);
240 
241  calo3d->SetupBBoxCube(ext, x, y, z);
242  } else {
243  // printf("endcap\n");
244  float z = TMath::Sign(calo3d->GetEndCapPos(), eta);
245  float r = z * TMath::Tan(theta);
246  calo3d->SetupBBoxCube(ext, r * TMath::Cos(phi), r * TMath::Sin(phi), z);
247  }
248  m_eveScene->AddElement(calo3d);
249  }
250 
251  // base vectors
252  TEveVectorD fwd = trk1->GetMomentum().Cross(trk0->GetMomentum());
253  fwd.Normalize();
254  TEveVectorD lft = trk1->GetMomentum();
255  lft.Normalize();
256  TEveVectorD up = lft.Cross(fwd);
257 
258  TEveVectorD c = (trk1->GetVertex() + trk0->GetVertex()) * 0.5;
259  if (true) {
260  setCameraInit(viewerGL(), TGLViewer::kCameraPerspXOZ, fwd, up, c); //default
261  setCameraInit(viewerGL(), TGLViewer::kCameraPerspYOZ, up, lft, c);
262  setCameraInit(viewerGL(), TGLViewer::kCameraPerspXOY, lft, fwd, c);
263 
264  setCameraInit(viewerGL(), TGLViewer::kCameraOrthoXOY, fwd, up, c);
265  setCameraInit(viewerGL(), TGLViewer::kCameraOrthoXOZ, up, lft, c);
266  setCameraInit(viewerGL(), TGLViewer::kCameraOrthoZOY, lft, fwd, c);
267  }
268  {
269  Float_t sfac = 100;
270  fwd *= sfac;
271  lft *= sfac;
272  up *= sfac;
273  int transp = 90;
274  {
275  TEveStraightLineSet* bls = new TEveStraightLineSet("base1");
276  bls->AddLine(c, fwd + c);
277  bls->SetMainColor(kBlue);
278  bls->SetMainTransparency(transp);
279  bls->SetPickable(false);
280  m_eveScene->AddElement(bls);
281  }
282 
283  {
284  TEveStraightLineSet* bls = new TEveStraightLineSet("base2");
285  bls->AddLine(c, lft + c);
286  bls->SetMainColor(kBlue);
287  bls->SetMainTransparency(transp);
288  bls->SetPickable(false);
289  m_eveScene->AddElement(bls);
290  }
291 
292  {
293  TEveStraightLineSet* bls = new TEveStraightLineSet("base3");
294  bls->AddLine(c, up + c);
295  bls->SetMainColor(kBlue);
296  bls->SetMainTransparency(transp);
297  bls->SetPickable(false);
298  m_eveScene->AddElement(bls);
299  }
300  }
301  {
302  TEveStraightLineSet* bls = new TEveStraightLineSet("Photon", "Photon");
304  bls->AddLine(c.fX, c.fY, c.fZ, bs->x0(), bs->y0(), bs->z0());
305  bls->SetMainColor(id.item()->defaultDisplayProperties().color());
306  bls->SetLineStyle(3);
307  m_eveScene->AddElement(bls);
308  }
309 
310  viewerGL()->SetStyle(TGLRnrCtx::kOutline);
311  viewerGL()->ResetCamerasAfterNextUpdate();
312  viewerGL()->UpdateScene(kFALSE);
313  gEve->Redraw3D();
314 
315  setTextInfo(id, conv);
317 }

References Abs(), writedatasetfile::action, CSGAction::activated, addHits(), addModules(), b, cms::cuda::bs, FWECALCaloDataDetailViewBuilder::buildCaloData(), c, camera1Callback(), camera2Callback(), camera3Callback(), EcnaPython_AdcPeg12_S1_10_R170298_1_0_150_Dee0::cerr, FWDetailViewBase::context(), conv, CSGAction::createTextButton(), data, mps_fire::end, PVValHelper::eta, reco::Track::extra(), f, fireworks::Context::getBeamSpot(), CaloRecHitAuxSetter::getField(), mps_fire::i, edm::Ref< C, T, F >::isAvailable(), FWDetailViewBase::item(), m_camTypeAction, FWDetailViewGL< reco::Conversion >::m_eveScene, FWDetailViewGL< reco::Conversion >::m_guiFrame, m_hits, m_moduleLabels, m_modules, Skims_PA_cff::name, AlCaHLTBitMon_ParallelJobs::p, phi, fireworks::prepareTrack(), alignCSCRings::r, rnrHits(), rnrModules(), setTextInfo(), Sign(), switchProjection(), runonSM::text, theta(), up, FWDetailViewGL< reco::Conversion >::viewerGL(), x, y, and z.

◆ camera1Callback()

void FWConvTrackHitsDetailView::camera1Callback ( )

Definition at line 604 of file FWConvTrackHitsDetailView.cc.

604  {
606 
607  viewerGL()->SetCurrentCamera(m_orthographic ? TGLViewer::kCameraOrthoXOY : TGLViewer::kCameraPerspXOZ);
608  viewerGL()->ResetCurrentCamera();
609  viewerGL()->RequestDraw();
610 }

References m_orthographic, and FWDetailViewGL< reco::Conversion >::viewerGL().

Referenced by build().

◆ camera2Callback()

void FWConvTrackHitsDetailView::camera2Callback ( )

Definition at line 612 of file FWConvTrackHitsDetailView.cc.

612  {
614 
615  viewerGL()->SetCurrentCamera(m_orthographic ? TGLViewer::kCameraOrthoXOZ : TGLViewer::kCameraPerspYOZ);
616  viewerGL()->ResetCurrentCamera();
617  viewerGL()->RequestDraw();
618 }

References m_orthographic, and FWDetailViewGL< reco::Conversion >::viewerGL().

Referenced by build().

◆ camera3Callback()

void FWConvTrackHitsDetailView::camera3Callback ( )

Definition at line 620 of file FWConvTrackHitsDetailView.cc.

620  {
622 
623  viewerGL()->SetCurrentCamera(m_orthographic ? TGLViewer::kCameraOrthoZOY : TGLViewer::kCameraPerspXOY);
624  viewerGL()->ResetCurrentCamera();
625  viewerGL()->RequestDraw();
626 }

References m_orthographic, and FWDetailViewGL< reco::Conversion >::viewerGL().

Referenced by build().

◆ operator=()

const FWConvTrackHitsDetailView& FWConvTrackHitsDetailView::operator= ( const FWConvTrackHitsDetailView )
privatedelete

◆ pickCameraCenter()

void FWConvTrackHitsDetailView::pickCameraCenter ( )

Definition at line 576 of file FWConvTrackHitsDetailView.cc.

576  {
577  viewerGL()->PickCameraCenter();
578  viewerGL()->SetDrawCameraCenter(kTRUE);
579 }

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

◆ rnrHits()

void FWConvTrackHitsDetailView::rnrHits ( )

Definition at line 599 of file FWConvTrackHitsDetailView.cc.

599  {
600  m_hits->SetRnrChildren(!m_hits->GetRnrChildren());
601  gEve->Redraw3D();
602 }

References m_hits.

Referenced by build().

◆ rnrLabels()

void FWConvTrackHitsDetailView::rnrLabels ( )

Definition at line 589 of file FWConvTrackHitsDetailView.cc.

589  {
590  m_moduleLabels->SetRnrChildren(!m_moduleLabels->GetRnrChildren());
591  gEve->Redraw3D();
592 }

References m_moduleLabels.

◆ rnrModules()

void FWConvTrackHitsDetailView::rnrModules ( )

Definition at line 594 of file FWConvTrackHitsDetailView.cc.

594  {
595  m_modules->SetRnrChildren(!m_modules->GetRnrChildren());
596  gEve->Redraw3D();
597 }

References m_modules.

Referenced by build().

◆ setTextInfo()

void FWConvTrackHitsDetailView::setTextInfo ( const FWModelId id,
const reco::Conversion conv 
)
overrideprivatevirtual

Implements FWDetailView< reco::Conversion >.

Definition at line 319 of file FWConvTrackHitsDetailView.cc.

319  {
320  m_infoCanvas->cd();
321 
322  float_t x = 0.02;
323  float y = 0.95;
324 
325  TLatex* latex = new TLatex(x, y, "");
326  const double textsize(0.07);
327  latex->SetTextSize(2 * textsize);
328 
329  latex->DrawLatex(x, y, id.item()->modelName(id.index()).c_str());
330  y -= latex->GetTextSize() * 0.6;
331 
332  latex->SetTextSize(textsize);
333  float lineH = latex->GetTextSize() * 0.6;
334 
335  latex->DrawLatex(x,
336  y,
337  Form("p_{T}=%.1f GeV, #eta=%0.2f, #varphi=%0.2f",
338  sqrt(conv->pairMomentum().Perp2()),
339  conv->pairMomentum().eta(),
340  conv->pairMomentum().phi()));
341  y -= lineH;
342  latex->DrawLatex(x,
343  y,
344  Form("vtx=(%.1f, %.1f, %.1f) r=%.1f [cm]",
345  conv->conversionVertex().x(),
346  conv->conversionVertex().y(),
347  conv->conversionVertex().z(),
348  conv->conversionVertex().position().rho()));
349  y -= lineH;
350  latex->DrawLatex(x, y, Form("#Deltactg#theta=%.3f", conv->pairCotThetaSeparation()));
351  y -= lineH;
352  latex->DrawLatex(x, y, Form("#Delta#phi_{vtx}=%.3f", conv->dPhiTracksAtVtx()));
353  y -= lineH;
354  latex->DrawLatex(x, y, Form("dist. min. app.=%.3f cm", conv->distOfMinimumApproach()));
355  y -= lineH;
356  y -= lineH;
357 
358  const reco::Track* track0 = conv->tracks().at(0).get();
359  latex->DrawLatex(x, y, Form("Trk0 q=%i", track0->charge()));
360  y -= lineH;
361  latex->DrawLatex(x, y, Form("p_{T}=%.1f GeV, #eta=%0.2f, #varphi=%0.2f", track0->pt(), track0->eta(), track0->phi()));
362  y -= lineH;
363  const reco::HitPattern& hp0 = track0->hitPattern();
364  int nvalid_tk0 = 0, ninvalid_tk0 = 0, npix_tk0 = 0, nstrip_tk0 = 0;
365  for (int i_tk0 = 0; i_tk0 < hp0.numberOfAllHits(reco::HitPattern::TRACK_HITS); i_tk0++) {
366  uint32_t hit = hp0.getHitPattern(reco::HitPattern::TRACK_HITS, i_tk0);
368  nvalid_tk0++;
370  npix_tk0++;
372  nstrip_tk0++;
373  } else
374  ninvalid_tk0++;
375  }
376  latex->DrawLatex(x, y, Form("valid hits: %i (pix. %i, str. %i)", nvalid_tk0, npix_tk0, nstrip_tk0));
377  y -= lineH;
378  latex->DrawLatex(x, y, Form("invalid: %i", ninvalid_tk0));
379  y -= lineH;
380 
381  int npix_mhi_tk0 = 0, nstrip_mhi_tk0 = 0;
382  for (int i_mhi_tk0 = 0; i_mhi_tk0 < hp0.numberOfAllHits(reco::HitPattern::MISSING_INNER_HITS); i_mhi_tk0++) {
383  uint32_t hit = hp0.getHitPattern(reco::HitPattern::MISSING_INNER_HITS, i_mhi_tk0);
385  npix_mhi_tk0++;
387  nstrip_mhi_tk0++;
388  }
389  latex->DrawLatex(x, y, Form("miss. inner hits: pix. %i, str. %i", npix_mhi_tk0, nstrip_mhi_tk0));
390 
391  y -= lineH;
392  y -= lineH;
393  const reco::Track* track1 = conv->tracks().at(1).get();
394  latex->DrawLatex(x, y, Form("Trk1 q=%i", track1->charge()));
395  y -= lineH;
396  latex->DrawLatex(x, y, Form("p_{T}=%.1f GeV, #eta=%0.2f, #varphi=%0.2f", track1->pt(), track1->eta(), track1->phi()));
397  y -= lineH;
398 
399  const reco::HitPattern& hp1 = track1->hitPattern();
400  int nvalid_tk1 = 0, ninvalid_tk1 = 0, npix_tk1 = 0, nstrip_tk1 = 0;
401  for (int i_tk1 = 0; i_tk1 < hp1.numberOfAllHits(reco::HitPattern::TRACK_HITS); i_tk1++) {
402  uint32_t hit = hp1.getHitPattern(reco::HitPattern::TRACK_HITS, i_tk1);
404  nvalid_tk1++;
406  npix_tk1++;
408  nstrip_tk1++;
409  } else
410  ninvalid_tk1++;
411  }
412  latex->DrawLatex(x, y, Form("valid hits: %i (pix. %i, str. %i)", nvalid_tk1, npix_tk1, nstrip_tk1));
413  y -= lineH;
414  latex->DrawLatex(x, y, Form("invalid: %i", ninvalid_tk1));
415  y -= lineH;
416 
417  int npix_mhi_tk1 = 0, nstrip_mhi_tk1 = 0;
418  for (int i_mhi_tk1 = 0; i_mhi_tk1 < hp1.numberOfAllHits(reco::HitPattern::MISSING_INNER_HITS); i_mhi_tk1++) {
419  uint32_t hit = hp1.getHitPattern(reco::HitPattern::MISSING_INNER_HITS, i_mhi_tk1);
421  npix_mhi_tk1++;
423  nstrip_mhi_tk1++;
424  }
425  latex->DrawLatex(x, y, Form("miss. inner hits: pix. %i, str. %i", npix_mhi_tk1, nstrip_mhi_tk1));
426  y -= lineH;
427  y -= lineH;
428 }

References reco::TrackBase::charge(), conv, reco::TrackBase::eta(), reco::HitPattern::getHitPattern(), reco::TrackBase::hitPattern(), FWDetailViewBase::item(), FWDetailViewGL< reco::Conversion >::m_infoCanvas, reco::HitPattern::MISSING_INNER_HITS, HLTEgPhaseIITestSequence_cff::modelName, reco::HitPattern::numberOfAllHits(), reco::TrackBase::phi(), reco::HitPattern::pixelHitFilter(), reco::TrackBase::pt(), mathSSE::sqrt(), reco::HitPattern::stripHitFilter(), reco::HitPattern::TRACK_HITS, reco::HitPattern::validHitFilter(), x, and y.

Referenced by build().

◆ switchProjection()

void FWConvTrackHitsDetailView::switchProjection ( )

Definition at line 581 of file FWConvTrackHitsDetailView.cc.

581  {
583  m_camTypeAction->setName(m_orthographic ? "Set Perspective Projection" : "Set Orthographic Projection");
584 
585  (this->*foo)();
586  //printf("current isOrthographic : %d \n", viewerGL()->CurrentCamera().IsOrthographic());
587 }

References m_camTypeAction, m_orthographic, and CSGAction::setName().

Referenced by build().

Member Data Documentation

◆ m_calo3D

TEveElement* FWConvTrackHitsDetailView::m_calo3D
private

Definition at line 55 of file FWConvTrackHitsDetailView.h.

◆ m_camTypeAction

CSGAction* FWConvTrackHitsDetailView::m_camTypeAction
private

Definition at line 59 of file FWConvTrackHitsDetailView.h.

Referenced by build(), and switchProjection().

◆ m_hits

TEveElementList* FWConvTrackHitsDetailView::m_hits
private

Definition at line 54 of file FWConvTrackHitsDetailView.h.

Referenced by build(), and rnrHits().

◆ m_legend

TLegend* FWConvTrackHitsDetailView::m_legend
private

Definition at line 57 of file FWConvTrackHitsDetailView.h.

◆ m_moduleLabels

TEveElementList* FWConvTrackHitsDetailView::m_moduleLabels
private

Definition at line 53 of file FWConvTrackHitsDetailView.h.

Referenced by build(), and rnrLabels().

◆ m_modules

TEveElementList* FWConvTrackHitsDetailView::m_modules
private

Definition at line 52 of file FWConvTrackHitsDetailView.h.

Referenced by build(), and rnrModules().

◆ m_orthographic

bool FWConvTrackHitsDetailView::m_orthographic
private
reco::HitPattern::getHitPattern
uint16_t getHitPattern(HitCategory category, int position) const
Definition: HitPattern.h:530
ext
Definition: memstream.h:15
DDAxes::y
MuonSubdetId::CSC
static constexpr int CSC
Definition: MuonSubdetId.h:12
fwLog
#define fwLog(_level_)
Definition: fwLog.h:45
mps_fire.i
i
Definition: mps_fire.py:428
HLT_FULL_cff.track
track
Definition: HLT_FULL_cff.py:11713
FWDetailViewGL< reco::Conversion >::m_eveScene
TEveScene * m_eveScene
Definition: FWDetailViewGL.h:29
TrackingRecHit::missing_inner
Definition: TrackingRecHit.h:50
PixelSubdetector::PixelEndcap
Definition: PixelSubdetector.h:11
FWConvTrackHitsDetailView::addModules
void addModules(const reco::Track &track, const FWEventItem *iItem, TEveElement *trkList, bool addLostHits)
Definition: FWConvTrackHitsDetailView.cc:479
PixelSubdetector::PixelBarrel
Definition: PixelSubdetector.h:11
HLT_FULL_cff.points
points
Definition: HLT_FULL_cff.py:21453
f
double f[11][100]
Definition: MuScleFitUtils.cc:78
FWConvTrackHitsDetailView::m_modules
TEveElementList * m_modules
Definition: FWConvTrackHitsDetailView.h:52
conv
static HepMC::IO_HEPEVT conv
Definition: BeamHaloProducer.cc:48
edm::Ref::isAvailable
bool isAvailable() const
Definition: Ref.h:537
FWECALCaloDataDetailViewBuilder
Definition: FWECALCaloDataDetailViewBuilder.h:20
AlCaHLTBitMon_ParallelJobs.p
p
Definition: AlCaHLTBitMon_ParallelJobs.py:153
DetId::det
constexpr Detector det() const
get the detector field from this detid
Definition: DetId.h:46
reco::HitPattern::validHitFilter
static bool validHitFilter(uint16_t pattern)
Definition: HitPattern.h:765
fireworks::pushPixelHits
void pushPixelHits(std::vector< TVector3 > &pixelPoints, const FWEventItem &iItem, const reco::Track &t)
Definition: TrackUtils.cc:533
FWDetailViewGL< reco::Conversion >::viewerGL
TGLViewer * viewerGL() const
Definition: FWDetailViewGL.h:20
FWConvTrackHitsDetailView::camera1Callback
void camera1Callback()
Definition: FWConvTrackHitsDetailView.cc:604
Sign
T Sign(T A, T B)
Definition: MathUtil.h:54
edm::second
U second(std::pair< T, U > const &p)
Definition: ParameterSet.cc:222
fireworks::Context::getBeamSpot
FWBeamSpot * getBeamSpot() const
Definition: Context.h:67
DDAxes::x
CSGAction
Definition: CSGAction.h:38
fireworks::info
std::string info(const DetId &)
Definition: TrackUtils.cc:599
FWDisplayProperties::color
Color_t color() const
Definition: FWDisplayProperties.h:47
FWConvTrackHitsDetailView::rnrHits
void rnrHits()
Definition: FWConvTrackHitsDetailView.cc:599
reco::Track::extra
const TrackExtraRef & extra() const
reference to "extra" object
Definition: Track.h:139
FWConvTrackHitsDetailView::rnrModules
void rnrModules()
Definition: FWConvTrackHitsDetailView.cc:594
gs
Definition: AbsArchive.cc:45
FWEventItem::defaultDisplayProperties
const FWDisplayProperties & defaultDisplayProperties() const
Definition: FWEventItem.cc:403
reco::TrackBase::pt
double pt() const
track transverse momentum
Definition: TrackBase.h:637
FWConvTrackHitsDetailView::setTextInfo
void setTextInfo(const FWModelId &id, const reco::Conversion *) override
Definition: FWConvTrackHitsDetailView.cc:319
DetId
Definition: DetId.h:17
fireworks::addSiStripClusters
void addSiStripClusters(const FWEventItem *iItem, const reco::Track &t, class TEveElement *tList, bool addNearbyClusters, bool master)
Definition: TrackUtils.cc:336
cms::cuda::bs
bs
Definition: HistoContainer.h:127
HLTEgPhaseIITestSequence_cff.modelName
modelName
Definition: HLTEgPhaseIITestSequence_cff.py:16
reco::HitPattern
Definition: HitPattern.h:147
FWConvTrackHitsDetailView::camera3Callback
void camera3Callback()
Definition: FWConvTrackHitsDetailView.cc:620
Abs
T Abs(T a)
Definition: MathUtil.h:49
FWConvTrackHitsDetailView::m_legend
TLegend * m_legend
Definition: FWConvTrackHitsDetailView.h:57
FWDetailViewGL< reco::Conversion >::m_infoCanvas
TCanvas * m_infoCanvas
Definition: FWDetailViewGL.h:25
PVValHelper::eta
Definition: PVValidationHelpers.h:70
mathSSE::sqrt
T sqrt(T t)
Definition: SSEVec.h:19
mps_fire.end
end
Definition: mps_fire.py:242
DDAxes::z
reco::Track
Definition: Track.h:27
theta
Geom::Theta< T > theta() const
Definition: Basic3DVectorLD.h:150
reco::TrackBase::charge
int charge() const
track electric charge
Definition: TrackBase.h:596
MuonSubdetId::DT
static constexpr int DT
Definition: MuonSubdetId.h:11
CSGAction::activated
sigc::signal< void > activated
Definition: CSGAction.h:100
CSGAction::setName
void setName(const std::string &name)
Definition: CSGAction.cc:85
b
double b
Definition: hdecay.h:118
SiStripDetId::TEC
static constexpr auto TEC
Definition: SiStripDetId.h:40
reco::TrackBase::phi
double phi() const
azimuthal angle of momentum vector
Definition: TrackBase.h:649
CaloRecHitAuxSetter::getField
constexpr unsigned getField(const uint32_t u, const unsigned mask, const unsigned offset)
Definition: CaloRecHitAuxSetter.h:13
edm::OwnVector::const_iterator
Definition: OwnVector.h:41
DetId::subdetId
constexpr int subdetId() const
get the contents of the subdetector field (not cast into any detector's numbering enum)
Definition: DetId.h:48
TrackingRecHit::inactive_inner
Definition: TrackingRecHit.h:52
TrackingRecHit::bad
Definition: TrackingRecHit.h:49
FWBeamSpot
Definition: FWBeamSpot.h:11
reco::HitPattern::pixelHitFilter
static bool pixelHitFilter(uint16_t pattern)
Definition: HitPattern.h:573
FWConvTrackHitsDetailView::m_hits
TEveElementList * m_hits
Definition: FWConvTrackHitsDetailView.h:54
DetId::Tracker
Definition: DetId.h:25
FWConvTrackHitsDetailView::m_camTypeAction
CSGAction * m_camTypeAction
Definition: FWConvTrackHitsDetailView.h:59
FWDetailViewBase::item
const FWEventItem * item()
Definition: FWDetailViewBase.h:48
FWConvTrackHitsDetailView::camera2Callback
void camera2Callback()
Definition: FWConvTrackHitsDetailView.cc:612
fireworks::prepareTrack
TEveTrack * prepareTrack(const reco::Track &track, TEveTrackPropagator *propagator, const std::vector< TEveVector > &extraRefPoints=std::vector< TEveVector >())
Definition: TrackUtils.cc:62
TrackingRecHit::missing
Definition: TrackingRecHit.h:47
reco::TrackBase::eta
double eta() const
pseudorapidity of momentum vector
Definition: TrackBase.h:652
TrackingRecHit::inactive_outer
Definition: TrackingRecHit.h:53
writedatasetfile.action
action
Definition: writedatasetfile.py:8
TrackingRecHit::missing_outer
Definition: TrackingRecHit.h:51
SiStripDetId::TOB
static constexpr auto TOB
Definition: SiStripDetId.h:39
FWConvTrackHitsDetailView::addHits
void addHits(const reco::Track &track, const FWEventItem *iItem, TEveElement *trkList, bool addNearbyHits)
Definition: FWConvTrackHitsDetailView.cc:450
TrackingRecHit::valid
Definition: TrackingRecHit.h:46
reco::HitPattern::TRACK_HITS
Definition: HitPattern.h:155
alignCSCRings.r
r
Definition: alignCSCRings.py:93
FWEventItem::getGeom
const FWGeometry * getGeom() const
Definition: FWEventItem.cc:548
fireworks::pushNearbyPixelHits
void pushNearbyPixelHits(std::vector< TVector3 > &pixelPoints, const FWEventItem &iItem, const reco::Track &t)
Definition: TrackUtils.cc:480
DDAxes::phi
SiStripDetId::TID
static constexpr auto TID
Definition: SiStripDetId.h:38
reco::TrackBase::hitPattern
const HitPattern & hitPattern() const
Access the hit pattern, indicating in which Tracker layers the track has hits.
Definition: TrackBase.h:504
fwlog::kInfo
Definition: fwLog.h:35
FWConvTrackHitsDetailView::m_orthographic
bool m_orthographic
Definition: FWConvTrackHitsDetailView.h:58
reco::HitPattern::numberOfAllHits
int numberOfAllHits(HitCategory category) const
Definition: HitPattern.h:773
DetId::rawId
constexpr uint32_t rawId() const
get the raw id
Definition: DetId.h:57
FWConvTrackHitsDetailView::m_moduleLabels
TEveElementList * m_moduleLabels
Definition: FWConvTrackHitsDetailView.h:53
FWDetailViewGL< reco::Conversion >::m_guiFrame
TGCompositeFrame * m_guiFrame
Definition: FWDetailViewGL.h:26
MuonSubdetId::RPC
static constexpr int RPC
Definition: MuonSubdetId.h:13
reco::HitPattern::MISSING_INNER_HITS
Definition: HitPattern.h:155
SiStripDetId::TIB
static constexpr auto TIB
Definition: SiStripDetId.h:37
Skims_PA_cff.name
name
Definition: Skims_PA_cff.py:17
data
char data[epos_bytes_allocation]
Definition: EPOS_Wrapper.h:79
AlignmentPI::index
index
Definition: AlignmentPayloadInspectorHelper.h:46
FWDetailViewBase::context
const fireworks::Context & context() const
Definition: FWDetailViewBase.cc:32
CSGAction::createTextButton
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:113
TrackingRecHit::inactive
Definition: TrackingRecHit.h:48
DetId::Muon
Definition: DetId.h:26
DTChamberId
Definition: DTChamberId.h:14
runonSM.text
text
Definition: runonSM.py:43
c
auto & c
Definition: CAHitNtupletGeneratorKernelsImpl.h:46
FWConvTrackHitsDetailView::switchProjection
void switchProjection()
Definition: FWConvTrackHitsDetailView.cc:581
reco::HitPattern::stripHitFilter
static bool stripHitFilter(uint16_t pattern)
Definition: HitPattern.h:597
EcnaPython_AdcPeg12_S1_10_R170298_1_0_150_Dee0.cerr
cerr
Definition: EcnaPython_AdcPeg12_S1_10_R170298_1_0_150_Dee0.py:8
FWGeometry::getEveShape
TEveGeoShape * getEveShape(unsigned int id) const
Definition: FWGeometry.cc:324
FWConvTrackHitsDetailView::addTrackerHits3D
void addTrackerHits3D(std::vector< TVector3 > &points, class TEveElementList *tList, Color_t color, int size)
Definition: FWConvTrackHitsDetailView.cc:430
DigiDM_cff.strips
strips
#turn off noise in all subdetectors simHcalUnsuppressedDigis.doNoise = False mix.digitizers....
Definition: DigiDM_cff.py:32
up
Definition: BitonicSort.h:7
hit
Definition: SiStripHitEffFromCalibTree.cc:88
findQualityFiles.size
size
Write out results.
Definition: findQualityFiles.py:443