CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
FWConvTrackHitsDetailView.cc
Go to the documentation of this file.
1 
2 #include "TGLViewer.h" // access to over-all bounding box
3 #include "TEveCalo.h" // workaround for TEveCalo3D bounding box
4 #include "TGLFontManager.h"
5 #include "TEveScene.h"
6 #include "TEveManager.h"
7 #include "TEveStraightLineSet.h"
8 #include "TEveTrack.h"
9 #include "TEveTrackPropagator.h"
10 #include "TEveTrans.h"
11 #include "TEveText.h"
12 #include "TEveGeoShape.h"
13 #include "TGSlider.h"
14 #include "TGButton.h"
15 #include "TGLabel.h"
16 #include "TCanvas.h"
17 #include "TLatex.h"
18 #include "TLegend.h"
19 #include "TG3DLine.h"
20 #include "TEveCaloData.h"
21 
22 // CMSSW includes
27 
28 // Fireworks includes
38 
42 
43 namespace {
44  void (FWConvTrackHitsDetailView::*foo)();
45 }
46 
48  : m_modules(nullptr), m_moduleLabels(nullptr), m_hits(nullptr), m_legend(nullptr), m_orthographic(false) {}
49 
51 
52 namespace {
53  void setCameraInit(
54  TGLViewer* v, TGLViewer::ECameraType type, const TEveVectorD b1, TEveVectorD b3, TEveVector center) {
55  TGLCamera& cam = v->RefCamera(type);
56  TGLMatrix& trans = cam.RefCamBase();
57 
58  trans.Set(trans.GetTranslation(), b3.Arr(), b1.Arr());
59  cam.Setup(v->RefOverallBoundingBox(), kTRUE);
60 
61  cam.SetExternalCenter(true);
62  cam.SetCenterVec(center.fX, center.fY, center.fZ);
63  }
64 
65  /*
66  // alternative to setCameraInit
67 void setCamera(TGLViewer* v, TGLViewer::ECameraType type, const TEveVectorD b1, TEveVectorD b2, TEveVectorD b3, TEveVector center )
68 {
69  // b1 = fwd, b2 = lft, b3 = up
70 
71  TGLCamera& cam = v->RefCamera(type);
72  TGLMatrix& trans = cam.RefCamBase();
73 
74  trans.SetBaseVec(1, b1.Arr());
75  trans.SetBaseVec(2, b2.Arr());
76  trans.SetBaseVec(3, b3.Arr());
77 
78  cam.SetExternalCenter(true);
79  cam.SetCenterVec(center.fX, center.fY, center.fZ);
80 }
81  */
82 } // namespace
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 }
318 
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++;
371  else if (reco::HitPattern::stripHitFilter(hit))
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++;
386  else if (reco::HitPattern::stripHitFilter(hit))
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++;
407  else if (reco::HitPattern::stripHitFilter(hit))
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++;
422  else if (reco::HitPattern::stripHitFilter(hit))
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 }
429 
430 void FWConvTrackHitsDetailView::addTrackerHits3D(std::vector<TVector3>& points,
431  class TEveElementList* tList,
432  Color_t color,
433  int size) {
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 }
449 
451  const FWEventItem* iItem,
452  TEveElement* trkList,
453  bool addNearbyHits) {
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 }
476 
477 //______________________________________________________________________________
478 
480  const FWEventItem* iItem,
481  TEveElement* trkList,
482  bool addLostHits) {
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 }
574 
575 //______________________________________________________________________________
577  viewerGL()->PickCameraCenter();
578  viewerGL()->SetDrawCameraCenter(kTRUE);
579 }
580 
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 }
588 
590  m_moduleLabels->SetRnrChildren(!m_moduleLabels->GetRnrChildren());
591  gEve->Redraw3D();
592 }
593 
595  m_modules->SetRnrChildren(!m_modules->GetRnrChildren());
596  gEve->Redraw3D();
597 }
598 
600  m_hits->SetRnrChildren(!m_hits->GetRnrChildren());
601  gEve->Redraw3D();
602 }
603 
606 
607  viewerGL()->SetCurrentCamera(m_orthographic ? TGLViewer::kCameraOrthoXOY : TGLViewer::kCameraPerspXOZ);
608  viewerGL()->ResetCurrentCamera();
609  viewerGL()->RequestDraw();
610 }
611 
614 
615  viewerGL()->SetCurrentCamera(m_orthographic ? TGLViewer::kCameraOrthoXOZ : TGLViewer::kCameraPerspYOZ);
616  viewerGL()->ResetCurrentCamera();
617  viewerGL()->RequestDraw();
618 }
619 
622 
623  viewerGL()->SetCurrentCamera(m_orthographic ? TGLViewer::kCameraOrthoZOY : TGLViewer::kCameraPerspXOY);
624  viewerGL()->ResetCurrentCamera();
625  viewerGL()->RequestDraw();
626 }
627 
629 /*
630 REGISTER_FWDETAILVIEW(FWConvTrackHitsDetailView, Conversion, ecalRecHit);
631 REGISTER_FWDETAILVIEW(FWConvTrackHitsDetailView, Conversion, reducedEcalRecHitsEB);
632 REGISTER_FWDETAILVIEW(FWConvTrackHitsDetailView, Conversion, reducedEGamma);
633 */
const reco::Vertex & conversionVertex() const
returns the reco conversion vertex
Definition: Conversion.h:88
const std::string & getName() const
Definition: CSGAction.cc:79
Definition: BitonicSort.h:7
void addModules(const reco::Track &track, const FWEventItem *iItem, TEveElement *trkList, bool addLostHits)
bool isAvailable() const
Definition: Ref.h:537
const FWDisplayProperties & defaultDisplayProperties() const
Definition: FWEventItem.cc:403
const edm::EventSetup & c
void build(const FWModelId &id, const reco::Conversion *) override
static bool pixelHitFilter(uint16_t pattern)
Definition: HitPattern.h:575
double x0() const
Definition: FWBeamSpot.cc:23
const TrackExtraRef & extra() const
reference to &quot;extra&quot; object
Definition: Track.h:139
T Sign(T A, T B)
Definition: MathUtil.h:54
TEveTrack * prepareTrack(const reco::Track &track, TEveTrackPropagator *propagator, const std::vector< TEveVector > &extraRefPoints=std::vector< TEveVector >())
Definition: TrackUtils.cc:62
double z0() const
Definition: FWBeamSpot.cc:27
static constexpr auto TID
Definition: SiStripDetId.h:38
double y0() const
Definition: FWBeamSpot.cc:25
double y() const
y coordinate
Definition: Vertex.h:131
const FWEventItem * item()
sigc::signal< void > activated
Definition: CSGAction.h:100
constexpr uint32_t rawId() const
get the raw id
Definition: DetId.h:57
Geom::Theta< T > theta() const
double distOfMinimumApproach() const
Definition: Conversion.h:116
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:179
double phi() const
azimuthal angle of momentum vector
Definition: TrackBase.h:649
#define REGISTER_FWDETAILVIEW(_classname_, _name_,...)
const Point & position() const
position
Definition: Vertex.h:127
Color_t color() const
static bool validHitFilter(uint16_t pattern)
Definition: HitPattern.h:790
U second(std::pair< T, U > const &p)
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
void setTextInfo(const FWModelId &id, const reco::Conversion *) override
FWBeamSpot * getBeamSpot() const
Definition: Context.h:67
const fireworks::Context & context() const
double eta() const
pseudorapidity of momentum vector
Definition: TrackBase.h:652
TEveGeoShape * getEveShape(unsigned int id) const
Definition: FWGeometry.cc:318
T sqrt(T t)
Definition: SSEVec.h:19
tuple 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
double pt() const
track transverse momentum
Definition: TrackBase.h:637
static bool stripHitFilter(uint16_t pattern)
Definition: HitPattern.h:602
T Abs(T a)
Definition: MathUtil.h:49
constexpr int subdetId() const
get the contents of the subdetector field (not cast into any detector&#39;s numbering enum) ...
Definition: DetId.h:48
int numberOfAllHits(HitCategory category) const
Definition: HitPattern.h:798
double z() const
z coordinate
Definition: Vertex.h:133
constexpr unsigned getField(const uint32_t u, const unsigned mask, const unsigned offset)
void setName(const std::string &name)
Definition: CSGAction.cc:85
tuple text
Definition: runonSM.py:43
void pushPixelHits(std::vector< TVector3 > &pixelPoints, const FWEventItem &iItem, const reco::Track &t)
Definition: TrackUtils.cc:533
trackingRecHit_iterator recHitsBegin() const
Iterator to first hit on the track.
Definition: Track.h:88
static constexpr auto TOB
Definition: SiStripDetId.h:39
void addHits(const reco::Track &track, const FWEventItem *iItem, TEveElement *trkList, bool addNearbyHits)
void addSiStripClusters(const FWEventItem *iItem, const reco::Track &t, class TEveElement *tList, bool addNearbyClusters, bool master)
Definition: TrackUtils.cc:336
unsigned int nTracks() const
Number of tracks= 0,1,2.
Definition: Conversion.h:92
Definition: DetId.h:17
double x() const
x coordinate
Definition: Vertex.h:129
math::XYZVectorF pairMomentum() const
Conversion tracks momentum from the tracks inner momentum.
Definition: Conversion.cc:191
const HitPattern & hitPattern() const
Access the hit pattern, indicating in which Tracker layers the track has hits.
Definition: TrackBase.h:504
#define fwLog(_level_)
Definition: fwLog.h:45
static constexpr int RPC
Definition: MuonSubdetId.h:13
double b
Definition: hdecay.h:118
EPOS::IO_EPOS conv
string action
Definition: mps_fire.py:183
static constexpr auto TIB
Definition: SiStripDetId.h:37
char data[epos_bytes_allocation]
Definition: EPOS_Wrapper.h:79
std::string info(const DetId &)
Definition: TrackUtils.cc:599
string end
Definition: dataset.py:937
int charge() const
track electric charge
Definition: TrackBase.h:596
void addTrackerHits3D(std::vector< TVector3 > &points, class TEveElementList *tList, Color_t color, int size)
static constexpr int DT
Definition: MuonSubdetId.h:11
uint16_t getHitPattern(HitCategory category, int position) const
Definition: HitPattern.h:531
static constexpr int CSC
Definition: MuonSubdetId.h:12
void pushNearbyPixelHits(std::vector< TVector3 > &pixelPoints, const FWEventItem &iItem, const reco::Track &t)
Definition: TrackUtils.cc:480
tuple size
Write out results.
const FWGeometry * getGeom() const
Definition: FWEventItem.cc:548
double dPhiTracksAtVtx() const
Definition: Conversion.cc:255
static constexpr auto TEC
Definition: SiStripDetId.h:40
static constexpr float b1
std::vector< edm::RefToBase< reco::Track > > const & tracks() const
vector of track to base references
Definition: Conversion.cc:150
constexpr Detector det() const
get the detector field from this detid
Definition: DetId.h:46
trackingRecHit_iterator recHitsEnd() const
Iterator to last hit on the track.
Definition: Track.h:91