CMS 3D CMS Logo

List of all members | Public Member Functions | Private Member Functions | Private Attributes
FWConvTrackHitsDetailView Class Reference

#include <FWConvTrackHitsDetailView.h>

Inheritance diagram for FWConvTrackHitsDetailView:
FWDetailViewGL< reco::Conversion > CSGActionSupervisor FWDetailView< reco::Conversion > FWDetailViewBase

Public Member Functions

void camera1Callback ()
 
void camera2Callback ()
 
void camera3Callback ()
 
 FWConvTrackHitsDetailView ()
 
void pickCameraCenter ()
 
void rnrHits ()
 
void rnrLabels ()
 
void rnrModules ()
 
void switchProjection ()
 
 ~FWConvTrackHitsDetailView () override
 
- Public Member Functions inherited from FWDetailViewGL< reco::Conversion >
 FWDetailViewGL ()
 
void init (TEveWindowSlot *) override
 
void setBackgroundColor (Color_t) override
 
TGLViewer * viewerGL () const
 
 ~FWDetailViewGL () override
 
- Public Member Functions inherited from FWDetailView< reco::Conversion >
void build (const FWModelId &iID, const void *iData) override
 
 FWDetailView ()
 
- Public Member Functions inherited from FWDetailViewBase
void build (const FWModelId &)
 
const fireworks::Contextcontext () const
 
const FWEventItemitem ()
 
void setItem (const FWEventItem *x)
 
virtual ~FWDetailViewBase ()
 
- Public Member Functions inherited from CSGActionSupervisor
Bool_t activateMenuEntry (int entry)
 
Bool_t activateToolBarEntry (int entry)
 
void addToActionMap (CSGAction *action)
 
 CSGActionSupervisor ()
 
virtual void defaultAction ()
 
virtual void enableActions (bool enable=true)
 
CSGActiongetAction (const std::string &name)
 
const std::vector< CSGAction * > & getListOfActions () const
 
Long_t getToolTipDelay () const
 
virtual void HandleMenu (Int_t id)
 
void resizeMenu (TGPopupMenu *menu)
 
virtual ~CSGActionSupervisor ()
 

Private Member Functions

void addHits (const reco::Track &track, const FWEventItem *iItem, TEveElement *trkList, bool addNearbyHits)
 
void addModules (const reco::Track &track, const FWEventItem *iItem, TEveElement *trkList, bool addLostHits)
 
void addTrackerHits3D (std::vector< TVector3 > &points, class TEveElementList *tList, Color_t color, int size)
 
void build (const FWModelId &id, const reco::Conversion *) override
 
 FWConvTrackHitsDetailView (const FWConvTrackHitsDetailView &)=delete
 
const FWConvTrackHitsDetailViewoperator= (const FWConvTrackHitsDetailView &)=delete
 
void setTextInfo (const FWModelId &id, const reco::Conversion *) override
 

Private Attributes

TEveElement * m_calo3D
 
CSGActionm_camTypeAction
 
TEveElementList * m_hits
 
TLegend * m_legend
 
TEveElementList * m_moduleLabels
 
TEveElementList * m_modules
 
bool m_orthographic
 

Additional Inherited Members

- Static Public Member Functions inherited from FWDetailView< reco::Conversion >
static std::string classRegisterTypeName ()
 
static std::string classTypeName ()
 
- Static Public Member Functions inherited from FWDetailViewBase
static void drawCanvasBox (Double_t *pos, Color_t fillCol, Int_t fillType=0, bool bg=kTRUE)
 
static void drawCanvasDot (Float_t x, Float_t y, Float_t r, Color_t)
 
- Protected Member Functions inherited from FWDetailViewBase
 FWDetailViewBase (const std::type_info &)
 
- Protected Attributes inherited from FWDetailViewGL< reco::Conversion >
TEveScene * m_eveScene
 
TEveViewer * m_eveViewer
 
TGCompositeFrame * m_guiFrame
 
TCanvas * m_infoCanvas
 
- Protected Attributes inherited from CSGActionSupervisor
std::vector< CSGAction * > m_actionList
 

Detailed Description

Definition at line 23 of file FWConvTrackHitsDetailView.h.

Constructor & Destructor Documentation

FWConvTrackHitsDetailView::FWConvTrackHitsDetailView ( )

Definition at line 47 of file FWConvTrackHitsDetailView.cc.

47  :
48  m_modules(nullptr),
49  m_moduleLabels(nullptr),
50  m_hits(nullptr),
51  m_legend(nullptr),
52  m_orthographic(false)
53 {
54 }
FWConvTrackHitsDetailView::~FWConvTrackHitsDetailView ( )
override

Definition at line 56 of file FWConvTrackHitsDetailView.cc.

References findQualityFiles::v.

57 {
58 }
FWConvTrackHitsDetailView::FWConvTrackHitsDetailView ( const FWConvTrackHitsDetailView )
privatedelete

Member Function Documentation

void FWConvTrackHitsDetailView::addHits ( const reco::Track track,
const FWEventItem iItem,
TEveElement *  trkList,
bool  addNearbyHits 
)
private

Definition at line 458 of file FWConvTrackHitsDetailView.cc.

References fireworks::addSiStripClusters(), addTrackerHits3D(), FWDisplayProperties::color(), FWEventItem::defaultDisplayProperties(), fireworks::pushNearbyPixelHits(), fireworks::pushPixelHits(), and RecoTauPiZeroBuilderPlugins_cfi::strips.

Referenced by build().

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 }
const FWDisplayProperties & defaultDisplayProperties() const
Definition: FWEventItem.cc:456
Color_t color() const
void pushPixelHits(std::vector< TVector3 > &pixelPoints, const FWEventItem &iItem, const reco::Track &t)
Definition: TrackUtils.cc:594
void addSiStripClusters(const FWEventItem *iItem, const reco::Track &t, class TEveElement *tList, bool addNearbyClusters, bool master)
Definition: TrackUtils.cc:368
void addTrackerHits3D(std::vector< TVector3 > &points, class TEveElementList *tList, Color_t color, int size)
void pushNearbyPixelHits(std::vector< TVector3 > &pixelPoints, const FWEventItem &iItem, const reco::Track &t)
Definition: TrackUtils.cc:535
void FWConvTrackHitsDetailView::addModules ( const reco::Track track,
const FWEventItem iItem,
TEveElement *  trkList,
bool  addLostHits 
)
private

Definition at line 492 of file FWConvTrackHitsDetailView.cc.

References TrackingRecHit::bad, FWDisplayProperties::color(), MuonSubdetId::CSC, FWEventItem::defaultDisplayProperties(), DetId::det(), MuonSubdetId::DT, fwLog, FWGeometry::getEveShape(), FWEventItem::getGeom(), TrackingRecHit::inactive, TrackingRecHit::inactive_inner, TrackingRecHit::inactive_outer, fireworks::info(), fwlog::kInfo, TrackingRecHit::missing, TrackingRecHit::missing_inner, TrackingRecHit::missing_outer, DetId::Muon, dataset::name, PixelSubdetector::PixelBarrel, PixelSubdetector::PixelEndcap, DetId::rawId(), reco::Track::recHitsBegin(), reco::Track::recHitsEnd(), MuonSubdetId::RPC, edm::second(), DetId::subdetId(), SiStripDetId::TEC, SiStripDetId::TIB, SiStripDetId::TID, SiStripDetId::TOB, DetId::Tracker, and TrackingRecHit::valid.

Referenced by build().

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 }
const FWDisplayProperties & defaultDisplayProperties() const
Definition: FWEventItem.cc:456
constexpr uint32_t rawId() const
get the raw id
Definition: DetId.h:50
Color_t color() const
U second(std::pair< T, U > const &p)
TEveGeoShape * getEveShape(unsigned int id) const
Definition: FWGeometry.cc:298
constexpr int subdetId() const
get the contents of the subdetector field (not cast into any detector&#39;s numbering enum) ...
Definition: DetId.h:41
trackingRecHit_iterator recHitsBegin() const
Iterator to first hit on the track.
Definition: Track.h:109
Definition: DetId.h:18
#define fwLog(_level_)
Definition: fwLog.h:50
static constexpr int RPC
Definition: MuonSubdetId.h:14
std::string info(const DetId &)
Definition: TrackUtils.cc:675
static constexpr int DT
Definition: MuonSubdetId.h:12
static constexpr int CSC
Definition: MuonSubdetId.h:13
const FWGeometry * getGeom() const
Definition: FWEventItem.cc:686
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:114
void FWConvTrackHitsDetailView::addTrackerHits3D ( std::vector< TVector3 > &  points,
class TEveElementList *  tList,
Color_t  color,
int  size 
)
private

Definition at line 439 of file FWConvTrackHitsDetailView.cc.

Referenced by addHits().

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 }
size
Write out results.
void FWConvTrackHitsDetailView::build ( const FWModelId id,
const reco::Conversion conv 
)
overrideprivatevirtual

Implements FWDetailView< reco::Conversion >.

Definition at line 92 of file FWConvTrackHitsDetailView.cc.

References Abs(), writedatasetfile::action, CSGAction::activated, addHits(), addModules(), b, FWECALCaloDataDetailViewBuilder::buildCaloData(), EnergyCorrector::c, camera1Callback(), camera2Callback(), camera3Callback(), MessageLogger_cfi::cerr, create_public_lumi_plots::color, FWDetailViewBase::context(), CSGAction::createTextButton(), data, end, PVValHelper::eta, reco::Track::extra(), f, fireworks::Context::getBeamSpot(), CaloRecHitAuxSetter::getField(), CSGAction::getName(), mps_fire::i, edm::Ref< C, T, F >::isAvailable(), FWDetailViewBase::item(), m_camTypeAction, FWDetailViewGL< reco::Conversion >::m_eveScene, FWDetailViewGL< reco::Conversion >::m_guiFrame, m_hits, m_moduleLabels, m_modules, dataset::name, reco::Conversion::nTracks(), AlCaHLTBitMon_ParallelJobs::p, reco::Conversion::pairMomentum(), phi, fireworks::prepareTrack(), alignCSCRings::r, rnrHits(), rnrModules(), setTextInfo(), Sign(), switchProjection(), RecoTauValidation_cfi::text, theta(), reco::Conversion::tracks(), up, FWDetailViewGL< reco::Conversion >::viewerGL(), x, FWBeamSpot::x0(), y, FWBeamSpot::y0(), z, and FWBeamSpot::z0().

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 }
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:575
double x0() const
Definition: FWBeamSpot.cc:30
const TrackExtraRef & extra() const
reference to "extra" object
Definition: Track.h:194
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
double z0() const
Definition: FWBeamSpot.cc:40
double y0() const
Definition: FWBeamSpot.cc:35
const FWEventItem * item()
sigc::signal< void > activated
Definition: CSGAction.h:88
Geom::Theta< T > theta() const
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
const fireworks::Context & context() const
T Abs(T a)
Definition: MathUtil.h:49
constexpr unsigned getField(const uint32_t u, const unsigned mask, const unsigned offset)
double f[11][100]
#define end
Definition: vmac.h:39
void addHits(const reco::Track &track, const FWEventItem *iItem, TEveElement *trkList, bool addNearbyHits)
unsigned int nTracks() const
Number of tracks= 0,1,2.
Definition: Conversion.h:102
math::XYZVectorF pairMomentum() const
Conversion tracks momentum from the tracks inner momentum.
Definition: Conversion.cc:223
double b
Definition: hdecay.h:120
char data[epos_bytes_allocation]
Definition: EPOS_Wrapper.h:82
Definition: AbsArchive.cc:45
Definition: memstream.h:15
std::vector< edm::RefToBase< reco::Track > > const & tracks() const
vector of track to base references
Definition: Conversion.cc:176
void FWConvTrackHitsDetailView::camera1Callback ( )

Definition at line 637 of file FWConvTrackHitsDetailView.cc.

References m_orthographic, and FWDetailViewGL< reco::Conversion >::viewerGL().

Referenced by build().

638 {
640 
641  viewerGL()->SetCurrentCamera(m_orthographic ? TGLViewer::kCameraOrthoXOY : TGLViewer::kCameraPerspXOZ);
642  viewerGL()->ResetCurrentCamera();
643  viewerGL()->RequestDraw();
644 }
void FWConvTrackHitsDetailView::camera2Callback ( )

Definition at line 646 of file FWConvTrackHitsDetailView.cc.

References m_orthographic, and FWDetailViewGL< reco::Conversion >::viewerGL().

Referenced by build().

647 {
649 
650  viewerGL()->SetCurrentCamera( m_orthographic ? TGLViewer::kCameraOrthoXOZ : TGLViewer::kCameraPerspYOZ);
651  viewerGL()->ResetCurrentCamera();
652  viewerGL()->RequestDraw();
653 
654 }
void FWConvTrackHitsDetailView::camera3Callback ( )

Definition at line 656 of file FWConvTrackHitsDetailView.cc.

References m_orthographic, REGISTER_FWDETAILVIEW, and FWDetailViewGL< reco::Conversion >::viewerGL().

Referenced by build().

657 {
659 
660  viewerGL()->SetCurrentCamera(m_orthographic ? TGLViewer::kCameraOrthoZOY : TGLViewer::kCameraPerspXOY);
661  viewerGL()->ResetCurrentCamera();
662  viewerGL()->RequestDraw();
663 
664 }
const FWConvTrackHitsDetailView& FWConvTrackHitsDetailView::operator= ( const FWConvTrackHitsDetailView )
privatedelete
void FWConvTrackHitsDetailView::pickCameraCenter ( )

Definition at line 598 of file FWConvTrackHitsDetailView.cc.

References FWDetailViewGL< reco::Conversion >::viewerGL().

599 {
600  viewerGL()->PickCameraCenter();
601  viewerGL()->SetDrawCameraCenter(kTRUE);
602 }
void FWConvTrackHitsDetailView::rnrHits ( )

Definition at line 630 of file FWConvTrackHitsDetailView.cc.

References m_hits.

Referenced by build().

631 {
632  m_hits->SetRnrChildren(!m_hits->GetRnrChildren());
633  gEve->Redraw3D();
634 }
void FWConvTrackHitsDetailView::rnrLabels ( )

Definition at line 616 of file FWConvTrackHitsDetailView.cc.

References m_moduleLabels.

617 {
618  m_moduleLabels->SetRnrChildren(!m_moduleLabels->GetRnrChildren());
619  gEve->Redraw3D();
620 }
void FWConvTrackHitsDetailView::rnrModules ( )

Definition at line 623 of file FWConvTrackHitsDetailView.cc.

References m_modules.

Referenced by build().

624 {
625  m_modules->SetRnrChildren(!m_modules->GetRnrChildren());
626  gEve->Redraw3D();
627 }
void FWConvTrackHitsDetailView::setTextInfo ( const FWModelId id,
const reco::Conversion conv 
)
overrideprivatevirtual

Implements FWDetailView< reco::Conversion >.

Definition at line 337 of file FWConvTrackHitsDetailView.cc.

References reco::TrackBase::charge(), reco::Conversion::conversionVertex(), reco::Conversion::distOfMinimumApproach(), reco::Conversion::dPhiTracksAtVtx(), reco::TrackBase::eta(), reco::HitPattern::getHitPattern(), reco::TrackBase::hitPattern(), FWDetailViewBase::item(), FWDetailViewGL< reco::Conversion >::m_infoCanvas, reco::HitPattern::MISSING_INNER_HITS, ecalBarrelClusterFastTimer_cfi::modelName, reco::HitPattern::numberOfAllHits(), reco::Conversion::pairCotThetaSeparation(), reco::Conversion::pairMomentum(), reco::TrackBase::phi(), reco::HitPattern::pixelHitFilter(), reco::Vertex::position(), reco::TrackBase::pt(), mathSSE::sqrt(), reco::HitPattern::stripHitFilter(), reco::HitPattern::TRACK_HITS, reco::Conversion::tracks(), reco::HitPattern::validHitFilter(), x, reco::Vertex::x(), y, reco::Vertex::y(), and reco::Vertex::z().

Referenced by build().

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 }
const reco::Vertex & conversionVertex() const
returns the reco conversion vertex
Definition: Conversion.h:98
static bool pixelHitFilter(uint16_t pattern)
Definition: HitPattern.h:602
double y() const
y coordinate
Definition: Vertex.h:113
const FWEventItem * item()
double distOfMinimumApproach() const
Definition: Conversion.h:126
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:684
const Point & position() const
position
Definition: Vertex.h:109
static bool validHitFilter(uint16_t pattern)
Definition: HitPattern.h:855
double eta() const
pseudorapidity of momentum vector
Definition: TrackBase.h:690
T sqrt(T t)
Definition: SSEVec.h:18
double pt() const
track transverse momentum
Definition: TrackBase.h:660
static bool stripHitFilter(uint16_t pattern)
Definition: HitPattern.h:633
int numberOfAllHits(HitCategory category) const
Definition: HitPattern.h:875
double z() const
z coordinate
Definition: Vertex.h:115
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:485
int charge() const
track electric charge
Definition: TrackBase.h:606
uint16_t getHitPattern(HitCategory category, int position) const
Definition: HitPattern.h:553
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
void FWConvTrackHitsDetailView::switchProjection ( )

Definition at line 605 of file FWConvTrackHitsDetailView.cc.

References m_camTypeAction, m_orthographic, and CSGAction::setName().

Referenced by build().

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 }
void setName(const std::string &name)
Definition: CSGAction.cc:93

Member Data Documentation

TEveElement* FWConvTrackHitsDetailView::m_calo3D
private

Definition at line 71 of file FWConvTrackHitsDetailView.h.

CSGAction* FWConvTrackHitsDetailView::m_camTypeAction
private

Definition at line 75 of file FWConvTrackHitsDetailView.h.

Referenced by build(), and switchProjection().

TEveElementList* FWConvTrackHitsDetailView::m_hits
private

Definition at line 70 of file FWConvTrackHitsDetailView.h.

Referenced by build(), and rnrHits().

TLegend* FWConvTrackHitsDetailView::m_legend
private

Definition at line 73 of file FWConvTrackHitsDetailView.h.

TEveElementList* FWConvTrackHitsDetailView::m_moduleLabels
private

Definition at line 69 of file FWConvTrackHitsDetailView.h.

Referenced by build(), and rnrLabels().

TEveElementList* FWConvTrackHitsDetailView::m_modules
private

Definition at line 68 of file FWConvTrackHitsDetailView.h.

Referenced by build(), and rnrModules().

bool FWConvTrackHitsDetailView::m_orthographic
private