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
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)
 
 FWEveView (const FWEveView &)=delete
 
FWTEveViewerfwViewer ()
 
FWTGLViewerfwViewerGL () const
 
TEveScene * geoScene ()
 
virtual bool isEnergyScaleGlobal () const
 
const FWEveViewoperator= (const FWEveView &)=delete
 
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)
 
 FWViewBase (const FWViewBase &)=delete
 
const FWViewBaseoperator= (const FWViewBase &)=delete
 
void promptForSaveImageTo (TGFrame *) const
 
FWViewType::EType typeId () const
 
const std::string & typeName () const
 
- Public Member Functions inherited from FWConfigurableParameterizable
 FWConfigurableParameterizable (unsigned int iVersion=1)
 
 FWConfigurableParameterizable (const FWConfigurableParameterizable &)=delete
 
const
FWConfigurableParameterizable
operator= (const FWConfigurableParameterizable &)=delete
 
unsigned int version () const
 
 ~FWConfigurableParameterizable () override
 
- Public Member Functions inherited from FWParameterizable
void add (FWParameterBase *)
 
const_iterator begin () const
 
const_iterator end () const
 
 FWParameterizable ()
 
 FWParameterizable (const FWParameterizable &)=delete
 
const FWParameterizableoperator= (const FWParameterizable &)=delete
 
virtual ~FWParameterizable ()
 
- Public Member Functions inherited from FWConfigurable
 FWConfigurable ()
 
 FWConfigurable (const FWConfigurable &)=delete
 
const FWConfigurableoperator= (const FWConfigurable &)=delete
 
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::FW3DViewBase ( TEveWindowSlot *  iParent,
FWViewType::EType  typeId,
unsigned int  version = 8 
)

Definition at line 100 of file FW3DViewBase.cc.

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().

101  : FWEveView(iParent, typeId, version),
102  m_geometry(nullptr),
103  m_glClip(nullptr),
104  m_showMuonBarrel(this, "Show Muon Barrel", 0l, 0l, 2l),
105  m_showMuonEndcap(this, "Show Muon Endcap", false),
106  m_showPixelBarrel(this, "Show Pixel Barrel", false),
107  m_showPixelEndcap(this, "Show Pixel Endcap", false),
108  m_showTrackerBarrel(this, "Show Tracker Barrel", false),
109  m_showTrackerEndcap(this, "Show Tracker Endcap", false),
110  m_showHGCalEE(this, "Show HGCalEE", false),
111  m_showHGCalHSi(this, "Show HGCalHSi", false),
112  m_showHGCalHSc(this, "Show HGCalHSc", false),
113  m_ecalBarrel(nullptr),
114  m_showEcalBarrel(this, "Show Ecal Barrel", false),
115  m_rnrStyle(this, "Render Style", 0l, 0l, 2l),
116  m_selectable(this, "Enable Tooltips", false),
117  m_cameraType(this, "Camera Type", 0l, 0l, 5l),
118  m_clipEnable(this, "Enable Clip", false),
119  m_clipTheta(this, "Clip Theta", 0.0, -5.0, 5.0),
120  m_clipPhi(this, "Clip Phi", 0.0, -2.0, 2.0),
121  m_clipDelta1(this, "Clip Delta1", 0.2, 0.01, 2),
122  m_clipDelta2(this, "Clip Delta2", 0.2, 0.01, 2),
123  m_clipAppexOffset(this, "Appex Offset", 10l, 0l, 50l),
124  m_clipHGCalLayerBegin(this, "HGCal Lower Bound", 1l, 1l, 52l),
125  m_clipHGCalLayerEnd(this, "HGCal Upper Bound", 52l, 1l, 52l),
126  m_DMT(nullptr),
127  m_DMTline(nullptr) {
128  viewerGL()->SetCurrentCamera(TGLViewer::kCameraPerspXOZ);
130 
131  m_showMuonBarrel.addEntry(0, "Hide");
132  m_showMuonBarrel.addEntry(1, "Simplified");
133  m_showMuonBarrel.addEntry(2, "Full");
134  m_showMuonBarrel.changed_.connect(std::bind(&FW3DViewBase::showMuonBarrel, this, std::placeholders::_1));
135 
136  m_rnrStyle.addEntry(TGLRnrCtx::kFill, "Fill");
137  m_rnrStyle.addEntry(TGLRnrCtx::kOutline, "Outline");
138  m_rnrStyle.addEntry(TGLRnrCtx::kWireFrame, "WireFrame");
139  m_rnrStyle.changed_.connect(std::bind(&FW3DViewBase::rnrStyle, this, std::placeholders::_1));
140 
141  m_selectable.changed_.connect(std::bind(&FW3DViewBase::selectable, this, std::placeholders::_1));
142 
143  m_cameraType.addEntry(TGLViewer::kCameraPerspXOZ, "PerspXOZ");
144  m_cameraType.addEntry(TGLViewer::kCameraOrthoXOY, "OrthoXOY");
145  m_cameraType.addEntry(TGLViewer::kCameraOrthoXOZ, "OrthoXOZ");
146  m_cameraType.addEntry(TGLViewer::kCameraOrthoZOY, "OrthoZOY");
147  m_cameraType.addEntry(TGLViewer::kCameraOrthoXnOY, "OrthoXnOY");
148  m_cameraType.addEntry(TGLViewer::kCameraOrthoXnOZ, "OrthoXnOZ");
149  m_cameraType.addEntry(TGLViewer::kCameraOrthoZnOY, "OrthoZnOY");
150  m_cameraType.changed_.connect(std::bind(&FW3DViewBase::setCameraType, this, std::placeholders::_1));
151 
152  m_clipEnable.changed_.connect(std::bind(&FW3DViewBase::enableSceneClip, this, std::placeholders::_1));
153  m_clipTheta.changed_.connect(std::bind(&FW3DViewBase::updateClipPlanes, this, false));
154  m_clipPhi.changed_.connect(std::bind(&FW3DViewBase::updateClipPlanes, this, false));
155  m_clipDelta1.changed_.connect(std::bind(&FW3DViewBase::updateClipPlanes, this, false));
156  m_clipDelta2.changed_.connect(std::bind(&FW3DViewBase::updateClipPlanes, this, false));
157  m_clipAppexOffset.changed_.connect(std::bind(&FW3DViewBase::updateClipPlanes, this, false));
158  m_clipHGCalLayerBegin.changed_.connect(std::bind(&FW3DViewBase::updateHGCalVisibility, this, false));
159  m_clipHGCalLayerEnd.changed_.connect(std::bind(&FW3DViewBase::updateHGCalVisibility, this, false));
160 
161  m_ecalBarrel = new TEveBoxSet("ecalBarrel");
162  m_ecalBarrel->UseSingleColor();
163  m_ecalBarrel->SetMainColor(kAzure + 10);
164  m_ecalBarrel->SetMainTransparency(98);
165  geoScene()->AddElement(m_ecalBarrel);
166 }
FWDoubleParameter m_clipTheta
Definition: FW3DViewBase.h:98
void updateHGCalVisibility(bool)
void showMuonBarrel(long)
void rnrStyle(long)
FWBoolParameter m_showMuonEndcap
Definition: FW3DViewBase.h:80
FWBoolParameter m_showHGCalEE
Definition: FW3DViewBase.h:85
FWBoolParameter m_showTrackerBarrel
Definition: FW3DViewBase.h:83
TGLViewer * viewerGL() const
Definition: FWEveView.cc:177
FW3DViewDistanceMeasureTool * m_DMT
Definition: FW3DViewBase.h:106
void selectable(bool)
void setCameraType(long)
FWDoubleParameter m_clipPhi
Definition: FW3DViewBase.h:99
void enableSceneClip(bool)
FWEnumParameter m_rnrStyle
Definition: FW3DViewBase.h:92
void updateClipPlanes(bool resetCamera)
FWBoolParameter m_clipEnable
Definition: FW3DViewBase.h:97
FWBoolParameter m_showPixelEndcap
Definition: FW3DViewBase.h:82
FWDoubleParameter m_clipDelta1
Definition: FW3DViewBase.h:100
bool addEntry(Long_t id, const std::string &txt)
FWLongParameter m_clipHGCalLayerBegin
Definition: FW3DViewBase.h:103
FWBoolParameter m_showHGCalHSi
Definition: FW3DViewBase.h:86
FWBoolParameter m_showHGCalHSc
Definition: FW3DViewBase.h:87
FWBoolParameter m_showEcalBarrel
Definition: FW3DViewBase.h:90
TEveScene * geoScene()
Definition: FWEveView.h:80
FWEveView(TEveWindowSlot *, FWViewType::EType, unsigned int version=7)
Definition: FWEveView.cc:70
TGLClip * m_glClip
Definition: FW3DViewBase.h:76
TEveLine * m_DMTline
Definition: FW3DViewBase.h:107
TEveBoxSet * m_ecalBarrel
Definition: FW3DViewBase.h:89
FWEnumParameter m_showMuonBarrel
Definition: FW3DViewBase.h:79
FW3DViewGeometry * m_geometry
Definition: FW3DViewBase.h:75
sigc::signal< void(T)> changed_
FWBoolParameter m_selectable
Definition: FW3DViewBase.h:93
FWLongParameter m_clipHGCalLayerEnd
Definition: FW3DViewBase.h:104
FWEnumParameter m_cameraType
Definition: FW3DViewBase.h:95
FWLongParameter m_clipAppexOffset
Definition: FW3DViewBase.h:102
FWBoolParameter m_showTrackerEndcap
Definition: FW3DViewBase.h:84
FWDoubleParameter m_clipDelta2
Definition: FW3DViewBase.h:101
FWBoolParameter m_showPixelBarrel
Definition: FW3DViewBase.h:81
FWViewType::EType typeId() const
Definition: FWViewBase.h:42
FW3DViewBase::~FW3DViewBase ( )
override

Definition at line 168 of file FW3DViewBase.cc.

References m_glClip.

168 { delete m_glClip; }
TGLClip * m_glClip
Definition: FW3DViewBase.h:76
FW3DViewBase::FW3DViewBase ( const FW3DViewBase )
private

Member Function Documentation

void FW3DViewBase::addTo ( FWConfiguration iTo) const
overridevirtual

Implements FWConfigurable.

Definition at line 432 of file FW3DViewBase.cc.

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

432  {
433  // take care of parameters
434  FWEveView::addTo(iTo);
435  TGLPerspectiveCamera* camera = dynamic_cast<TGLPerspectiveCamera*>(&(viewerGL()->CurrentCamera()));
436  if (camera)
437  addToPerspectiveCamera(camera, "Plain3D", iTo);
438 }
TGLViewer * viewerGL() const
Definition: FWEveView.cc:177
void addTo(FWConfiguration &) const override
Definition: FWEveView.cc:291
void addToPerspectiveCamera(TGLPerspectiveCamera *, const std::string &, FWConfiguration &) const
Definition: FWEveView.cc:397
void FW3DViewBase::enableSceneClip ( bool  x)
private

Definition at line 225 of file FW3DViewBase.cc.

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

Referenced by FW3DViewBase().

225  {
226  if (m_glClip == nullptr) {
227  m_glClip = new Clipsi(viewerGL()->GetRnrCtx());
228 
229  m_glClip->SetMode(TGLClip::kOutside);
230  }
231 
232  geoScene()->GetGLScene()->SetClip(x ? m_glClip : nullptr);
233  for (TEveElement::List_i it = gEve->GetScenes()->BeginChildren(); it != gEve->GetScenes()->EndChildren(); ++it) {
234  if (strncmp((*it)->GetElementName(), "TopGeoNodeScene", 15) == 0)
235  ((TEveScene*)(*it))->GetGLScene()->SetClip(x ? m_glClip : nullptr);
236  }
237  eventScene()->GetGLScene()->SetClip(x ? m_glClip : nullptr);
238  updateClipPlanes(true);
239  updateHGCalVisibility(false);
240  viewerGL()->RequestDraw();
241 }
void updateHGCalVisibility(bool)
TEveScene * eventScene()
Definition: FWEveView.h:79
TGLViewer * viewerGL() const
Definition: FWEveView.cc:177
void updateClipPlanes(bool resetCamera)
TEveScene * geoScene()
Definition: FWEveView.h:80
TGLClip * m_glClip
Definition: FW3DViewBase.h:76
FW3DViewDistanceMeasureTool* FW3DViewBase::getDMT ( )
inline

Definition at line 61 of file FW3DViewBase.h.

References m_DMT.

61 { return m_DMT; }
FW3DViewDistanceMeasureTool * m_DMT
Definition: FW3DViewBase.h:106
const FW3DViewBase& FW3DViewBase::operator= ( const FW3DViewBase )
private
void FW3DViewBase::populateController ( ViewerParameterGUI gui) const
overridevirtual

Reimplemented from FWViewBase.

Reimplemented in FWISpyView.

Definition at line 473 of file FW3DViewBase.cc.

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().

473  {
475 
476  gui.requestTab("Detector")
489 
490  gui.requestTab("Clipping")
499 
500  gui.requestTab("Style").separator();
501  gui.getTabContainer()->AddFrame(
502  new TGTextButton(gui.getTabContainer(),
503  "Root controls",
504  Form("TEveGedEditor::SpawnNewEditor((TGLViewer*)0x%lx)", (unsigned long)viewerGL())));
505 
506  gui.requestTab("Tools").addParam(&m_cameraType).separator();
507  gui.getTabContainer()->AddFrame(m_DMT->buildGUI(gui.getTabContainer()),
508  new TGLayoutHints(kLHintsExpandX, 2, 2, 2, 2));
509 }
FWDoubleParameter m_clipTheta
Definition: FW3DViewBase.h:98
FWBoolParameter m_showMuonEndcap
Definition: FW3DViewBase.h:80
FWBoolParameter m_showHGCalEE
Definition: FW3DViewBase.h:85
ViewerParameterGUI & requestTab(const char *)
ViewerParameterGUI & separator()
TGCompositeFrame * buildGUI(TGCompositeFrame *p)
FWBoolParameter m_showTrackerBarrel
Definition: FW3DViewBase.h:83
TGLViewer * viewerGL() const
Definition: FWEveView.cc:177
FW3DViewDistanceMeasureTool * m_DMT
Definition: FW3DViewBase.h:106
FWDoubleParameter m_clipPhi
Definition: FW3DViewBase.h:99
FWEnumParameter m_rnrStyle
Definition: FW3DViewBase.h:92
FWBoolParameter m_clipEnable
Definition: FW3DViewBase.h:97
FWBoolParameter m_showPixelEndcap
Definition: FW3DViewBase.h:82
FWDoubleParameter m_clipDelta1
Definition: FW3DViewBase.h:100
FWLongParameter m_clipHGCalLayerBegin
Definition: FW3DViewBase.h:103
FWBoolParameter m_showHGCalHSi
Definition: FW3DViewBase.h:86
void populateController(ViewerParameterGUI &) const override
Definition: FWEveView.cc:466
FWBoolParameter m_showHGCalHSc
Definition: FW3DViewBase.h:87
FWBoolParameter m_showEcalBarrel
Definition: FW3DViewBase.h:90
ViewerParameterGUI & addParam(const FWParameterBase *)
TGCompositeFrame * getTabContainer()
FWEnumParameter m_showMuonBarrel
Definition: FW3DViewBase.h:79
FWBoolParameter m_selectable
Definition: FW3DViewBase.h:93
FWLongParameter m_clipHGCalLayerEnd
Definition: FW3DViewBase.h:104
FWEnumParameter m_cameraType
Definition: FW3DViewBase.h:95
FWLongParameter m_clipAppexOffset
Definition: FW3DViewBase.h:102
FWBoolParameter m_showTrackerEndcap
Definition: FW3DViewBase.h:84
FWDoubleParameter m_clipDelta2
Definition: FW3DViewBase.h:101
FWBoolParameter m_showPixelBarrel
Definition: FW3DViewBase.h:81
bool FW3DViewBase::requestGLHandlerPick ( ) const
overridevirtual
void FW3DViewBase::rnrStyle ( long  x)
private

Definition at line 218 of file FW3DViewBase.cc.

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

Referenced by FW3DViewBase().

218  {
219  geoScene()->GetGLScene()->SetStyle(x);
220  viewerGL()->Changed();
221  gEve->Redraw3D();
222 }
TGLViewer * viewerGL() const
Definition: FWEveView.cc:177
TEveScene * geoScene()
Definition: FWEveView.h:80
void FW3DViewBase::selectable ( bool  x)
private

Definition at line 224 of file FW3DViewBase.cc.

References FWEveView::geoScene().

Referenced by FW3DViewBase().

224 { geoScene()->GetGLScene()->SetSelectable(x); }
TEveScene * geoScene()
Definition: FWEveView.h:80
void FW3DViewBase::setCameraType ( long  x)
private

Definition at line 210 of file FW3DViewBase.cc.

References FWEveView::viewerGL().

Referenced by FW3DViewBase().

210  {
211  viewerGL()->RefCamera(TGLViewer::ECameraType(x)).IncTimeStamp();
212  viewerGL()->SetCurrentCamera(TGLViewer::ECameraType(x));
213 
214  //if (viewerGL()->CurrentCamera().IsOrthographic())
215  // ((TGLOrthoCamera*)(&viewerGL()->CurrentCamera()))->SetEnableRotate(1);
216 }
TGLViewer * viewerGL() const
Definition: FWEveView.cc:177
void FW3DViewBase::setClip ( float  eta,
float  phi 
)

Definition at line 243 of file FW3DViewBase.cc.

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

243  {
244  // called from popup menu via FWGUIManager
245 
246  // limit to 2 decimals, else TGNumber entry in the view controller shows only last 5 irrelevant digits
247  double base = 100.0;
248  int thetaInt = theta * base;
249  int phiInt = phi * base;
250  m_clipTheta.set(thetaInt / base);
251  m_clipPhi.set(phiInt / base);
252  m_clipEnable.set(true);
253 }
tuple base
Main Program
Definition: newFWLiteAna.py:92
FWDoubleParameter m_clipTheta
Definition: FW3DViewBase.h:98
Geom::Theta< T > theta() const
FWDoubleParameter m_clipPhi
Definition: FW3DViewBase.h:99
FWBoolParameter m_clipEnable
Definition: FW3DViewBase.h:97
void FW3DViewBase::setContext ( const fireworks::Context context)
overridevirtual

Reimplemented from FWEveView.

Reimplemented in FWISpyView.

Definition at line 170 of file FW3DViewBase.cc.

References c, FWGenericParameter< T >::changed_, 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().

170  {
171  FWEveView::setContext(context);
172 
173  m_geometry = new FW3DViewGeometry(context);
174  geoScene()->AddElement(m_geometry);
175 
176  m_showPixelBarrel.changed_.connect(std::bind(&FW3DViewGeometry::showPixelBarrel, m_geometry, std::placeholders::_1));
177  m_showPixelEndcap.changed_.connect(std::bind(&FW3DViewGeometry::showPixelEndcap, m_geometry, std::placeholders::_1));
179  std::bind(&FW3DViewGeometry::showTrackerBarrel, m_geometry, std::placeholders::_1));
181  std::bind(&FW3DViewGeometry::showTrackerEndcap, m_geometry, std::placeholders::_1));
182  m_showHGCalEE.changed_.connect(std::bind(&FW3DViewGeometry::showHGCalEE, m_geometry, std::placeholders::_1));
183  m_showHGCalHSi.changed_.connect(std::bind(&FW3DViewGeometry::showHGCalHSi, m_geometry, std::placeholders::_1));
184  m_showHGCalHSc.changed_.connect(std::bind(&FW3DViewGeometry::showHGCalHSc, m_geometry, std::placeholders::_1));
185  m_showMuonEndcap.changed_.connect(std::bind(&FW3DViewGeometry::showMuonEndcap, m_geometry, std::placeholders::_1));
186  m_showEcalBarrel.changed_.connect(std::bind(&FW3DViewBase::showEcalBarrel, this, std::placeholders::_1));
187 
188  // don't clip event scene -- ideally, would have TGLClipNoClip in root
189  TGLClipPlane* c = new TGLClipPlane();
190  c->Setup(TGLVector3(1e10, 0, 0), TGLVector3(-1, 0, 0));
191  eventScene()->GetGLScene()->SetClip(c);
192 
193  m_DMTline = new TEveLine();
194  m_DMTline->SetLineColor(1016);
195  m_DMTline->SetLineStyle(5);
196 
197  m_DMTline->SetPoint(0, 0, 0, 0);
198  m_DMTline->SetPoint(1, 0, 0, 0);
199  eventScene()->AddElement(m_DMTline);
201 }
const edm::EventSetup & c
TEveScene * eventScene()
Definition: FWEveView.h:79
void showEcalBarrel(bool)
FWBoolParameter m_showMuonEndcap
Definition: FW3DViewBase.h:80
FWBoolParameter m_showHGCalEE
Definition: FW3DViewBase.h:85
void showTrackerEndcap(bool)
FWBoolParameter m_showTrackerBarrel
Definition: FW3DViewBase.h:83
void showTrackerBarrel(bool)
void showMuonEndcap(bool)
FWBoolParameter m_showPixelEndcap
Definition: FW3DViewBase.h:82
FWBoolParameter m_showHGCalHSi
Definition: FW3DViewBase.h:86
void showPixelBarrel(bool)
FWBoolParameter m_showHGCalHSc
Definition: FW3DViewBase.h:87
FWBoolParameter m_showEcalBarrel
Definition: FW3DViewBase.h:90
TEveScene * geoScene()
Definition: FWEveView.h:80
void showPixelEndcap(bool)
TEveLine * m_DMTline
Definition: FW3DViewBase.h:107
FW3DViewGeometry * m_geometry
Definition: FW3DViewBase.h:75
sigc::signal< void(T)> changed_
virtual void setContext(const fireworks::Context &x)
Definition: FWEveView.cc:227
FWBoolParameter m_showTrackerEndcap
Definition: FW3DViewBase.h:84
FWBoolParameter m_showPixelBarrel
Definition: FW3DViewBase.h:81
void FW3DViewBase::setCurrentDMTVertex ( double  x,
double  y,
double  z 
)

Definition at line 461 of file FW3DViewBase.cc.

References FW3DViewDistanceMeasureTool::kNone, FW3DViewDistanceMeasureTool::m_action, m_DMT, m_DMTline, gpuVertexFinder::printf(), FW3DViewDistanceMeasureTool::refCurrentVertex(), FW3DViewDistanceMeasureTool::resetAction(), and FWEveView::viewerGL().

Referenced by FWGLEventHandler::HandleButton().

461  {
463  printf("ERROR!!!! FW3DViewBase::setCurrentDMTVertex \n");
464 
465  m_DMTline->SetPoint(m_DMT->m_action, x, y, z);
466  m_DMTline->ElementChanged();
467  viewerGL()->RequestDraw();
468 
469  m_DMT->refCurrentVertex().Set(x, y, z);
470  m_DMT->resetAction();
471 }
TGLViewer * viewerGL() const
Definition: FWEveView.cc:177
FW3DViewDistanceMeasureTool * m_DMT
Definition: FW3DViewBase.h:106
printf("params %d %f %f %f\n", minT, eps, errmax, chi2max)
TEveLine * m_DMTline
Definition: FW3DViewBase.h:107
void FW3DViewBase::setFrom ( const FWConfiguration iFrom)
overridevirtual

Implements FWConfigurable.

Definition at line 441 of file FW3DViewBase.cc.

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

441  {
442  // take care of parameters
443  FWEveView::setFrom(iFrom);
444 
445  TGLPerspectiveCamera* camera = dynamic_cast<TGLPerspectiveCamera*>(&(viewerGL()->CurrentCamera()));
446  if (camera)
447  setFromPerspectiveCamera(camera, "Plain3D", iFrom);
448 
449  if (iFrom.version() < 5) {
450  // transparency moved to common preferences in FWEveView version 5
451  std::string tName("Detector Transparency");
452  std::istringstream s(iFrom.valueForKey(tName)->value());
453  int transp;
454  s >> transp;
455  context().colorManager()->setGeomTransparency(transp, false);
456  }
457 }
FWColorManager * colorManager() const
Definition: Context.h:58
unsigned int version() const
TGLViewer * viewerGL() const
Definition: FWEveView.cc:177
void setGeomTransparency(Color_t idx, bool projectedType)
const std::string & value(unsigned int iIndex=0) const
const fireworks::Context & context()
Definition: FWEveView.h:64
void setFrom(const FWConfiguration &) override
Definition: FWEveView.cc:307
void setFromPerspectiveCamera(TGLPerspectiveCamera *, const std::string &, const FWConfiguration &)
Definition: FWEveView.cc:420
const FWConfiguration * valueForKey(const std::string &iKey) const
void FW3DViewBase::showEcalBarrel ( bool  x)

Definition at line 511 of file FW3DViewBase.cc.

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

Referenced by setContext().

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

Definition at line 203 of file FW3DViewBase.cc.

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

Referenced by FW3DViewBase().

203  {
204  if (m_geometry) {
205  m_geometry->showMuonBarrel(x == 1);
207  }
208 }
void showMuonBarrel(bool)
void showMuonBarrelFull(bool)
FW3DViewGeometry * m_geometry
Definition: FW3DViewBase.h:75
void FW3DViewBase::updateClipPlanes ( bool  resetCamera)
private

Definition at line 319 of file FW3DViewBase.cc.

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

Referenced by enableSceneClip(), and FW3DViewBase().

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

Definition at line 390 of file FW3DViewBase.cc.

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

Referenced by enableSceneClip(), and FW3DViewBase().

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

Member Data Documentation

FWEnumParameter FW3DViewBase::m_cameraType
private

Definition at line 95 of file FW3DViewBase.h.

Referenced by FW3DViewBase(), and populateController().

FWLongParameter FW3DViewBase::m_clipAppexOffset
private

Definition at line 102 of file FW3DViewBase.h.

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

FWDoubleParameter FW3DViewBase::m_clipDelta1
private

Definition at line 100 of file FW3DViewBase.h.

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

FWDoubleParameter FW3DViewBase::m_clipDelta2
private

Definition at line 101 of file FW3DViewBase.h.

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

FWBoolParameter FW3DViewBase::m_clipEnable
private
FWLongParameter FW3DViewBase::m_clipHGCalLayerBegin
private

Definition at line 103 of file FW3DViewBase.h.

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

FWLongParameter FW3DViewBase::m_clipHGCalLayerEnd
private

Definition at line 104 of file FW3DViewBase.h.

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

FWDoubleParameter FW3DViewBase::m_clipPhi
private

Definition at line 99 of file FW3DViewBase.h.

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

FWDoubleParameter FW3DViewBase::m_clipTheta
private

Definition at line 98 of file FW3DViewBase.h.

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

FW3DViewDistanceMeasureTool* FW3DViewBase::m_DMT
private
TEveLine* FW3DViewBase::m_DMTline
private

Definition at line 107 of file FW3DViewBase.h.

Referenced by setContext(), and setCurrentDMTVertex().

TEveBoxSet* FW3DViewBase::m_ecalBarrel
private

Definition at line 89 of file FW3DViewBase.h.

Referenced by FW3DViewBase(), and showEcalBarrel().

FW3DViewGeometry* FW3DViewBase::m_geometry
private

Definition at line 75 of file FW3DViewBase.h.

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

TGLClip* FW3DViewBase::m_glClip
private

Definition at line 76 of file FW3DViewBase.h.

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

FWEnumParameter FW3DViewBase::m_rnrStyle
private

Definition at line 92 of file FW3DViewBase.h.

Referenced by FW3DViewBase(), and populateController().

FWBoolParameter FW3DViewBase::m_selectable
private

Definition at line 93 of file FW3DViewBase.h.

Referenced by FW3DViewBase(), and populateController().

FWBoolParameter FW3DViewBase::m_showEcalBarrel
private

Definition at line 90 of file FW3DViewBase.h.

Referenced by populateController(), and setContext().

FWBoolParameter FW3DViewBase::m_showHGCalEE
private

Definition at line 85 of file FW3DViewBase.h.

Referenced by populateController(), and setContext().

FWBoolParameter FW3DViewBase::m_showHGCalHSc
private

Definition at line 87 of file FW3DViewBase.h.

Referenced by populateController(), and setContext().

FWBoolParameter FW3DViewBase::m_showHGCalHSi
private

Definition at line 86 of file FW3DViewBase.h.

Referenced by populateController(), and setContext().

FWEnumParameter FW3DViewBase::m_showMuonBarrel
private

Definition at line 79 of file FW3DViewBase.h.

Referenced by FW3DViewBase(), and populateController().

FWBoolParameter FW3DViewBase::m_showMuonEndcap
private

Definition at line 80 of file FW3DViewBase.h.

Referenced by populateController(), and setContext().

FWBoolParameter FW3DViewBase::m_showPixelBarrel
private

Definition at line 81 of file FW3DViewBase.h.

Referenced by populateController(), and setContext().

FWBoolParameter FW3DViewBase::m_showPixelEndcap
private

Definition at line 82 of file FW3DViewBase.h.

Referenced by populateController(), and setContext().

FWBoolParameter FW3DViewBase::m_showTrackerBarrel
private

Definition at line 83 of file FW3DViewBase.h.

Referenced by populateController(), and setContext().

FWBoolParameter FW3DViewBase::m_showTrackerEndcap
private

Definition at line 84 of file FW3DViewBase.h.

Referenced by populateController(), and setContext().