CMS 3D CMS Logo

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