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)
 
TEveCaloViz * getEveCalo () const override
 
void importElements (TEveElement *iProjectableChild, float layer, TEveElement *iProjectedParent=nullptr)
 
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)
 
FWTEveViewerfwViewer ()
 
FWTGLViewerfwViewerGL () const
 
TEveScene * geoScene ()
 
virtual bool isEnergyScaleGlobal () const
 
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)
 
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 doCompression (bool)
 
void doFishEyeDistortion ()
 
void doPreScaleDistortion ()
 
void doShiftOriginToBeamSpot ()
 
 FWRPZView (const FWRPZView &)=delete
 
const FWRPZViewoperator= (const FWRPZView &)=delete
 
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_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::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().

46  :
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_shiftOrigin(this,"Shift origin to beam-spot", false),
63  m_fishEyeDistortion(this,"Distortion",0., 0., 100.),
64  m_fishEyeR(this,"FixedRadius",(double)fireworks::Context::caloR1(), 0.0, 150.0),
65 
66  m_caloDistortion(this,"Calo compression",1.0,0.01,10.),
67  m_muonDistortion(this,"Muon compression",0.2,0.01,10.),
68  m_showProjectionAxes(this,"Show projection axis", false),
69  m_projectionAxesLabelSize(this,"Projection axis label size", 0.015, 0.001, 0.2),
70  m_compressMuon(this,"Compress detectors",false),
71  m_showHF(nullptr),
72  m_showEndcaps(nullptr)
73 {
74  TEveProjection::EPType_e projType = (id == FWViewType::kRhoZ) ? TEveProjection::kPT_RhoZ : TEveProjection::kPT_RPhi;
75 
76  m_projMgr = new TEveProjectionManager(projType);
77  m_projMgr->IncDenyDestroy();
78  m_projMgr->SetImportEmpty(kTRUE);
79 
80  m_projMgr->GetProjection()->SetDistortion(m_fishEyeDistortion.value()*s_distortF);
81  m_projMgr->GetProjection()->SetFixR(m_fishEyeR.value());
82 
83 #ifdef TEVEPROJECTIONS_DISPLACE_ORIGIN_MODE
84  m_projMgr->GetProjection()->SetDisplaceOrigin( m_shiftOrigin.value());
85 #endif
86 
87  if ( id == FWViewType::kRhoPhi || id == FWViewType::kRhoPhiPF) {
88  m_projMgr->GetProjection()->AddPreScaleEntry(0, fireworks::Context::caloR1(), 1.0);
89  m_projMgr->GetProjection()->AddPreScaleEntry(0, 300, 0.2);
90  } else {
91  m_projMgr->GetProjection()->AddPreScaleEntry(0, fireworks::Context::caloR1(), 1.0);
92  m_projMgr->GetProjection()->AddPreScaleEntry(1, 310, 1.0);
93  m_projMgr->GetProjection()->AddPreScaleEntry(0, 370, 0.2);
94  m_projMgr->GetProjection()->AddPreScaleEntry(1, 580, 0.2);
95  }
96 
97 
98  // camera
99  viewerGL()->SetCurrentCamera(TGLViewer::kCameraOrthoXOY);
100  if ( TGLOrthoCamera* camera = dynamic_cast<TGLOrthoCamera*>( &(viewerGL()->CurrentCamera()) ) ) {
101  camera->SetZoomMax(1e6);
102  }
103  geoScene()->GetGLScene()->SetSelectable(kFALSE);
104 
105  m_axes = new TEveProjectionAxes(m_projMgr);
106  m_axes->SetRnrState(m_showProjectionAxes.value());
107  m_axes->SetLabelSize(m_projectionAxesLabelSize.value());
108  m_showProjectionAxes.changed_.connect(boost::bind(&FWRPZView::showProjectionAxes,this));
110  eventScene()->AddElement(m_axes);
111 
112  if ( id != FWViewType::kRhoZ ) {
113  m_showEndcaps = new FWBoolParameter(this,"Include EndCaps", true);
114  m_showEndcaps->changed_.connect( boost::bind(&FWRPZView::setEtaRng, this) );
115  m_showHF = new FWBoolParameter(this,"Include HF", true);
116  m_showHF->changed_.connect( boost::bind(&FWRPZView::setEtaRng, this) );
117  }
118 
119  m_shiftOrigin.changed_.connect(boost::bind(&FWRPZView::doShiftOriginToBeamSpot,this));
120 
121  m_fishEyeDistortion.changed_.connect(boost::bind(&FWRPZView::doFishEyeDistortion,this));
122 
123  m_fishEyeR.changed_.connect(boost::bind(&FWRPZView::doFishEyeDistortion,this));
124 
125  m_caloDistortion.changed_.connect(boost::bind(&FWRPZView::doPreScaleDistortion,this));
126  m_muonDistortion.changed_.connect(boost::bind(&FWRPZView::doPreScaleDistortion,this));
127  m_compressMuon.changed_.connect(boost::bind(&FWRPZView::doCompression,this,_1));
128 }
void doShiftOriginToBeamSpot()
Definition: FWRPZView.cc:228
void doFishEyeDistortion()
Definition: FWRPZView.cc:277
FWBoolParameter m_shiftOrigin
Definition: FWRPZView.h:101
TEveScene * eventScene()
Definition: FWEveView.h:82
FWBoolParameter m_showProjectionAxes
Definition: FWRPZView.h:107
TEveCalo2D * m_calo
Definition: FWRPZView.h:88
FWBoolParameter m_showME0
Definition: FWRPZView.h:99
FWDoubleParameter m_projectionAxesLabelSize
Definition: FWRPZView.h:108
TEveProjectionAxes * m_axes
Definition: FWRPZView.h:87
TGLViewer * viewerGL() const
Definition: FWEveView.cc:190
sigc::signal< void, T > changed_
FWParameters::Bool FWBoolParameter
Definition: FWParameters.h:38
FWBoolParameter * m_showHF
Definition: FWRPZView.h:111
TEveProjectionManager * m_projMgr
Definition: FWRPZView.h:86
FWDoubleParameter m_fishEyeR
Definition: FWRPZView.h:103
FWBoolParameter m_showRpcEndcap
Definition: FWRPZView.h:97
void doCompression(bool)
Definition: FWRPZView.cc:307
void setEtaRng()
Definition: FWRPZView.cc:353
FWBoolParameter m_showTrackerBarrel
Definition: FWRPZView.h:95
void showProjectionAxes()
Definition: FWRPZView.cc:399
static float caloR1(bool offset=true)
Definition: Context.cc:208
FWBoolParameter m_compressMuon
Definition: FWRPZView.h:109
FWRPZViewGeometry * m_geometryList
Definition: FWRPZView.h:85
void doPreScaleDistortion()
Definition: FWRPZView.cc:290
FWBoolParameter * m_showEndcaps
Definition: FWRPZView.h:112
FWBoolParameter m_showGEM
Definition: FWRPZView.h:98
FWDoubleParameter m_fishEyeDistortion
Definition: FWRPZView.h:102
TEveScene * geoScene()
Definition: FWEveView.h:83
FWEveView(TEveWindowSlot *, FWViewType::EType, unsigned int version=7)
Definition: FWEveView.cc:77
FWBoolParameter m_showTrackerEndcap
Definition: FWRPZView.h:96
FWDoubleParameter m_muonDistortion
Definition: FWRPZView.h:106
FWBoolParameter m_showPixelEndcap
Definition: FWRPZView.h:94
FWDoubleParameter m_caloDistortion
Definition: FWRPZView.h:105
FWBoolParameter m_showPixelBarrel
Definition: FWRPZView.h:93
static const float s_distortF
Definition: FWRPZView.h:82
void projectionAxesLabelSize()
Definition: FWRPZView.cc:406
FWRPZView::~FWRPZView ( )
override

Definition at line 130 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:88
TEveProjectionManager * m_projMgr
Definition: FWRPZView.h:86
FWRPZView::FWRPZView ( const FWRPZView )
privatedelete

Member Function Documentation

void FWRPZView::addTo ( FWConfiguration iTo) const
overridevirtual

Reimplemented from FWEveView.

Definition at line 329 of file FWRPZView.cc.

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

330 {
331  FWEveView::addTo(iTo);
332  TGLOrthoCamera* camera = dynamic_cast<TGLOrthoCamera*>( &(viewerGL()->CurrentCamera()) );
333  if (camera) addToOrthoCamera(camera, iTo);
334 }
void addToOrthoCamera(TGLOrthoCamera *, FWConfiguration &) const
Definition: FWEveView.cc:424
TGLViewer * viewerGL() const
Definition: FWEveView.cc:190
void addTo(FWConfiguration &) const override
Definition: FWEveView.cc:351
void FWRPZView::doCompression ( bool  flag)
private

Definition at line 307 of file FWRPZView.cc.

References m_projMgr.

Referenced by FWRPZView().

308 {
309  m_projMgr->GetProjection()->SetUsePreScale(flag);
310  m_projMgr->UpdateName();
311  m_projMgr->ProjectChildren();
312  gEve->Redraw3D();
313 }
TEveProjectionManager * m_projMgr
Definition: FWRPZView.h:86
void FWRPZView::doFishEyeDistortion ( )
private

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

278 {
279  TEveProjection* p = m_projMgr->GetProjection();
280  if (p->GetDistortion() != m_fishEyeDistortion.value()*s_distortFInv)
281  p->SetDistortion(m_fishEyeDistortion.value()*s_distortF);
282  if (p->GetFixR() != m_fishEyeR.value())
283  p->SetFixR(m_fishEyeR.value());
284 
285  m_projMgr->ProjectChildren();
286  gEve->Redraw3D();
287 }
TEveProjectionManager * m_projMgr
Definition: FWRPZView.h:86
FWDoubleParameter m_fishEyeR
Definition: FWRPZView.h:103
static const float s_distortFInv
Definition: FWRPZView.h:83
FWDoubleParameter m_fishEyeDistortion
Definition: FWRPZView.h:102
static const float s_distortF
Definition: FWRPZView.h:82
void FWRPZView::doPreScaleDistortion ( )
private

Definition at line 290 of file FWRPZView.cc.

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

Referenced by FWRPZView().

291 {
293  m_projMgr->GetProjection()->ChangePreScaleEntry(0,1,m_caloDistortion.value());
294  m_projMgr->GetProjection()->ChangePreScaleEntry(0,2,m_muonDistortion.value());
295  } else {
296  m_projMgr->GetProjection()->ChangePreScaleEntry(0,1,m_caloDistortion.value());
297  m_projMgr->GetProjection()->ChangePreScaleEntry(0,2,m_muonDistortion.value());
298  m_projMgr->GetProjection()->ChangePreScaleEntry(1,1,m_caloDistortion.value());
299  m_projMgr->GetProjection()->ChangePreScaleEntry(1,2,m_muonDistortion.value());
300  }
301  m_projMgr->UpdateName();
302  m_projMgr->ProjectChildren();
303  gEve->Redraw3D();
304 }
TEveProjectionManager * m_projMgr
Definition: FWRPZView.h:86
FWDoubleParameter m_muonDistortion
Definition: FWRPZView.h:106
FWDoubleParameter m_caloDistortion
Definition: FWRPZView.h:105
FWViewType::EType typeId() const
Definition: FWViewBase.h:43
void FWRPZView::doShiftOriginToBeamSpot ( )
private

Definition at line 228 of file FWRPZView.cc.

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

Referenced by FWRPZView().

229 {
230 #ifdef TEVEPROJECTIONS_DISPLACE_ORIGIN_MODE
231 
232  TEveProjection* p = m_projMgr->GetProjection();
233  if (p->GetDisplaceOrigin() != m_shiftOrigin.value())
234  {
235  p->SetDisplaceOrigin( m_shiftOrigin.value());
236  m_projMgr->ProjectChildren();
237  gEve->Redraw3D();
238  }
239 #endif
240 }
FWBoolParameter m_shiftOrigin
Definition: FWRPZView.h:101
TEveProjectionManager * m_projMgr
Definition: FWRPZView.h:86
void FWRPZView::eventBegin ( )
overridevirtual

Reimplemented from FWEveView.

Definition at line 183 of file FWRPZView.cc.

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

184 {
185  if (context().getBeamSpot())
186  {
187  float c[3] = {0,0,0};
189 
190  // projection center
191  TEveVector center(c[0], c[1], c[2] );
192  m_projMgr->GetProjection()->SetCenter(center);
193 
194  // camera move
195  TGLCamera& cam = viewerGL()->CurrentCamera();
196  cam.SetExternalCenter(true);
197  if (typeId() != FWViewType::kRhoZ)
198  {
199  double r = center.Mag();
200  cam.SetCenterVec(center.fZ, TMath::Sign(r, center.fY), 0);
201  }
202  else
203  {
204  cam.SetCenterVec(c[0], c[1], c[2] );
205  }
206  }
207 }
T Sign(T A, T B)
Definition: MathUtil.h:54
void getEventCenter(float *inC) const
TGLViewer * viewerGL() const
Definition: FWEveView.cc:190
TEveProjectionManager * m_projMgr
Definition: FWRPZView.h:86
const fireworks::Context & context()
Definition: FWEveView.h:67
CmsShowCommon * commonPrefs() const
Definition: Context.cc:177
FWViewType::EType typeId() const
Definition: FWViewBase.h:43
void FWRPZView::eventEnd ( )
overridevirtual

Reimplemented from FWEveView.

Definition at line 210 of file FWRPZView.cc.

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

211 {
212  float c[3]; context().commonPrefs()->getEventCenter(c);
213  m_projMgr->SetCenter(c[0], c[1], c[2]);
215 }
void getEventCenter(float *inC) const
virtual void eventEnd()
Definition: FWEveView.cc:251
TEveProjectionManager * m_projMgr
Definition: FWRPZView.h:86
const fireworks::Context & context()
Definition: FWEveView.h:67
CmsShowCommon * commonPrefs() const
Definition: Context.cc:177
TEveCaloViz * FWRPZView::getEveCalo ( ) const
overridevirtual

Reimplemented from FWEveView.

Definition at line 141 of file FWRPZView.cc.

References m_calo.

142 {
143  return static_cast<TEveCaloViz*>(m_calo);
144 }
TEveCalo2D * m_calo
Definition: FWRPZView.h:88
void FWRPZView::importElements ( TEveElement *  iProjectableChild,
float  layer,
TEveElement *  iProjectedParent = nullptr 
)

Definition at line 316 of file FWRPZView.cc.

References m_projMgr.

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

317 {
318  float oldLayer = m_projMgr->GetCurrentDepth();
319  m_projMgr->SetCurrentDepth(iLayer);
320  //make sure current depth is reset even if an exception is thrown
321  std::shared_ptr<TEveProjectionManager> sentry(m_projMgr,
322  boost::bind(&TEveProjectionManager::SetCurrentDepth,
323  _1,oldLayer));
324  m_projMgr->ImportElements(iChildren,iProjectedParent);
325 }
TEveProjectionManager * m_projMgr
Definition: FWRPZView.h:86
const FWRPZView& FWRPZView::operator= ( const FWRPZView )
privatedelete
void FWRPZView::populateController ( ViewerParameterGUI gui) const
overridevirtual

Reimplemented from FWEveView.

Definition at line 413 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_showPixelBarrel, m_showPixelEndcap, m_showProjectionAxes, m_showRpcEndcap, m_showTrackerBarrel, FWEveView::populateController(), ViewerParameterGUI::requestTab(), mps_merge::separator, FWViewBase::typeId(), and FWGeometry::versionInfo().

414 {
416 
417  ViewerParameterGUI& det = gui.requestTab("Detector");;
419 
420  if (typeId() == FWViewType::kRhoZ)
421  {
425  bool showGEM = m_context->getGeom()->versionInfo().haveExtraDet("GEM");
426  if (showGEM) det.addParam(&m_showGEM);
427  bool showME0 = m_context->getGeom()->versionInfo().haveExtraDet("ME0");
428  if (showME0) det.addParam(&m_showME0);
429  }
430 
431 #ifdef TEVEPROJECTIONS_DISPLACE_ORIGIN_MODE
432  gui.requestTab("Projection").addParam(&m_shiftOrigin);
433 #endif
434 
435  gui.requestTab("Projection").
436  addParam(&m_showProjectionAxes).
437  addParam(&m_projectionAxesLabelSize).
438  separator();
439 
440  TGCompositeFrame* f = gui.getTabContainer();
441 
442  f->AddFrame(new TGLabel(f, "FishEye:"));
444  addParam(&m_fishEyeR).
445  separator();
446 
447  f->AddFrame(new TGLabel(f, "PreScales:"));
448 
449  gui.requestTab("Projection").
450  addParam(&m_compressMuon).
451  addParam(&m_muonDistortion).
452  addParam(&m_caloDistortion);
453 
454 
456  {
457  gui.requestTab("Calo").
458  addParam(m_showHF).
459  addParam(m_showEndcaps);
460  }
461 }
string separator
Definition: mps_merge.py:79
FWBoolParameter m_shiftOrigin
Definition: FWRPZView.h:101
FWBoolParameter m_showProjectionAxes
Definition: FWRPZView.h:107
FWBoolParameter m_showME0
Definition: FWRPZView.h:99
FWDoubleParameter m_projectionAxesLabelSize
Definition: FWRPZView.h:108
const FWGeometry * getGeom() const
Definition: Context.h:83
ViewerParameterGUI & requestTab(const char *)
const fireworks::Context * m_context
Definition: FWEveView.h:112
const VersionInfo & versionInfo() const
Definition: FWGeometry.h:127
FWBoolParameter * m_showHF
Definition: FWRPZView.h:111
FWDoubleParameter m_fishEyeR
Definition: FWRPZView.h:103
FWBoolParameter m_showRpcEndcap
Definition: FWRPZView.h:97
bool haveExtraDet(const char *) const
Definition: FWGeometry.cc:529
FWBoolParameter m_showTrackerBarrel
Definition: FWRPZView.h:95
double f[11][100]
FWBoolParameter m_compressMuon
Definition: FWRPZView.h:109
FWBoolParameter * m_showEndcaps
Definition: FWRPZView.h:112
FWBoolParameter m_showGEM
Definition: FWRPZView.h:98
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:94
FWDoubleParameter m_caloDistortion
Definition: FWRPZView.h:105
FWBoolParameter m_showPixelBarrel
Definition: FWRPZView.h:93
void populateController(ViewerParameterGUI &) const override
Definition: FWEveView.cc:556
FWViewType::EType typeId() const
Definition: FWViewBase.h:43
void FWRPZView::projectionAxesLabelSize ( )
private

Definition at line 406 of file FWRPZView.cc.

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

Referenced by FWRPZView().

407 {
408  m_axes->SetLabelSize(m_projectionAxesLabelSize.value());
409  viewerGL()->RequestDraw();
410 }
FWDoubleParameter m_projectionAxesLabelSize
Definition: FWRPZView.h:108
TEveProjectionAxes * m_axes
Definition: FWRPZView.h:87
TGLViewer * viewerGL() const
Definition: FWEveView.cc:190
void FWRPZView::resetOrigin ( )

Definition at line 261 of file FWRPZView.cc.

References b, FWEveView::context(), fireworks::Context::getBeamSpot(), m_projMgr, FWBeamSpot::x0(), FWBeamSpot::y0(), and FWBeamSpot::z0().

Referenced by FWViewContextMenuHandlerGL::select().

262 {
263  // set center back to beam spot
264 
265 #ifdef TEVEPROJECTIONS_DISPLACE_ORIGIN_MODE
266  FWBeamSpot& b = *(context().getBeamSpot());
267  TEveVector center(b.x0(), b.y0(), b.z0());
268  m_projMgr->GetProjection()->SetCenter(center);
269 
270  m_projMgr->ProjectChildren();
271  gEve->Redraw3D();
272 #endif
273 }
double x0() const
Definition: FWBeamSpot.cc:30
double z0() const
Definition: FWBeamSpot.cc:40
double y0() const
Definition: FWBeamSpot.cc:35
TEveProjectionManager * m_projMgr
Definition: FWRPZView.h:86
FWBeamSpot * getBeamSpot() const
Definition: Context.h:78
const fireworks::Context & context()
Definition: FWEveView.h:67
double b
Definition: hdecay.h:120
void FWRPZView::setContext ( const fireworks::Context ctx)
overridevirtual

Reimplemented from FWEveView.

Definition at line 147 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_showPixelBarrel, m_showPixelEndcap, m_showRpcEndcap, m_showTrackerBarrel, m_showTrackerEndcap, AlCaHLTBitMon_ParallelJobs::p, FWEveView::setContext(), FWRPZViewGeometry::showGEM(), FWRPZViewGeometry::showME0(), FWRPZViewGeometry::showPixelBarrel(), FWRPZViewGeometry::showPixelEndcap(), FWRPZViewGeometry::showRpcEndcap(), FWRPZViewGeometry::showTrackerBarrel(), FWRPZViewGeometry::showTrackerEndcap(), and FWViewBase::typeId().

148 {
150 
152  m_geometryList->IncDenyDestroy();
154  TEveElement* p = m_projMgr->ImportElements(m_geometryList);
155  geoScene()->AddElement(p);
156 
157  TEveCaloData* data = context().getCaloData();
158 
159  TEveCalo3D* calo3d = new TEveCalo3D(data);
160 
161  m_calo = static_cast<TEveCalo2D*> (m_projMgr->ImportElements(calo3d, eventScene()));
162 
163  if (typeId() == FWViewType::kRhoPhiPF)
164  m_calo->SetBarrelRadius(177);
165  else
166  m_calo->SetBarrelRadius(context().caloR1(false));
167 
168  m_calo->SetEndCapPos(context().caloZ1(false));
169  m_calo->SetAutoRange(false);
170  m_calo->SetScaleAbs(true);
171 
179 
180 }
TEveScene * eventScene()
Definition: FWEveView.h:82
TEveCalo2D * m_calo
Definition: FWRPZView.h:88
FWBoolParameter m_showME0
Definition: FWRPZView.h:99
sigc::signal< void, T > changed_
TEveProjectionManager * m_projMgr
Definition: FWRPZView.h:86
FWBoolParameter m_showRpcEndcap
Definition: FWRPZView.h:97
float caloR1()
Definition: FWPFGeom.h:21
void initStdGeoElements(const FWViewType::EType id)
FWBoolParameter m_showTrackerBarrel
Definition: FWRPZView.h:95
TEveCaloDataHist * getCaloData() const
Definition: Context.h:80
FWRPZViewGeometry * m_geometryList
Definition: FWRPZView.h:85
const fireworks::Context & context()
Definition: FWEveView.h:67
FWBoolParameter m_showGEM
Definition: FWRPZView.h:98
float caloZ1()
Definition: FWPFGeom.h:22
void showTrackerBarrel(bool)
TEveScene * geoScene()
Definition: FWEveView.h:83
FWBoolParameter m_showTrackerEndcap
Definition: FWRPZView.h:96
char data[epos_bytes_allocation]
Definition: EPOS_Wrapper.h:82
FWBoolParameter m_showPixelEndcap
Definition: FWRPZView.h:94
void showTrackerEndcap(bool)
FWBoolParameter m_showPixelBarrel
Definition: FWRPZView.h:93
virtual void setContext(const fireworks::Context &x)
Definition: FWEveView.cc:271
FWViewType::EType typeId() const
Definition: FWViewBase.h:43
void FWRPZView::setEtaRng ( )
private

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

354 {
355  if (typeId() != FWViewType::kRhoZ)
356  {
357  // rng controllers only in RhoPhi
358  double eta_range = context().caloMaxEta();
359  if (!m_showHF->value() ) eta_range = 3.0;
360  if (!m_showEndcaps->value() ) eta_range = context().caloTransEta();
361  m_calo->SetEta(-eta_range,eta_range);
362  }
363 
365 }
static float caloTransEta()
Definition: Context.cc:228
TEveCalo2D * m_calo
Definition: FWRPZView.h:88
virtual void setupEnergyScale()
Definition: FWEveView.cc:303
FWBoolParameter * m_showHF
Definition: FWRPZView.h:111
const fireworks::Context & context()
Definition: FWEveView.h:67
FWBoolParameter * m_showEndcaps
Definition: FWRPZView.h:112
static double caloMaxEta()
Definition: Context.cc:238
FWViewType::EType typeId() const
Definition: FWViewBase.h:43
void FWRPZView::setFrom ( const FWConfiguration iFrom)
overridevirtual

Reimplemented from FWEveView.

Definition at line 337 of file FWRPZView.cc.

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

338 {
339  FWEveView::setFrom(iFrom);
340 
341  TGLOrthoCamera* camera = dynamic_cast<TGLOrthoCamera*>( &(viewerGL()->CurrentCamera()) );
342  if (camera) setFromOrthoCamera(camera, iFrom);
343 
344  if (iFrom.version() < 7)
345  {
346  const FWConfiguration* value = iFrom.valueForKey("Show projection axes");
347  if (value)
348  m_showProjectionAxes.set(value->value() == "1");
349  }
350 }
FWBoolParameter m_showProjectionAxes
Definition: FWRPZView.h:107
unsigned int version() const
TGLViewer * viewerGL() const
Definition: FWEveView.cc:190
Definition: value.py:1
const std::string & value(unsigned int iIndex=0) const
void setFrom(const FWConfiguration &) override
Definition: FWEveView.cc:369
const FWConfiguration * valueForKey(const std::string &iKey) const
void setFromOrthoCamera(TGLOrthoCamera *, const FWConfiguration &)
Definition: FWEveView.cc:442
void FWRPZView::setupEventCenter ( )
overridevirtual

Reimplemented from FWEveView.

Definition at line 219 of file FWRPZView.cc.

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

220 {
221  float c[3]; context().commonPrefs()->getEventCenter(c);
222  m_projMgr->SetCenter(c[0], c[1], c[2]);
224 }
void getEventCenter(float *inC) const
virtual void setupEventCenter()
Definition: FWEveView.cc:341
TEveProjectionManager * m_projMgr
Definition: FWRPZView.h:86
const fireworks::Context & context()
Definition: FWEveView.h:67
CmsShowCommon * commonPrefs() const
Definition: Context.cc:177
void FWRPZView::shiftOrigin ( TEveVector &  center)

Definition at line 243 of file FWRPZView.cc.

References m_projMgr, and FWEveView::viewerGL().

Referenced by FWViewContextMenuHandlerGL::select().

244 {
245 #ifdef TEVEPROJECTIONS_DISPLACE_ORIGIN_MODE
246  // re-project with new center
247  m_projMgr->GetProjection()->SetCenter(center);
248  m_projMgr->ProjectChildren();
249 
250  // draw projected center
251  float* pc = m_projMgr->GetProjection()->GetProjectedCenter();
252  viewerGL()->CurrentCamera().SetExternalCenter(true);
253  viewerGL()->CurrentCamera().SetCenterVec(pc[0], pc[1], pc[2]);
254  viewerGL()->SetDrawCameraCenter(true);
255 
256  gEve->Redraw3D();
257 #endif
258 }
TGLViewer * viewerGL() const
Definition: FWEveView.cc:190
TEveProjectionManager * m_projMgr
Definition: FWRPZView.h:86
void FWRPZView::showProjectionAxes ( )
private

Definition at line 399 of file FWRPZView.cc.

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

Referenced by FWRPZView().

400 {
401  m_axes->SetRnrState(m_showProjectionAxes.value());
402  gEve->Redraw3D();
403  viewerGL()->RequestDraw();
404 }
FWBoolParameter m_showProjectionAxes
Definition: FWRPZView.h:107
TEveProjectionAxes * m_axes
Definition: FWRPZView.h:87
TGLViewer * viewerGL() const
Definition: FWEveView.cc:190
void FWRPZView::voteCaloMaxVal ( )
overridevirtual

Reimplemented from FWEveView.

Definition at line 368 of file FWRPZView.cc.

References a, FWEveView::context(), gen::k, m_calo, objects.METAnalyzer::sumEt, and fireworks::Context::voteMaxEtAndEnergy().

369 {
370  if (! m_calo->GetData()->Empty())
371  {
372  m_calo->AssertCellIdCache();
373  Float_t sumEt, sumE;
374  TEveCaloData::CellData_t cellData;
375  typedef std::vector<TEveCaloData::vCellId_t*> vBinCells_t;
376  typedef std::vector<TEveCaloData::vCellId_t*>::iterator vBinCells_i;
377 
378  vBinCells_t cellLists = m_calo->GetBinLists();
379  for (vBinCells_i it = cellLists.begin(); it != cellLists.end(); it++)
380  {
381  TEveCaloData::vCellId_t* binCells = *it;
382  if (binCells) {
383  sumEt = 0; sumE = 0;
384  TEveCaloData::vCellId_i a = binCells->end();
385 
386  for (TEveCaloData::vCellId_i k = binCells->begin(); k != a; ++k)
387  {
388  m_calo->GetData()->GetCellData((*k), cellData);
389  sumEt += cellData.Value(true);
390  sumE += cellData.Value(false);
391  }
392  // printf("vote sum %f %f \n", sumEt , sumE);
393  context().voteMaxEtAndEnergy(sumEt, sumE);
394  }
395  }
396  }
397 }
TEveCalo2D * m_calo
Definition: FWRPZView.h:88
void voteMaxEtAndEnergy(float Et, float energy) const
Definition: Context.cc:183
int k[5][pyjets_maxn]
const fireworks::Context & context()
Definition: FWEveView.h:67
double a
Definition: hdecay.h:121

Member Data Documentation

TEveProjectionAxes* FWRPZView::m_axes
private

Definition at line 87 of file FWRPZView.h.

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

TEveCalo2D* FWRPZView::m_calo
private

Definition at line 88 of file FWRPZView.h.

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

FWDoubleParameter FWRPZView::m_caloDistortion
private

Definition at line 105 of file FWRPZView.h.

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

FWBoolParameter FWRPZView::m_compressMuon
private

Definition at line 109 of file FWRPZView.h.

Referenced by FWRPZView(), and populateController().

FWDoubleParameter FWRPZView::m_fishEyeDistortion
private

Definition at line 102 of file FWRPZView.h.

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

FWDoubleParameter FWRPZView::m_fishEyeR
private

Definition at line 103 of file FWRPZView.h.

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

FWRPZViewGeometry* FWRPZView::m_geometryList
private

Definition at line 85 of file FWRPZView.h.

Referenced by setContext().

FWDoubleParameter FWRPZView::m_muonDistortion
private

Definition at line 106 of file FWRPZView.h.

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

FWDoubleParameter FWRPZView::m_projectionAxesLabelSize
private

Definition at line 108 of file FWRPZView.h.

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

TEveProjectionManager* FWRPZView::m_projMgr
private
FWBoolParameter FWRPZView::m_shiftOrigin
private

Definition at line 101 of file FWRPZView.h.

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

FWBoolParameter* FWRPZView::m_showEndcaps
private

Definition at line 112 of file FWRPZView.h.

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

FWBoolParameter FWRPZView::m_showGEM
private

Definition at line 98 of file FWRPZView.h.

Referenced by populateController(), and setContext().

FWBoolParameter* FWRPZView::m_showHF
private

Definition at line 111 of file FWRPZView.h.

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

FWBoolParameter FWRPZView::m_showME0
private

Definition at line 99 of file FWRPZView.h.

Referenced by populateController(), and setContext().

FWBoolParameter FWRPZView::m_showPixelBarrel
private

Definition at line 93 of file FWRPZView.h.

Referenced by populateController(), and setContext().

FWBoolParameter FWRPZView::m_showPixelEndcap
private

Definition at line 94 of file FWRPZView.h.

Referenced by populateController(), and setContext().

FWBoolParameter FWRPZView::m_showProjectionAxes
private

Definition at line 107 of file FWRPZView.h.

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

FWBoolParameter FWRPZView::m_showRpcEndcap
private

Definition at line 97 of file FWRPZView.h.

Referenced by populateController(), and setContext().

FWBoolParameter FWRPZView::m_showTrackerBarrel
private

Definition at line 95 of file FWRPZView.h.

Referenced by populateController(), and setContext().

FWBoolParameter FWRPZView::m_showTrackerEndcap
private

Definition at line 96 of file FWRPZView.h.

Referenced by setContext().

const float FWRPZView::s_distortF = 0.001
staticprivate

Definition at line 82 of file FWRPZView.h.

Referenced by doFishEyeDistortion(), and FWRPZView().

const float FWRPZView::s_distortFInv = 1000
staticprivate

Definition at line 83 of file FWRPZView.h.

Referenced by doFishEyeDistortion().