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(std::bind(&FW3DViewBase::showMuonBarrel, this, std::placeholders::_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(std::bind(&FW3DViewBase::rnrStyle, this, std::placeholders::_1));
139 
140  m_selectable.changed_.connect(std::bind(&FW3DViewBase::selectable, this, std::placeholders::_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(std::bind(&FW3DViewBase::setCameraType, this, std::placeholders::_1));
150 
151  m_clipEnable.changed_.connect(std::bind(&FW3DViewBase::enableSceneClip, this, std::placeholders::_1));
152  m_clipTheta.changed_.connect(std::bind(&FW3DViewBase::updateClipPlanes, this, false));
153  m_clipPhi.changed_.connect(std::bind(&FW3DViewBase::updateClipPlanes, this, false));
154  m_clipDelta1.changed_.connect(std::bind(&FW3DViewBase::updateClipPlanes, this, false));
155  m_clipDelta2.changed_.connect(std::bind(&FW3DViewBase::updateClipPlanes, this, false));
156  m_clipAppexOffset.changed_.connect(std::bind(&FW3DViewBase::updateClipPlanes, this, false));
157  m_clipHGCalLayerBegin.changed_.connect(std::bind(&FW3DViewBase::updateHGCalVisibility, this, false));
158  m_clipHGCalLayerEnd.changed_.connect(std::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 431 of file FW3DViewBase.cc.

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

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

◆ enableSceneClip()

void FW3DViewBase::enableSceneClip ( bool  x)
private

Definition at line 224 of file FW3DViewBase.cc.

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

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 472 of file FW3DViewBase.cc.

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

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 217 of file FW3DViewBase.cc.

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

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

Referenced by FW3DViewBase().

◆ selectable()

void FW3DViewBase::selectable ( bool  x)
private

Definition at line 223 of file FW3DViewBase.cc.

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

References FWEveView::geoScene(), and x.

Referenced by FW3DViewBase().

◆ setCameraType()

void FW3DViewBase::setCameraType ( long  x)
private

Definition at line 209 of file FW3DViewBase.cc.

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

References FWEveView::viewerGL(), and x.

Referenced by FW3DViewBase().

◆ setClip()

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

Definition at line 242 of file FW3DViewBase.cc.

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

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 
175  m_showPixelBarrel.changed_.connect(std::bind(&FW3DViewGeometry::showPixelBarrel, m_geometry, std::placeholders::_1));
176  m_showPixelEndcap.changed_.connect(std::bind(&FW3DViewGeometry::showPixelEndcap, m_geometry, std::placeholders::_1));
178  std::bind(&FW3DViewGeometry::showTrackerBarrel, m_geometry, std::placeholders::_1));
180  std::bind(&FW3DViewGeometry::showTrackerEndcap, m_geometry, std::placeholders::_1));
181  m_showHGCalEE.changed_.connect(std::bind(&FW3DViewGeometry::showHGCalEE, m_geometry, std::placeholders::_1));
182  m_showHGCalHSi.changed_.connect(std::bind(&FW3DViewGeometry::showHGCalHSi, m_geometry, std::placeholders::_1));
183  m_showHGCalHSc.changed_.connect(std::bind(&FW3DViewGeometry::showHGCalHSc, m_geometry, std::placeholders::_1));
184  m_showMuonEndcap.changed_.connect(std::bind(&FW3DViewGeometry::showMuonEndcap, m_geometry, std::placeholders::_1));
185  m_showEcalBarrel.changed_.connect(std::bind(&FW3DViewBase::showEcalBarrel, this, std::placeholders::_1));
186 
187  // don't clip event scene -- ideally, would have TGLClipNoClip in root
188  TGLClipPlane* c = new TGLClipPlane();
189  c->Setup(TGLVector3(1e10, 0, 0), TGLVector3(-1, 0, 0));
190  eventScene()->GetGLScene()->SetClip(c);
191 
192  m_DMTline = new TEveLine();
193  m_DMTline->SetLineColor(1016);
194  m_DMTline->SetLineStyle(5);
195 
196  m_DMTline->SetPoint(0, 0, 0, 0);
197  m_DMTline->SetPoint(1, 0, 0, 0);
198  eventScene()->AddElement(m_DMTline);
200 }

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 460 of file FW3DViewBase.cc.

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

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 440 of file FW3DViewBase.cc.

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

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 510 of file FW3DViewBase.cc.

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

References 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 202 of file FW3DViewBase.cc.

202  {
203  if (m_geometry) {
204  m_geometry->showMuonBarrel(x == 1);
206  }
207 }

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

Referenced by FW3DViewBase().

◆ updateClipPlanes()

void FW3DViewBase::updateClipPlanes ( bool  resetCamera)
private

Definition at line 318 of file FW3DViewBase.cc.

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

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 389 of file FW3DViewBase.cc.

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

References FW3DViewGeometry::getHGCalEE(), FW3DViewGeometry::getHGCalHSc(), FW3DViewGeometry::getHGCalHSi(), m_clipEnable, m_clipHGCalLayerBegin, m_clipHGCalLayerEnd, m_geometry, SiStripPI::max, min(), AlCaHLTBitMon_QueryRunRegistry::string, runGCPTkAlMap::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
runGCPTkAlMap.title
string title
Definition: runGCPTkAlMap.py:94
mps_fire.i
i
Definition: mps_fire.py:428
FWGeometry
Definition: FWGeometry.h:27
FWGeometry::getCorners
const float * getCorners(unsigned int id) const
Definition: FWGeometry.cc:467
FW3DViewGeometry::showHGCalHSi
void showHGCalHSi(bool)
Definition: FW3DViewGeometry.cc:408
FW3DViewGeometry::showHGCalEE
void showHGCalEE(bool)
Definition: FW3DViewGeometry.cc:379
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:113
FW3DViewGeometry::showMuonBarrel
void showMuonBarrel(bool)
Definition: FW3DViewGeometry.cc:81
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:510
FW3DViewBase::m_showHGCalHSc
FWBoolParameter m_showHGCalHSc
Definition: FW3DViewBase.h:87
FW3DViewBase::showMuonBarrel
void showMuonBarrel(long)
Definition: FW3DViewBase.cc:202
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:122
AlCaHLTBitMon_QueryRunRegistry.string
string
Definition: AlCaHLTBitMon_QueryRunRegistry.py:256
FW3DViewBase::selectable
void selectable(bool)
Definition: FW3DViewBase.cc:223
FWConfiguration::value
const std::string & value(unsigned int iIndex=0) const
Definition: FWConfiguration.cc:115
FW3DViewGeometry::showMuonEndcap
void showMuonEndcap(bool)
Definition: FW3DViewGeometry.cc:143
FW3DViewBase::m_showTrackerEndcap
FWBoolParameter m_showTrackerEndcap
Definition: FW3DViewBase.h:84
FW3DViewBase::setCameraType
void setCameraType(long)
Definition: FW3DViewBase.cc:209
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:389
FWColorManager::setGeomTransparency
void setGeomTransparency(Color_t idx, bool projectedType)
Definition: FWColorManager.cc:238
FW3DViewGeometry::showPixelEndcap
void showPixelEndcap(bool)
Definition: FW3DViewGeometry.cc:302
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:217
FW3DViewBase::m_selectable
FWBoolParameter m_selectable
Definition: FW3DViewBase.h:93
cmsLHEtoEOSManager.l
l
Definition: cmsLHEtoEOSManager.py:204
FW3DViewGeometry::showHGCalHSc
void showHGCalHSc(bool)
Definition: FW3DViewGeometry.cc:437
FWGenericParameter::value
T value() const
Definition: FWGenericParameter.h:50
DDAxes::phi
FW3DViewGeometry::showPixelBarrel
void showPixelBarrel(bool)
Definition: FW3DViewGeometry.cc:276
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:224
FWEveView::setContext
virtual void setContext(const fireworks::Context &x)
Definition: FWEveView.cc:227
FW3DViewGeometry::showTrackerBarrel
void showTrackerBarrel(bool)
Definition: FW3DViewGeometry.cc:325
calo
Definition: Common.h:9
FWEveView::geoScene
TEveScene * geoScene()
Definition: FWEveView.h:80
newFWLiteAna.base
base
Definition: newFWLiteAna.py:92
FW3DViewBase::updateClipPlanes
void updateClipPlanes(bool resetCamera)
Definition: FW3DViewBase.cc:318
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:352
ViewerParameterGUI::requestTab
ViewerParameterGUI & requestTab(const char *)
Definition: CmsShowViewPopup.cc:197
FW3DViewBase::m_clipDelta1
FWDoubleParameter m_clipDelta1
Definition: FW3DViewBase.h:100