CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
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::FWConvTrackHitsDetailView ( )

Definition at line 47 of file FWConvTrackHitsDetailView.cc.

FWConvTrackHitsDetailView::~FWConvTrackHitsDetailView ( )
override

Definition at line 50 of file FWConvTrackHitsDetailView.cc.

50 {}
FWConvTrackHitsDetailView::FWConvTrackHitsDetailView ( const FWConvTrackHitsDetailView )
delete

Member Function Documentation

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

Definition at line 450 of file FWConvTrackHitsDetailView.cc.

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

Referenced by build().

453  {
454  std::vector<TVector3> pixelPoints;
455  fireworks::pushPixelHits(pixelPoints, *iItem, track);
456  TEveElementList* pixels = new TEveElementList("Pixels");
457  trkList->AddElement(pixels);
458  if (addNearbyHits) {
459  // get the extra hits
460  std::vector<TVector3> pixelExtraPoints;
461  fireworks::pushNearbyPixelHits(pixelExtraPoints, *iItem, track);
462  // draw first the others
463  addTrackerHits3D(pixelExtraPoints, pixels, kRed, 1);
464  // then the good ones, so they're on top
465  addTrackerHits3D(pixelPoints, pixels, kGreen, 1);
466  } else {
467  // just add those points with the default color
468  addTrackerHits3D(pixelPoints, pixels, iItem->defaultDisplayProperties().color(), 1);
469  }
470 
471  // strips
472  TEveElementList* strips = new TEveElementList("Strips");
473  trkList->AddElement(strips);
474  fireworks::addSiStripClusters(iItem, track, strips, addNearbyHits, false);
475 }
const FWDisplayProperties & defaultDisplayProperties() const
Definition: FWEventItem.cc:403
Color_t color() const
tuple 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 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
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
void FWConvTrackHitsDetailView::addModules ( const reco::Track track,
const FWEventItem iItem,
TEveElement *  trkList,
bool  addLostHits 
)
private

Definition at line 479 of file FWConvTrackHitsDetailView.cc.

References TrackingRecHit::bad, FWDisplayProperties::color(), MuonSubdetId::CSC, FWEventItem::defaultDisplayProperties(), DetId::det(), MuonSubdetId::DT, DTChamberId, 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, 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().

482  {
483  std::set<unsigned int> ids;
484  for (trackingRecHit_iterator recIt = track.recHitsBegin(), recItEnd = track.recHitsEnd(); recIt != recItEnd;
485  ++recIt) {
486  DetId detid = (*recIt)->geographicalId();
487  if (!addLostHits && !(*recIt)->isValid())
488  continue;
489  if (detid.rawId() != 0) {
490  TString name("");
491  switch (detid.det()) {
492  case DetId::Tracker:
493  switch (detid.subdetId()) {
494  case SiStripDetId::TIB:
495  name = "TIB ";
496  break;
497  case SiStripDetId::TOB:
498  name = "TOB ";
499  break;
500  case SiStripDetId::TID:
501  name = "TID ";
502  break;
503  case SiStripDetId::TEC:
504  name = "TEC ";
505  break;
507  name = "Pixel Barrel ";
508  break;
510  name = "Pixel Endcap ";
511  default:
512  break;
513  }
514  break;
515 
516  case DetId::Muon:
517  switch (detid.subdetId()) {
518  case MuonSubdetId::DT:
519  name = "DT";
520  detid = DetId(DTChamberId(detid)); // get rid of layer bits
521  break;
522  case MuonSubdetId::CSC:
523  name = "CSC";
524  break;
525  case MuonSubdetId::RPC:
526  name = "RPC";
527  break;
528  default:
529  break;
530  }
531  break;
532  default:
533  break;
534  }
535  if (!ids.insert(detid.rawId()).second)
536  continue;
537  if (iItem->getGeom()) {
538  TEveGeoShape* shape = iItem->getGeom()->getEveShape(detid);
539  if (nullptr != shape) {
540  shape->SetMainTransparency(65);
541  shape->SetPickable(kTRUE);
542  switch ((*recIt)->type()) {
544  shape->SetMainColor(iItem->defaultDisplayProperties().color());
545  break;
549  name += "LOST ";
550  shape->SetMainColor(kRed);
551  break;
555  name += "INACTIVE ";
556  shape->SetMainColor(28);
557  break;
558  case TrackingRecHit::bad:
559  name += "BAD ";
560  shape->SetMainColor(218);
561  break;
562  }
563  shape->SetTitle(name + ULong_t(detid.rawId()));
564  trkList->AddElement(shape);
565  } else {
566  fwLog(fwlog::kInfo) << "Failed to get shape extract for a tracking rec hit: "
567  << "\n"
568  << fireworks::info(detid) << std::endl;
569  }
570  }
571  }
572  }
573 }
const FWDisplayProperties & defaultDisplayProperties() const
Definition: FWEventItem.cc:403
static constexpr auto TID
Definition: SiStripDetId.h:38
constexpr uint32_t rawId() const
get the raw id
Definition: DetId.h:57
Color_t color() const
U second(std::pair< T, U > const &p)
TEveGeoShape * getEveShape(unsigned int id) const
Definition: FWGeometry.cc:318
constexpr int subdetId() const
get the contents of the subdetector field (not cast into any detector&#39;s numbering enum) ...
Definition: DetId.h:48
trackingRecHit_iterator recHitsBegin() const
Iterator to first hit on the track.
Definition: Track.h:88
static constexpr auto TOB
Definition: SiStripDetId.h:39
Definition: DetId.h:17
#define fwLog(_level_)
Definition: fwLog.h:45
static constexpr int RPC
Definition: MuonSubdetId.h:13
static constexpr auto TIB
Definition: SiStripDetId.h:37
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
const FWGeometry * getGeom() const
Definition: FWEventItem.cc:548
static constexpr auto TEC
Definition: SiStripDetId.h:40
constexpr Detector det() const
get the detector field from this detid
Definition: DetId.h:46
trackingRecHit_iterator recHitsEnd() const
Iterator to last hit on the track.
Definition: Track.h:91
void FWConvTrackHitsDetailView::addTrackerHits3D ( std::vector< TVector3 > &  points,
class TEveElementList *  tList,
Color_t  color,
int  size 
)
private

Definition at line 430 of file FWConvTrackHitsDetailView.cc.

Referenced by addHits().

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

Implements FWDetailView< reco::Conversion >.

Definition at line 83 of file FWConvTrackHitsDetailView.cc.

References Abs(), mps_fire::action, CSGAction::activated, addHits(), addModules(), b, cms::cuda::bs, FWECALCaloDataDetailViewBuilder::buildCaloData(), c, camera1Callback(), camera2Callback(), camera3Callback(), EcnaPython_AdcPeg12_S1_10_R170298_1_0_150_Dee0::cerr, FWDetailViewBase::context(), CSGAction::createTextButton(), data, dataset::end, PVValHelper::eta, reco::Track::extra(), validate-o2o-wbm::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, mergeVDriftHistosByStation::name, reco::Conversion::nTracks(), AlCaHLTBitMon_ParallelJobs::p, reco::Conversion::pairMomentum(), phi, fireworks::prepareTrack(), alignCSCRings::r, rnrHits(), rnrModules(), setTextInfo(), Sign(), switchProjection(), runonSM::text, theta(), reco::Conversion::tracks(), up, FWDetailViewGL< reco::Conversion >::viewerGL(), x, FWBeamSpot::x0(), y, FWBeamSpot::y0(), z, and FWBeamSpot::z0().

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

Definition at line 604 of file FWConvTrackHitsDetailView.cc.

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

Referenced by build().

604  {
606 
607  viewerGL()->SetCurrentCamera(m_orthographic ? TGLViewer::kCameraOrthoXOY : TGLViewer::kCameraPerspXOZ);
608  viewerGL()->ResetCurrentCamera();
609  viewerGL()->RequestDraw();
610 }
void FWConvTrackHitsDetailView::camera2Callback ( )

Definition at line 612 of file FWConvTrackHitsDetailView.cc.

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

Referenced by build().

612  {
614 
615  viewerGL()->SetCurrentCamera(m_orthographic ? TGLViewer::kCameraOrthoXOZ : TGLViewer::kCameraPerspYOZ);
616  viewerGL()->ResetCurrentCamera();
617  viewerGL()->RequestDraw();
618 }
void FWConvTrackHitsDetailView::camera3Callback ( )

Definition at line 620 of file FWConvTrackHitsDetailView.cc.

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

Referenced by build().

620  {
622 
623  viewerGL()->SetCurrentCamera(m_orthographic ? TGLViewer::kCameraOrthoZOY : TGLViewer::kCameraPerspXOY);
624  viewerGL()->ResetCurrentCamera();
625  viewerGL()->RequestDraw();
626 }
const FWConvTrackHitsDetailView& FWConvTrackHitsDetailView::operator= ( const FWConvTrackHitsDetailView )
delete
void FWConvTrackHitsDetailView::pickCameraCenter ( )

Definition at line 576 of file FWConvTrackHitsDetailView.cc.

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

576  {
577  viewerGL()->PickCameraCenter();
578  viewerGL()->SetDrawCameraCenter(kTRUE);
579 }
void FWConvTrackHitsDetailView::rnrHits ( )

Definition at line 599 of file FWConvTrackHitsDetailView.cc.

References m_hits.

Referenced by build().

599  {
600  m_hits->SetRnrChildren(!m_hits->GetRnrChildren());
601  gEve->Redraw3D();
602 }
void FWConvTrackHitsDetailView::rnrLabels ( )

Definition at line 589 of file FWConvTrackHitsDetailView.cc.

References m_moduleLabels.

589  {
590  m_moduleLabels->SetRnrChildren(!m_moduleLabels->GetRnrChildren());
591  gEve->Redraw3D();
592 }
void FWConvTrackHitsDetailView::rnrModules ( )

Definition at line 594 of file FWConvTrackHitsDetailView.cc.

References m_modules.

Referenced by build().

594  {
595  m_modules->SetRnrChildren(!m_modules->GetRnrChildren());
596  gEve->Redraw3D();
597 }
void FWConvTrackHitsDetailView::setTextInfo ( const FWModelId id,
const reco::Conversion conv 
)
overrideprivatevirtual

Implements FWDetailView< reco::Conversion >.

Definition at line 319 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, 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().

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

Definition at line 581 of file FWConvTrackHitsDetailView.cc.

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

Referenced by build().

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

Member Data Documentation

TEveElement* FWConvTrackHitsDetailView::m_calo3D
private

Definition at line 55 of file FWConvTrackHitsDetailView.h.

CSGAction* FWConvTrackHitsDetailView::m_camTypeAction
private

Definition at line 59 of file FWConvTrackHitsDetailView.h.

Referenced by build(), and switchProjection().

TEveElementList* FWConvTrackHitsDetailView::m_hits
private

Definition at line 54 of file FWConvTrackHitsDetailView.h.

Referenced by build(), and rnrHits().

TLegend* FWConvTrackHitsDetailView::m_legend
private

Definition at line 57 of file FWConvTrackHitsDetailView.h.

TEveElementList* FWConvTrackHitsDetailView::m_moduleLabels
private

Definition at line 53 of file FWConvTrackHitsDetailView.h.

Referenced by build(), and rnrLabels().

TEveElementList* FWConvTrackHitsDetailView::m_modules
private

Definition at line 52 of file FWConvTrackHitsDetailView.h.

Referenced by build(), and rnrModules().

bool FWConvTrackHitsDetailView::m_orthographic
private