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(0),
49  m_moduleLabels(0),
50  m_hits(0),
51  m_legend(0),
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  if (gs == 0 && (*i != 0)) {
179  std::cerr << "Got a " << typeid(**i).name() << ", expecting TEveGeoShape. ignoring (it must be the clusters)." << std::endl;
180  continue;
181  }
182  // gs->SetMainTransparency(75);
183  // gs->SetPickable(kFALSE);
184 
185  TString name = gs->GetElementTitle();
186  if (!name.Contains("BAD") && !name.Contains("INACTIVE") && !name.Contains("LOST")) {
187  gs->SetMainColor(kBlue);
188  }
189  TEveText* text = new TEveText(name.Data());
190  text->PtrMainTrans()->SetFrom(gs->RefMainTrans().Array());
191  text->SetFontMode(TGLFont::kPixmap);
192  text->SetFontSize(12);
193  m_moduleLabels->AddElement(text);
194  }
195  m_moduleLabels->SetRnrChildren(false);
196 
197  TEveTrackPropagator* prop = new TEveTrackPropagator();
198  prop->SetMagFieldObj(item()->context().getField(), false);
199  prop->SetStepper(TEveTrackPropagator::kRungeKutta);
200  prop->SetMaxR(123);
201  prop->SetMaxZ(300);
202  prop->SetMaxStep(1);
203  prop->SetRnrDaughters(kTRUE);
204  prop->SetRnrReferences(kTRUE);
205  prop->SetRnrDecay(kTRUE);
206 
207  // first-vertex style
208  prop->SetRnrFV(kTRUE);
209  prop->RefFVAtt().SetMarkerColor(id.item()->defaultDisplayProperties().color());
210  prop->RefFVAtt().SetMarkerSize(0.8);
211 
212  // path-mark style
213  prop->RefPMAtt().SetMarkerSize(0.5);
214  prop->RefPMAtt().SetMarkerColor(id.item()->defaultDisplayProperties().color());
215 
216  TEveTrack* trk1 = fireworks::prepareTrack( *track1, prop );
217  trk1->MakeTrack();
218  trk1->SetLineWidth(2);
219  trk1->SetTitle( "Track 1 and its ref states" );
220  trk1->SetMainColor(id.item()->defaultDisplayProperties().color());
221  trk1->SetLineStyle(7);
222  m_eveScene->AddElement(trk1);
223 
224  TEveTrack* trk0 = fireworks::prepareTrack( *track0, prop );
225  trk0->MakeTrack();
226  trk0->SetLineWidth(2);
227  trk0->SetTitle( "Track 0 and its ref states" );
228  trk0->SetMainColor(id.item()->defaultDisplayProperties().color());
229  m_eveScene->AddElement(trk0);
230 
231  // create TEveCalo3D object, fix bounding box
232  {
233  float phi = conv->pairMomentum().phi();
234  float eta = conv->pairMomentum().eta();
235 
236  FWECALCaloDataDetailViewBuilder caloBld( id.item()->getEvent(), id.item()->getGeom(), eta, phi, 30);
237  TEveCaloData* data = caloBld.buildCaloData(false);
238  // AMT!!! this is memory leak, check why it needs to be added
239  TEveCalo3D* calo3d = new TEveCalo3D(data);
240  gEve->AddElement(data);
241  calo3d->SetBarrelRadius(129.00);
242  calo3d->SetEndCapPos(268.36);
243 
244  float theta = TEveCaloData::EtaToTheta(eta);
245  float ext = data->GetMaxVal(true) * calo3d->GetValToHeight();
246  if (TMath::Abs(eta) < calo3d->GetTransitionEta())
247  {
248  // printf("barrel\n");
249  float x = calo3d->GetBarrelRadius() * TMath::Cos(phi);
250  float y = calo3d->GetBarrelRadius() * TMath::Sin(phi);
251  float z = calo3d->GetBarrelRadius() / TMath::Tan(theta);
252 
253  calo3d->SetupBBoxCube(ext, x, y, z);
254  }
255  else
256  {
257  // printf("endcap\n");
258  float z = TMath::Sign(calo3d->GetEndCapPos(), eta);
259  float r = z*TMath::Tan(theta);
260  calo3d->SetupBBoxCube(ext, r* TMath::Cos(phi), r*TMath::Sin(phi), z);
261  }
262  m_eveScene->AddElement(calo3d);
263  }
264 
265  // base vectors
266  TEveVectorD fwd = trk1->GetMomentum().Cross(trk0->GetMomentum());
267  fwd.Normalize();
268  TEveVectorD lft =trk1->GetMomentum();
269  lft.Normalize();
270  TEveVectorD up = lft.Cross(fwd);
271 
272 
273  TEveVectorD c = ( trk1->GetVertex() + trk0->GetVertex()) *0.5;
274  if (1)
275  {
276  setCameraInit(viewerGL(),TGLViewer::kCameraPerspXOZ, fwd, up, c); //default
277  setCameraInit(viewerGL(),TGLViewer::kCameraPerspYOZ, up, lft,c);
278  setCameraInit(viewerGL(),TGLViewer::kCameraPerspXOY, lft, fwd,c);
279 
280  setCameraInit(viewerGL(),TGLViewer::kCameraOrthoXOY, fwd, up,c);
281  setCameraInit(viewerGL(),TGLViewer::kCameraOrthoXOZ, up, lft,c);
282  setCameraInit(viewerGL(),TGLViewer::kCameraOrthoZOY, lft, fwd,c);
283  }
284  {
285  Float_t sfac = 100;
286  fwd *= sfac;
287  lft *= sfac;
288  up *= sfac;
289  int transp = 90;
290  {
291  TEveStraightLineSet* bls = new TEveStraightLineSet("base1");
292  bls->AddLine(c, fwd + c);
293  bls->SetMainColor(kBlue);
294  bls->SetMainTransparency(transp);
295  bls->SetPickable(false);
296  m_eveScene->AddElement(bls);
297  }
298 
299  {
300  TEveStraightLineSet* bls = new TEveStraightLineSet("base2");
301  bls->AddLine(c, lft + c);
302  bls->SetMainColor(kBlue);
303  bls->SetMainTransparency(transp);
304  bls->SetPickable(false);
305  m_eveScene->AddElement(bls);
306  }
307 
308  {
309  TEveStraightLineSet* bls = new TEveStraightLineSet("base3");
310  bls->AddLine(c, up + c);
311  bls->SetMainColor(kBlue);
312  bls->SetMainTransparency(transp);
313  bls->SetPickable(false);
314  m_eveScene->AddElement(bls);
315  }
316  }
317  {
318  TEveStraightLineSet* bls = new TEveStraightLineSet("Photon", "Photon");
319  FWBeamSpot* bs = context().getBeamSpot();
320  bls->AddLine(c.fX, c.fY, c.fZ, bs->x0(), bs->y0(), bs->z0());
321  bls->SetMainColor(id.item()->defaultDisplayProperties().color());
322  bls->SetLineStyle(3);
323  m_eveScene->AddElement(bls);
324  }
325 
326  viewerGL()->SetStyle(TGLRnrCtx::kOutline);
327  viewerGL()->ResetCamerasAfterNextUpdate();
328  viewerGL()->UpdateScene(kFALSE);
329  gEve->Redraw3D();
330 
331  setTextInfo(id, conv);
333 }
334 
335 void
337 {
338  m_infoCanvas->cd();
339 
340  float_t x = 0.02;
341  float y = 0.95;
342 
343  TLatex* latex = new TLatex( x, y, "" );
344  const double textsize( 0.07 );
345  latex->SetTextSize( 2*textsize );
346 
347  latex->DrawLatex( x, y, id.item()->modelName( id.index()).c_str());
348  y -= latex->GetTextSize()*0.6;
349 
350  latex->SetTextSize( textsize );
351  float lineH = latex->GetTextSize()*0.6;
352 
353  latex->DrawLatex( x, y, Form("p_{T}=%.1f GeV, #eta=%0.2f, #varphi=%0.2f",
354  sqrt(conv->pairMomentum().Perp2()), conv->pairMomentum().eta(), conv->pairMomentum().phi() ));
355  y -= lineH;
356  latex->DrawLatex( x, y, Form("vtx=(%.1f, %.1f, %.1f) r=%.1f [cm]",
357  conv->conversionVertex().x(), conv->conversionVertex().y(), conv->conversionVertex().z(),
358  conv->conversionVertex().position().rho() ));
359  y -= lineH;
360  latex->DrawLatex( x, y, Form("#Deltactg#theta=%.3f",
361  conv->pairCotThetaSeparation() ));
362  y -= lineH;
363  latex->DrawLatex( x, y, Form("#Delta#phi_{vtx}=%.3f",
364  conv->dPhiTracksAtVtx() ));
365  y -= lineH;
366  latex->DrawLatex( x, y, Form("dist. min. app.=%.3f cm",
367  conv->distOfMinimumApproach() ));
368  y -= lineH;
369  y -= lineH;
370 
371 
372  const reco::Track* track0 = conv->tracks().at(0).get();
373  latex->DrawLatex( x, y, Form("Trk0 q=%i",track0->charge()));
374  y -= lineH;
375  latex->DrawLatex( x, y, Form( "p_{T}=%.1f GeV, #eta=%0.2f, #varphi=%0.2f",
376  track0->pt(), track0->eta(), track0->phi()));
377  y -= lineH;
378  const reco::HitPattern &hp0 = track0->hitPattern();
379  int nvalid_tk0 = 0, ninvalid_tk0 = 0, npix_tk0 = 0, nstrip_tk0 = 0;
380  for(int i_tk0 = 0; i_tk0 < hp0.numberOfHits(reco::HitPattern::TRACK_HITS); i_tk0++) {
381  uint32_t hit = hp0.getHitPattern(reco::HitPattern::TRACK_HITS, i_tk0);
383  nvalid_tk0++;
384  if (reco::HitPattern::pixelHitFilter(hit)) npix_tk0++;
385  else if (reco::HitPattern::stripHitFilter(hit)) nstrip_tk0++;
386  } else ninvalid_tk0++;
387  }
388  latex->DrawLatex( x, y, Form( "valid hits: %i (pix. %i, str. %i)", nvalid_tk0, npix_tk0, nstrip_tk0) );
389  y -= lineH;
390  latex->DrawLatex( x, y, Form( "invalid: %i", ninvalid_tk0) );
391  y -= lineH;
392 
393  int npix_mhi_tk0 = 0, nstrip_mhi_tk0 = 0;
394  for(int i_mhi_tk0 = 0; i_mhi_tk0 < hp0.numberOfHits(reco::HitPattern::MISSING_INNER_HITS); i_mhi_tk0++) {
395  uint32_t hit = hp0.getHitPattern(reco::HitPattern::MISSING_INNER_HITS, i_mhi_tk0);
396  if (reco::HitPattern::pixelHitFilter(hit)) npix_mhi_tk0++;
397  else if (reco::HitPattern::stripHitFilter(hit)) nstrip_mhi_tk0++;
398  }
399  latex->DrawLatex( x, y, Form("miss. inner hits: pix. %i, str. %i", npix_mhi_tk0, nstrip_mhi_tk0) );
400 
401  y -= lineH;
402  y -= lineH;
403  const reco::Track* track1 = conv->tracks().at(1).get();
404  latex->DrawLatex( x, y, Form("Trk1 q=%i",track1->charge()));
405  y -= lineH;
406  latex->DrawLatex( x, y, Form( "p_{T}=%.1f GeV, #eta=%0.2f, #varphi=%0.2f",
407  track1->pt(), track1->eta(), track1->phi()));
408  y -= lineH;
409 
410  const reco::HitPattern &hp1 = track1->hitPattern();
411  int nvalid_tk1 = 0, ninvalid_tk1 = 0, npix_tk1 = 0, nstrip_tk1 = 0;
412  for(int i_tk1 = 0; i_tk1 < hp1.numberOfHits(reco::HitPattern::TRACK_HITS); i_tk1++) {
413  uint32_t hit = hp1.getHitPattern(reco::HitPattern::TRACK_HITS, i_tk1);
415  nvalid_tk1++;
416  if (reco::HitPattern::pixelHitFilter(hit)) npix_tk1++;
417  else if (reco::HitPattern::stripHitFilter(hit)) nstrip_tk1++;
418  } else ninvalid_tk1++;
419  }
420  latex->DrawLatex( x, y, Form( "valid hits: %i (pix. %i, str. %i)", nvalid_tk1, npix_tk1, nstrip_tk1) );
421  y -= lineH;
422  latex->DrawLatex( x, y, Form( "invalid: %i", ninvalid_tk1) );
423  y -= lineH;
424 
425  int npix_mhi_tk1 = 0, nstrip_mhi_tk1 = 0;
426  for(int i_mhi_tk1 = 0; i_mhi_tk1 < hp1.numberOfHits(reco::HitPattern::MISSING_INNER_HITS); i_mhi_tk1++) {
427  uint32_t hit = hp1.getHitPattern(reco::HitPattern::MISSING_INNER_HITS, i_mhi_tk1);
428  if (reco::HitPattern::pixelHitFilter(hit)) npix_mhi_tk1++;
429  else if (reco::HitPattern::stripHitFilter(hit)) nstrip_mhi_tk1++;
430  }
431  latex->DrawLatex( x, y, Form("miss. inner hits: pix. %i, str. %i", npix_mhi_tk1, nstrip_mhi_tk1) );
432  y -= lineH;
433  y -= lineH;
434 }
435 
436 
437 void
438 FWConvTrackHitsDetailView::addTrackerHits3D( std::vector<TVector3> &points, class TEveElementList *tList, Color_t color, int size )
439 {
440  // !AMT this is detail view specific, should move to track hits
441  // detail view
442 
443  TEvePointSet* pointSet = new TEvePointSet();
444  pointSet->SetMarkerSize(size);
445  pointSet->SetMarkerStyle(4);
446  pointSet->SetPickable(kTRUE);
447  pointSet->SetTitle("Pixel Hits");
448  pointSet->SetMarkerColor(color);
449 
450  for( std::vector<TVector3>::const_iterator it = points.begin(), itEnd = points.end(); it != itEnd; ++it) {
451  pointSet->SetNextPoint(it->x(), it->y(), it->z());
452  }
453  tList->AddElement(pointSet);
454 }
455 
456 void
458  const FWEventItem* iItem,
459  TEveElement* trkList,
460  bool addNearbyHits )
461 {
462  std::vector<TVector3> pixelPoints;
463  fireworks::pushPixelHits( pixelPoints, *iItem, track );
464  TEveElementList* pixels = new TEveElementList( "Pixels" );
465  trkList->AddElement( pixels );
466  if( addNearbyHits )
467  {
468  // get the extra hits
469  std::vector<TVector3> pixelExtraPoints;
470  fireworks::pushNearbyPixelHits( pixelExtraPoints, *iItem, track );
471  // draw first the others
472  addTrackerHits3D( pixelExtraPoints, pixels, kRed, 1 );
473  // then the good ones, so they're on top
474  addTrackerHits3D( pixelPoints, pixels, kGreen, 1 );
475  }
476  else
477  {
478  // just add those points with the default color
479  addTrackerHits3D( pixelPoints, pixels, iItem->defaultDisplayProperties().color(), 1 );
480  }
481 
482  // strips
483  TEveElementList* strips = new TEveElementList( "Strips" );
484  trkList->AddElement( strips );
485  fireworks::addSiStripClusters( iItem, track, strips, addNearbyHits, false );
486 }
487 
488 //______________________________________________________________________________
489 
490 void
492  const FWEventItem* iItem,
493  TEveElement* trkList,
494  bool addLostHits )
495 {
496  std::set<unsigned int> ids;
497  for( trackingRecHit_iterator recIt = track.recHitsBegin(), recItEnd = track.recHitsEnd();
498  recIt != recItEnd; ++recIt )
499  {
500  DetId detid = (*recIt)->geographicalId();
501  if( !addLostHits && !(*recIt)->isValid()) continue;
502  if( detid.rawId() != 0 )
503  {
504  TString name("");
505  switch( detid.det())
506  {
507  case DetId::Tracker:
508  switch( detid.subdetId())
509  {
510  case SiStripDetId::TIB:
511  name = "TIB ";
512  break;
513  case SiStripDetId::TOB:
514  name = "TOB ";
515  break;
516  case SiStripDetId::TID:
517  name = "TID ";
518  break;
519  case SiStripDetId::TEC:
520  name = "TEC ";
521  break;
523  name = "Pixel Barrel ";
524  break;
526  name = "Pixel Endcap ";
527  default:
528  break;
529  }
530  break;
531 
532  case DetId::Muon:
533  switch( detid.subdetId())
534  {
535  case MuonSubdetId::DT:
536  name = "DT";
537  detid = DetId( DTChamberId( detid )); // get rid of layer bits
538  break;
539  case MuonSubdetId::CSC:
540  name = "CSC";
541  break;
542  case MuonSubdetId::RPC:
543  name = "RPC";
544  break;
545  default:
546  break;
547  }
548  break;
549  default:
550  break;
551  }
552  if( ! ids.insert( detid.rawId()).second ) continue;
553  if( iItem->getGeom())
554  {
555  TEveGeoShape* shape = iItem->getGeom()->getEveShape( detid );
556  if( 0 != shape )
557  {
558  shape->SetMainTransparency( 65 );
559  shape->SetPickable( kTRUE );
560  switch(( *recIt )->type())
561  {
563  shape->SetMainColor( iItem->defaultDisplayProperties().color());
564  break;
568  name += "LOST ";
569  shape->SetMainColor( kRed );
570  break;
572  name += "INACTIVE ";
573  shape->SetMainColor( 28 );
574  break;
575  case TrackingRecHit::bad:
576  name += "BAD ";
577  shape->SetMainColor( 218 );
578  break;
579  }
580  shape->SetTitle( name + ULong_t( detid.rawId()));
581  trkList->AddElement( shape );
582  }
583  else
584  {
585  fwLog( fwlog::kInfo ) << "Failed to get shape extract for a tracking rec hit: "
586  << "\n" << fireworks::info( detid ) << std::endl;
587  }
588  }
589  }
590  }
591 }
592 
593 //______________________________________________________________________________
594 void
596 {
597  viewerGL()->PickCameraCenter();
598  viewerGL()->SetDrawCameraCenter(kTRUE);
599 }
600 
601 void
603 {
605  m_camTypeAction->setName(m_orthographic ? "Set Perspective Projection" : "Set Orthographic Projection");
606 
607  (this->*foo) ();
608  //printf("current isOrthographic : %d \n", viewerGL()->CurrentCamera().IsOrthographic());
609 }
610 
611 
612 void
614 {
615  m_moduleLabels->SetRnrChildren(!m_moduleLabels->GetRnrChildren());
616  gEve->Redraw3D();
617 }
618 
619 void
621 {
622  m_modules->SetRnrChildren(!m_modules->GetRnrChildren());
623  gEve->Redraw3D();
624 }
625 
626 void
628 {
629  m_hits->SetRnrChildren(!m_hits->GetRnrChildren());
630  gEve->Redraw3D();
631 }
632 
633 
635 {
637 
638  viewerGL()->SetCurrentCamera(m_orthographic ? TGLViewer::kCameraOrthoXOY : TGLViewer::kCameraPerspXOZ);
639  viewerGL()->ResetCurrentCamera();
640  viewerGL()->RequestDraw();
641 }
642 
644 {
646 
647  viewerGL()->SetCurrentCamera( m_orthographic ? TGLViewer::kCameraOrthoXOZ : TGLViewer::kCameraPerspYOZ);
648  viewerGL()->ResetCurrentCamera();
649  viewerGL()->RequestDraw();
650 
651 }
652 
654 {
656 
657  viewerGL()->SetCurrentCamera(m_orthographic ? TGLViewer::kCameraOrthoZOY : TGLViewer::kCameraPerspXOY);
658  viewerGL()->ResetCurrentCamera();
659  viewerGL()->RequestDraw();
660 
661 }
662 
664 /*
665 REGISTER_FWDETAILVIEW(FWConvTrackHitsDetailView, Conversion, ecalRecHit);
666 REGISTER_FWDETAILVIEW(FWConvTrackHitsDetailView, Conversion, reducedEcalRecHitsEB);
667 REGISTER_FWDETAILVIEW(FWConvTrackHitsDetailView, Conversion, reducedEGamma);
668 */
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:576
type
Definition: HCALResponse.h:21
int i
Definition: DBlmapReader.cc:9
const FWDisplayProperties & defaultDisplayProperties() const
Definition: FWEventItem.cc:453
static bool pixelHitFilter(uint16_t pattern)
Definition: HitPattern.h:564
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
unsigned getField(const uint32_t u, const unsigned mask, const unsigned offset)
TEveTrack * prepareTrack(const reco::Track &track, TEveTrackPropagator *propagator, const std::vector< TEveVector > &extraRefPoints=std::vector< TEveVector >())
Definition: TrackUtils.cc:69
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
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:640
const Point & position() const
position
Definition: Vertex.h:109
Color_t color() const
static bool validHitFilter(uint16_t pattern)
Definition: HitPattern.h:787
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:646
TEveGeoShape * getEveShape(unsigned int id) const
Definition: FWGeometry.cc:259
T sqrt(T t)
Definition: SSEVec.h:18
double pt() const
track transverse momentum
Definition: TrackBase.h:616
static bool stripHitFilter(uint16_t pattern)
Definition: HitPattern.h:595
T Abs(T a)
Definition: MathUtil.h:49
double z() const
z coordinate
Definition: Vertex.h:115
double f[11][100]
void setName(const std::string &name)
Definition: CSGAction.cc:93
#define end
Definition: vmac.h:37
void pushPixelHits(std::vector< TVector3 > &pixelPoints, const FWEventItem &iItem, const reco::Track &t)
Definition: TrackUtils.cc:582
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:358
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: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:445
#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
#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:663
int charge() const
track electric charge
Definition: TrackBase.h:562
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:515
Definition: memstream.h:15
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:524
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
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:807
trackingRecHit_iterator recHitsEnd() const
Iterator to last hit on the track.
Definition: Track.h:109