CMS 3D CMS Logo

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

#include <Fireworks/Core/interface/FW3DViewBase.h>

Inheritance diagram for FW3DViewBase:
FWEveView FWViewBase FWConfigurableParameterizable FWParameterizable FWConfigurable FW3DView FWISpyView

Public Member Functions

void addTo (FWConfiguration &) const override
 
 FW3DViewBase (TEveWindowSlot *, FWViewType::EType, unsigned int version=8)
 
FW3DViewDistanceMeasureToolgetDMT ()
 
void populateController (ViewerParameterGUI &) const override
 
bool requestGLHandlerPick () const override
 
void setClip (float eta, float phi)
 
void setContext (const fireworks::Context &) override
 
void setCurrentDMTVertex (double x, double y, double z)
 
void setFrom (const FWConfiguration &) override
 
void showEcalBarrel (bool)
 
void updateGlobalSceneScaleParameters ()
 
 ~FW3DViewBase () override
 
- Public Member Functions inherited from FWEveView
void addTo (FWConfiguration &) const override
 
const fireworks::Contextcontext ()
 
FWViewContextMenuHandlerBasecontextMenuHandler () const override
 
virtual void eventBegin ()
 
virtual void eventEnd ()
 
TEveScene * eventScene ()
 
 FWEveView (TEveWindowSlot *, FWViewType::EType, unsigned int version=7)
 
FWTEveViewerfwViewer ()
 
FWTGLViewerfwViewerGL () const
 
TEveScene * geoScene ()
 
virtual bool isEnergyScaleGlobal () const
 
TEveElement * ownedProducts ()
 
void populateController (ViewerParameterGUI &) const override
 
void saveImageTo (const std::string &iName) const override
 
virtual void setBackgroundColor (Color_t)
 
void setFrom (const FWConfiguration &) override
 
virtual void setupEnergyScale ()
 
virtual void setupEventCenter ()
 
virtual void useGlobalEnergyScaleChanged ()
 
FWViewContextviewContext ()
 
TEveViewer * viewer ()
 
TGLViewer * viewerGL () const
 
virtual void voteCaloMaxVal ()
 
 ~FWEveView () override
 
- Public Member Functions inherited from FWViewBase
void destroy ()
 
 FWViewBase (FWViewType::EType, unsigned int iVersion=1)
 
void promptForSaveImageTo (TGFrame *) const
 
FWViewType::EType typeId () const
 
const std::string & typeName () const
 
- Public Member Functions inherited from FWConfigurableParameterizable
 FWConfigurableParameterizable (unsigned int iVersion=1)
 
unsigned int version () const
 
 ~FWConfigurableParameterizable () override
 
- Public Member Functions inherited from FWParameterizable
void add (FWParameterBase *)
 
const_iterator begin () const
 
const_iterator end () const
 
 FWParameterizable ()
 
virtual ~FWParameterizable ()
 
- Public Member Functions inherited from FWConfigurable
 FWConfigurable ()
 
virtual ~FWConfigurable ()
 

Private Member Functions

void enableSceneClip (bool)
 
 FW3DViewBase (const FW3DViewBase &)
 
const FW3DViewBaseoperator= (const FW3DViewBase &)
 
void rnrStyle (long)
 
void selectable (bool)
 
void setCameraType (long)
 
void showMuonBarrel (long)
 
void updateClipPlanes (bool resetCamera)
 
void updateHGCalVisibility (bool)
 

Private Attributes

FWEnumParameter m_cameraType
 
FWLongParameter m_clipAppexOffset
 
FWDoubleParameter m_clipDelta1
 
FWDoubleParameter m_clipDelta2
 
FWBoolParameter m_clipEnable
 
FWLongParameter m_clipHGCalLayerBegin
 
FWLongParameter m_clipHGCalLayerEnd
 
FWDoubleParameter m_clipPhi
 
FWDoubleParameter m_clipTheta
 
FW3DViewDistanceMeasureToolm_DMT
 
TEveLine * m_DMTline
 
TEveBoxSet * m_ecalBarrel
 
FW3DViewGeometrym_geometry
 
TGLClip * m_glClip
 
FWEnumParameter m_rnrStyle
 
FWBoolParameter m_selectable
 
FWBoolParameter m_showEcalBarrel
 
FWBoolParameter m_showHGCalEE
 
FWBoolParameter m_showHGCalHSc
 
FWBoolParameter m_showHGCalHSi
 
FWEnumParameter m_showMuonBarrel
 
FWBoolParameter m_showMuonEndcap
 
FWBoolParameter m_showPixelBarrel
 
FWBoolParameter m_showPixelEndcap
 
FWBoolParameter m_showTrackerBarrel
 
FWBoolParameter m_showTrackerEndcap
 

Additional Inherited Members

- Public Types inherited from FWParameterizable
typedef std::vector< FWParameterBase * >::const_iterator const_iterator
 
- Public Attributes inherited from FWViewBase
sigc::signal< void, const FWViewBase * > beingDestroyed_
 
sigc::signal< void, Int_t, Int_t > openSelectedModelContextMenu_
 
- Protected Member Functions inherited from FWEveView
void addToOrthoCamera (TGLOrthoCamera *, FWConfiguration &) const
 
void addToPerspectiveCamera (TGLPerspectiveCamera *, const std::string &, FWConfiguration &) const
 
virtual void cameraGuideChanged ()
 
virtual TEveCaloViz * getEveCalo () const
 
virtual void pointLineScalesChanged ()
 
virtual void resetCamera ()
 
void setFromOrthoCamera (TGLOrthoCamera *, const FWConfiguration &)
 
void setFromPerspectiveCamera (TGLPerspectiveCamera *, const std::string &, const FWConfiguration &)
 
- Protected Member Functions inherited from FWViewBase
 ~FWViewBase () override
 
- Protected Attributes inherited from FWEveView
const fireworks::Contextm_context
 
- Protected Attributes inherited from FWViewBase
FWViewType m_type
 

Detailed Description

Description: <one line="" class="" summary>="">

Usage: <usage>

Definition at line 42 of file FW3DViewBase.h.

Constructor & Destructor Documentation

◆ FW3DViewBase() [1/2]

FW3DViewBase::FW3DViewBase ( TEveWindowSlot *  iParent,
FWViewType::EType  typeId,
unsigned int  version = 8 
)

Definition at line 99 of file FW3DViewBase.cc.

100  : FWEveView(iParent, typeId, version),
101  m_geometry(nullptr),
102  m_glClip(nullptr),
103  m_showMuonBarrel(this, "Show Muon Barrel", 0l, 0l, 2l),
104  m_showMuonEndcap(this, "Show Muon Endcap", false),
105  m_showPixelBarrel(this, "Show Pixel Barrel", false),
106  m_showPixelEndcap(this, "Show Pixel Endcap", false),
107  m_showTrackerBarrel(this, "Show Tracker Barrel", false),
108  m_showTrackerEndcap(this, "Show Tracker Endcap", false),
109  m_showHGCalEE(this, "Show HGCalEE", false),
110  m_showHGCalHSi(this, "Show HGCalHSi", false),
111  m_showHGCalHSc(this, "Show HGCalHSc", false),
112  m_ecalBarrel(nullptr),
113  m_showEcalBarrel(this, "Show Ecal Barrel", false),
114  m_rnrStyle(this, "Render Style", 0l, 0l, 2l),
115  m_selectable(this, "Enable Tooltips", false),
116  m_cameraType(this, "Camera Type", 0l, 0l, 5l),
117  m_clipEnable(this, "Enable Clip", false),
118  m_clipTheta(this, "Clip Theta", 0.0, -5.0, 5.0),
119  m_clipPhi(this, "Clip Phi", 0.0, -2.0, 2.0),
120  m_clipDelta1(this, "Clip Delta1", 0.2, 0.01, 2),
121  m_clipDelta2(this, "Clip Delta2", 0.2, 0.01, 2),
122  m_clipAppexOffset(this, "Appex Offset", 10l, 0l, 50l),
123  m_clipHGCalLayerBegin(this, "HGCal Lower Bound", 1l, 1l, 52l),
124  m_clipHGCalLayerEnd(this, "HGCal Upper Bound", 52l, 1l, 52l),
125  m_DMT(nullptr),
126  m_DMTline(nullptr) {
127  viewerGL()->SetCurrentCamera(TGLViewer::kCameraPerspXOZ);
129 
130  m_showMuonBarrel.addEntry(0, "Hide");
131  m_showMuonBarrel.addEntry(1, "Simplified");
132  m_showMuonBarrel.addEntry(2, "Full");
133  m_showMuonBarrel.changed_.connect(boost::bind(&FW3DViewBase::showMuonBarrel, this, _1));
134 
135  m_rnrStyle.addEntry(TGLRnrCtx::kFill, "Fill");
136  m_rnrStyle.addEntry(TGLRnrCtx::kOutline, "Outline");
137  m_rnrStyle.addEntry(TGLRnrCtx::kWireFrame, "WireFrame");
138  m_rnrStyle.changed_.connect(boost::bind(&FW3DViewBase::rnrStyle, this, _1));
139 
140  m_selectable.changed_.connect(boost::bind(&FW3DViewBase::selectable, this, _1));
141 
142  m_cameraType.addEntry(TGLViewer::kCameraPerspXOZ, "PerspXOZ");
143  m_cameraType.addEntry(TGLViewer::kCameraOrthoXOY, "OrthoXOY");
144  m_cameraType.addEntry(TGLViewer::kCameraOrthoXOZ, "OrthoXOZ");
145  m_cameraType.addEntry(TGLViewer::kCameraOrthoZOY, "OrthoZOY");
146  m_cameraType.addEntry(TGLViewer::kCameraOrthoXnOY, "OrthoXnOY");
147  m_cameraType.addEntry(TGLViewer::kCameraOrthoXnOZ, "OrthoXnOZ");
148  m_cameraType.addEntry(TGLViewer::kCameraOrthoZnOY, "OrthoZnOY");
149  m_cameraType.changed_.connect(boost::bind(&FW3DViewBase::setCameraType, this, _1));
150 
151  m_clipEnable.changed_.connect(boost::bind(&FW3DViewBase::enableSceneClip, this, _1));
152  m_clipTheta.changed_.connect(boost::bind(&FW3DViewBase::updateClipPlanes, this, false));
153  m_clipPhi.changed_.connect(boost::bind(&FW3DViewBase::updateClipPlanes, this, false));
154  m_clipDelta1.changed_.connect(boost::bind(&FW3DViewBase::updateClipPlanes, this, false));
155  m_clipDelta2.changed_.connect(boost::bind(&FW3DViewBase::updateClipPlanes, this, false));
156  m_clipAppexOffset.changed_.connect(boost::bind(&FW3DViewBase::updateClipPlanes, this, false));
157  m_clipHGCalLayerBegin.changed_.connect(boost::bind(&FW3DViewBase::updateHGCalVisibility, this, false));
158  m_clipHGCalLayerEnd.changed_.connect(boost::bind(&FW3DViewBase::updateHGCalVisibility, this, false));
159 
160  m_ecalBarrel = new TEveBoxSet("ecalBarrel");
161  m_ecalBarrel->UseSingleColor();
162  m_ecalBarrel->SetMainColor(kAzure + 10);
163  m_ecalBarrel->SetMainTransparency(98);
164  geoScene()->AddElement(m_ecalBarrel);
165 }

References FWEnumParameter::addEntry(), FWGenericParameter< T >::changed_, enableSceneClip(), FWEveView::geoScene(), m_cameraType, m_clipAppexOffset, m_clipDelta1, m_clipDelta2, m_clipEnable, m_clipHGCalLayerBegin, m_clipHGCalLayerEnd, m_clipPhi, m_clipTheta, m_DMT, m_ecalBarrel, m_rnrStyle, m_selectable, m_showMuonBarrel, rnrStyle(), selectable(), setCameraType(), showMuonBarrel(), updateClipPlanes(), updateHGCalVisibility(), and FWEveView::viewerGL().

◆ ~FW3DViewBase()

FW3DViewBase::~FW3DViewBase ( )
override

Definition at line 167 of file FW3DViewBase.cc.

167 { delete m_glClip; }

References m_glClip.

◆ FW3DViewBase() [2/2]

FW3DViewBase::FW3DViewBase ( const FW3DViewBase )
private

Member Function Documentation

◆ addTo()

void FW3DViewBase::addTo ( FWConfiguration iTo) const
overridevirtual

Implements FWConfigurable.

Definition at line 429 of file FW3DViewBase.cc.

429  {
430  // take care of parameters
431  FWEveView::addTo(iTo);
432  TGLPerspectiveCamera* camera = dynamic_cast<TGLPerspectiveCamera*>(&(viewerGL()->CurrentCamera()));
433  if (camera)
434  addToPerspectiveCamera(camera, "Plain3D", iTo);
435 }

References FWEveView::addTo(), FWEveView::addToPerspectiveCamera(), and FWEveView::viewerGL().

◆ enableSceneClip()

void FW3DViewBase::enableSceneClip ( bool  x)
private

Definition at line 222 of file FW3DViewBase.cc.

222  {
223  if (m_glClip == nullptr) {
224  m_glClip = new Clipsi(viewerGL()->GetRnrCtx());
225 
226  m_glClip->SetMode(TGLClip::kOutside);
227  }
228 
229  geoScene()->GetGLScene()->SetClip(x ? m_glClip : nullptr);
230  for (TEveElement::List_i it = gEve->GetScenes()->BeginChildren(); it != gEve->GetScenes()->EndChildren(); ++it) {
231  if (strncmp((*it)->GetElementName(), "TopGeoNodeScene", 15) == 0)
232  ((TEveScene*)(*it))->GetGLScene()->SetClip(x ? m_glClip : nullptr);
233  }
234  eventScene()->GetGLScene()->SetClip(x ? m_glClip : nullptr);
235  updateClipPlanes(true);
236  updateHGCalVisibility(false);
237  viewerGL()->RequestDraw();
238 }

References FWEveView::eventScene(), FWEveView::geoScene(), m_glClip, updateClipPlanes(), updateHGCalVisibility(), FWEveView::viewerGL(), and x.

Referenced by FW3DViewBase().

◆ getDMT()

FW3DViewDistanceMeasureTool* FW3DViewBase::getDMT ( )
inline

Definition at line 61 of file FW3DViewBase.h.

61 { return m_DMT; }

References m_DMT.

◆ operator=()

const FW3DViewBase& FW3DViewBase::operator= ( const FW3DViewBase )
private

◆ populateController()

void FW3DViewBase::populateController ( ViewerParameterGUI gui) const
overridevirtual

Reimplemented from FWViewBase.

Reimplemented in FWISpyView.

Definition at line 470 of file FW3DViewBase.cc.

470  {
472 
473  gui.requestTab("Detector")
486 
487  gui.requestTab("Clipping")
496 
497  gui.requestTab("Style").separator();
498  gui.getTabContainer()->AddFrame(
499  new TGTextButton(gui.getTabContainer(),
500  "Root controls",
501  Form("TEveGedEditor::SpawnNewEditor((TGLViewer*)0x%lx)", (unsigned long)viewerGL())));
502 
503  gui.requestTab("Tools").addParam(&m_cameraType).separator();
504  gui.getTabContainer()->AddFrame(m_DMT->buildGUI(gui.getTabContainer()),
505  new TGLayoutHints(kLHintsExpandX, 2, 2, 2, 2));
506 }

References ViewerParameterGUI::addParam(), FW3DViewDistanceMeasureTool::buildGUI(), ViewerParameterGUI::getTabContainer(), m_cameraType, m_clipAppexOffset, m_clipDelta1, m_clipDelta2, m_clipEnable, m_clipHGCalLayerBegin, m_clipHGCalLayerEnd, m_clipPhi, m_clipTheta, m_DMT, m_rnrStyle, m_selectable, m_showEcalBarrel, m_showHGCalEE, m_showHGCalHSc, m_showHGCalHSi, m_showMuonBarrel, m_showMuonEndcap, m_showPixelBarrel, m_showPixelEndcap, m_showTrackerBarrel, m_showTrackerEndcap, FWEveView::populateController(), ViewerParameterGUI::requestTab(), ViewerParameterGUI::separator(), and FWEveView::viewerGL().

Referenced by FWISpyView::populateController().

◆ requestGLHandlerPick()

bool FW3DViewBase::requestGLHandlerPick ( ) const
overridevirtual

◆ rnrStyle()

void FW3DViewBase::rnrStyle ( long  x)
private

Definition at line 215 of file FW3DViewBase.cc.

215  {
216  geoScene()->GetGLScene()->SetStyle(x);
217  viewerGL()->Changed();
218  gEve->Redraw3D();
219 }

References FWEveView::geoScene(), FWEveView::viewerGL(), and x.

Referenced by FW3DViewBase().

◆ selectable()

void FW3DViewBase::selectable ( bool  x)
private

Definition at line 221 of file FW3DViewBase.cc.

221 { geoScene()->GetGLScene()->SetSelectable(x); }

References FWEveView::geoScene(), and x.

Referenced by FW3DViewBase().

◆ setCameraType()

void FW3DViewBase::setCameraType ( long  x)
private

Definition at line 207 of file FW3DViewBase.cc.

207  {
208  viewerGL()->RefCamera(TGLViewer::ECameraType(x)).IncTimeStamp();
209  viewerGL()->SetCurrentCamera(TGLViewer::ECameraType(x));
210 
211  //if (viewerGL()->CurrentCamera().IsOrthographic())
212  // ((TGLOrthoCamera*)(&viewerGL()->CurrentCamera()))->SetEnableRotate(1);
213 }

References FWEveView::viewerGL(), and x.

Referenced by FW3DViewBase().

◆ setClip()

void FW3DViewBase::setClip ( float  eta,
float  phi 
)

Definition at line 240 of file FW3DViewBase.cc.

240  {
241  // called from popup menu via FWGUIManager
242 
243  // limit to 2 decimals, else TGNumber entry in the view controller shows only last 5 irrelevant digits
244  double base = 100.0;
245  int thetaInt = theta * base;
246  int phiInt = phi * base;
247  m_clipTheta.set(thetaInt / base);
248  m_clipPhi.set(phiInt / base);
249  m_clipEnable.set(true);
250 }

References newFWLiteAna::base, m_clipEnable, m_clipPhi, m_clipTheta, phi, FWGenericParameter< T >::set(), and theta().

◆ setContext()

void FW3DViewBase::setContext ( const fireworks::Context context)
overridevirtual

Reimplemented from FWEveView.

Reimplemented in FWISpyView.

Definition at line 169 of file FW3DViewBase.cc.

169  {
171 
173  geoScene()->AddElement(m_geometry);
174 
183  m_showEcalBarrel.changed_.connect(boost::bind(&FW3DViewBase::showEcalBarrel, this, _1));
184 
185  // don't clip event scene -- ideally, would have TGLClipNoClip in root
186  TGLClipPlane* c = new TGLClipPlane();
187  c->Setup(TGLVector3(1e10, 0, 0), TGLVector3(-1, 0, 0));
188  eventScene()->GetGLScene()->SetClip(c);
189 
190  m_DMTline = new TEveLine();
191  m_DMTline->SetLineColor(1016);
192  m_DMTline->SetLineStyle(5);
193 
194  m_DMTline->SetPoint(0, 0, 0, 0);
195  m_DMTline->SetPoint(1, 0, 0, 0);
196  eventScene()->AddElement(m_DMTline);
198 }

References HltBtagPostValidation_cff::c, FWGenericParameter< T >::changed_, FWEveView::context(), FWEveView::eventScene(), FWEveView::geoScene(), m_DMTline, m_geometry, m_showEcalBarrel, m_showHGCalEE, m_showHGCalHSc, m_showHGCalHSi, m_showMuonEndcap, m_showPixelBarrel, m_showPixelEndcap, m_showTrackerBarrel, m_showTrackerEndcap, FWEveView::setContext(), showEcalBarrel(), FW3DViewGeometry::showHGCalEE(), FW3DViewGeometry::showHGCalHSc(), FW3DViewGeometry::showHGCalHSi(), FW3DViewGeometry::showMuonEndcap(), FW3DViewGeometry::showPixelBarrel(), FW3DViewGeometry::showPixelEndcap(), FW3DViewGeometry::showTrackerBarrel(), FW3DViewGeometry::showTrackerEndcap(), and FWGenericParameter< T >::value().

Referenced by FWISpyView::setContext(), and FW3DView::setContext().

◆ setCurrentDMTVertex()

void FW3DViewBase::setCurrentDMTVertex ( double  x,
double  y,
double  z 
)

Definition at line 458 of file FW3DViewBase.cc.

458  {
460  printf("ERROR!!!! FW3DViewBase::setCurrentDMTVertex \n");
461 
462  m_DMTline->SetPoint(m_DMT->m_action, x, y, z);
463  m_DMTline->ElementChanged();
464  viewerGL()->RequestDraw();
465 
466  m_DMT->refCurrentVertex().Set(x, y, z);
467  m_DMT->resetAction();
468 }

References FW3DViewDistanceMeasureTool::kNone, FW3DViewDistanceMeasureTool::m_action, m_DMT, m_DMTline, FW3DViewDistanceMeasureTool::refCurrentVertex(), FW3DViewDistanceMeasureTool::resetAction(), FWEveView::viewerGL(), x, y, and z.

Referenced by FWGLEventHandler::HandleButton().

◆ setFrom()

void FW3DViewBase::setFrom ( const FWConfiguration iFrom)
overridevirtual

Implements FWConfigurable.

Definition at line 438 of file FW3DViewBase.cc.

438  {
439  // take care of parameters
440  FWEveView::setFrom(iFrom);
441 
442  TGLPerspectiveCamera* camera = dynamic_cast<TGLPerspectiveCamera*>(&(viewerGL()->CurrentCamera()));
443  if (camera)
444  setFromPerspectiveCamera(camera, "Plain3D", iFrom);
445 
446  if (iFrom.version() < 5) {
447  // transparency moved to common preferences in FWEveView version 5
448  std::string tName("Detector Transparency");
449  std::istringstream s(iFrom.valueForKey(tName)->value());
450  int transp;
451  s >> transp;
452  context().colorManager()->setGeomTransparency(transp, false);
453  }
454 }

References fireworks::Context::colorManager(), FWEveView::context(), alignCSCRings::s, FWEveView::setFrom(), FWEveView::setFromPerspectiveCamera(), FWColorManager::setGeomTransparency(), AlCaHLTBitMon_QueryRunRegistry::string, simpleEdmComparison::tName, FWConfiguration::value(), FWConfiguration::valueForKey(), FWConfiguration::version(), and FWEveView::viewerGL().

◆ showEcalBarrel()

void FW3DViewBase::showEcalBarrel ( bool  x)

Definition at line 508 of file FW3DViewBase.cc.

508  {
509  if (x && m_ecalBarrel->GetPlex()->Size() == 0) {
510  const FWGeometry* geom = context().getGeom();
511  std::vector<unsigned int> ids =
512  geom->getMatchedIds(FWGeometry::Detector::Ecal, FWGeometry::SubDetector::PixelBarrel);
513  m_ecalBarrel->Reset(TEveBoxSet::kBT_FreeBox, true, ids.size());
514  for (std::vector<unsigned int>::iterator it = ids.begin(); it != ids.end(); ++it) {
515  const float* cor = context().getGeom()->getCorners(*it);
516  m_ecalBarrel->AddBox(cor);
517  }
518  m_ecalBarrel->RefitPlex();
519  }
520 
521  if (m_ecalBarrel->GetRnrSelf() != x) {
522  m_ecalBarrel->SetRnrSelf(x);
523  gEve->Redraw3D();
524  }
525 
526  // disable enable grid in 3DView
527  if (typeId() == FWViewType::k3D) {
528  TEveElement* calo = eventScene()->FindChild("calo barrel");
529  if (calo) {
530  TEveCalo3D* c3d = dynamic_cast<TEveCalo3D*>(calo);
531  c3d->SetRnrFrame(!x, !x);
532  c3d->ElementChanged();
533  }
534  }
535 }

References L1TowerCalibrationProducer_cfi::calo, FWEveView::context(), FWEveView::eventScene(), relativeConstraints::geom, FWGeometry::getCorners(), fireworks::Context::getGeom(), FWViewType::k3D, m_ecalBarrel, GeomDetEnumerators::PixelBarrel, FWViewBase::typeId(), and x.

Referenced by setContext().

◆ showMuonBarrel()

void FW3DViewBase::showMuonBarrel ( long  x)
private

Definition at line 200 of file FW3DViewBase.cc.

200  {
201  if (m_geometry) {
202  m_geometry->showMuonBarrel(x == 1);
204  }
205 }

References m_geometry, FW3DViewGeometry::showMuonBarrel(), FW3DViewGeometry::showMuonBarrelFull(), and x.

Referenced by FW3DViewBase().

◆ updateClipPlanes()

void FW3DViewBase::updateClipPlanes ( bool  resetCamera)
private

Definition at line 316 of file FW3DViewBase.cc.

316  {
317  // TEveScene* gs = (TEveScene*)gEve->GetScenes()->FindChild(TString("TopGeoNodeScene"));
318  //printf("node scene %p\n", gs);
319  if (m_clipEnable.value()) {
320  float theta = m_clipTheta.value();
321  float phi = m_clipPhi.value();
322  using namespace TMath;
323  TEveVector in(Sin(theta) * Cos(phi), Sin(theta) * Sin(phi), Cos(theta));
324 
325  // one side of cross section plane is paralel to XY plane
326  TEveVector normXY(0., 1., 0);
327  TEveVector b0 = in.Cross(normXY);
328  TEveVector b1 = in.Cross(b0);
329 
330  float delta1 = m_clipDelta1.value();
331  float delta2 = m_clipDelta2.value();
332  b0.Normalize();
333  b0 *= Sin(delta1);
334  b1.Normalize();
335  b1 *= Sin(delta2);
336 
337  TEveVector c[4];
338  c[0] += b0;
339  c[0] += b1;
340  c[1] -= b0;
341  c[1] += b1;
342  c[2] -= b0;
343  c[2] -= b1;
344  c[3] += b0;
345  c[3] -= b1;
346  for (int i = 0; i < 4; ++i)
347  c[i] += in;
348 
349  TEveVector aOff = in;
350  aOff.NegateXYZ();
351  aOff.Normalize();
352  aOff *= m_clipAppexOffset.value();
353  ((Clipsi*)m_glClip)->SetAppexOffset(aOff);
354 
355  ((Clipsi*)m_glClip)->SetPlaneInfo(&c[0]);
356 
357  if (resetCamera) {
358  TGLBoundingBox bbox;
359  float es = getBBoxLineLength(eventScene(), in);
360  float gs = getBBoxLineLength(geoScene(), in);
361  setBBoxClipped(bbox, in, b0, b1, TMath::Max(es, gs));
362 
363  /*
364  TEvePointSet* bmarker = new TEvePointSet(8);
365  bmarker->Reset(4);
366  bmarker->SetName("bbox");
367  bmarker->SetMarkerColor(kOrange);
368  bmarker->SetMarkerStyle(3);
369  bmarker->SetMarkerSize(0.2);
370  for (int i = 0; i < 8; ++i)
371  bmarker->SetPoint(i, bbox[i].X(), bbox[i].Y(), bbox[i].Z());
372  eventScene()->AddElement(bmarker);
373  */
374 
375  TGLCamera& cam = viewerGL()->CurrentCamera();
376  cam.SetExternalCenter(true);
377  cam.SetCenterVec(bbox.Center().X(), bbox.Center().Y(), bbox.Center().Z());
378  cam.Setup(bbox, true);
379  } else {
380  eventScene()->Repaint();
381  }
382  }
383 
384  gEve->Redraw3D();
385 }

References b0, b1, HltBtagPostValidation_cff::c, FWEveView::eventScene(), FWEveView::geoScene(), mps_fire::i, recoMuon::in, m_clipAppexOffset, m_clipDelta1, m_clipDelta2, m_clipEnable, m_clipPhi, m_clipTheta, m_glClip, Max(), phi, FWEveView::resetCamera(), theta(), FWGenericParameter< T >::value(), and FWEveView::viewerGL().

Referenced by enableSceneClip(), and FW3DViewBase().

◆ updateGlobalSceneScaleParameters()

void FW3DViewBase::updateGlobalSceneScaleParameters ( )

◆ updateHGCalVisibility()

void FW3DViewBase::updateHGCalVisibility ( bool  )
private

Definition at line 387 of file FW3DViewBase.cc.

387  {
388  if (!m_clipEnable.value())
389  return;
390 
391  long lmin = m_clipHGCalLayerBegin.value();
392  long lmax = m_clipHGCalLayerEnd.value();
393 
394  // real min, max
395  long r_lmin = std::min(lmin, lmax);
396  long r_lmax = std::max(lmin, lmax);
397 
398  TEveElementList const* const HGCalEE = m_geometry->getHGCalEE();
399  if (HGCalEE) {
400  for (const auto& it : HGCalEE->RefChildren()) {
401  std::string title(it->GetElementTitle());
402  int layer = stoi(title.substr(title.length() - 2));
403  it->SetRnrState(layer >= r_lmin && layer <= r_lmax);
404  }
405  }
406 
407  TEveElementList const* const HGCalHSi = m_geometry->getHGCalHSi();
408  if (HGCalHSi) {
409  for (const auto& it : HGCalHSi->RefChildren()) {
410  std::string title(it->GetElementTitle());
411  int layer = stoi(title.substr(title.length() - 2)) + 28;
412  it->SetRnrState(layer >= r_lmin && layer <= r_lmax);
413  }
414  }
415 
416  TEveElementList const* const HGCalHSc = m_geometry->getHGCalHSc();
417  if (HGCalHSc) {
418  for (const auto& it : HGCalHSc->RefChildren()) {
419  std::string title(it->GetElementTitle());
420  int layer = stoi(title.substr(title.length() - 2)) + 28;
421  it->SetRnrState(layer >= r_lmin && layer <= r_lmax);
422  }
423  }
424 
425  gEve->Redraw3D();
426 }

References FW3DViewGeometry::getHGCalEE(), FW3DViewGeometry::getHGCalHSc(), FW3DViewGeometry::getHGCalHSi(), m_clipEnable, m_clipHGCalLayerBegin, m_clipHGCalLayerEnd, m_geometry, SiStripPI::max, min(), AlCaHLTBitMon_QueryRunRegistry::string, overlapproblemtsosanalyzer_cfi::title, and FWGenericParameter< T >::value().

Referenced by enableSceneClip(), and FW3DViewBase().

Member Data Documentation

◆ m_cameraType

FWEnumParameter FW3DViewBase::m_cameraType
private

Definition at line 95 of file FW3DViewBase.h.

Referenced by FW3DViewBase(), and populateController().

◆ m_clipAppexOffset

FWLongParameter FW3DViewBase::m_clipAppexOffset
private

Definition at line 102 of file FW3DViewBase.h.

Referenced by FW3DViewBase(), populateController(), and updateClipPlanes().

◆ m_clipDelta1

FWDoubleParameter FW3DViewBase::m_clipDelta1
private

Definition at line 100 of file FW3DViewBase.h.

Referenced by FW3DViewBase(), populateController(), and updateClipPlanes().

◆ m_clipDelta2

FWDoubleParameter FW3DViewBase::m_clipDelta2
private

Definition at line 101 of file FW3DViewBase.h.

Referenced by FW3DViewBase(), populateController(), and updateClipPlanes().

◆ m_clipEnable

FWBoolParameter FW3DViewBase::m_clipEnable
private

◆ m_clipHGCalLayerBegin

FWLongParameter FW3DViewBase::m_clipHGCalLayerBegin
private

Definition at line 103 of file FW3DViewBase.h.

Referenced by FW3DViewBase(), populateController(), and updateHGCalVisibility().

◆ m_clipHGCalLayerEnd

FWLongParameter FW3DViewBase::m_clipHGCalLayerEnd
private

Definition at line 104 of file FW3DViewBase.h.

Referenced by FW3DViewBase(), populateController(), and updateHGCalVisibility().

◆ m_clipPhi

FWDoubleParameter FW3DViewBase::m_clipPhi
private

Definition at line 99 of file FW3DViewBase.h.

Referenced by FW3DViewBase(), populateController(), setClip(), and updateClipPlanes().

◆ m_clipTheta

FWDoubleParameter FW3DViewBase::m_clipTheta
private

Definition at line 98 of file FW3DViewBase.h.

Referenced by FW3DViewBase(), populateController(), setClip(), and updateClipPlanes().

◆ m_DMT

FW3DViewDistanceMeasureTool* FW3DViewBase::m_DMT
private

◆ m_DMTline

TEveLine* FW3DViewBase::m_DMTline
private

Definition at line 107 of file FW3DViewBase.h.

Referenced by setContext(), and setCurrentDMTVertex().

◆ m_ecalBarrel

TEveBoxSet* FW3DViewBase::m_ecalBarrel
private

Definition at line 89 of file FW3DViewBase.h.

Referenced by FW3DViewBase(), and showEcalBarrel().

◆ m_geometry

FW3DViewGeometry* FW3DViewBase::m_geometry
private

Definition at line 75 of file FW3DViewBase.h.

Referenced by setContext(), showMuonBarrel(), and updateHGCalVisibility().

◆ m_glClip

TGLClip* FW3DViewBase::m_glClip
private

Definition at line 76 of file FW3DViewBase.h.

Referenced by enableSceneClip(), updateClipPlanes(), and ~FW3DViewBase().

◆ m_rnrStyle

FWEnumParameter FW3DViewBase::m_rnrStyle
private

Definition at line 92 of file FW3DViewBase.h.

Referenced by FW3DViewBase(), and populateController().

◆ m_selectable

FWBoolParameter FW3DViewBase::m_selectable
private

Definition at line 93 of file FW3DViewBase.h.

Referenced by FW3DViewBase(), and populateController().

◆ m_showEcalBarrel

FWBoolParameter FW3DViewBase::m_showEcalBarrel
private

Definition at line 90 of file FW3DViewBase.h.

Referenced by populateController(), and setContext().

◆ m_showHGCalEE

FWBoolParameter FW3DViewBase::m_showHGCalEE
private

Definition at line 85 of file FW3DViewBase.h.

Referenced by populateController(), and setContext().

◆ m_showHGCalHSc

FWBoolParameter FW3DViewBase::m_showHGCalHSc
private

Definition at line 87 of file FW3DViewBase.h.

Referenced by populateController(), and setContext().

◆ m_showHGCalHSi

FWBoolParameter FW3DViewBase::m_showHGCalHSi
private

Definition at line 86 of file FW3DViewBase.h.

Referenced by populateController(), and setContext().

◆ m_showMuonBarrel

FWEnumParameter FW3DViewBase::m_showMuonBarrel
private

Definition at line 79 of file FW3DViewBase.h.

Referenced by FW3DViewBase(), and populateController().

◆ m_showMuonEndcap

FWBoolParameter FW3DViewBase::m_showMuonEndcap
private

Definition at line 80 of file FW3DViewBase.h.

Referenced by populateController(), and setContext().

◆ m_showPixelBarrel

FWBoolParameter FW3DViewBase::m_showPixelBarrel
private

Definition at line 81 of file FW3DViewBase.h.

Referenced by populateController(), and setContext().

◆ m_showPixelEndcap

FWBoolParameter FW3DViewBase::m_showPixelEndcap
private

Definition at line 82 of file FW3DViewBase.h.

Referenced by populateController(), and setContext().

◆ m_showTrackerBarrel

FWBoolParameter FW3DViewBase::m_showTrackerBarrel
private

Definition at line 83 of file FW3DViewBase.h.

Referenced by populateController(), and setContext().

◆ m_showTrackerEndcap

FWBoolParameter FW3DViewBase::m_showTrackerEndcap
private

Definition at line 84 of file FW3DViewBase.h.

Referenced by populateController(), and setContext().

FW3DViewBase::m_showPixelEndcap
FWBoolParameter m_showPixelEndcap
Definition: FW3DViewBase.h:82
FW3DViewBase::m_DMTline
TEveLine * m_DMTline
Definition: FW3DViewBase.h:107
DDAxes::y
FW3DViewDistanceMeasureTool::m_action
EPickAction m_action
Definition: FW3DViewDistanceMeasureTool.h:32
mps_fire.i
i
Definition: mps_fire.py:355
FWGeometry
Definition: FWGeometry.h:27
L1TowerCalibrationProducer_cfi.calo
calo
Definition: L1TowerCalibrationProducer_cfi.py:59
FWGeometry::getCorners
const float * getCorners(unsigned int id) const
Definition: FWGeometry.cc:464
FW3DViewGeometry::showHGCalHSi
void showHGCalHSi(bool)
Definition: FW3DViewGeometry.cc:406
FW3DViewGeometry::showHGCalEE
void showHGCalEE(bool)
Definition: FW3DViewGeometry.cc:377
FW3DViewDistanceMeasureTool::buildGUI
TGCompositeFrame * buildGUI(TGCompositeFrame *p)
Definition: FW3DViewDistanceMeasureTool.cc:70
fireworks::Context::colorManager
FWColorManager * colorManager() const
Definition: Context.h:58
FW3DViewDistanceMeasureTool::refCurrentVertex
TGLVector3 & refCurrentVertex()
Definition: FW3DViewDistanceMeasureTool.cc:58
min
T min(T a, T b)
Definition: MathUtil.h:58
FW3DViewGeometry::showMuonBarrelFull
void showMuonBarrelFull(bool)
Definition: FW3DViewGeometry.cc:111
FW3DViewGeometry::showMuonBarrel
void showMuonBarrel(bool)
Definition: FW3DViewGeometry.cc:79
simpleEdmComparison.tName
tName
Definition: simpleEdmComparison.py:125
FWEveView::populateController
void populateController(ViewerParameterGUI &) const override
Definition: FWEveView.cc:466
FWEveView::setFrom
void setFrom(const FWConfiguration &) override
Definition: FWEveView.cc:307
FWEnumParameter::addEntry
bool addEntry(Long_t id, const std::string &txt)
Definition: FWEnumParameter.h:53
FW3DViewBase::m_showEcalBarrel
FWBoolParameter m_showEcalBarrel
Definition: FW3DViewBase.h:90
FW3DViewBase::m_rnrStyle
FWEnumParameter m_rnrStyle
Definition: FW3DViewBase.h:92
FWGenericParameter::set
void set(T iValue)
Definition: FWGenericParameter.h:70
DDAxes::x
FW3DViewBase::showEcalBarrel
void showEcalBarrel(bool)
Definition: FW3DViewBase.cc:508
FW3DViewBase::m_showHGCalHSc
FWBoolParameter m_showHGCalHSc
Definition: FW3DViewBase.h:87
FW3DViewBase::showMuonBarrel
void showMuonBarrel(long)
Definition: FW3DViewBase.cc:200
gs
Definition: AbsArchive.cc:45
FW3DViewDistanceMeasureTool::kNone
Definition: FW3DViewDistanceMeasureTool.h:14
FWEveView::eventScene
TEveScene * eventScene()
Definition: FWEveView.h:79
b1
static constexpr float b1
Definition: L1EGammaCrystalsEmulatorProducer.cc:82
FWViewBase::typeId
FWViewType::EType typeId() const
Definition: FWViewBase.h:42
GeomDetEnumerators::PixelBarrel
Definition: GeomDetEnumerators.h:11
alignCSCRings.s
s
Definition: alignCSCRings.py:92
FW3DViewBase::m_geometry
FW3DViewGeometry * m_geometry
Definition: FW3DViewBase.h:75
FWGenericParameter::changed_
sigc::signal< void, T > changed_
Definition: FWGenericParameter.h:75
ViewerParameterGUI::separator
ViewerParameterGUI & separator()
Definition: CmsShowViewPopup.cc:232
FWEveView::context
const fireworks::Context & context()
Definition: FWEveView.h:64
FWEveView::setFromPerspectiveCamera
void setFromPerspectiveCamera(TGLPerspectiveCamera *, const std::string &, const FWConfiguration &)
Definition: FWEveView.cc:420
FW3DViewGeometry::getHGCalHSi
TEveElementList const *const getHGCalHSi()
Definition: FW3DViewGeometry.h:50
FW3DViewBase::m_ecalBarrel
TEveBoxSet * m_ecalBarrel
Definition: FW3DViewBase.h:89
FW3DViewBase::m_clipHGCalLayerBegin
FWLongParameter m_clipHGCalLayerBegin
Definition: FW3DViewBase.h:103
DDAxes::z
FW3DViewBase::m_clipHGCalLayerEnd
FWLongParameter m_clipHGCalLayerEnd
Definition: FW3DViewBase.h:104
FW3DViewGeometry::getHGCalHSc
TEveElementList const *const getHGCalHSc()
Definition: FW3DViewGeometry.h:52
FW3DViewBase::m_clipAppexOffset
FWLongParameter m_clipAppexOffset
Definition: FW3DViewBase.h:102
relativeConstraints.geom
geom
Definition: relativeConstraints.py:72
theta
Geom::Theta< T > theta() const
Definition: Basic3DVectorLD.h:150
FWConfiguration::valueForKey
const FWConfiguration * valueForKey(const std::string &iKey) const
Definition: FWConfiguration.cc:121
AlCaHLTBitMon_QueryRunRegistry.string
string
Definition: AlCaHLTBitMon_QueryRunRegistry.py:256
FW3DViewBase::selectable
void selectable(bool)
Definition: FW3DViewBase.cc:221
FWConfiguration::value
const std::string & value(unsigned int iIndex=0) const
Definition: FWConfiguration.cc:114
FW3DViewGeometry::showMuonEndcap
void showMuonEndcap(bool)
Definition: FW3DViewGeometry.cc:141
FW3DViewBase::m_showTrackerEndcap
FWBoolParameter m_showTrackerEndcap
Definition: FW3DViewBase.h:84
FW3DViewBase::setCameraType
void setCameraType(long)
Definition: FW3DViewBase.cc:207
FW3DViewBase::m_glClip
TGLClip * m_glClip
Definition: FW3DViewBase.h:76
ViewerParameterGUI::getTabContainer
TGCompositeFrame * getTabContainer()
Definition: CmsShowViewPopup.cc:240
FW3DViewBase::m_showMuonEndcap
FWBoolParameter m_showMuonEndcap
Definition: FW3DViewBase.h:80
SiStripPI::max
Definition: SiStripPayloadInspectorHelper.h:169
recoMuon::in
Definition: RecoMuonEnumerators.h:6
fireworks::Context::getGeom
FWGeometry * getGeom() const
Definition: Context.h:72
FW3DViewBase::m_clipEnable
FWBoolParameter m_clipEnable
Definition: FW3DViewBase.h:97
FW3DViewBase::updateHGCalVisibility
void updateHGCalVisibility(bool)
Definition: FW3DViewBase.cc:387
FWColorManager::setGeomTransparency
void setGeomTransparency(Color_t idx, bool projectedType)
Definition: FWColorManager.cc:238
FW3DViewGeometry::showPixelEndcap
void showPixelEndcap(bool)
Definition: FW3DViewGeometry.cc:300
FW3DViewDistanceMeasureTool::resetAction
void resetAction()
Definition: FW3DViewDistanceMeasureTool.cc:22
b0
static constexpr float b0
Definition: L1EGammaCrystalsEmulatorProducer.cc:82
Max
T Max(T a, T b)
Definition: MathUtil.h:44
FW3DViewBase::m_showMuonBarrel
FWEnumParameter m_showMuonBarrel
Definition: FW3DViewBase.h:79
FWEveView::FWEveView
FWEveView(TEveWindowSlot *, FWViewType::EType, unsigned int version=7)
Definition: FWEveView.cc:70
HltBtagPostValidation_cff.c
c
Definition: HltBtagPostValidation_cff.py:31
FWConfiguration::version
unsigned int version() const
Definition: FWConfiguration.h:49
FW3DViewBase::rnrStyle
void rnrStyle(long)
Definition: FW3DViewBase.cc:215
FW3DViewBase::m_selectable
FWBoolParameter m_selectable
Definition: FW3DViewBase.h:93
cmsLHEtoEOSManager.l
l
Definition: cmsLHEtoEOSManager.py:193
overlapproblemtsosanalyzer_cfi.title
title
Definition: overlapproblemtsosanalyzer_cfi.py:7
FW3DViewGeometry::showHGCalHSc
void showHGCalHSc(bool)
Definition: FW3DViewGeometry.cc:435
FWGenericParameter::value
T value() const
Definition: FWGenericParameter.h:50
DDAxes::phi
FW3DViewGeometry::showPixelBarrel
void showPixelBarrel(bool)
Definition: FW3DViewGeometry.cc:274
FW3DViewBase::m_cameraType
FWEnumParameter m_cameraType
Definition: FW3DViewBase.h:95
FWEveView::addToPerspectiveCamera
void addToPerspectiveCamera(TGLPerspectiveCamera *, const std::string &, FWConfiguration &) const
Definition: FWEveView.cc:397
FW3DViewBase::m_clipDelta2
FWDoubleParameter m_clipDelta2
Definition: FW3DViewBase.h:101
FW3DViewBase::m_clipPhi
FWDoubleParameter m_clipPhi
Definition: FW3DViewBase.h:99
FWEveView::addTo
void addTo(FWConfiguration &) const override
Definition: FWEveView.cc:291
FWConfigurableParameterizable::version
unsigned int version() const
Definition: FWConfigurableParameterizable.h:37
FW3DViewBase::m_showPixelBarrel
FWBoolParameter m_showPixelBarrel
Definition: FW3DViewBase.h:81
FW3DViewBase::m_showTrackerBarrel
FWBoolParameter m_showTrackerBarrel
Definition: FW3DViewBase.h:83
FW3DViewGeometry
Definition: FW3DViewGeometry.h:29
FW3DViewBase::m_DMT
FW3DViewDistanceMeasureTool * m_DMT
Definition: FW3DViewBase.h:106
FWEveView::resetCamera
virtual void resetCamera()
Definition: FWEveView.cc:224
FWViewType::k3D
Definition: FWViewType.h:34
FWEveView::viewerGL
TGLViewer * viewerGL() const
Definition: FWEveView.cc:177
FW3DViewBase::m_showHGCalHSi
FWBoolParameter m_showHGCalHSi
Definition: FW3DViewBase.h:86
FW3DViewBase::m_clipTheta
FWDoubleParameter m_clipTheta
Definition: FW3DViewBase.h:98
FW3DViewBase::enableSceneClip
void enableSceneClip(bool)
Definition: FW3DViewBase.cc:222
FWEveView::setContext
virtual void setContext(const fireworks::Context &x)
Definition: FWEveView.cc:227
FW3DViewGeometry::showTrackerBarrel
void showTrackerBarrel(bool)
Definition: FW3DViewGeometry.cc:323
FWEveView::geoScene
TEveScene * geoScene()
Definition: FWEveView.h:80
newFWLiteAna.base
base
Definition: newFWLiteAna.py:92
FW3DViewBase::updateClipPlanes
void updateClipPlanes(bool resetCamera)
Definition: FW3DViewBase.cc:316
FW3DViewGeometry::getHGCalEE
TEveElementList const *const getHGCalEE()
Definition: FW3DViewGeometry.h:48
FW3DViewDistanceMeasureTool
Definition: FW3DViewDistanceMeasureTool.h:10
ViewerParameterGUI::addParam
ViewerParameterGUI & addParam(const FWParameterBase *)
Definition: CmsShowViewPopup.cc:212
FW3DViewBase::m_showHGCalEE
FWBoolParameter m_showHGCalEE
Definition: FW3DViewBase.h:85
FW3DViewGeometry::showTrackerEndcap
void showTrackerEndcap(bool)
Definition: FW3DViewGeometry.cc:350
ViewerParameterGUI::requestTab
ViewerParameterGUI & requestTab(const char *)
Definition: CmsShowViewPopup.cc:197
FW3DViewBase::m_clipDelta1
FWDoubleParameter m_clipDelta1
Definition: FW3DViewBase.h:100