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 ()
 
 FWConvTrackHitsDetailView (const FWConvTrackHitsDetailView &)=delete
 
const FWConvTrackHitsDetailViewoperator= (const FWConvTrackHitsDetailView &)=delete
 
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
 
 FWDetailViewBase (const FWDetailViewBase &)=delete
 
const FWEventItemitem ()
 
const FWDetailViewBaseoperator= (const FWDetailViewBase &)=delete
 
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 ()
 
 CSGActionSupervisor (const CSGActionSupervisor &)=delete
 
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)
 
const CSGActionSupervisoroperator= (const CSGActionSupervisor &)=delete
 
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
 
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() [1/2]

FWConvTrackHitsDetailView::FWConvTrackHitsDetailView ( )

◆ ~FWConvTrackHitsDetailView()

FWConvTrackHitsDetailView::~FWConvTrackHitsDetailView ( )
override

Definition at line 50 of file FWConvTrackHitsDetailView.cc.

50 {}

◆ FWConvTrackHitsDetailView() [2/2]

FWConvTrackHitsDetailView::FWConvTrackHitsDetailView ( const FWConvTrackHitsDetailView )
delete

Member Function Documentation

◆ addHits()

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

Definition at line 448 of file FWConvTrackHitsDetailView.cc.

References fireworks::addSiStripClusters(), addTrackerHits3D(), FWDisplayProperties::color(), FWEventItem::defaultDisplayProperties(), Hcal_Conditions_forGlobalTag_cff::pixels, fireworks::pushNearbyPixelHits(), fireworks::pushPixelHits(), DigiDM_cff::strips, and HLT_2024v14_cff::track.

Referenced by build().

451  {
452  std::vector<TVector3> pixelPoints;
453  fireworks::pushPixelHits(pixelPoints, *iItem, track);
454  TEveElementList* pixels = new TEveElementList("Pixels");
455  trkList->AddElement(pixels);
456  if (addNearbyHits) {
457  // get the extra hits
458  std::vector<TVector3> pixelExtraPoints;
459  fireworks::pushNearbyPixelHits(pixelExtraPoints, *iItem, track);
460  // draw first the others
461  addTrackerHits3D(pixelExtraPoints, pixels, kRed, 1);
462  // then the good ones, so they're on top
463  addTrackerHits3D(pixelPoints, pixels, kGreen, 1);
464  } else {
465  // just add those points with the default color
466  addTrackerHits3D(pixelPoints, pixels, iItem->defaultDisplayProperties().color(), 1);
467  }
468 
469  // strips
470  TEveElementList* strips = new TEveElementList("Strips");
471  trkList->AddElement(strips);
472  fireworks::addSiStripClusters(iItem, track, strips, addNearbyHits, false);
473 }
const FWDisplayProperties & defaultDisplayProperties() const
Definition: FWEventItem.cc:403
void pushPixelHits(std::vector< TVector3 > &pixelPoints, const FWEventItem &iItem, const reco::Track &t)
Definition: TrackUtils.cc:533
void addSiStripClusters(const FWEventItem *iItem, const reco::Track &t, class TEveElement *tList, bool addNearbyClusters, bool master)
Definition: TrackUtils.cc:336
strips
#turn off noise in all subdetectors simHcalUnsuppressedDigis.doNoise = False mix.digitizers.hcal.doNoise = False simEcalUnsuppressedDigis.doNoise = False mix.digitizers.ecal.doNoise = False simEcalUnsuppressedDigis.doESNoise = False simSiPixelDigis.AddNoise = False mix.digitizers.pixel.AddNoise = False simSiStripDigis.Noise = False mix.digitizers.strip.AddNoise = False
Definition: DigiDM_cff.py:32
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:480

◆ addModules()

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

Definition at line 477 of file FWConvTrackHitsDetailView.cc.

References TrackingRecHit::bad, FWDisplayProperties::color(), MuonSubdetId::CSC, FWEventItem::defaultDisplayProperties(), ALCARECOPPSCalTrackBasedSel_cff::detid, 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, mergeVDriftHistosByStation::name, PixelSubdetector::PixelBarrel, PixelSubdetector::PixelEndcap, MuonSubdetId::RPC, edm::second(), l1trig_cff::shape, SiStripDetId::TEC, SiStripDetId::TIB, SiStripDetId::TID, SiStripDetId::TOB, HLT_2024v14_cff::track, DetId::Tracker, and TrackingRecHit::valid.

Referenced by build().

480  {
481  std::set<unsigned int> ids;
482  for (trackingRecHit_iterator recIt = track.recHitsBegin(), recItEnd = track.recHitsEnd(); recIt != recItEnd;
483  ++recIt) {
484  DetId detid = (*recIt)->geographicalId();
485  if (!addLostHits && !(*recIt)->isValid())
486  continue;
487  if (detid.rawId() != 0) {
488  TString name("");
489  switch (detid.det()) {
490  case DetId::Tracker:
491  switch (detid.subdetId()) {
492  case SiStripDetId::TIB:
493  name = "TIB ";
494  break;
495  case SiStripDetId::TOB:
496  name = "TOB ";
497  break;
498  case SiStripDetId::TID:
499  name = "TID ";
500  break;
501  case SiStripDetId::TEC:
502  name = "TEC ";
503  break;
505  name = "Pixel Barrel ";
506  break;
508  name = "Pixel Endcap ";
509  default:
510  break;
511  }
512  break;
513 
514  case DetId::Muon:
515  switch (detid.subdetId()) {
516  case MuonSubdetId::DT:
517  name = "DT";
518  detid = DetId(DTChamberId(detid)); // get rid of layer bits
519  break;
520  case MuonSubdetId::CSC:
521  name = "CSC";
522  break;
523  case MuonSubdetId::RPC:
524  name = "RPC";
525  break;
526  default:
527  break;
528  }
529  break;
530  default:
531  break;
532  }
533  if (!ids.insert(detid.rawId()).second)
534  continue;
535  if (iItem->getGeom()) {
536  TEveGeoShape* shape = iItem->getGeom()->getEveShape(detid);
537  if (nullptr != shape) {
538  shape->SetMainTransparency(65);
539  shape->SetPickable(kTRUE);
540  switch ((*recIt)->type()) {
542  shape->SetMainColor(iItem->defaultDisplayProperties().color());
543  break;
547  name += "LOST ";
548  shape->SetMainColor(kRed);
549  break;
553  name += "INACTIVE ";
554  shape->SetMainColor(28);
555  break;
556  case TrackingRecHit::bad:
557  name += "BAD ";
558  shape->SetMainColor(218);
559  break;
560  }
561  shape->SetTitle(name + ULong_t(detid.rawId()));
562  trkList->AddElement(shape);
563  } else {
564  fwLog(fwlog::kInfo) << "Failed to get shape extract for a tracking rec hit: "
565  << "\n"
566  << fireworks::info(detid) << std::endl;
567  }
568  }
569  }
570  }
571 }
static constexpr auto TID
Definition: SiStripDetId.h:39
U second(std::pair< T, U > const &p)
const FWDisplayProperties & defaultDisplayProperties() const
Definition: FWEventItem.cc:403
static constexpr auto TOB
Definition: SiStripDetId.h:40
Definition: DetId.h:17
TEveGeoShape * getEveShape(unsigned int id) const
Definition: FWGeometry.cc:317
const FWGeometry * getGeom() const
Definition: FWEventItem.cc:548
#define fwLog(_level_)
Definition: fwLog.h:45
static constexpr int RPC
Definition: MuonSubdetId.h:13
static constexpr auto TIB
Definition: SiStripDetId.h:38
std::string info(const DetId &)
Definition: TrackUtils.cc:599
static constexpr int DT
Definition: MuonSubdetId.h:11
static constexpr int CSC
Definition: MuonSubdetId.h:12
static constexpr auto TEC
Definition: SiStripDetId.h:41

◆ addTrackerHits3D()

void FWConvTrackHitsDetailView::addTrackerHits3D ( std::vector< TVector3 > &  points,
class TEveElementList *  tList,
Color_t  color,
int  size 
)
private

Definition at line 428 of file FWConvTrackHitsDetailView.cc.

References ALPAKA_ACCELERATOR_NAMESPACE::vertexFinder::it, and findQualityFiles::size.

Referenced by addHits().

431  {
432  // !AMT this is detail view specific, should move to track hits
433  // detail view
434 
435  TEvePointSet* pointSet = new TEvePointSet();
436  pointSet->SetMarkerSize(size);
437  pointSet->SetMarkerStyle(4);
438  pointSet->SetPickable(kTRUE);
439  pointSet->SetTitle("Pixel Hits");
440  pointSet->SetMarkerColor(color);
441 
442  for (std::vector<TVector3>::const_iterator it = points.begin(), itEnd = points.end(); it != itEnd; ++it) {
443  pointSet->SetNextPoint(it->x(), it->y(), it->z());
444  }
445  tList->AddElement(pointSet);
446 }
size
Write out results.

◆ build()

void FWConvTrackHitsDetailView::build ( const FWModelId id,
const reco::Conversion conv 
)
overrideprivatevirtual

Implements FWDetailView< reco::Conversion >.

Definition at line 83 of file FWConvTrackHitsDetailView.cc.

References writedatasetfile::action, CSGAction::activated, addHits(), addModules(), b, cms::cuda::bs, FWECALCaloDataDetailViewBuilder::buildCaloData(), DummyCfis::c, camera1Callback(), camera2Callback(), camera3Callback(), DMR_cfg::cerr, FWDetailViewBase::context(), conv, CSGAction::createTextButton(), data, mps_fire::end, PVValHelper::eta, reco::Track::extra(), f, custom_jme_cff::foo, fireworks::Context::getBeamSpot(), CaloRecHitAuxSetter::getField(), 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, mergeVDriftHistosByStation::name, AlCaHLTBitMon_ParallelJobs::p, phi, fireworks::prepareTrack(), alignCSCRings::r, rnrHits(), rnrModules(), setTextInfo(), switchProjection(), submitPVValidationJobs::text, tauSpinnerTable_cfi::theta, up, FWDetailViewGL< reco::Conversion >::viewerGL(), x, y, and z.

83  {
84  if (conv->nTracks() < 2)
85  return;
86  const reco::Track* track0 = conv->tracks().at(0).get();
87  const reco::Track* track1 = conv->tracks().at(1).get();
88 
89  m_guiFrame->AddFrame(new TGLabel(m_guiFrame, "Camera Views:"), new TGLayoutHints(kLHintsLeft, 2, 2, 2, 2));
90 
91  {
92  TGHorizontalFrame* f = new TGHorizontalFrame(m_guiFrame);
93  m_guiFrame->AddFrame(f, new TGLayoutHints(kLHintsExpandX, 2, 0, 0, 0));
94  {
95  CSGAction* action = new CSGAction(this, "Top");
96  TGTextButton* b = new TGTextButton(f, action->getName().c_str());
97  f->AddFrame(b, new TGLayoutHints(kLHintsExpandX));
98  TQObject::Connect(b, "Clicked()", "CSGAction", action, "activate()");
99  b->SetToolTipText("plane normal: track0 x track1");
100  action->activated.connect(sigc::mem_fun(*this, &FWConvTrackHitsDetailView::camera1Callback));
101  }
102 
103  {
104  CSGAction* action = new CSGAction(this, "Side");
105  TGTextButton* b = new TGTextButton(f, action->getName().c_str());
106  f->AddFrame(b, new TGLayoutHints(kLHintsExpandX));
107  TQObject::Connect(b, "Clicked()", "CSGAction", action, "activate()");
108  b->SetToolTipText("left fir: track1");
109  action->activated.connect(sigc::mem_fun(*this, &FWConvTrackHitsDetailView::camera2Callback));
110  }
111  {
112  CSGAction* action = new CSGAction(this, "Front");
113  TGTextButton* b = new TGTextButton(f, action->getName().c_str());
114  f->AddFrame(b, new TGLayoutHints(kLHintsExpandX));
115  TQObject::Connect(b, "Clicked()", "CSGAction", action, "activate()");
116  action->activated.connect(sigc::mem_fun(*this, &FWConvTrackHitsDetailView::camera3Callback));
117  b->SetToolTipText("plane normal: track1 ");
118  }
119  }
120 
121  {
122  m_camTypeAction = new CSGAction(this, " Set Ortographic Projection ");
123  m_camTypeAction->createTextButton(m_guiFrame, new TGLayoutHints(kLHintsExpandX, 2, 0, 1, 4));
125  }
126  {
127  CSGAction* action = new CSGAction(this, "Draw Module");
128  TGCheckButton* b = new TGCheckButton(m_guiFrame, action->getName().c_str());
129  b->SetState(kButtonDown, false);
130  m_guiFrame->AddFrame(b, new TGLayoutHints(kLHintsNormal, 2, 3, 1, 4));
131  TQObject::Connect(b, "Clicked()", "CSGAction", action, "activate()");
132  action->activated.connect(sigc::mem_fun(*this, &FWConvTrackHitsDetailView::rnrModules));
133  }
134  {
135  CSGAction* action = new CSGAction(this, "Draw Hits");
136  TGCheckButton* b = new TGCheckButton(m_guiFrame, action->getName().c_str());
137  b->SetState(kButtonDown, false);
138  m_guiFrame->AddFrame(b, new TGLayoutHints(kLHintsNormal, 2, 3, 1, 4));
139  TQObject::Connect(b, "Clicked()", "CSGAction", action, "activate()");
140  action->activated.connect(sigc::mem_fun(*this, &FWConvTrackHitsDetailView::rnrHits));
141  }
142 
143  TGCompositeFrame* p = (TGCompositeFrame*)m_guiFrame->GetParent();
144  p->MapSubwindows();
145  p->Layout();
146 
147  m_modules = new TEveElementList("Modules");
148  m_eveScene->AddElement(m_modules);
149  m_moduleLabels = new TEveElementList("Modules");
150  m_eveScene->AddElement(m_moduleLabels);
151  m_hits = new TEveElementList("Hits");
152  m_eveScene->AddElement(m_hits);
153  if (track1->extra().isAvailable()) {
154  addModules(*track1, id.item(), m_modules, true);
155  addHits(*track1, id.item(), m_hits, true);
156  }
157  if (track0->extra().isAvailable()) {
158  addModules(*track0, id.item(), m_modules, true);
159  addHits(*track0, id.item(), m_hits, true);
160  }
161  for (TEveElement::List_i i = m_modules->BeginChildren(), end = m_modules->EndChildren(); i != end; ++i) {
162  TEveGeoShape* gs = dynamic_cast<TEveGeoShape*>(*i);
163  const auto& rhs = *(*(i));
164  if (gs == nullptr && (*i != nullptr)) {
165  std::cerr << "Got a " << typeid(rhs).name() << ", expecting TEveGeoShape. ignoring (it must be the clusters)."
166  << std::endl;
167  continue;
168  }
169  // gs->SetMainTransparency(75);
170  // gs->SetPickable(kFALSE);
171 
172  TString name = gs->GetElementTitle();
173  if (!name.Contains("BAD") && !name.Contains("INACTIVE") && !name.Contains("LOST")) {
174  gs->SetMainColor(kBlue);
175  }
176  TEveText* text = new TEveText(name.Data());
177  text->PtrMainTrans()->SetFrom(gs->RefMainTrans().Array());
178  text->SetFontMode(TGLFont::kPixmap);
179  text->SetFontSize(12);
180  m_moduleLabels->AddElement(text);
181  }
182  m_moduleLabels->SetRnrChildren(false);
183 
184  TEveTrackPropagator* prop = new TEveTrackPropagator();
185  prop->SetMagFieldObj(item()->context().getField(), false);
186  prop->SetStepper(TEveTrackPropagator::kRungeKutta);
187  prop->SetMaxR(123);
188  prop->SetMaxZ(300);
189  prop->SetMaxStep(1);
190  prop->SetRnrDaughters(kTRUE);
191  prop->SetRnrReferences(kTRUE);
192  prop->SetRnrDecay(kTRUE);
193 
194  // first-vertex style
195  prop->SetRnrFV(kTRUE);
196  prop->RefFVAtt().SetMarkerColor(id.item()->defaultDisplayProperties().color());
197  prop->RefFVAtt().SetMarkerSize(0.8);
198 
199  // path-mark style
200  prop->RefPMAtt().SetMarkerSize(0.5);
201  prop->RefPMAtt().SetMarkerColor(id.item()->defaultDisplayProperties().color());
202 
203  TEveTrack* trk1 = fireworks::prepareTrack(*track1, prop);
204  trk1->MakeTrack();
205  trk1->SetLineWidth(2);
206  trk1->SetTitle("Track 1 and its ref states");
207  trk1->SetMainColor(id.item()->defaultDisplayProperties().color());
208  trk1->SetLineStyle(7);
209  m_eveScene->AddElement(trk1);
210 
211  TEveTrack* trk0 = fireworks::prepareTrack(*track0, prop);
212  trk0->MakeTrack();
213  trk0->SetLineWidth(2);
214  trk0->SetTitle("Track 0 and its ref states");
215  trk0->SetMainColor(id.item()->defaultDisplayProperties().color());
216  m_eveScene->AddElement(trk0);
217 
218  // create TEveCalo3D object, fix bounding box
219  {
220  float phi = conv->pairMomentum().phi();
221  float eta = conv->pairMomentum().eta();
222 
223  FWECALCaloDataDetailViewBuilder caloBld(id.item()->getEvent(), id.item()->getGeom(), eta, phi, 30);
224  TEveCaloData* data = caloBld.buildCaloData(false);
225  // AMT!!! this is memory leak, check why it needs to be added
226  TEveCalo3D* calo3d = new TEveCalo3D(data);
227  gEve->AddElement(data);
228  calo3d->SetBarrelRadius(129.00);
229  calo3d->SetEndCapPos(268.36);
230 
231  float theta = TEveCaloData::EtaToTheta(eta);
232  float ext = data->GetMaxVal(true) * calo3d->GetValToHeight();
233  if (TMath::Abs(eta) < calo3d->GetTransitionEta()) {
234  // printf("barrel\n");
235  float x = calo3d->GetBarrelRadius() * TMath::Cos(phi);
236  float y = calo3d->GetBarrelRadius() * TMath::Sin(phi);
237  float z = calo3d->GetBarrelRadius() / TMath::Tan(theta);
238 
239  calo3d->SetupBBoxCube(ext, x, y, z);
240  } else {
241  // printf("endcap\n");
242  float z = TMath::Sign(calo3d->GetEndCapPos(), eta);
243  float r = z * TMath::Tan(theta);
244  calo3d->SetupBBoxCube(ext, r * TMath::Cos(phi), r * TMath::Sin(phi), z);
245  }
246  m_eveScene->AddElement(calo3d);
247  }
248 
249  // base vectors
250  TEveVectorD fwd = trk1->GetMomentum().Cross(trk0->GetMomentum());
251  fwd.Normalize();
252  TEveVectorD lft = trk1->GetMomentum();
253  lft.Normalize();
254  TEveVectorD up = lft.Cross(fwd);
255 
256  TEveVectorD c = (trk1->GetVertex() + trk0->GetVertex()) * 0.5;
257  if (true) {
258  setCameraInit(viewerGL(), TGLViewer::kCameraPerspXOZ, fwd, up, c); //default
259  setCameraInit(viewerGL(), TGLViewer::kCameraPerspYOZ, up, lft, c);
260  setCameraInit(viewerGL(), TGLViewer::kCameraPerspXOY, lft, fwd, c);
261 
262  setCameraInit(viewerGL(), TGLViewer::kCameraOrthoXOY, fwd, up, c);
263  setCameraInit(viewerGL(), TGLViewer::kCameraOrthoXOZ, up, lft, c);
264  setCameraInit(viewerGL(), TGLViewer::kCameraOrthoZOY, lft, fwd, c);
265  }
266  {
267  Float_t sfac = 100;
268  fwd *= sfac;
269  lft *= sfac;
270  up *= sfac;
271  int transp = 90;
272  {
273  TEveStraightLineSet* bls = new TEveStraightLineSet("base1");
274  bls->AddLine(c, fwd + c);
275  bls->SetMainColor(kBlue);
276  bls->SetMainTransparency(transp);
277  bls->SetPickable(false);
278  m_eveScene->AddElement(bls);
279  }
280 
281  {
282  TEveStraightLineSet* bls = new TEveStraightLineSet("base2");
283  bls->AddLine(c, lft + c);
284  bls->SetMainColor(kBlue);
285  bls->SetMainTransparency(transp);
286  bls->SetPickable(false);
287  m_eveScene->AddElement(bls);
288  }
289 
290  {
291  TEveStraightLineSet* bls = new TEveStraightLineSet("base3");
292  bls->AddLine(c, up + 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("Photon", "Photon");
302  bls->AddLine(c.fX, c.fY, c.fZ, bs->x0(), bs->y0(), bs->z0());
303  bls->SetMainColor(id.item()->defaultDisplayProperties().color());
304  bls->SetLineStyle(3);
305  m_eveScene->AddElement(bls);
306  }
307 
308  viewerGL()->SetStyle(TGLRnrCtx::kOutline);
309  viewerGL()->ResetCamerasAfterNextUpdate();
310  viewerGL()->UpdateScene(kFALSE);
311  gEve->Redraw3D();
312 
313  setTextInfo(id, conv);
315 }
Definition: BitonicSort.h:7
void addModules(const reco::Track &track, const FWEventItem *iItem, TEveElement *trkList, bool addLostHits)
TEveTrack * prepareTrack(const reco::Track &track, TEveTrackPropagator *propagator, const std::vector< TEveVector > &extraRefPoints=std::vector< TEveVector >())
Definition: TrackUtils.cc:62
FWBeamSpot * getBeamSpot() const
Definition: Context.h:67
const FWEventItem * item()
const fireworks::Context & context() 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:113
void setTextInfo(const FWModelId &id, const reco::Conversion *) override
bool isAvailable() const
Definition: Ref.h:535
constexpr unsigned getField(const uint32_t u, const unsigned mask, const unsigned offset)
double f[11][100]
void addHits(const reco::Track &track, const FWEventItem *iItem, TEveElement *trkList, bool addNearbyHits)
double b
Definition: hdecay.h:120
EPOS::IO_EPOS conv
char data[epos_bytes_allocation]
Definition: EPOS_Wrapper.h:80
sigc::signal< void()> activated
Definition: CSGAction.h:100
Definition: AbsArchive.cc:46
Definition: memstream.h:15
const TrackExtraRef & extra() const
reference to "extra" object
Definition: Track.h:139

◆ camera1Callback()

void FWConvTrackHitsDetailView::camera1Callback ( )

Definition at line 602 of file FWConvTrackHitsDetailView.cc.

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

Referenced by build().

602  {
604 
605  viewerGL()->SetCurrentCamera(m_orthographic ? TGLViewer::kCameraOrthoXOY : TGLViewer::kCameraPerspXOZ);
606  viewerGL()->ResetCurrentCamera();
607  viewerGL()->RequestDraw();
608 }

◆ camera2Callback()

void FWConvTrackHitsDetailView::camera2Callback ( )

Definition at line 610 of file FWConvTrackHitsDetailView.cc.

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

Referenced by build().

610  {
612 
613  viewerGL()->SetCurrentCamera(m_orthographic ? TGLViewer::kCameraOrthoXOZ : TGLViewer::kCameraPerspYOZ);
614  viewerGL()->ResetCurrentCamera();
615  viewerGL()->RequestDraw();
616 }

◆ camera3Callback()

void FWConvTrackHitsDetailView::camera3Callback ( )

Definition at line 618 of file FWConvTrackHitsDetailView.cc.

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

Referenced by build().

618  {
620 
621  viewerGL()->SetCurrentCamera(m_orthographic ? TGLViewer::kCameraOrthoZOY : TGLViewer::kCameraPerspXOY);
622  viewerGL()->ResetCurrentCamera();
623  viewerGL()->RequestDraw();
624 }

◆ operator=()

const FWConvTrackHitsDetailView& FWConvTrackHitsDetailView::operator= ( const FWConvTrackHitsDetailView )
delete

◆ pickCameraCenter()

void FWConvTrackHitsDetailView::pickCameraCenter ( )

Definition at line 574 of file FWConvTrackHitsDetailView.cc.

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

574  {
575  viewerGL()->PickCameraCenter();
576  viewerGL()->SetDrawCameraCenter(kTRUE);
577 }

◆ rnrHits()

void FWConvTrackHitsDetailView::rnrHits ( )

Definition at line 597 of file FWConvTrackHitsDetailView.cc.

References m_hits.

Referenced by build().

597  {
598  m_hits->SetRnrChildren(!m_hits->GetRnrChildren());
599  gEve->Redraw3D();
600 }

◆ rnrLabels()

void FWConvTrackHitsDetailView::rnrLabels ( )

Definition at line 587 of file FWConvTrackHitsDetailView.cc.

References m_moduleLabels.

587  {
588  m_moduleLabels->SetRnrChildren(!m_moduleLabels->GetRnrChildren());
589  gEve->Redraw3D();
590 }

◆ rnrModules()

void FWConvTrackHitsDetailView::rnrModules ( )

Definition at line 592 of file FWConvTrackHitsDetailView.cc.

References m_modules.

Referenced by build().

592  {
593  m_modules->SetRnrChildren(!m_modules->GetRnrChildren());
594  gEve->Redraw3D();
595 }

◆ setTextInfo()

void FWConvTrackHitsDetailView::setTextInfo ( const FWModelId id,
const reco::Conversion conv 
)
overrideprivatevirtual

Implements FWDetailView< reco::Conversion >.

Definition at line 317 of file FWConvTrackHitsDetailView.cc.

References reco::TrackBase::charge(), conv, reco::TrackBase::eta(), reco::HitPattern::getHitPattern(), reco::TrackBase::hitPattern(), FWDetailViewBase::item(), FWDetailViewGL< reco::Conversion >::m_infoCanvas, reco::HitPattern::MISSING_INNER_HITS, hltEcalBarrelClusterFastTimer_cfi::modelName, reco::HitPattern::numberOfAllHits(), reco::TrackBase::phi(), reco::HitPattern::pixelHitFilter(), reco::TrackBase::pt(), mathSSE::sqrt(), reco::HitPattern::stripHitFilter(), reco::HitPattern::TRACK_HITS, reco::HitPattern::validHitFilter(), x, and y.

Referenced by build().

317  {
318  m_infoCanvas->cd();
319 
320  float_t x = 0.02;
321  float y = 0.95;
322 
323  TLatex* latex = new TLatex(x, y, "");
324  const double textsize(0.07);
325  latex->SetTextSize(2 * textsize);
326 
327  latex->DrawLatex(x, y, id.item()->modelName(id.index()).c_str());
328  y -= latex->GetTextSize() * 0.6;
329 
330  latex->SetTextSize(textsize);
331  float lineH = latex->GetTextSize() * 0.6;
332 
333  latex->DrawLatex(x,
334  y,
335  Form("p_{T}=%.1f GeV, #eta=%0.2f, #varphi=%0.2f",
336  sqrt(conv->pairMomentum().Perp2()),
337  conv->pairMomentum().eta(),
338  conv->pairMomentum().phi()));
339  y -= lineH;
340  latex->DrawLatex(x,
341  y,
342  Form("vtx=(%.1f, %.1f, %.1f) r=%.1f [cm]",
343  conv->conversionVertex().x(),
344  conv->conversionVertex().y(),
345  conv->conversionVertex().z(),
346  conv->conversionVertex().position().rho()));
347  y -= lineH;
348  latex->DrawLatex(x, y, Form("#Deltactg#theta=%.3f", conv->pairCotThetaSeparation()));
349  y -= lineH;
350  latex->DrawLatex(x, y, Form("#Delta#phi_{vtx}=%.3f", conv->dPhiTracksAtVtx()));
351  y -= lineH;
352  latex->DrawLatex(x, y, Form("dist. min. app.=%.3f cm", conv->distOfMinimumApproach()));
353  y -= lineH;
354  y -= lineH;
355 
356  const reco::Track* track0 = conv->tracks().at(0).get();
357  latex->DrawLatex(x, y, Form("Trk0 q=%i", track0->charge()));
358  y -= lineH;
359  latex->DrawLatex(x, y, Form("p_{T}=%.1f GeV, #eta=%0.2f, #varphi=%0.2f", track0->pt(), track0->eta(), track0->phi()));
360  y -= lineH;
361  const reco::HitPattern& hp0 = track0->hitPattern();
362  int nvalid_tk0 = 0, ninvalid_tk0 = 0, npix_tk0 = 0, nstrip_tk0 = 0;
363  for (int i_tk0 = 0; i_tk0 < hp0.numberOfAllHits(reco::HitPattern::TRACK_HITS); i_tk0++) {
364  uint32_t hit = hp0.getHitPattern(reco::HitPattern::TRACK_HITS, i_tk0);
366  nvalid_tk0++;
368  npix_tk0++;
370  nstrip_tk0++;
371  } else
372  ninvalid_tk0++;
373  }
374  latex->DrawLatex(x, y, Form("valid hits: %i (pix. %i, str. %i)", nvalid_tk0, npix_tk0, nstrip_tk0));
375  y -= lineH;
376  latex->DrawLatex(x, y, Form("invalid: %i", ninvalid_tk0));
377  y -= lineH;
378 
379  int npix_mhi_tk0 = 0, nstrip_mhi_tk0 = 0;
380  for (int i_mhi_tk0 = 0; i_mhi_tk0 < hp0.numberOfAllHits(reco::HitPattern::MISSING_INNER_HITS); i_mhi_tk0++) {
381  uint32_t hit = hp0.getHitPattern(reco::HitPattern::MISSING_INNER_HITS, i_mhi_tk0);
383  npix_mhi_tk0++;
385  nstrip_mhi_tk0++;
386  }
387  latex->DrawLatex(x, y, Form("miss. inner hits: pix. %i, str. %i", npix_mhi_tk0, nstrip_mhi_tk0));
388 
389  y -= lineH;
390  y -= lineH;
391  const reco::Track* track1 = conv->tracks().at(1).get();
392  latex->DrawLatex(x, y, Form("Trk1 q=%i", track1->charge()));
393  y -= lineH;
394  latex->DrawLatex(x, y, Form("p_{T}=%.1f GeV, #eta=%0.2f, #varphi=%0.2f", track1->pt(), track1->eta(), track1->phi()));
395  y -= lineH;
396 
397  const reco::HitPattern& hp1 = track1->hitPattern();
398  int nvalid_tk1 = 0, ninvalid_tk1 = 0, npix_tk1 = 0, nstrip_tk1 = 0;
399  for (int i_tk1 = 0; i_tk1 < hp1.numberOfAllHits(reco::HitPattern::TRACK_HITS); i_tk1++) {
400  uint32_t hit = hp1.getHitPattern(reco::HitPattern::TRACK_HITS, i_tk1);
402  nvalid_tk1++;
404  npix_tk1++;
406  nstrip_tk1++;
407  } else
408  ninvalid_tk1++;
409  }
410  latex->DrawLatex(x, y, Form("valid hits: %i (pix. %i, str. %i)", nvalid_tk1, npix_tk1, nstrip_tk1));
411  y -= lineH;
412  latex->DrawLatex(x, y, Form("invalid: %i", ninvalid_tk1));
413  y -= lineH;
414 
415  int npix_mhi_tk1 = 0, nstrip_mhi_tk1 = 0;
416  for (int i_mhi_tk1 = 0; i_mhi_tk1 < hp1.numberOfAllHits(reco::HitPattern::MISSING_INNER_HITS); i_mhi_tk1++) {
417  uint32_t hit = hp1.getHitPattern(reco::HitPattern::MISSING_INNER_HITS, i_mhi_tk1);
419  npix_mhi_tk1++;
421  nstrip_mhi_tk1++;
422  }
423  latex->DrawLatex(x, y, Form("miss. inner hits: pix. %i, str. %i", npix_mhi_tk1, nstrip_mhi_tk1));
424  y -= lineH;
425  y -= lineH;
426 }
static bool pixelHitFilter(uint16_t pattern)
Definition: HitPattern.h:581
int numberOfAllHits(HitCategory category) const
Definition: HitPattern.h:804
const FWEventItem * item()
static bool validHitFilter(uint16_t pattern)
Definition: HitPattern.h:796
double pt() const
track transverse momentum
Definition: TrackBase.h:637
int charge() const
track electric charge
Definition: TrackBase.h:596
T sqrt(T t)
Definition: SSEVec.h:23
static bool stripHitFilter(uint16_t pattern)
Definition: HitPattern.h:608
double phi() const
azimuthal angle of momentum vector
Definition: TrackBase.h:649
uint16_t getHitPattern(HitCategory category, int position) const
Definition: HitPattern.h:537
double eta() const
pseudorapidity of momentum vector
Definition: TrackBase.h:652
const HitPattern & hitPattern() const
Access the hit pattern, indicating in which Tracker layers the track has hits.
Definition: TrackBase.h:504
EPOS::IO_EPOS conv

◆ switchProjection()

void FWConvTrackHitsDetailView::switchProjection ( )

Definition at line 579 of file FWConvTrackHitsDetailView.cc.

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

Referenced by build().

579  {
581  m_camTypeAction->setName(m_orthographic ? "Set Perspective Projection" : "Set Orthographic Projection");
582 
583  (this->*foo)();
584  //printf("current isOrthographic : %d \n", viewerGL()->CurrentCamera().IsOrthographic());
585 }
void setName(const std::string &name)
Definition: CSGAction.cc:85

Member Data Documentation

◆ m_calo3D

TEveElement* FWConvTrackHitsDetailView::m_calo3D
private

Definition at line 55 of file FWConvTrackHitsDetailView.h.

◆ m_camTypeAction

CSGAction* FWConvTrackHitsDetailView::m_camTypeAction
private

Definition at line 59 of file FWConvTrackHitsDetailView.h.

Referenced by build(), and switchProjection().

◆ m_hits

TEveElementList* FWConvTrackHitsDetailView::m_hits
private

Definition at line 54 of file FWConvTrackHitsDetailView.h.

Referenced by build(), and rnrHits().

◆ m_legend

TLegend* FWConvTrackHitsDetailView::m_legend
private

Definition at line 57 of file FWConvTrackHitsDetailView.h.

◆ m_moduleLabels

TEveElementList* FWConvTrackHitsDetailView::m_moduleLabels
private

Definition at line 53 of file FWConvTrackHitsDetailView.h.

Referenced by build(), and rnrLabels().

◆ m_modules

TEveElementList* FWConvTrackHitsDetailView::m_modules
private

Definition at line 52 of file FWConvTrackHitsDetailView.h.

Referenced by build(), and rnrModules().

◆ m_orthographic

bool FWConvTrackHitsDetailView::m_orthographic
private