CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
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

virtual void addTo (FWConfiguration &) const
 
virtual void eventBegin ()
 
virtual void eventEnd ()
 
 FWRPZView (TEveWindowSlot *iParent, FWViewType::EType)
 
virtual TEveCaloViz * getEveCalo () const
 
void importElements (TEveElement *iProjectableChild, float layer, TEveElement *iProjectedParent=0)
 
virtual void populateController (ViewerParameterGUI &) const
 
void resetOrigin ()
 
virtual void setContext (const fireworks::Context &)
 
virtual void setFrom (const FWConfiguration &)
 
void shiftOrigin (TEveVector &center)
 
virtual void voteCaloMaxVal ()
 
virtual ~FWRPZView ()
 
- Public Member Functions inherited from FWEveView
const fireworks::Contextcontext ()
 
virtual
FWViewContextMenuHandlerBase
contextMenuHandler () const
 
TEveScene * eventScene ()
 
 FWEveView (TEveWindowSlot *, FWViewType::EType, unsigned int version=7)
 
TEveScene * geoScene ()
 
virtual bool isEnergyScaleGlobal () const
 
TEveElement * ownedProducts ()
 
virtual void saveImageTo (const std::string &iName) const
 
virtual void setBackgroundColor (Color_t)
 
virtual void setupEnergyScale ()
 
virtual void useGlobalEnergyScaleChanged ()
 
FWViewContextviewContext ()
 
TEveViewer * viewer ()
 
TGLViewer * viewerGL () const
 
virtual ~FWEveView ()
 
- 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
 
virtual ~FWConfigurableParameterizable ()
 
- 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 &)
 
const FWRPZViewoperator= (const FWRPZView &)
 
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
 
FWBoolParameterm_showHF
 
FWBoolParameter m_showPixelBarrel
 
FWBoolParameter m_showPixelEndcap
 
FWBoolParameter m_showProjectionAxes
 
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
virtual ~FWViewBase ()
 
- Protected Attributes inherited from FWViewBase
FWViewType m_type
 

Detailed Description

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

Usage: <usage>

Definition at line 41 of file FWRPZView.h.

Constructor & Destructor Documentation

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

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

51  :
52  FWEveView(iParent, id, 7),
53  m_geometryList(0),
54  m_projMgr(0),
55  m_axes(0),
56 
57  m_calo(0),
58 
59  m_showPixelBarrel(this, "Show Pixel Barrel", false ),
60  m_showPixelEndcap(this, "Show Pixel Endcap", false),
61  m_showTrackerBarrel(this, "Show Tracker Barrel", false ),
62  m_showTrackerEndcap(this, "Show Tracker Endcap", false),
63 
64  m_shiftOrigin(this,"Shift origin to beam-spot", false),
65  m_fishEyeDistortion(this,"Distortion",0., 0., 100.),
66  m_fishEyeR(this,"FixedRadius",(double)fireworks::Context::caloR1(), 0.0, 150.0),
67 
68  m_caloDistortion(this,"Calo compression",1.0,0.01,10.),
69  m_muonDistortion(this,"Muon compression",0.2,0.01,10.),
70  m_showProjectionAxes(this,"Show projection axis", false),
71  m_projectionAxesLabelSize(this,"Projection axis label size", 0.015, 0.001, 0.2),
72  m_compressMuon(this,"Compress detectors",false),
73  m_showHF(0),
74  m_showEndcaps(0)
75 {
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 
100  // camera
101  viewerGL()->SetCurrentCamera(TGLViewer::kCameraOrthoXOY);
102  if ( TGLOrthoCamera* camera = dynamic_cast<TGLOrthoCamera*>( &(viewerGL()->CurrentCamera()) ) ) {
103  camera->SetZoomMax(1e6);
104  }
105  geoScene()->GetGLScene()->SetSelectable(kFALSE);
106 
107  m_axes = new TEveProjectionAxes(m_projMgr);
108  m_axes->SetRnrState(m_showProjectionAxes.value());
109  m_axes->SetLabelSize(m_projectionAxesLabelSize.value());
110  m_showProjectionAxes.changed_.connect(boost::bind(&FWRPZView::showProjectionAxes,this));
112  eventScene()->AddElement(m_axes);
113 
114  if ( id != FWViewType::kRhoZ ) {
115  m_showEndcaps = new FWBoolParameter(this,"Include EndCaps", true);
116  m_showEndcaps->changed_.connect( boost::bind(&FWRPZView::setEtaRng, this) );
117  m_showHF = new FWBoolParameter(this,"Include HF", true);
118  m_showHF->changed_.connect( boost::bind(&FWRPZView::setEtaRng, this) );
119  }
120 
121  m_shiftOrigin.changed_.connect(boost::bind(&FWRPZView::doShiftOriginToBeamSpot,this));
122 
123  m_fishEyeDistortion.changed_.connect(boost::bind(&FWRPZView::doFishEyeDistortion,this));
124 
125  m_fishEyeR.changed_.connect(boost::bind(&FWRPZView::doFishEyeDistortion,this));
126 
127  m_caloDistortion.changed_.connect(boost::bind(&FWRPZView::doPreScaleDistortion,this));
128  m_muonDistortion.changed_.connect(boost::bind(&FWRPZView::doPreScaleDistortion,this));
129  m_compressMuon.changed_.connect(boost::bind(&FWRPZView::doCompression,this,_1));
130 }
void doShiftOriginToBeamSpot()
Definition: FWRPZView.cc:216
void doFishEyeDistortion()
Definition: FWRPZView.cc:265
FWBoolParameter m_shiftOrigin
Definition: FWRPZView.h:98
TEveScene * eventScene()
Definition: FWEveView.h:76
FWBoolParameter m_showProjectionAxes
Definition: FWRPZView.h:104
TEveCalo2D * m_calo
Definition: FWRPZView.h:88
FWDoubleParameter m_projectionAxesLabelSize
Definition: FWRPZView.h:105
TEveProjectionAxes * m_axes
Definition: FWRPZView.h:87
TGLViewer * viewerGL() const
Definition: FWEveView.cc:198
sigc::signal< void, T > changed_
FWParameters::Bool FWBoolParameter
Definition: FWParameters.h:39
FWBoolParameter * m_showHF
Definition: FWRPZView.h:108
TEveProjectionManager * m_projMgr
Definition: FWRPZView.h:86
FWDoubleParameter m_fishEyeR
Definition: FWRPZView.h:100
void doCompression(bool)
Definition: FWRPZView.cc:295
void setEtaRng()
Definition: FWRPZView.cc:341
FWBoolParameter m_showTrackerBarrel
Definition: FWRPZView.h:95
void showProjectionAxes()
Definition: FWRPZView.cc:387
static float caloR1(bool offset=true)
Definition: Context.cc:210
FWBoolParameter m_compressMuon
Definition: FWRPZView.h:106
FWRPZViewGeometry * m_geometryList
Definition: FWRPZView.h:85
void doPreScaleDistortion()
Definition: FWRPZView.cc:278
FWBoolParameter * m_showEndcaps
Definition: FWRPZView.h:109
FWDoubleParameter m_fishEyeDistortion
Definition: FWRPZView.h:99
TEveScene * geoScene()
Definition: FWEveView.h:77
FWEveView(TEveWindowSlot *, FWViewType::EType, unsigned int version=7)
Definition: FWEveView.cc:80
FWBoolParameter m_showTrackerEndcap
Definition: FWRPZView.h:96
FWDoubleParameter m_muonDistortion
Definition: FWRPZView.h:103
FWBoolParameter m_showPixelEndcap
Definition: FWRPZView.h:94
FWDoubleParameter m_caloDistortion
Definition: FWRPZView.h:102
FWBoolParameter m_showPixelBarrel
Definition: FWRPZView.h:93
static const float s_distortF
Definition: FWRPZView.h:82
void projectionAxesLabelSize()
Definition: FWRPZView.cc:394
FWRPZView::~FWRPZView ( )
virtual

Definition at line 132 of file FWRPZView.cc.

References m_calo, and m_projMgr.

133 {
134  m_calo->Destroy();
135  m_projMgr->DecDenyDestroy();
136 }
TEveCalo2D * m_calo
Definition: FWRPZView.h:88
TEveProjectionManager * m_projMgr
Definition: FWRPZView.h:86
FWRPZView::FWRPZView ( const FWRPZView )
private

Member Function Documentation

void FWRPZView::addTo ( FWConfiguration iTo) const
virtual

Reimplemented from FWEveView.

Definition at line 317 of file FWRPZView.cc.

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

318 {
319  FWEveView::addTo(iTo);
320  TGLOrthoCamera* camera = dynamic_cast<TGLOrthoCamera*>( &(viewerGL()->CurrentCamera()) );
321  if (camera) addToOrthoCamera(camera, iTo);
322 }
void addToOrthoCamera(TGLOrthoCamera *, FWConfiguration &) const
Definition: FWEveView.cc:405
TGLViewer * viewerGL() const
Definition: FWEveView.cc:198
virtual void addTo(FWConfiguration &) const
Definition: FWEveView.cc:338
void FWRPZView::doCompression ( bool  flag)
private

Definition at line 295 of file FWRPZView.cc.

References m_projMgr.

Referenced by FWRPZView().

296 {
297  m_projMgr->GetProjection()->SetUsePreScale(flag);
298  m_projMgr->UpdateName();
299  m_projMgr->ProjectChildren();
300  gEve->Redraw3D();
301 }
long int flag
Definition: mlp_lapack.h:47
TEveProjectionManager * m_projMgr
Definition: FWRPZView.h:86
void FWRPZView::doFishEyeDistortion ( )
private

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

266 {
267  TEveProjection* p = m_projMgr->GetProjection();
268  if (p->GetDistortion() != m_fishEyeDistortion.value()*s_distortFInv)
269  p->SetDistortion(m_fishEyeDistortion.value()*s_distortF);
270  if (p->GetFixR() != m_fishEyeR.value())
271  p->SetFixR(m_fishEyeR.value());
272 
273  m_projMgr->ProjectChildren();
274  gEve->Redraw3D();
275 }
TEveProjectionManager * m_projMgr
Definition: FWRPZView.h:86
FWDoubleParameter m_fishEyeR
Definition: FWRPZView.h:100
static const float s_distortFInv
Definition: FWRPZView.h:83
FWDoubleParameter m_fishEyeDistortion
Definition: FWRPZView.h:99
static const float s_distortF
Definition: FWRPZView.h:82
void FWRPZView::doPreScaleDistortion ( )
private

Definition at line 278 of file FWRPZView.cc.

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

Referenced by FWRPZView().

279 {
281  m_projMgr->GetProjection()->ChangePreScaleEntry(0,1,m_caloDistortion.value());
282  m_projMgr->GetProjection()->ChangePreScaleEntry(0,2,m_muonDistortion.value());
283  } else {
284  m_projMgr->GetProjection()->ChangePreScaleEntry(0,1,m_caloDistortion.value());
285  m_projMgr->GetProjection()->ChangePreScaleEntry(0,2,m_muonDistortion.value());
286  m_projMgr->GetProjection()->ChangePreScaleEntry(1,1,m_caloDistortion.value());
287  m_projMgr->GetProjection()->ChangePreScaleEntry(1,2,m_muonDistortion.value());
288  }
289  m_projMgr->UpdateName();
290  m_projMgr->ProjectChildren();
291  gEve->Redraw3D();
292 }
TEveProjectionManager * m_projMgr
Definition: FWRPZView.h:86
FWDoubleParameter m_muonDistortion
Definition: FWRPZView.h:103
FWDoubleParameter m_caloDistortion
Definition: FWRPZView.h:102
FWViewType::EType typeId() const
Definition: FWViewBase.h:42
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().

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

Reimplemented from FWEveView.

Definition at line 182 of file FWRPZView.cc.

References b, FWEveView::context(), fwLog, fireworks::Context::getBeamSpot(), fwlog::kDebug, FWViewType::kRhoZ, m_projMgr, alignCSCRings::r, FWViewBase::typeId(), FWViewBase::typeName(), FWEveView::viewerGL(), FWBeamSpot::x0(), FWBeamSpot::y0(), and FWBeamSpot::z0().

183 {
184  if (context().getBeamSpot())
185  {
186  FWBeamSpot& b = *(context().getBeamSpot());
187  fwLog(fwlog::kDebug) << Form("%s::eventBegin Set projection center (%f, %f, %f) \n", typeName().c_str(), b.x0(), b.y0(), b.z0());
188 
189  // projection center
190  TEveVector center(b.x0(), b.y0(), b.z0());
191  m_projMgr->GetProjection()->SetCenter(center);
192 
193  // camera move
194  TGLCamera& cam = viewerGL()->CurrentCamera();
195  cam.SetExternalCenter(true);
196  if (typeId() != FWViewType::kRhoZ)
197  {
198  double r = TMath::Sqrt( b.x0()*b.x0() + b.y0()*b.y0());
199  cam.SetCenterVec(b.z0(), TMath::Sign(r, b.y0()), 0);
200  }
201  else
202  {
203  cam.SetCenterVec(b.x0(), b.y0(), b.z0());
204  }
205  }
206 }
double x0() const
Definition: FWBeamSpot.cc:30
double z0() const
Definition: FWBeamSpot.cc:40
double y0() const
Definition: FWBeamSpot.cc:35
const std::string & typeName() const
Definition: FWViewBase.cc:121
TGLViewer * viewerGL() const
Definition: FWEveView.cc:198
TEveProjectionManager * m_projMgr
Definition: FWRPZView.h:86
FWBeamSpot * getBeamSpot() const
Definition: Context.h:79
const fireworks::Context & context()
Definition: FWEveView.h:65
#define fwLog(_level_)
Definition: fwLog.h:51
double b
Definition: hdecay.h:120
FWViewType::EType typeId() const
Definition: FWViewBase.h:42
void FWRPZView::eventEnd ( )
virtual

Reimplemented from FWEveView.

Definition at line 209 of file FWRPZView.cc.

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

210 {
212  viewerGL()->RequestDraw();
213 }
TGLViewer * viewerGL() const
Definition: FWEveView.cc:198
virtual void eventEnd()
Definition: FWEveView.cc:247
TEveCaloViz * FWRPZView::getEveCalo ( ) const
virtual

Reimplemented from FWEveView.

Definition at line 143 of file FWRPZView.cc.

References m_calo.

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

Definition at line 304 of file FWRPZView.cc.

References m_projMgr.

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

305 {
306  float oldLayer = m_projMgr->GetCurrentDepth();
307  m_projMgr->SetCurrentDepth(iLayer);
308  //make sure current depth is reset even if an exception is thrown
309  boost::shared_ptr<TEveProjectionManager> sentry(m_projMgr,
310  boost::bind(&TEveProjectionManager::SetCurrentDepth,
311  _1,oldLayer));
312  m_projMgr->ImportElements(iChildren,iProjectedParent);
313 }
TEveProjectionManager * m_projMgr
Definition: FWRPZView.h:86
const FWRPZView& FWRPZView::operator= ( const FWRPZView )
private
void FWRPZView::populateController ( ViewerParameterGUI gui) const
virtual

Reimplemented from FWEveView.

Definition at line 401 of file FWRPZView.cc.

References ViewerParameterGUI::addParam(), f, ViewerParameterGUI::getTabContainer(), FWViewType::kRhoPhi, FWViewType::kRhoPhiPF, FWViewType::kRhoZ, m_caloDistortion, m_compressMuon, m_fishEyeDistortion, m_fishEyeR, m_muonDistortion, m_projectionAxesLabelSize, m_shiftOrigin, m_showEndcaps, m_showHF, m_showPixelBarrel, m_showPixelEndcap, m_showProjectionAxes, m_showTrackerBarrel, m_showTrackerEndcap, FWEveView::populateController(), ViewerParameterGUI::requestTab(), and FWViewBase::typeId().

402 {
404 
405  ViewerParameterGUI& det = gui.requestTab("Detector");;
410 
411 #ifdef TEVEPROJECTIONS_DISPLACE_ORIGIN_MODE
412  gui.requestTab("Projection").addParam(&m_shiftOrigin);
413 #endif
414 
415  gui.requestTab("Projection").
416  addParam(&m_showProjectionAxes).
417  addParam(&m_projectionAxesLabelSize).
418  separator();
419 
420  TGCompositeFrame* f = gui.getTabContainer();
421 
422  f->AddFrame(new TGLabel(f, "FishEye:"));
424  addParam(&m_fishEyeR).
425  separator();
426 
427  f->AddFrame(new TGLabel(f, "PreScales:"));
428 
429  gui.requestTab("Projection").
430  addParam(&m_compressMuon).
431  addParam(&m_muonDistortion).
432  addParam(&m_caloDistortion);
433 
434 
436  {
437  gui.requestTab("Calo").
438  addParam(m_showHF).
439  addParam(m_showEndcaps);
440  }
441 }
FWBoolParameter m_shiftOrigin
Definition: FWRPZView.h:98
FWBoolParameter m_showProjectionAxes
Definition: FWRPZView.h:104
FWDoubleParameter m_projectionAxesLabelSize
Definition: FWRPZView.h:105
virtual void populateController(ViewerParameterGUI &) const
Definition: FWEveView.cc:543
ViewerParameterGUI & requestTab(const char *)
FWBoolParameter * m_showHF
Definition: FWRPZView.h:108
FWDoubleParameter m_fishEyeR
Definition: FWRPZView.h:100
FWBoolParameter m_showTrackerBarrel
Definition: FWRPZView.h:95
double f[11][100]
FWBoolParameter m_compressMuon
Definition: FWRPZView.h:106
FWBoolParameter * m_showEndcaps
Definition: FWRPZView.h:109
FWDoubleParameter m_fishEyeDistortion
Definition: FWRPZView.h:99
ViewerParameterGUI & addParam(const FWParameterBase *)
FWBoolParameter m_showTrackerEndcap
Definition: FWRPZView.h:96
TGCompositeFrame * getTabContainer()
FWDoubleParameter m_muonDistortion
Definition: FWRPZView.h:103
FWBoolParameter m_showPixelEndcap
Definition: FWRPZView.h:94
FWDoubleParameter m_caloDistortion
Definition: FWRPZView.h:102
FWBoolParameter m_showPixelBarrel
Definition: FWRPZView.h:93
FWViewType::EType typeId() const
Definition: FWViewBase.h:42
void FWRPZView::projectionAxesLabelSize ( )
private

Definition at line 394 of file FWRPZView.cc.

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

Referenced by FWRPZView().

395 {
396  m_axes->SetLabelSize(m_projectionAxesLabelSize.value());
397  viewerGL()->RequestDraw();
398 }
FWDoubleParameter m_projectionAxesLabelSize
Definition: FWRPZView.h:105
TEveProjectionAxes * m_axes
Definition: FWRPZView.h:87
TGLViewer * viewerGL() const
Definition: FWEveView.cc:198
void FWRPZView::resetOrigin ( )

Definition at line 249 of file FWRPZView.cc.

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

Referenced by FWViewContextMenuHandlerGL::select().

250 {
251  // set center back to beam spot
252 
253 #ifdef TEVEPROJECTIONS_DISPLACE_ORIGIN_MODE
254  FWBeamSpot& b = *(context().getBeamSpot());
255  TEveVector center(b.x0(), b.y0(), b.z0());
256  m_projMgr->GetProjection()->SetCenter(center);
257 
258  m_projMgr->ProjectChildren();
259  gEve->Redraw3D();
260 #endif
261 }
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:79
const fireworks::Context & context()
Definition: FWEveView.h:65
double b
Definition: hdecay.h:120
void FWRPZView::setContext ( const fireworks::Context ctx)
virtual

Reimplemented from FWEveView.

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

150 {
152 
154  m_geometryList->IncDenyDestroy();
156  TEveElement* p = m_projMgr->ImportElements(m_geometryList);
157  geoScene()->AddElement(p);
158 
159  TEveCaloData* data = context().getCaloData();
160 
161  TEveCalo3D* calo3d = new TEveCalo3D(data);
162 
163  m_calo = static_cast<TEveCalo2D*> (m_projMgr->ImportElements(calo3d, eventScene()));
164 
165  if (typeId() == FWViewType::kRhoPhiPF)
166  m_calo->SetBarrelRadius(177);
167  else
168  m_calo->SetBarrelRadius(context().caloR1(false));
169 
170  m_calo->SetEndCapPos(context().caloZ1(false));
171  m_calo->SetAutoRange(false);
172  m_calo->SetScaleAbs(true);
173 
178 
179 }
TEveScene * eventScene()
Definition: FWEveView.h:76
TEveCalo2D * m_calo
Definition: FWRPZView.h:88
sigc::signal< void, T > changed_
TEveProjectionManager * m_projMgr
Definition: FWRPZView.h:86
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:81
FWRPZViewGeometry * m_geometryList
Definition: FWRPZView.h:85
const fireworks::Context & context()
Definition: FWEveView.h:65
float caloZ1()
Definition: FWPFGeom.h:22
void showTrackerBarrel(bool)
TEveScene * geoScene()
Definition: FWEveView.h:77
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:267
FWViewType::EType typeId() const
Definition: FWViewBase.h:42
void FWRPZView::setEtaRng ( )
private

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

342 {
343  if (typeId() != FWViewType::kRhoZ)
344  {
345  // rng controllers only in RhoPhi
346  double eta_range = context().caloMaxEta();
347  if (!m_showHF->value() ) eta_range = 3.0;
348  if (!m_showEndcaps->value() ) eta_range = context().caloTransEta();
349  m_calo->SetEta(-eta_range,eta_range);
350  }
351 
353 }
static float caloTransEta()
Definition: Context.cc:230
TEveCalo2D * m_calo
Definition: FWRPZView.h:88
virtual void setupEnergyScale()
Definition: FWEveView.cc:299
FWBoolParameter * m_showHF
Definition: FWRPZView.h:108
const fireworks::Context & context()
Definition: FWEveView.h:65
FWBoolParameter * m_showEndcaps
Definition: FWRPZView.h:109
static double caloMaxEta()
Definition: Context.cc:240
FWViewType::EType typeId() const
Definition: FWViewBase.h:42
void FWRPZView::setFrom ( const FWConfiguration iFrom)
virtual

Reimplemented from FWEveView.

Definition at line 325 of file FWRPZView.cc.

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

326 {
327  FWEveView::setFrom(iFrom);
328 
329  TGLOrthoCamera* camera = dynamic_cast<TGLOrthoCamera*>( &(viewerGL()->CurrentCamera()) );
330  if (camera) setFromOrthoCamera(camera, iFrom);
331 
332  if (iFrom.version() < 7)
333  {
334  const FWConfiguration* value = iFrom.valueForKey("Show projection axes");
335  if (value)
336  m_showProjectionAxes.set(value->value() == "1");
337  }
338 }
FWBoolParameter m_showProjectionAxes
Definition: FWRPZView.h:104
virtual void setFrom(const FWConfiguration &)
Definition: FWEveView.cc:356
unsigned int version() const
TGLViewer * viewerGL() const
Definition: FWEveView.cc:198
const std::string & value(unsigned int iIndex=0) const
const FWConfiguration * valueForKey(const std::string &iKey) const
void setFromOrthoCamera(TGLOrthoCamera *, const FWConfiguration &)
Definition: FWEveView.cc:425
void FWRPZView::shiftOrigin ( TEveVector &  center)

Definition at line 231 of file FWRPZView.cc.

References m_projMgr, and FWEveView::viewerGL().

Referenced by FWViewContextMenuHandlerGL::select().

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

Definition at line 387 of file FWRPZView.cc.

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

Referenced by FWRPZView().

388 {
389  m_axes->SetRnrState(m_showProjectionAxes.value());
390  gEve->Redraw3D();
391  viewerGL()->RequestDraw();
392 }
FWBoolParameter m_showProjectionAxes
Definition: FWRPZView.h:104
TEveProjectionAxes * m_axes
Definition: FWRPZView.h:87
TGLViewer * viewerGL() const
Definition: FWEveView.cc:198
void FWRPZView::voteCaloMaxVal ( )
virtual

Reimplemented from FWEveView.

Definition at line 356 of file FWRPZView.cc.

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

357 {
358  if (! m_calo->GetData()->Empty())
359  {
360  m_calo->AssertCellIdCache();
361  Float_t sumEt, sumE;
362  TEveCaloData::CellData_t cellData;
363  typedef std::vector<TEveCaloData::vCellId_t*> vBinCells_t;
364  typedef std::vector<TEveCaloData::vCellId_t*>::iterator vBinCells_i;
365 
366  vBinCells_t cellLists = m_calo->fCellLists;
367  for (vBinCells_i it = cellLists.begin(); it != cellLists.end(); it++)
368  {
369  TEveCaloData::vCellId_t* binCells = *it;
370  if (binCells) {
371  sumEt = 0; sumE = 0;
372  TEveCaloData::vCellId_i a = binCells->end();
373 
374  for (TEveCaloData::vCellId_i k = binCells->begin(); k != a; ++k)
375  {
376  m_calo->GetData()->GetCellData((*k), cellData);
377  sumEt += cellData.Value(true);
378  sumE += cellData.Value(false);
379  }
380  // printf("vote sum %f %f \n", sumEt , sumE);
381  context().voteMaxEtAndEnergy(sumEt, sumE);
382  }
383  }
384  }
385 }
TEveCalo2D * m_calo
Definition: FWRPZView.h:88
void voteMaxEtAndEnergy(float Et, float energy) const
Definition: Context.cc:185
int k[5][pyjets_maxn]
const fireworks::Context & context()
Definition: FWEveView.h:65
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 102 of file FWRPZView.h.

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

FWBoolParameter FWRPZView::m_compressMuon
private

Definition at line 106 of file FWRPZView.h.

Referenced by FWRPZView(), and populateController().

FWDoubleParameter FWRPZView::m_fishEyeDistortion
private

Definition at line 99 of file FWRPZView.h.

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

FWDoubleParameter FWRPZView::m_fishEyeR
private

Definition at line 100 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 103 of file FWRPZView.h.

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

FWDoubleParameter FWRPZView::m_projectionAxesLabelSize
private

Definition at line 105 of file FWRPZView.h.

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

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

Definition at line 98 of file FWRPZView.h.

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

FWBoolParameter* FWRPZView::m_showEndcaps
private

Definition at line 109 of file FWRPZView.h.

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

FWBoolParameter* FWRPZView::m_showHF
private

Definition at line 108 of file FWRPZView.h.

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

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

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

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 populateController(), and 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().