CMS 3D CMS Logo

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

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

Inheritance diagram for FWRPZView:
FWEveView FWViewBase FWConfigurableParameterizable FWParameterizable FWConfigurable

Public Member Functions

void addTo (FWConfiguration &) const override
 
void eventBegin () override
 
void eventEnd () override
 
 FWRPZView (TEveWindowSlot *iParent, FWViewType::EType)
 
 FWRPZView (const FWRPZView &)=delete
 
TEveCaloViz * getEveCalo () const override
 
void importElements (TEveElement *iProjectableChild, float layer, TEveElement *iProjectedParent=nullptr)
 
const FWRPZViewoperator= (const FWRPZView &)=delete
 
void populateController (ViewerParameterGUI &) const override
 
void resetOrigin ()
 
void setContext (const fireworks::Context &) override
 
void setFrom (const FWConfiguration &) override
 
void setupEventCenter () override
 
void shiftOrigin (TEveVector &center)
 
void voteCaloMaxVal () override
 
 ~FWRPZView () override
 
- Public Member Functions inherited from FWEveView
const fireworks::Contextcontext ()
 
FWViewContextMenuHandlerBasecontextMenuHandler () const override
 
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 ()
 
virtual bool requestGLHandlerPick () const
 
void saveImageTo (const std::string &iName) const override
 
virtual void setBackgroundColor (Color_t)
 
virtual void setupEnergyScale ()
 
virtual void useGlobalEnergyScaleChanged ()
 
FWViewContextviewContext ()
 
TEveViewer * viewer ()
 
TGLViewer * viewerGL () const
 
 ~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 FWConfigurableParameterizableoperator= (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 doCompression (bool)
 
void doFishEyeDistortion ()
 
void doPreScaleDistortion ()
 
void doShiftOriginToBeamSpot ()
 
void projectionAxesLabelSize ()
 
void setEtaRng ()
 
void showProjectionAxes ()
 

Private Attributes

TEveProjectionAxes * m_axes
 
TEveCalo2D * m_calo
 
FWDoubleParameter m_caloDistortion
 
FWBoolParameter m_compressMuon
 
FWDoubleParameter m_fishEyeDistortion
 
FWDoubleParameter m_fishEyeR
 
FWRPZViewGeometrym_geometryList
 
FWDoubleParameter m_muonDistortion
 
FWDoubleParameter m_projectionAxesLabelSize
 
TEveProjectionManager * m_projMgr
 
FWBoolParameter m_shiftOrigin
 
FWBoolParameterm_showEndcaps
 
FWBoolParameter m_showGEM
 
FWBoolParameterm_showHF
 
FWBoolParameter m_showME0
 
FWBoolParameter m_showMtdBarrel
 
FWBoolParameter m_showMtdEndcap
 
FWBoolParameter m_showPixelBarrel
 
FWBoolParameter m_showPixelEndcap
 
FWBoolParameter m_showProjectionAxes
 
FWBoolParameter m_showRpcEndcap
 
FWBoolParameter m_showTrackerBarrel
 
FWBoolParameter m_showTrackerEndcap
 

Static Private Attributes

static const float s_distortF = 0.001
 
static const float s_distortFInv = 1000
 

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 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 40 of file FWRPZView.h.

Constructor & Destructor Documentation

◆ FWRPZView() [1/2]

FWRPZView::FWRPZView ( TEveWindowSlot *  iParent,
FWViewType::EType  id 
)

Definition at line 46 of file FWRPZView.cc.

References fireworks::Context::caloR1(), FWGenericParameter< T >::changed_, doCompression(), doFishEyeDistortion(), doPreScaleDistortion(), doShiftOriginToBeamSpot(), FWEveView::eventScene(), FWEveView::geoScene(), FWViewType::kRhoPhi, FWViewType::kRhoPhiPF, FWViewType::kRhoZ, m_axes, m_caloDistortion, m_compressMuon, m_fishEyeDistortion, m_fishEyeR, m_muonDistortion, m_projectionAxesLabelSize, m_projMgr, m_shiftOrigin, m_showEndcaps, m_showHF, m_showProjectionAxes, projectionAxesLabelSize(), s_distortF, setEtaRng(), showProjectionAxes(), FWGenericParameter< T >::value(), and FWEveView::viewerGL().

47  : FWEveView(iParent, id, 7),
48  m_geometryList(nullptr),
49  m_projMgr(nullptr),
50  m_axes(nullptr),
51 
52  m_calo(nullptr),
53 
54  m_showPixelBarrel(this, "Show Pixel Barrel", false),
55  m_showPixelEndcap(this, "Show Pixel Endcap", false),
56  m_showTrackerBarrel(this, "Show Tracker Barrel", false),
57  m_showTrackerEndcap(this, "Show Tracker Endcap", false),
58  m_showRpcEndcap(this, "Show RPC Endcap", false),
59  m_showGEM(this, "Show GEM", false),
60  m_showME0(this, "Show ME0", false),
61 
62  m_showMtdBarrel(this, "Show MTD Barrel", false),
63  m_showMtdEndcap(this, "Show MTD Endcap", false),
64 
65  m_shiftOrigin(this, "Shift origin to beam-spot", false),
66  m_fishEyeDistortion(this, "Distortion", 0., 0., 100.),
67  m_fishEyeR(this, "FixedRadius", (double)fireworks::Context::caloR1(), 0.0, 150.0),
68 
69  m_caloDistortion(this, "Calo compression", 1.0, 0.01, 10.),
70  m_muonDistortion(this, "Muon compression", 0.2, 0.01, 10.),
71  m_showProjectionAxes(this, "Show projection axis", false),
72  m_projectionAxesLabelSize(this, "Projection axis label size", 0.015, 0.001, 0.2),
73  m_compressMuon(this, "Compress detectors", false),
74  m_showHF(nullptr),
75  m_showEndcaps(nullptr) {
76  TEveProjection::EPType_e projType = (id == FWViewType::kRhoZ) ? TEveProjection::kPT_RhoZ : TEveProjection::kPT_RPhi;
77 
78  m_projMgr = new TEveProjectionManager(projType);
79  m_projMgr->IncDenyDestroy();
80  m_projMgr->SetImportEmpty(kTRUE);
81 
82  m_projMgr->GetProjection()->SetDistortion(m_fishEyeDistortion.value() * s_distortF);
83  m_projMgr->GetProjection()->SetFixR(m_fishEyeR.value());
84 
85 #ifdef TEVEPROJECTIONS_DISPLACE_ORIGIN_MODE
86  m_projMgr->GetProjection()->SetDisplaceOrigin(m_shiftOrigin.value());
87 #endif
88 
89  if (id == FWViewType::kRhoPhi || id == FWViewType::kRhoPhiPF) {
90  m_projMgr->GetProjection()->AddPreScaleEntry(0, fireworks::Context::caloR1(), 1.0);
91  m_projMgr->GetProjection()->AddPreScaleEntry(0, 300, 0.2);
92  } else {
93  m_projMgr->GetProjection()->AddPreScaleEntry(0, fireworks::Context::caloR1(), 1.0);
94  m_projMgr->GetProjection()->AddPreScaleEntry(1, 310, 1.0);
95  m_projMgr->GetProjection()->AddPreScaleEntry(0, 370, 0.2);
96  m_projMgr->GetProjection()->AddPreScaleEntry(1, 580, 0.2);
97  }
98 
99  // camera
100  viewerGL()->SetCurrentCamera(TGLViewer::kCameraOrthoXOY);
101  if (TGLOrthoCamera* camera = dynamic_cast<TGLOrthoCamera*>(&(viewerGL()->CurrentCamera()))) {
102  camera->SetZoomMax(1e6);
103  }
104  geoScene()->GetGLScene()->SetSelectable(kFALSE);
105 
106  m_axes = new TEveProjectionAxes(m_projMgr);
107  m_axes->SetRnrState(m_showProjectionAxes.value());
108  m_axes->SetLabelSize(m_projectionAxesLabelSize.value());
111  eventScene()->AddElement(m_axes);
112 
113  if (id != FWViewType::kRhoZ) {
114  m_showEndcaps = new FWBoolParameter(this, "Include EndCaps", true);
115  m_showEndcaps->changed_.connect(std::bind(&FWRPZView::setEtaRng, this));
116  m_showHF = new FWBoolParameter(this, "Include HF", true);
117  m_showHF->changed_.connect(std::bind(&FWRPZView::setEtaRng, this));
118  }
119 
120  m_shiftOrigin.changed_.connect(std::bind(&FWRPZView::doShiftOriginToBeamSpot, this));
121 
123 
124  m_fishEyeR.changed_.connect(std::bind(&FWRPZView::doFishEyeDistortion, this));
125 
126  m_caloDistortion.changed_.connect(std::bind(&FWRPZView::doPreScaleDistortion, this));
127  m_muonDistortion.changed_.connect(std::bind(&FWRPZView::doPreScaleDistortion, this));
128  m_compressMuon.changed_.connect(std::bind(&FWRPZView::doCompression, this, std::placeholders::_1));
129 }
void doShiftOriginToBeamSpot()
Definition: FWRPZView.cc:216
void doFishEyeDistortion()
Definition: FWRPZView.cc:257
FWBoolParameter m_shiftOrigin
Definition: FWRPZView.h:101
TEveScene * eventScene()
Definition: FWEveView.h:79
FWBoolParameter m_showProjectionAxes
Definition: FWRPZView.h:107
TEveCalo2D * m_calo
Definition: FWRPZView.h:87
FWBoolParameter m_showME0
Definition: FWRPZView.h:97
FWDoubleParameter m_projectionAxesLabelSize
Definition: FWRPZView.h:108
FWBoolParameter m_showMtdEndcap
Definition: FWRPZView.h:99
TEveProjectionAxes * m_axes
Definition: FWRPZView.h:86
FWParameters::Bool FWBoolParameter
Definition: FWParameters.h:37
FWBoolParameter m_showMtdBarrel
Definition: FWRPZView.h:98
FWBoolParameter * m_showHF
Definition: FWRPZView.h:111
TEveProjectionManager * m_projMgr
Definition: FWRPZView.h:85
FWDoubleParameter m_fishEyeR
Definition: FWRPZView.h:103
FWBoolParameter m_showRpcEndcap
Definition: FWRPZView.h:95
void doCompression(bool)
Definition: FWRPZView.cc:283
void setEtaRng()
Definition: FWRPZView.cc:320
FWBoolParameter m_showTrackerBarrel
Definition: FWRPZView.h:93
void showProjectionAxes()
Definition: FWRPZView.cc:362
static float caloR1(bool offset=true)
Definition: Context.cc:187
FWBoolParameter m_compressMuon
Definition: FWRPZView.h:109
FWRPZViewGeometry * m_geometryList
Definition: FWRPZView.h:84
void doPreScaleDistortion()
Definition: FWRPZView.cc:268
FWBoolParameter * m_showEndcaps
Definition: FWRPZView.h:112
FWBoolParameter m_showGEM
Definition: FWRPZView.h:96
FWDoubleParameter m_fishEyeDistortion
Definition: FWRPZView.h:102
TEveScene * geoScene()
Definition: FWEveView.h:80
FWEveView(TEveWindowSlot *, FWViewType::EType, unsigned int version=7)
Definition: FWEveView.cc:70
FWBoolParameter m_showTrackerEndcap
Definition: FWRPZView.h:94
FWDoubleParameter m_muonDistortion
Definition: FWRPZView.h:106
FWBoolParameter m_showPixelEndcap
Definition: FWRPZView.h:92
FWDoubleParameter m_caloDistortion
Definition: FWRPZView.h:105
sigc::signal< void(T)> changed_
TGLViewer * viewerGL() const
Definition: FWEveView.cc:177
FWBoolParameter m_showPixelBarrel
Definition: FWRPZView.h:91
static const float s_distortF
Definition: FWRPZView.h:81
void projectionAxesLabelSize()
Definition: FWRPZView.cc:368

◆ ~FWRPZView()

FWRPZView::~FWRPZView ( )
override

Definition at line 131 of file FWRPZView.cc.

References m_calo, and m_projMgr.

131  {
132  m_calo->Destroy();
133  m_projMgr->DecDenyDestroy();
134 }
TEveCalo2D * m_calo
Definition: FWRPZView.h:87
TEveProjectionManager * m_projMgr
Definition: FWRPZView.h:85

◆ FWRPZView() [2/2]

FWRPZView::FWRPZView ( const FWRPZView )
delete

Member Function Documentation

◆ addTo()

void FWRPZView::addTo ( FWConfiguration iTo) const
overridevirtual

Reimplemented from FWEveView.

Definition at line 299 of file FWRPZView.cc.

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

299  {
300  FWEveView::addTo(iTo);
301  TGLOrthoCamera* camera = dynamic_cast<TGLOrthoCamera*>(&(viewerGL()->CurrentCamera()));
302  if (camera)
303  addToOrthoCamera(camera, iTo);
304 }
void addToOrthoCamera(TGLOrthoCamera *, FWConfiguration &) const
Definition: FWEveView.cc:352
void addTo(FWConfiguration &) const override
Definition: FWEveView.cc:291
TGLViewer * viewerGL() const
Definition: FWEveView.cc:177

◆ doCompression()

void FWRPZView::doCompression ( bool  flag)
private

Definition at line 283 of file FWRPZView.cc.

References RemoveAddSevLevel::flag, and m_projMgr.

Referenced by FWRPZView().

283  {
284  m_projMgr->GetProjection()->SetUsePreScale(flag);
285  m_projMgr->UpdateName();
286  m_projMgr->ProjectChildren();
287  gEve->Redraw3D();
288 }
TEveProjectionManager * m_projMgr
Definition: FWRPZView.h:85

◆ doFishEyeDistortion()

void FWRPZView::doFishEyeDistortion ( )
private

Definition at line 257 of file FWRPZView.cc.

References m_fishEyeDistortion, m_fishEyeR, m_projMgr, AlCaHLTBitMon_ParallelJobs::p, s_distortF, s_distortFInv, and FWGenericParameter< T >::value().

Referenced by FWRPZView().

257  {
258  TEveProjection* p = m_projMgr->GetProjection();
259  if (p->GetDistortion() != m_fishEyeDistortion.value() * s_distortFInv)
260  p->SetDistortion(m_fishEyeDistortion.value() * s_distortF);
261  if (p->GetFixR() != m_fishEyeR.value())
262  p->SetFixR(m_fishEyeR.value());
263 
264  m_projMgr->ProjectChildren();
265  gEve->Redraw3D();
266 }
TEveProjectionManager * m_projMgr
Definition: FWRPZView.h:85
FWDoubleParameter m_fishEyeR
Definition: FWRPZView.h:103
static const float s_distortFInv
Definition: FWRPZView.h:82
FWDoubleParameter m_fishEyeDistortion
Definition: FWRPZView.h:102
static const float s_distortF
Definition: FWRPZView.h:81

◆ doPreScaleDistortion()

void FWRPZView::doPreScaleDistortion ( )
private

Definition at line 268 of file FWRPZView.cc.

References FWViewType::kRhoPhi, FWViewType::kRhoPhiPF, m_caloDistortion, m_muonDistortion, m_projMgr, FWViewBase::typeId(), and FWGenericParameter< T >::value().

Referenced by FWRPZView().

268  {
270  m_projMgr->GetProjection()->ChangePreScaleEntry(0, 1, m_caloDistortion.value());
271  m_projMgr->GetProjection()->ChangePreScaleEntry(0, 2, m_muonDistortion.value());
272  } else {
273  m_projMgr->GetProjection()->ChangePreScaleEntry(0, 1, m_caloDistortion.value());
274  m_projMgr->GetProjection()->ChangePreScaleEntry(0, 2, m_muonDistortion.value());
275  m_projMgr->GetProjection()->ChangePreScaleEntry(1, 1, m_caloDistortion.value());
276  m_projMgr->GetProjection()->ChangePreScaleEntry(1, 2, m_muonDistortion.value());
277  }
278  m_projMgr->UpdateName();
279  m_projMgr->ProjectChildren();
280  gEve->Redraw3D();
281 }
TEveProjectionManager * m_projMgr
Definition: FWRPZView.h:85
FWDoubleParameter m_muonDistortion
Definition: FWRPZView.h:106
FWDoubleParameter m_caloDistortion
Definition: FWRPZView.h:105
FWViewType::EType typeId() const
Definition: FWViewBase.h:42

◆ doShiftOriginToBeamSpot()

void FWRPZView::doShiftOriginToBeamSpot ( )
private

Definition at line 216 of file FWRPZView.cc.

References m_projMgr, m_shiftOrigin, AlCaHLTBitMon_ParallelJobs::p, and FWGenericParameter< T >::value().

Referenced by FWRPZView().

216  {
217 #ifdef TEVEPROJECTIONS_DISPLACE_ORIGIN_MODE
218 
219  TEveProjection* p = m_projMgr->GetProjection();
220  if (p->GetDisplaceOrigin() != m_shiftOrigin.value()) {
221  p->SetDisplaceOrigin(m_shiftOrigin.value());
222  m_projMgr->ProjectChildren();
223  gEve->Redraw3D();
224  }
225 #endif
226 }
FWBoolParameter m_shiftOrigin
Definition: FWRPZView.h:101
TEveProjectionManager * m_projMgr
Definition: FWRPZView.h:85

◆ eventBegin()

void FWRPZView::eventBegin ( )
overridevirtual

Reimplemented from FWEveView.

Definition at line 181 of file FWRPZView.cc.

References HltBtagPostValidation_cff::c, fireworks::Context::commonPrefs(), FWEveView::context(), CmsShowCommon::getEventCenter(), FWViewType::kRhoZ, m_projMgr, alignCSCRings::r, FWViewBase::typeId(), and FWEveView::viewerGL().

181  {
182  if (context().getBeamSpot()) {
183  float c[3] = {0, 0, 0};
185 
186  // projection center
187  TEveVector center(c[0], c[1], c[2]);
188  m_projMgr->GetProjection()->SetCenter(center);
189 
190  // camera move
191  TGLCamera& cam = viewerGL()->CurrentCamera();
192  cam.SetExternalCenter(true);
193  if (typeId() != FWViewType::kRhoZ) {
194  double r = center.Mag();
195  cam.SetCenterVec(center.fZ, TMath::Sign(r, center.fY), 0);
196  } else {
197  cam.SetCenterVec(c[0], c[1], c[2]);
198  }
199  }
200 }
CmsShowCommon * commonPrefs() const
Definition: Context.cc:167
TEveProjectionManager * m_projMgr
Definition: FWRPZView.h:85
const fireworks::Context & context()
Definition: FWEveView.h:64
FWViewType::EType typeId() const
Definition: FWViewBase.h:42
void getEventCenter(float *inC) const
TGLViewer * viewerGL() const
Definition: FWEveView.cc:177

◆ eventEnd()

void FWRPZView::eventEnd ( )
overridevirtual

Reimplemented from FWEveView.

Definition at line 202 of file FWRPZView.cc.

References HltBtagPostValidation_cff::c, fireworks::Context::commonPrefs(), FWEveView::context(), FWEveView::eventEnd(), CmsShowCommon::getEventCenter(), and m_projMgr.

202  {
203  float c[3];
205  m_projMgr->SetCenter(c[0], c[1], c[2]);
207 }
CmsShowCommon * commonPrefs() const
Definition: Context.cc:167
virtual void eventEnd()
Definition: FWEveView.cc:217
TEveProjectionManager * m_projMgr
Definition: FWRPZView.h:85
const fireworks::Context & context()
Definition: FWEveView.h:64
void getEventCenter(float *inC) const

◆ getEveCalo()

TEveCaloViz * FWRPZView::getEveCalo ( ) const
overridevirtual

Reimplemented from FWEveView.

Definition at line 140 of file FWRPZView.cc.

References m_calo.

140 { return static_cast<TEveCaloViz*>(m_calo); }
TEveCalo2D * m_calo
Definition: FWRPZView.h:87

◆ importElements()

void FWRPZView::importElements ( TEveElement *  iProjectableChild,
float  layer,
TEveElement *  iProjectedParent = nullptr 
)

Definition at line 290 of file FWRPZView.cc.

References m_projMgr.

Referenced by addElements(), and FWEveViewManager::finishViewCreate().

290  {
291  float oldLayer = m_projMgr->GetCurrentDepth();
292  m_projMgr->SetCurrentDepth(iLayer);
293  //make sure current depth is reset even if an exception is thrown
294  std::shared_ptr<TEveProjectionManager> sentry(
295  m_projMgr, std::bind(&TEveProjectionManager::SetCurrentDepth, std::placeholders::_1, oldLayer));
296  m_projMgr->ImportElements(iChildren, iProjectedParent);
297 }
TEveProjectionManager * m_projMgr
Definition: FWRPZView.h:85

◆ operator=()

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

◆ populateController()

void FWRPZView::populateController ( ViewerParameterGUI gui) const
overridevirtual

Reimplemented from FWEveView.

Definition at line 373 of file FWRPZView.cc.

References ViewerParameterGUI::addParam(), f, fireworks::Context::getGeom(), ViewerParameterGUI::getTabContainer(), FWGeometry::VersionInfo::haveExtraDet(), FWViewType::kRhoPhi, FWViewType::kRhoPhiPF, FWViewType::kRhoZ, m_caloDistortion, m_compressMuon, FWEveView::m_context, m_fishEyeDistortion, m_fishEyeR, m_muonDistortion, m_projectionAxesLabelSize, m_shiftOrigin, m_showEndcaps, m_showGEM, m_showHF, m_showME0, m_showMtdBarrel, m_showMtdEndcap, m_showPixelBarrel, m_showPixelEndcap, m_showProjectionAxes, m_showRpcEndcap, m_showTrackerBarrel, FWEveView::populateController(), ViewerParameterGUI::requestTab(), ViewerParameterGUI::separator(), FWViewBase::typeId(), and FWGeometry::versionInfo().

373  {
375 
376  ViewerParameterGUI& det = gui.requestTab("Detector");
377  ;
379 
380  if (typeId() == FWViewType::kRhoZ) {
384  bool showGEM = m_context->getGeom()->versionInfo().haveExtraDet("GEM");
385  if (showGEM)
386  det.addParam(&m_showGEM);
387  bool showME0 = m_context->getGeom()->versionInfo().haveExtraDet("ME0");
388  if (showME0)
389  det.addParam(&m_showME0);
390  }
391 
393  if (typeId() == FWViewType::kRhoZ)
395 
396 #ifdef TEVEPROJECTIONS_DISPLACE_ORIGIN_MODE
397  gui.requestTab("Projection").addParam(&m_shiftOrigin);
398 #endif
399 
401 
402  TGCompositeFrame* f = gui.getTabContainer();
403 
404  f->AddFrame(new TGLabel(f, "FishEye:"));
406 
407  f->AddFrame(new TGLabel(f, "PreScales:"));
408 
410 
413  }
414 }
FWBoolParameter m_shiftOrigin
Definition: FWRPZView.h:101
FWBoolParameter m_showProjectionAxes
Definition: FWRPZView.h:107
FWBoolParameter m_showME0
Definition: FWRPZView.h:97
FWDoubleParameter m_projectionAxesLabelSize
Definition: FWRPZView.h:108
ViewerParameterGUI & requestTab(const char *)
ViewerParameterGUI & separator()
FWBoolParameter m_showMtdEndcap
Definition: FWRPZView.h:99
const fireworks::Context * m_context
Definition: FWEveView.h:109
bool haveExtraDet(const char *) const
Definition: FWGeometry.cc:507
FWBoolParameter m_showMtdBarrel
Definition: FWRPZView.h:98
FWBoolParameter * m_showHF
Definition: FWRPZView.h:111
const VersionInfo & versionInfo() const
Definition: FWGeometry.h:151
FWDoubleParameter m_fishEyeR
Definition: FWRPZView.h:103
FWBoolParameter m_showRpcEndcap
Definition: FWRPZView.h:95
FWGeometry * getGeom() const
Definition: Context.h:72
FWBoolParameter m_showTrackerBarrel
Definition: FWRPZView.h:93
double f[11][100]
FWBoolParameter m_compressMuon
Definition: FWRPZView.h:109
void populateController(ViewerParameterGUI &) const override
Definition: FWEveView.cc:466
FWBoolParameter * m_showEndcaps
Definition: FWRPZView.h:112
FWBoolParameter m_showGEM
Definition: FWRPZView.h:96
FWDoubleParameter m_fishEyeDistortion
Definition: FWRPZView.h:102
ViewerParameterGUI & addParam(const FWParameterBase *)
TGCompositeFrame * getTabContainer()
FWDoubleParameter m_muonDistortion
Definition: FWRPZView.h:106
FWBoolParameter m_showPixelEndcap
Definition: FWRPZView.h:92
FWDoubleParameter m_caloDistortion
Definition: FWRPZView.h:105
FWViewType::EType typeId() const
Definition: FWViewBase.h:42
FWBoolParameter m_showPixelBarrel
Definition: FWRPZView.h:91

◆ projectionAxesLabelSize()

void FWRPZView::projectionAxesLabelSize ( )
private

Definition at line 368 of file FWRPZView.cc.

References m_axes, m_projectionAxesLabelSize, FWGenericParameter< T >::value(), and FWEveView::viewerGL().

Referenced by FWRPZView().

368  {
369  m_axes->SetLabelSize(m_projectionAxesLabelSize.value());
370  viewerGL()->RequestDraw();
371 }
FWDoubleParameter m_projectionAxesLabelSize
Definition: FWRPZView.h:108
TEveProjectionAxes * m_axes
Definition: FWRPZView.h:86
TGLViewer * viewerGL() const
Definition: FWEveView.cc:177

◆ resetOrigin()

void FWRPZView::resetOrigin ( )

Definition at line 244 of file FWRPZView.cc.

References b, FWEveView::context(), fireworks::Context::getBeamSpot(), and m_projMgr.

244  {
245  // set center back to beam spot
246 
247 #ifdef TEVEPROJECTIONS_DISPLACE_ORIGIN_MODE
248  FWBeamSpot& b = *(context().getBeamSpot());
249  TEveVector center(b.x0(), b.y0(), b.z0());
250  m_projMgr->GetProjection()->SetCenter(center);
251 
252  m_projMgr->ProjectChildren();
253  gEve->Redraw3D();
254 #endif
255 }
FWBeamSpot * getBeamSpot() const
Definition: Context.h:67
TEveProjectionManager * m_projMgr
Definition: FWRPZView.h:85
const fireworks::Context & context()
Definition: FWEveView.h:64
double b
Definition: hdecay.h:120

◆ setContext()

void FWRPZView::setContext ( const fireworks::Context ctx)
overridevirtual

Reimplemented from FWEveView.

Definition at line 142 of file FWRPZView.cc.

References FWPFGeom::caloR1(), FWPFGeom::caloZ1(), FWGenericParameter< T >::changed_, FWEveView::context(), data, FWEveView::eventScene(), FWEveView::geoScene(), fireworks::Context::getCaloData(), FWRPZViewGeometry::initStdGeoElements(), FWViewType::kRhoPhiPF, m_calo, m_geometryList, m_projMgr, m_showGEM, m_showME0, m_showMtdBarrel, m_showMtdEndcap, m_showPixelBarrel, m_showPixelEndcap, m_showRpcEndcap, m_showTrackerBarrel, m_showTrackerEndcap, AlCaHLTBitMon_ParallelJobs::p, FWEveView::setContext(), FWRPZViewGeometry::showGEM(), FWRPZViewGeometry::showME0(), FWRPZViewGeometry::showMtdBarrel(), FWRPZViewGeometry::showMtdEndcap(), FWRPZViewGeometry::showPixelBarrel(), FWRPZViewGeometry::showPixelEndcap(), FWRPZViewGeometry::showRpcEndcap(), FWRPZViewGeometry::showTrackerBarrel(), FWRPZViewGeometry::showTrackerEndcap(), and FWViewBase::typeId().

142  {
144 
146  m_geometryList->IncDenyDestroy();
148  TEveElement* p = m_projMgr->ImportElements(m_geometryList);
149  geoScene()->AddElement(p);
150 
151  TEveCaloData* data = context().getCaloData();
152 
153  TEveCalo3D* calo3d = new TEveCalo3D(data);
154 
155  m_calo = static_cast<TEveCalo2D*>(m_projMgr->ImportElements(calo3d, eventScene()));
156 
157  if (typeId() == FWViewType::kRhoPhiPF)
158  m_calo->SetBarrelRadius(177);
159  else
160  m_calo->SetBarrelRadius(context().caloR1(false));
161 
162  m_calo->SetEndCapPos(context().caloZ1(false));
163  m_calo->SetAutoRange(false);
164  m_calo->SetScaleAbs(true);
165 
166  m_showPixelBarrel.changed_.connect(
167  std::bind(&FWRPZViewGeometry::showPixelBarrel, m_geometryList, std::placeholders::_1));
168  m_showPixelEndcap.changed_.connect(
169  std::bind(&FWRPZViewGeometry::showPixelEndcap, m_geometryList, std::placeholders::_1));
171  std::bind(&FWRPZViewGeometry::showTrackerBarrel, m_geometryList, std::placeholders::_1));
173  std::bind(&FWRPZViewGeometry::showTrackerEndcap, m_geometryList, std::placeholders::_1));
174  m_showRpcEndcap.changed_.connect(std::bind(&FWRPZViewGeometry::showRpcEndcap, m_geometryList, std::placeholders::_1));
175  m_showGEM.changed_.connect(std::bind(&FWRPZViewGeometry::showGEM, m_geometryList, std::placeholders::_1));
176  m_showME0.changed_.connect(std::bind(&FWRPZViewGeometry::showME0, m_geometryList, std::placeholders::_1));
177  m_showMtdBarrel.changed_.connect(std::bind(&FWRPZViewGeometry::showMtdBarrel, m_geometryList, std::placeholders::_1));
178  m_showMtdEndcap.changed_.connect(std::bind(&FWRPZViewGeometry::showMtdEndcap, m_geometryList, std::placeholders::_1));
179 }
TEveScene * eventScene()
Definition: FWEveView.h:79
TEveCalo2D * m_calo
Definition: FWRPZView.h:87
FWBoolParameter m_showME0
Definition: FWRPZView.h:97
TEveCaloDataHist * getCaloData() const
Definition: Context.h:69
FWBoolParameter m_showMtdEndcap
Definition: FWRPZView.h:99
FWBoolParameter m_showMtdBarrel
Definition: FWRPZView.h:98
TEveProjectionManager * m_projMgr
Definition: FWRPZView.h:85
FWBoolParameter m_showRpcEndcap
Definition: FWRPZView.h:95
float caloR1()
Definition: FWPFGeom.h:20
void initStdGeoElements(const FWViewType::EType id)
FWBoolParameter m_showTrackerBarrel
Definition: FWRPZView.h:93
FWRPZViewGeometry * m_geometryList
Definition: FWRPZView.h:84
const fireworks::Context & context()
Definition: FWEveView.h:64
FWBoolParameter m_showGEM
Definition: FWRPZView.h:96
float caloZ1()
Definition: FWPFGeom.h:21
void showTrackerBarrel(bool)
TEveScene * geoScene()
Definition: FWEveView.h:80
FWBoolParameter m_showTrackerEndcap
Definition: FWRPZView.h:94
char data[epos_bytes_allocation]
Definition: EPOS_Wrapper.h:80
FWBoolParameter m_showPixelEndcap
Definition: FWRPZView.h:92
void showTrackerEndcap(bool)
sigc::signal< void(T)> changed_
FWViewType::EType typeId() const
Definition: FWViewBase.h:42
FWBoolParameter m_showPixelBarrel
Definition: FWRPZView.h:91
virtual void setContext(const fireworks::Context &x)
Definition: FWEveView.cc:227

◆ setEtaRng()

void FWRPZView::setEtaRng ( )
private

Definition at line 320 of file FWRPZView.cc.

References fireworks::Context::caloMaxEta(), fireworks::Context::caloTransEta(), FWEveView::context(), FWViewType::kRhoZ, m_calo, m_showEndcaps, m_showHF, FWEveView::setupEnergyScale(), FWViewBase::typeId(), and FWGenericParameter< T >::value().

Referenced by FWRPZView().

320  {
321  if (typeId() != FWViewType::kRhoZ) {
322  // rng controllers only in RhoPhi
323  double eta_range = context().caloMaxEta();
324  if (!m_showHF->value())
325  eta_range = 3.0;
326  if (!m_showEndcaps->value())
327  eta_range = context().caloTransEta();
328  m_calo->SetEta(-eta_range, eta_range);
329  }
330 
332 }
static float caloTransEta()
Definition: Context.cc:194
TEveCalo2D * m_calo
Definition: FWRPZView.h:87
virtual void setupEnergyScale()
Definition: FWEveView.cc:251
FWBoolParameter * m_showHF
Definition: FWRPZView.h:111
const fireworks::Context & context()
Definition: FWEveView.h:64
FWBoolParameter * m_showEndcaps
Definition: FWRPZView.h:112
static double caloMaxEta()
Definition: Context.cc:198
FWViewType::EType typeId() const
Definition: FWViewBase.h:42

◆ setFrom()

void FWRPZView::setFrom ( const FWConfiguration iFrom)
overridevirtual

Reimplemented from FWEveView.

Definition at line 306 of file FWRPZView.cc.

References m_showProjectionAxes, FWGenericParameter< T >::set(), FWEveView::setFrom(), FWEveView::setFromOrthoCamera(), FWConfiguration::valueForKey(), FWConfiguration::version(), and FWEveView::viewerGL().

306  {
307  FWEveView::setFrom(iFrom);
308 
309  TGLOrthoCamera* camera = dynamic_cast<TGLOrthoCamera*>(&(viewerGL()->CurrentCamera()));
310  if (camera)
311  setFromOrthoCamera(camera, iFrom);
312 
313  if (iFrom.version() < 7) {
314  const FWConfiguration* value = iFrom.valueForKey("Show projection axes");
315  if (value)
316  m_showProjectionAxes.set(value->value() == "1");
317  }
318 }
FWBoolParameter m_showProjectionAxes
Definition: FWRPZView.h:107
Definition: value.py:1
void setFrom(const FWConfiguration &) override
Definition: FWEveView.cc:307
const FWConfiguration * valueForKey(const std::string &iKey) const
TGLViewer * viewerGL() const
Definition: FWEveView.cc:177
void setFromOrthoCamera(TGLOrthoCamera *, const FWConfiguration &)
Definition: FWEveView.cc:368
unsigned int version() const

◆ setupEventCenter()

void FWRPZView::setupEventCenter ( )
overridevirtual

Reimplemented from FWEveView.

Definition at line 209 of file FWRPZView.cc.

References HltBtagPostValidation_cff::c, fireworks::Context::commonPrefs(), FWEveView::context(), CmsShowCommon::getEventCenter(), m_projMgr, and FWEveView::setupEventCenter().

209  {
210  float c[3];
212  m_projMgr->SetCenter(c[0], c[1], c[2]);
214 }
CmsShowCommon * commonPrefs() const
Definition: Context.cc:167
virtual void setupEventCenter()
Definition: FWEveView.cc:283
TEveProjectionManager * m_projMgr
Definition: FWRPZView.h:85
const fireworks::Context & context()
Definition: FWEveView.h:64
void getEventCenter(float *inC) const

◆ shiftOrigin()

void FWRPZView::shiftOrigin ( TEveVector &  center)

Definition at line 228 of file FWRPZView.cc.

References m_projMgr, and FWEveView::viewerGL().

228  {
229 #ifdef TEVEPROJECTIONS_DISPLACE_ORIGIN_MODE
230  // re-project with new center
231  m_projMgr->GetProjection()->SetCenter(center);
232  m_projMgr->ProjectChildren();
233 
234  // draw projected center
235  float* pc = m_projMgr->GetProjection()->GetProjectedCenter();
236  viewerGL()->CurrentCamera().SetExternalCenter(true);
237  viewerGL()->CurrentCamera().SetCenterVec(pc[0], pc[1], pc[2]);
238  viewerGL()->SetDrawCameraCenter(true);
239 
240  gEve->Redraw3D();
241 #endif
242 }
TEveProjectionManager * m_projMgr
Definition: FWRPZView.h:85
TGLViewer * viewerGL() const
Definition: FWEveView.cc:177

◆ showProjectionAxes()

void FWRPZView::showProjectionAxes ( )
private

Definition at line 362 of file FWRPZView.cc.

References m_axes, m_showProjectionAxes, FWGenericParameter< T >::value(), and FWEveView::viewerGL().

Referenced by FWRPZView().

362  {
363  m_axes->SetRnrState(m_showProjectionAxes.value());
364  gEve->Redraw3D();
365  viewerGL()->RequestDraw();
366 }
FWBoolParameter m_showProjectionAxes
Definition: FWRPZView.h:107
TEveProjectionAxes * m_axes
Definition: FWRPZView.h:86
TGLViewer * viewerGL() const
Definition: FWEveView.cc:177

◆ voteCaloMaxVal()

void FWRPZView::voteCaloMaxVal ( )
overridevirtual

Reimplemented from FWEveView.

Definition at line 334 of file FWRPZView.cc.

References a, FWEveView::context(), ALPAKA_ACCELERATOR_NAMESPACE::vertexFinder::it, dqmdumpme::k, m_calo, objects.METAnalyzer::sumEt, and fireworks::Context::voteMaxEtAndEnergy().

334  {
335  if (!m_calo->GetData()->Empty()) {
336  m_calo->AssertCellIdCache();
337  Float_t sumEt, sumE;
338  TEveCaloData::CellData_t cellData;
339  typedef std::vector<TEveCaloData::vCellId_t*> vBinCells_t;
340  typedef std::vector<TEveCaloData::vCellId_t*>::iterator vBinCells_i;
341 
342  vBinCells_t cellLists = m_calo->GetBinLists();
343  for (vBinCells_i it = cellLists.begin(); it != cellLists.end(); it++) {
344  TEveCaloData::vCellId_t* binCells = *it;
345  if (binCells) {
346  sumEt = 0;
347  sumE = 0;
348  TEveCaloData::vCellId_i a = binCells->end();
349 
350  for (TEveCaloData::vCellId_i k = binCells->begin(); k != a; ++k) {
351  m_calo->GetData()->GetCellData((*k), cellData);
352  sumEt += cellData.Value(true);
353  sumE += cellData.Value(false);
354  }
355  // printf("vote sum %f %f \n", sumEt , sumE);
357  }
358  }
359  }
360 }
TEveCalo2D * m_calo
Definition: FWRPZView.h:87
void voteMaxEtAndEnergy(float Et, float energy) const
Definition: Context.cc:169
const fireworks::Context & context()
Definition: FWEveView.h:64
double a
Definition: hdecay.h:121

Member Data Documentation

◆ m_axes

TEveProjectionAxes* FWRPZView::m_axes
private

Definition at line 86 of file FWRPZView.h.

Referenced by FWRPZView(), projectionAxesLabelSize(), and showProjectionAxes().

◆ m_calo

TEveCalo2D* FWRPZView::m_calo
private

Definition at line 87 of file FWRPZView.h.

Referenced by getEveCalo(), setContext(), setEtaRng(), voteCaloMaxVal(), and ~FWRPZView().

◆ m_caloDistortion

FWDoubleParameter FWRPZView::m_caloDistortion
private

Definition at line 105 of file FWRPZView.h.

Referenced by doPreScaleDistortion(), FWRPZView(), and populateController().

◆ m_compressMuon

FWBoolParameter FWRPZView::m_compressMuon
private

Definition at line 109 of file FWRPZView.h.

Referenced by FWRPZView(), and populateController().

◆ m_fishEyeDistortion

FWDoubleParameter FWRPZView::m_fishEyeDistortion
private

Definition at line 102 of file FWRPZView.h.

Referenced by doFishEyeDistortion(), FWRPZView(), and populateController().

◆ m_fishEyeR

FWDoubleParameter FWRPZView::m_fishEyeR
private

Definition at line 103 of file FWRPZView.h.

Referenced by doFishEyeDistortion(), FWRPZView(), and populateController().

◆ m_geometryList

FWRPZViewGeometry* FWRPZView::m_geometryList
private

Definition at line 84 of file FWRPZView.h.

Referenced by setContext().

◆ m_muonDistortion

FWDoubleParameter FWRPZView::m_muonDistortion
private

Definition at line 106 of file FWRPZView.h.

Referenced by doPreScaleDistortion(), FWRPZView(), and populateController().

◆ m_projectionAxesLabelSize

FWDoubleParameter FWRPZView::m_projectionAxesLabelSize
private

Definition at line 108 of file FWRPZView.h.

Referenced by FWRPZView(), populateController(), and projectionAxesLabelSize().

◆ m_projMgr

TEveProjectionManager* FWRPZView::m_projMgr
private

◆ m_shiftOrigin

FWBoolParameter FWRPZView::m_shiftOrigin
private

Definition at line 101 of file FWRPZView.h.

Referenced by doShiftOriginToBeamSpot(), FWRPZView(), and populateController().

◆ m_showEndcaps

FWBoolParameter* FWRPZView::m_showEndcaps
private

Definition at line 112 of file FWRPZView.h.

Referenced by FWRPZView(), populateController(), and setEtaRng().

◆ m_showGEM

FWBoolParameter FWRPZView::m_showGEM
private

Definition at line 96 of file FWRPZView.h.

Referenced by populateController(), and setContext().

◆ m_showHF

FWBoolParameter* FWRPZView::m_showHF
private

Definition at line 111 of file FWRPZView.h.

Referenced by FWRPZView(), populateController(), and setEtaRng().

◆ m_showME0

FWBoolParameter FWRPZView::m_showME0
private

Definition at line 97 of file FWRPZView.h.

Referenced by populateController(), and setContext().

◆ m_showMtdBarrel

FWBoolParameter FWRPZView::m_showMtdBarrel
private

Definition at line 98 of file FWRPZView.h.

Referenced by populateController(), and setContext().

◆ m_showMtdEndcap

FWBoolParameter FWRPZView::m_showMtdEndcap
private

Definition at line 99 of file FWRPZView.h.

Referenced by populateController(), and setContext().

◆ m_showPixelBarrel

FWBoolParameter FWRPZView::m_showPixelBarrel
private

Definition at line 91 of file FWRPZView.h.

Referenced by populateController(), and setContext().

◆ m_showPixelEndcap

FWBoolParameter FWRPZView::m_showPixelEndcap
private

Definition at line 92 of file FWRPZView.h.

Referenced by populateController(), and setContext().

◆ m_showProjectionAxes

FWBoolParameter FWRPZView::m_showProjectionAxes
private

Definition at line 107 of file FWRPZView.h.

Referenced by FWRPZView(), populateController(), setFrom(), and showProjectionAxes().

◆ m_showRpcEndcap

FWBoolParameter FWRPZView::m_showRpcEndcap
private

Definition at line 95 of file FWRPZView.h.

Referenced by populateController(), and setContext().

◆ m_showTrackerBarrel

FWBoolParameter FWRPZView::m_showTrackerBarrel
private

Definition at line 93 of file FWRPZView.h.

Referenced by populateController(), and setContext().

◆ m_showTrackerEndcap

FWBoolParameter FWRPZView::m_showTrackerEndcap
private

Definition at line 94 of file FWRPZView.h.

Referenced by setContext().

◆ s_distortF

const float FWRPZView::s_distortF = 0.001
staticprivate

Definition at line 81 of file FWRPZView.h.

Referenced by doFishEyeDistortion(), and FWRPZView().

◆ s_distortFInv

const float FWRPZView::s_distortFInv = 1000
staticprivate

Definition at line 82 of file FWRPZView.h.

Referenced by doFishEyeDistortion().