CMS 3D CMS Logo

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),
49  m_moduleLabels(nullptr),
50  m_hits(nullptr),
51  m_legend(nullptr),
52  m_orthographic(false)
53 {
54 }
55 
57 {
58 }
59 
60 namespace {
61 void setCameraInit(TGLViewer* v, TGLViewer::ECameraType type, const TEveVectorD b1, TEveVectorD b3, TEveVector center )
62 {
63  TGLCamera& cam = v->RefCamera(type);
64  TGLMatrix& trans = cam.RefCamBase();
65 
66  trans.Set(trans.GetTranslation(), b3.Arr(), b1.Arr());
67  cam.Setup(v->RefOverallBoundingBox(), kTRUE);
68 
69  cam.SetExternalCenter(true);
70  cam.SetCenterVec(center.fX, center.fY, center.fZ);
71 }
72 
73  /*
74  // alternative to setCameraInit
75 void setCamera(TGLViewer* v, TGLViewer::ECameraType type, const TEveVectorD b1, TEveVectorD b2, TEveVectorD b3, TEveVector center )
76 {
77  // b1 = fwd, b2 = lft, b3 = up
78 
79  TGLCamera& cam = v->RefCamera(type);
80  TGLMatrix& trans = cam.RefCamBase();
81 
82  trans.SetBaseVec(1, b1.Arr());
83  trans.SetBaseVec(2, b2.Arr());
84  trans.SetBaseVec(3, b3.Arr());
85 
86  cam.SetExternalCenter(true);
87  cam.SetCenterVec(center.fX, center.fY, center.fZ);
88 }
89  */
90 }
91 void
93 {
94  if (conv->nTracks()<2) return;
95  const reco::Track* track0 = conv->tracks().at(0).get();
96  const reco::Track* track1 = conv->tracks().at(1).get();
97 
98  m_guiFrame->AddFrame(new TGLabel(m_guiFrame, "Camera Views:"), new TGLayoutHints(kLHintsLeft, 2, 2, 2, 2));
99 
100  {
101  TGHorizontalFrame* f = new TGHorizontalFrame(m_guiFrame);
102  m_guiFrame->AddFrame(f, new TGLayoutHints(kLHintsExpandX, 2, 0, 0, 0));
103 
104  {
105  CSGAction* action = new CSGAction(this, "Top");
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("plane normal: track0 x track1");
110  action->activated.connect(sigc::mem_fun(this, &FWConvTrackHitsDetailView::camera1Callback));
111  }
112 
113  {
114  CSGAction* action = new CSGAction(this, "Side");
115  TGTextButton* b = new TGTextButton(f, action->getName().c_str());
116  f->AddFrame(b, new TGLayoutHints( kLHintsExpandX));
117  TQObject::Connect(b, "Clicked()", "CSGAction", action, "activate()");
118  b->SetToolTipText("left fir: track1");
119  action->activated.connect(sigc::mem_fun(this, &FWConvTrackHitsDetailView::camera2Callback));
120  }
121  {
122  CSGAction* action = new CSGAction(this, "Front");
123  TGTextButton* b = new TGTextButton(f, action->getName().c_str());
124  f->AddFrame(b, new TGLayoutHints( kLHintsExpandX));
125  TQObject::Connect(b, "Clicked()", "CSGAction", action, "activate()");
126  action->activated.connect(sigc::mem_fun(this, &FWConvTrackHitsDetailView::camera3Callback));
127  b->SetToolTipText("plane normal: track1 ");
128 
129  }
130  }
131 
132  {
133  m_camTypeAction = new CSGAction(this, " Set Ortographic Projection ");
134  m_camTypeAction->createTextButton(m_guiFrame, new TGLayoutHints( kLHintsExpandX, 2, 0, 1, 4));
136  }
137 
138  {
139  CSGAction* action = new CSGAction(this, "Draw Module");
140  TGCheckButton* b = new TGCheckButton(m_guiFrame, action->getName().c_str() );
141  b->SetState(kButtonDown, false);
142  m_guiFrame->AddFrame(b, new TGLayoutHints( kLHintsNormal, 2, 3, 1, 4));
143  TQObject::Connect(b, "Clicked()", "CSGAction", action, "activate()");
144  action->activated.connect(sigc::mem_fun(this, &FWConvTrackHitsDetailView::rnrModules));
145  }
146  {
147  CSGAction* action = new CSGAction(this, "Draw Hits");
148  TGCheckButton* b = new TGCheckButton(m_guiFrame, action->getName().c_str() );
149  b->SetState(kButtonDown, false);
150  m_guiFrame->AddFrame(b, new TGLayoutHints( kLHintsNormal, 2, 3, 1, 4));
151  TQObject::Connect(b, "Clicked()", "CSGAction", action, "activate()");
152  action->activated.connect(sigc::mem_fun(this, &FWConvTrackHitsDetailView::rnrHits));
153  }
154 
155  TGCompositeFrame* p = (TGCompositeFrame*)m_guiFrame->GetParent();
156  p->MapSubwindows();
157  p->Layout();
158 
159  m_modules = new TEveElementList( "Modules" );
160  m_eveScene->AddElement( m_modules );
161  m_moduleLabels = new TEveElementList( "Modules" );
162  m_eveScene->AddElement( m_moduleLabels );
163  m_hits = new TEveElementList( "Hits" );
164  m_eveScene->AddElement( m_hits );
165  if( track1->extra().isAvailable())
166  {
167  addModules( *track1, id.item(), m_modules, true );
168  addHits( *track1, id.item(), m_hits, true );
169  }
170  if( track0->extra().isAvailable())
171  {
172  addModules( *track0, id.item(), m_modules, true );
173  addHits( *track0, id.item(), m_hits, true );
174  }
175  for( TEveElement::List_i i = m_modules->BeginChildren(), end = m_modules->EndChildren(); i != end; ++i )
176  {
177  TEveGeoShape* gs = dynamic_cast<TEveGeoShape*>(*i);
178  const auto & rhs = *(*(i));
179  if (gs == nullptr && (*i != nullptr)) {
180  std::cerr << "Got a " << typeid( rhs ).name() << ", expecting TEveGeoShape. ignoring (it must be the clusters)." << std::endl;
181  continue;
182  }
183  // gs->SetMainTransparency(75);
184  // gs->SetPickable(kFALSE);
185 
186  TString name = gs->GetElementTitle();
187  if (!name.Contains("BAD") && !name.Contains("INACTIVE") && !name.Contains("LOST")) {
188  gs->SetMainColor(kBlue);
189  }
190  TEveText* text = new TEveText(name.Data());
191  text->PtrMainTrans()->SetFrom(gs->RefMainTrans().Array());
192  text->SetFontMode(TGLFont::kPixmap);
193  text->SetFontSize(12);
194  m_moduleLabels->AddElement(text);
195  }
196  m_moduleLabels->SetRnrChildren(false);
197 
198  TEveTrackPropagator* prop = new TEveTrackPropagator();
199  prop->SetMagFieldObj(item()->context().getField(), false);
200  prop->SetStepper(TEveTrackPropagator::kRungeKutta);
201  prop->SetMaxR(123);
202  prop->SetMaxZ(300);
203  prop->SetMaxStep(1);
204  prop->SetRnrDaughters(kTRUE);
205  prop->SetRnrReferences(kTRUE);
206  prop->SetRnrDecay(kTRUE);
207 
208  // first-vertex style
209  prop->SetRnrFV(kTRUE);
210  prop->RefFVAtt().SetMarkerColor(id.item()->defaultDisplayProperties().color());
211  prop->RefFVAtt().SetMarkerSize(0.8);
212 
213  // path-mark style
214  prop->RefPMAtt().SetMarkerSize(0.5);
215  prop->RefPMAtt().SetMarkerColor(id.item()->defaultDisplayProperties().color());
216 
217  TEveTrack* trk1 = fireworks::prepareTrack( *track1, prop );
218  trk1->MakeTrack();
219  trk1->SetLineWidth(2);
220  trk1->SetTitle( "Track 1 and its ref states" );
221  trk1->SetMainColor(id.item()->defaultDisplayProperties().color());
222  trk1->SetLineStyle(7);
223  m_eveScene->AddElement(trk1);
224 
225  TEveTrack* trk0 = fireworks::prepareTrack( *track0, prop );
226  trk0->MakeTrack();
227  trk0->SetLineWidth(2);
228  trk0->SetTitle( "Track 0 and its ref states" );
229  trk0->SetMainColor(id.item()->defaultDisplayProperties().color());
230  m_eveScene->AddElement(trk0);
231 
232  // create TEveCalo3D object, fix bounding box
233  {
234  float phi = conv->pairMomentum().phi();
235  float eta = conv->pairMomentum().eta();
236 
237  FWECALCaloDataDetailViewBuilder caloBld( id.item()->getEvent(), id.item()->getGeom(), eta, phi, 30);
238  TEveCaloData* data = caloBld.buildCaloData(false);
239  // AMT!!! this is memory leak, check why it needs to be added
240  TEveCalo3D* calo3d = new TEveCalo3D(data);
241  gEve->AddElement(data);
242  calo3d->SetBarrelRadius(129.00);
243  calo3d->SetEndCapPos(268.36);
244 
245  float theta = TEveCaloData::EtaToTheta(eta);
246  float ext = data->GetMaxVal(true) * calo3d->GetValToHeight();
247  if (TMath::Abs(eta) < calo3d->GetTransitionEta())
248  {
249  // printf("barrel\n");
250  float x = calo3d->GetBarrelRadius() * TMath::Cos(phi);
251  float y = calo3d->GetBarrelRadius() * TMath::Sin(phi);
252  float z = calo3d->GetBarrelRadius() / TMath::Tan(theta);
253 
254  calo3d->SetupBBoxCube(ext, x, y, z);
255  }
256  else
257  {
258  // printf("endcap\n");
259  float z = TMath::Sign(calo3d->GetEndCapPos(), eta);
260  float r = z*TMath::Tan(theta);
261  calo3d->SetupBBoxCube(ext, r* TMath::Cos(phi), r*TMath::Sin(phi), z);
262  }
263  m_eveScene->AddElement(calo3d);
264  }
265 
266  // base vectors
267  TEveVectorD fwd = trk1->GetMomentum().Cross(trk0->GetMomentum());
268  fwd.Normalize();
269  TEveVectorD lft =trk1->GetMomentum();
270  lft.Normalize();
271  TEveVectorD up = lft.Cross(fwd);
272 
273 
274  TEveVectorD c = ( trk1->GetVertex() + trk0->GetVertex()) *0.5;
275  if (true)
276  {
277  setCameraInit(viewerGL(),TGLViewer::kCameraPerspXOZ, fwd, up, c); //default
278  setCameraInit(viewerGL(),TGLViewer::kCameraPerspYOZ, up, lft,c);
279  setCameraInit(viewerGL(),TGLViewer::kCameraPerspXOY, lft, fwd,c);
280 
281  setCameraInit(viewerGL(),TGLViewer::kCameraOrthoXOY, fwd, up,c);
282  setCameraInit(viewerGL(),TGLViewer::kCameraOrthoXOZ, up, lft,c);
283  setCameraInit(viewerGL(),TGLViewer::kCameraOrthoZOY, lft, fwd,c);
284  }
285  {
286  Float_t sfac = 100;
287  fwd *= sfac;
288  lft *= sfac;
289  up *= sfac;
290  int transp = 90;
291  {
292  TEveStraightLineSet* bls = new TEveStraightLineSet("base1");
293  bls->AddLine(c, fwd + c);
294  bls->SetMainColor(kBlue);
295  bls->SetMainTransparency(transp);
296  bls->SetPickable(false);
297  m_eveScene->AddElement(bls);
298  }
299 
300  {
301  TEveStraightLineSet* bls = new TEveStraightLineSet("base2");
302  bls->AddLine(c, lft + c);
303  bls->SetMainColor(kBlue);
304  bls->SetMainTransparency(transp);
305  bls->SetPickable(false);
306  m_eveScene->AddElement(bls);
307  }
308 
309  {
310  TEveStraightLineSet* bls = new TEveStraightLineSet("base3");
311  bls->AddLine(c, up + c);
312  bls->SetMainColor(kBlue);
313  bls->SetMainTransparency(transp);
314  bls->SetPickable(false);
315  m_eveScene->AddElement(bls);
316  }
317  }
318  {
319  TEveStraightLineSet* bls = new TEveStraightLineSet("Photon", "Photon");
320  FWBeamSpot* bs = context().getBeamSpot();
321  bls->AddLine(c.fX, c.fY, c.fZ, bs->x0(), bs->y0(), bs->z0());
322  bls->SetMainColor(id.item()->defaultDisplayProperties().color());
323  bls->SetLineStyle(3);
324  m_eveScene->AddElement(bls);
325  }
326 
327  viewerGL()->SetStyle(TGLRnrCtx::kOutline);
328  viewerGL()->ResetCamerasAfterNextUpdate();
329  viewerGL()->UpdateScene(kFALSE);
330  gEve->Redraw3D();
331 
332  setTextInfo(id, conv);
334 }
335 
336 void
338 {
339  m_infoCanvas->cd();
340 
341  float_t x = 0.02;
342  float y = 0.95;
343 
344  TLatex* latex = new TLatex( x, y, "" );
345  const double textsize( 0.07 );
346  latex->SetTextSize( 2*textsize );
347 
348  latex->DrawLatex( x, y, id.item()->modelName( id.index()).c_str());
349  y -= latex->GetTextSize()*0.6;
350 
351  latex->SetTextSize( textsize );
352  float lineH = latex->GetTextSize()*0.6;
353 
354  latex->DrawLatex( x, y, Form("p_{T}=%.1f GeV, #eta=%0.2f, #varphi=%0.2f",
355  sqrt(conv->pairMomentum().Perp2()), conv->pairMomentum().eta(), conv->pairMomentum().phi() ));
356  y -= lineH;
357  latex->DrawLatex( x, y, Form("vtx=(%.1f, %.1f, %.1f) r=%.1f [cm]",
358  conv->conversionVertex().x(), conv->conversionVertex().y(), conv->conversionVertex().z(),
359  conv->conversionVertex().position().rho() ));
360  y -= lineH;
361  latex->DrawLatex( x, y, Form("#Deltactg#theta=%.3f",
362  conv->pairCotThetaSeparation() ));
363  y -= lineH;
364  latex->DrawLatex( x, y, Form("#Delta#phi_{vtx}=%.3f",
365  conv->dPhiTracksAtVtx() ));
366  y -= lineH;
367  latex->DrawLatex( x, y, Form("dist. min. app.=%.3f cm",
368  conv->distOfMinimumApproach() ));
369  y -= lineH;
370  y -= lineH;
371 
372 
373  const reco::Track* track0 = conv->tracks().at(0).get();
374  latex->DrawLatex( x, y, Form("Trk0 q=%i",track0->charge()));
375  y -= lineH;
376  latex->DrawLatex( x, y, Form( "p_{T}=%.1f GeV, #eta=%0.2f, #varphi=%0.2f",
377  track0->pt(), track0->eta(), track0->phi()));
378  y -= lineH;
379  const reco::HitPattern &hp0 = track0->hitPattern();
380  int nvalid_tk0 = 0, ninvalid_tk0 = 0, npix_tk0 = 0, nstrip_tk0 = 0;
381  for(int i_tk0 = 0; i_tk0 < hp0.numberOfAllHits(reco::HitPattern::TRACK_HITS); i_tk0++) {
382  uint32_t hit = hp0.getHitPattern(reco::HitPattern::TRACK_HITS, i_tk0);
384  nvalid_tk0++;
385  if (reco::HitPattern::pixelHitFilter(hit)) npix_tk0++;
386  else if (reco::HitPattern::stripHitFilter(hit)) nstrip_tk0++;
387  } else ninvalid_tk0++;
388  }
389  latex->DrawLatex( x, y, Form( "valid hits: %i (pix. %i, str. %i)", nvalid_tk0, npix_tk0, nstrip_tk0) );
390  y -= lineH;
391  latex->DrawLatex( x, y, Form( "invalid: %i", ninvalid_tk0) );
392  y -= lineH;
393 
394  int npix_mhi_tk0 = 0, nstrip_mhi_tk0 = 0;
395  for(int i_mhi_tk0 = 0; i_mhi_tk0 < hp0.numberOfAllHits(reco::HitPattern::MISSING_INNER_HITS); i_mhi_tk0++) {
396  uint32_t hit = hp0.getHitPattern(reco::HitPattern::MISSING_INNER_HITS, i_mhi_tk0);
397  if (reco::HitPattern::pixelHitFilter(hit)) npix_mhi_tk0++;
398  else if (reco::HitPattern::stripHitFilter(hit)) nstrip_mhi_tk0++;
399  }
400  latex->DrawLatex( x, y, Form("miss. inner hits: pix. %i, str. %i", npix_mhi_tk0, nstrip_mhi_tk0) );
401 
402  y -= lineH;
403  y -= lineH;
404  const reco::Track* track1 = conv->tracks().at(1).get();
405  latex->DrawLatex( x, y, Form("Trk1 q=%i",track1->charge()));
406  y -= lineH;
407  latex->DrawLatex( x, y, Form( "p_{T}=%.1f GeV, #eta=%0.2f, #varphi=%0.2f",
408  track1->pt(), track1->eta(), track1->phi()));
409  y -= lineH;
410 
411  const reco::HitPattern &hp1 = track1->hitPattern();
412  int nvalid_tk1 = 0, ninvalid_tk1 = 0, npix_tk1 = 0, nstrip_tk1 = 0;
413  for(int i_tk1 = 0; i_tk1 < hp1.numberOfAllHits(reco::HitPattern::TRACK_HITS); i_tk1++) {
414  uint32_t hit = hp1.getHitPattern(reco::HitPattern::TRACK_HITS, i_tk1);
416  nvalid_tk1++;
417  if (reco::HitPattern::pixelHitFilter(hit)) npix_tk1++;
418  else if (reco::HitPattern::stripHitFilter(hit)) nstrip_tk1++;
419  } else ninvalid_tk1++;
420  }
421  latex->DrawLatex( x, y, Form( "valid hits: %i (pix. %i, str. %i)", nvalid_tk1, npix_tk1, nstrip_tk1) );
422  y -= lineH;
423  latex->DrawLatex( x, y, Form( "invalid: %i", ninvalid_tk1) );
424  y -= lineH;
425 
426  int npix_mhi_tk1 = 0, nstrip_mhi_tk1 = 0;
427  for(int i_mhi_tk1 = 0; i_mhi_tk1 < hp1.numberOfAllHits(reco::HitPattern::MISSING_INNER_HITS); i_mhi_tk1++) {
428  uint32_t hit = hp1.getHitPattern(reco::HitPattern::MISSING_INNER_HITS, i_mhi_tk1);
429  if (reco::HitPattern::pixelHitFilter(hit)) npix_mhi_tk1++;
430  else if (reco::HitPattern::stripHitFilter(hit)) nstrip_mhi_tk1++;
431  }
432  latex->DrawLatex( x, y, Form("miss. inner hits: pix. %i, str. %i", npix_mhi_tk1, nstrip_mhi_tk1) );
433  y -= lineH;
434  y -= lineH;
435 }
436 
437 
438 void
439 FWConvTrackHitsDetailView::addTrackerHits3D( std::vector<TVector3> &points, class TEveElementList *tList, Color_t color, int size )
440 {
441  // !AMT this is detail view specific, should move to track hits
442  // detail view
443 
444  TEvePointSet* pointSet = new TEvePointSet();
445  pointSet->SetMarkerSize(size);
446  pointSet->SetMarkerStyle(4);
447  pointSet->SetPickable(kTRUE);
448  pointSet->SetTitle("Pixel Hits");
449  pointSet->SetMarkerColor(color);
450 
451  for( std::vector<TVector3>::const_iterator it = points.begin(), itEnd = points.end(); it != itEnd; ++it) {
452  pointSet->SetNextPoint(it->x(), it->y(), it->z());
453  }
454  tList->AddElement(pointSet);
455 }
456 
457 void
459  const FWEventItem* iItem,
460  TEveElement* trkList,
461  bool addNearbyHits )
462 {
463  std::vector<TVector3> pixelPoints;
464  fireworks::pushPixelHits( pixelPoints, *iItem, track );
465  TEveElementList* pixels = new TEveElementList( "Pixels" );
466  trkList->AddElement( pixels );
467  if( addNearbyHits )
468  {
469  // get the extra hits
470  std::vector<TVector3> pixelExtraPoints;
471  fireworks::pushNearbyPixelHits( pixelExtraPoints, *iItem, track );
472  // draw first the others
473  addTrackerHits3D( pixelExtraPoints, pixels, kRed, 1 );
474  // then the good ones, so they're on top
475  addTrackerHits3D( pixelPoints, pixels, kGreen, 1 );
476  }
477  else
478  {
479  // just add those points with the default color
480  addTrackerHits3D( pixelPoints, pixels, iItem->defaultDisplayProperties().color(), 1 );
481  }
482 
483  // strips
484  TEveElementList* strips = new TEveElementList( "Strips" );
485  trkList->AddElement( strips );
486  fireworks::addSiStripClusters( iItem, track, strips, addNearbyHits, false );
487 }
488 
489 //______________________________________________________________________________
490 
491 void
493  const FWEventItem* iItem,
494  TEveElement* trkList,
495  bool addLostHits )
496 {
497  std::set<unsigned int> ids;
498  for( trackingRecHit_iterator recIt = track.recHitsBegin(), recItEnd = track.recHitsEnd();
499  recIt != recItEnd; ++recIt )
500  {
501  DetId detid = (*recIt)->geographicalId();
502  if( !addLostHits && !(*recIt)->isValid()) continue;
503  if( detid.rawId() != 0 )
504  {
505  TString name("");
506  switch( detid.det())
507  {
508  case DetId::Tracker:
509  switch( detid.subdetId())
510  {
511  case SiStripDetId::TIB:
512  name = "TIB ";
513  break;
514  case SiStripDetId::TOB:
515  name = "TOB ";
516  break;
517  case SiStripDetId::TID:
518  name = "TID ";
519  break;
520  case SiStripDetId::TEC:
521  name = "TEC ";
522  break;
524  name = "Pixel Barrel ";
525  break;
527  name = "Pixel Endcap ";
528  default:
529  break;
530  }
531  break;
532 
533  case DetId::Muon:
534  switch( detid.subdetId())
535  {
536  case MuonSubdetId::DT:
537  name = "DT";
538  detid = DetId( DTChamberId( detid )); // get rid of layer bits
539  break;
540  case MuonSubdetId::CSC:
541  name = "CSC";
542  break;
543  case MuonSubdetId::RPC:
544  name = "RPC";
545  break;
546  default:
547  break;
548  }
549  break;
550  default:
551  break;
552  }
553  if( ! ids.insert( detid.rawId()).second ) continue;
554  if( iItem->getGeom())
555  {
556  TEveGeoShape* shape = iItem->getGeom()->getEveShape( detid );
557  if( nullptr != shape )
558  {
559  shape->SetMainTransparency( 65 );
560  shape->SetPickable( kTRUE );
561  switch(( *recIt )->type())
562  {
564  shape->SetMainColor( iItem->defaultDisplayProperties().color());
565  break;
569  name += "LOST ";
570  shape->SetMainColor( kRed );
571  break;
575  name += "INACTIVE ";
576  shape->SetMainColor( 28 );
577  break;
578  case TrackingRecHit::bad:
579  name += "BAD ";
580  shape->SetMainColor( 218 );
581  break;
582  }
583  shape->SetTitle( name + ULong_t( detid.rawId()));
584  trkList->AddElement( shape );
585  }
586  else
587  {
588  fwLog( fwlog::kInfo ) << "Failed to get shape extract for a tracking rec hit: "
589  << "\n" << fireworks::info( detid ) << std::endl;
590  }
591  }
592  }
593  }
594 }
595 
596 //______________________________________________________________________________
597 void
599 {
600  viewerGL()->PickCameraCenter();
601  viewerGL()->SetDrawCameraCenter(kTRUE);
602 }
603 
604 void
606 {
608  m_camTypeAction->setName(m_orthographic ? "Set Perspective Projection" : "Set Orthographic Projection");
609 
610  (this->*foo) ();
611  //printf("current isOrthographic : %d \n", viewerGL()->CurrentCamera().IsOrthographic());
612 }
613 
614 
615 void
617 {
618  m_moduleLabels->SetRnrChildren(!m_moduleLabels->GetRnrChildren());
619  gEve->Redraw3D();
620 }
621 
622 void
624 {
625  m_modules->SetRnrChildren(!m_modules->GetRnrChildren());
626  gEve->Redraw3D();
627 }
628 
629 void
631 {
632  m_hits->SetRnrChildren(!m_hits->GetRnrChildren());
633  gEve->Redraw3D();
634 }
635 
636 
638 {
640 
641  viewerGL()->SetCurrentCamera(m_orthographic ? TGLViewer::kCameraOrthoXOY : TGLViewer::kCameraPerspXOZ);
642  viewerGL()->ResetCurrentCamera();
643  viewerGL()->RequestDraw();
644 }
645 
647 {
649 
650  viewerGL()->SetCurrentCamera( m_orthographic ? TGLViewer::kCameraOrthoXOZ : TGLViewer::kCameraPerspYOZ);
651  viewerGL()->ResetCurrentCamera();
652  viewerGL()->RequestDraw();
653 
654 }
655 
657 {
659 
660  viewerGL()->SetCurrentCamera(m_orthographic ? TGLViewer::kCameraOrthoZOY : TGLViewer::kCameraPerspXOY);
661  viewerGL()->ResetCurrentCamera();
662  viewerGL()->RequestDraw();
663 
664 }
665 
667 /*
668 REGISTER_FWDETAILVIEW(FWConvTrackHitsDetailView, Conversion, ecalRecHit);
669 REGISTER_FWDETAILVIEW(FWConvTrackHitsDetailView, Conversion, reducedEcalRecHitsEB);
670 REGISTER_FWDETAILVIEW(FWConvTrackHitsDetailView, Conversion, reducedEGamma);
671 */
size
Write out results.
const reco::Vertex & conversionVertex() const
returns the reco conversion vertex
Definition: Conversion.h:97
const std::string & getName() const
Definition: CSGAction.cc:81
Definition: BitonicSort.h:8
void addModules(const reco::Track &track, const FWEventItem *iItem, TEveElement *trkList, bool addLostHits)
bool isAvailable() const
Definition: Ref.h:577
type
Definition: HCALResponse.h:21
const FWDisplayProperties & defaultDisplayProperties() const
Definition: FWEventItem.cc:453
void build(const FWModelId &id, const reco::Conversion *) override
static bool pixelHitFilter(uint16_t pattern)
Definition: HitPattern.h:565
double x0() const
Definition: FWBeamSpot.cc:30
const TrackExtraRef & extra() const
reference to "extra" object
Definition: Track.h:189
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:63
static HepMC::IO_HEPEVT conv
double z0() const
Definition: FWBeamSpot.cc:40
double y0() const
Definition: FWBeamSpot.cc:35
double y() const
y coordinate
Definition: Vertex.h:113
const FWEventItem * item()
sigc::signal< void > activated
Definition: CSGAction.h:88
constexpr uint32_t rawId() const
get the raw id
Definition: DetId.h:47
Geom::Theta< T > theta() const
double distOfMinimumApproach() const
Definition: Conversion.h:125
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:209
double phi() const
azimuthal angle of momentum vector
Definition: TrackBase.h:645
#define nullptr
const Point & position() const
position
Definition: Vertex.h:109
Color_t color() const
static bool validHitFilter(uint16_t pattern)
Definition: HitPattern.h:788
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:126
void setTextInfo(const FWModelId &id, const reco::Conversion *) override
FWBeamSpot * getBeamSpot() const
Definition: Context.h:78
static const int CSC
Definition: MuonSubdetId.h:13
const fireworks::Context & context() const
double eta() const
pseudorapidity of momentum vector
Definition: TrackBase.h:651
TEveGeoShape * getEveShape(unsigned int id) const
Definition: FWGeometry.cc:270
T sqrt(T t)
Definition: SSEVec.h:18
double pt() const
track transverse momentum
Definition: TrackBase.h:621
static bool stripHitFilter(uint16_t pattern)
Definition: HitPattern.h:596
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:41
int numberOfAllHits(HitCategory category) const
Definition: HitPattern.h:808
double z() const
z coordinate
Definition: Vertex.h:115
constexpr unsigned getField(const uint32_t u, const unsigned mask, const unsigned offset)
double f[11][100]
void setName(const std::string &name)
Definition: CSGAction.cc:93
#define end
Definition: vmac.h:39
void pushPixelHits(std::vector< TVector3 > &pixelPoints, const FWEventItem &iItem, const reco::Track &t)
Definition: TrackUtils.cc:578
trackingRecHit_iterator recHitsBegin() const
Iterator to first hit on the track.
Definition: Track.h:104
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:352
unsigned int nTracks() const
Number of tracks= 0,1,2.
Definition: Conversion.h:101
Definition: DetId.h:18
double x() const
x coordinate
Definition: Vertex.h:111
math::XYZVectorF pairMomentum() const
Conversion tracks momentum from the tracks inner momentum.
Definition: Conversion.cc:223
const HitPattern & hitPattern() const
Access the hit pattern, indicating in which Tracker layers the track has hits.
Definition: TrackBase.h:446
#define fwLog(_level_)
Definition: fwLog.h:50
double b
Definition: hdecay.h:120
#define REGISTER_FWDETAILVIEW(_classname_, _name_,...)
char data[epos_bytes_allocation]
Definition: EPOS_Wrapper.h:82
static const int RPC
Definition: MuonSubdetId.h:14
std::string info(const DetId &)
Definition: TrackUtils.cc:659
int charge() const
track electric charge
Definition: TrackBase.h:567
static const int DT
Definition: MuonSubdetId.h:12
void addTrackerHits3D(std::vector< TVector3 > &points, class TEveElementList *tList, Color_t color, int size)
Definition: AbsArchive.cc:53
uint16_t getHitPattern(HitCategory category, int position) const
Definition: HitPattern.h:516
Definition: memstream.h:15
void pushNearbyPixelHits(std::vector< TVector3 > &pixelPoints, const FWEventItem &iItem, const reco::Track &t)
Definition: TrackUtils.cc:519
const FWGeometry * getGeom() const
Definition: FWEventItem.cc:683
double dPhiTracksAtVtx() const
Definition: Conversion.cc:313
std::vector< edm::RefToBase< reco::Track > > const & tracks() const
vector of track to base references
Definition: Conversion.cc:176
constexpr Detector det() const
get the detector field from this detid
Definition: DetId.h:39
trackingRecHit_iterator recHitsEnd() const
Iterator to last hit on the track.
Definition: Track.h:109