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& p_tk0 = track0->hitPattern();
381  int nvalid_tk0=0, ninvalid_tk0=0, npix_tk0=0, nstrip_tk0=0;
382  for(int i_tk0=0; i_tk0<p_tk0.numberOfHits(); i_tk0++) {
383  uint32_t hit = p_tk0.getHitPattern(i_tk0);
384  if(p_tk0.validHitFilter(hit)) {
385  nvalid_tk0++;
386  if (p_tk0.pixelHitFilter(hit)) npix_tk0++;
387  else if (p_tk0.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  const reco::HitPattern& p_mhi_tk0 = track0->trackerExpectedHitsInner();
395  int npix_mhi_tk0=0, nstrip_mhi_tk0=0;
396  for(int i_mhi_tk0=0; i_mhi_tk0<p_mhi_tk0.numberOfHits(); i_mhi_tk0++) {
397  uint32_t hit = p_mhi_tk0.getHitPattern(i_mhi_tk0);
398  if (p_mhi_tk0.pixelHitFilter(hit)) npix_mhi_tk0++;
399  else if (p_mhi_tk0.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  const reco::HitPattern& p_tk1 = track1->hitPattern();
412  int nvalid_tk1=0, ninvalid_tk1=0, npix_tk1=0, nstrip_tk1=0;
413  for(int i_tk1=0; i_tk1<p_tk1.numberOfHits(); i_tk1++) {
414  uint32_t hit = p_tk1.getHitPattern(i_tk1);
415  if(p_tk1.validHitFilter(hit)) {
416  nvalid_tk1++;
417  if (p_tk1.pixelHitFilter(hit)) npix_tk1++;
418  else if (p_tk1.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  const reco::HitPattern& p_mhi_tk1 = track1->trackerExpectedHitsInner();
426  int npix_mhi_tk1=0, nstrip_mhi_tk1=0;
427  for(int i_mhi_tk1=0; i_mhi_tk1<p_mhi_tk1.numberOfHits(); i_mhi_tk1++) {
428  uint32_t hit = p_mhi_tk1.getHitPattern(i_mhi_tk1);
429  if (p_mhi_tk1.pixelHitFilter(hit)) npix_mhi_tk1++;
430  else if (p_mhi_tk1.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( 0 != shape )
558  {
559  shape->SetMainTransparency( 65 );
560  shape->SetPickable( kTRUE );
561  switch(( *recIt )->type())
562  {
564  shape->SetMainColor( iItem->defaultDisplayProperties().color());
565  break;
567  name += "LOST ";
568  shape->SetMainColor( kRed );
569  break;
571  name += "INACTIVE ";
572  shape->SetMainColor( 28 );
573  break;
574  case TrackingRecHit::bad:
575  name += "BAD ";
576  shape->SetMainColor( 218 );
577  break;
578  }
579  shape->SetTitle( name + ULong_t( detid.rawId()));
580  trkList->AddElement( shape );
581  }
582  else
583  {
584  fwLog( fwlog::kInfo ) << "Failed to get shape extract for a tracking rec hit: "
585  << "\n" << fireworks::info( detid ) << std::endl;
586  }
587  }
588  }
589  }
590 }
591 
592 //______________________________________________________________________________
593 void
595 {
596  viewerGL()->PickCameraCenter();
597  viewerGL()->SetDrawCameraCenter(kTRUE);
598 }
599 
600 void
602 {
604  m_camTypeAction->setName(m_orthographic ? "Set Perspective Projection" : "Set Orthographic Projection");
605 
606  (this->*foo) ();
607  //printf("current isOrthographic : %d \n", viewerGL()->CurrentCamera().IsOrthographic());
608 }
609 
610 
611 void
613 {
614  m_moduleLabels->SetRnrChildren(!m_moduleLabels->GetRnrChildren());
615  gEve->Redraw3D();
616 }
617 
618 void
620 {
621  m_modules->SetRnrChildren(!m_modules->GetRnrChildren());
622  gEve->Redraw3D();
623 }
624 
625 void
627 {
628  m_hits->SetRnrChildren(!m_hits->GetRnrChildren());
629  gEve->Redraw3D();
630 }
631 
632 
634 {
636 
637  viewerGL()->SetCurrentCamera(m_orthographic ? TGLViewer::kCameraOrthoXOY : TGLViewer::kCameraPerspXOZ);
638  viewerGL()->ResetCurrentCamera();
639  viewerGL()->RequestDraw();
640 }
641 
643 {
645 
646  viewerGL()->SetCurrentCamera( m_orthographic ? TGLViewer::kCameraOrthoXOZ : TGLViewer::kCameraPerspYOZ);
647  viewerGL()->ResetCurrentCamera();
648  viewerGL()->RequestDraw();
649 
650 }
651 
653 {
655 
656  viewerGL()->SetCurrentCamera(m_orthographic ? TGLViewer::kCameraOrthoZOY : TGLViewer::kCameraPerspXOY);
657  viewerGL()->ResetCurrentCamera();
658  viewerGL()->RequestDraw();
659 
660 }
661 
662 
const reco::Vertex & conversionVertex() const
returns the reco conversion vertex
Definition: Conversion.h:97
const std::string & getName() const
Definition: CSGAction.cc:81
void addModules(const reco::Track &track, const FWEventItem *iItem, TEveElement *trkList, bool addLostHits)
type
Definition: HCALResponse.h:21
int i
Definition: DBlmapReader.cc:9
const FWDisplayProperties & defaultDisplayProperties() const
Definition: FWEventItem.cc:451
double x0() const
Definition: FWBeamSpot.cc:30
const TrackExtraRef & extra() const
reference to &quot;extra&quot; object
Definition: Track.h:97
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: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:137
bool isAvailable() const
Definition: Ref.h:276
T eta() const
const Point & position() const
position
Definition: Vertex.h:106
float float float z
Color_t color() const
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:139
TEveGeoShape * getEveShape(unsigned int id) const
Definition: FWGeometry.cc:250
T sqrt(T t)
Definition: SSEVec.h:48
double pt() const
track transverse momentum
Definition: TrackBase.h:129
static bool pixelHitFilter(uint32_t pattern)
Definition: HitPattern.h:419
int numberOfHits() const
Definition: HitPattern.cc:211
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
const HitPattern & trackerExpectedHitsInner() const
Access the hit pattern counting (in the Tracker) the number of expected crossed layers before the fir...
Definition: TrackBase.h:223
static bool validHitFilter(uint32_t pattern)
Definition: HitPattern.h:564
#define end
Definition: vmac.h:37
void pushPixelHits(std::vector< TVector3 > &pixelPoints, const FWEventItem &iItem, const reco::Track &t)
Definition: TrackUtils.cc:599
trackingRecHit_iterator recHitsBegin() const
Iterator to first hit on the track.
Definition: Track.h:63
const HitPattern & hitPattern() const
Access the hit pattern, indicating in which Tracker layers the track has hits.
Definition: TrackBase.h:221
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:381
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
#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
#define REGISTER_FWDETAILVIEW(_classname_, _name_)
std::string info(const DetId &)
Definition: TrackUtils.cc:680
static bool stripHitFilter(uint32_t pattern)
Definition: HitPattern.h:441
int charge() const
track electric charge
Definition: TrackBase.h:111
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
Detector det() const
get the detector field from this detid
Definition: DetId.h:35
uint32_t getHitPattern(int position) const
Definition: HitPattern.cc:142
void pushNearbyPixelHits(std::vector< TVector3 > &pixelPoints, const FWEventItem &iItem, const reco::Track &t)
Definition: TrackUtils.cc:543
tuple size
Write out results.
const FWGeometry * getGeom() const
Definition: FWEventItem.cc:681
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
trackingRecHit_iterator recHitsEnd() const
Iterator to last hit on the track.
Definition: Track.h:65
Definition: DDAxes.h:10