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 bool requestGLHandlerPick () const
 
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 40 of file FWRPZView.h.

Constructor & Destructor Documentation

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

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

50  :
51  FWEveView(iParent, id, 7),
52  m_geometryList(0),
53  m_projMgr(0),
54  m_axes(0),
55 
56  m_calo(0),
57 
58  m_showPixelBarrel(this, "Show Pixel Barrel", false ),
59  m_showPixelEndcap(this, "Show Pixel Endcap", false),
60  m_showTrackerBarrel(this, "Show Tracker Barrel", false ),
61  m_showTrackerEndcap(this, "Show Tracker Endcap", false),
62 
63  m_shiftOrigin(this,"Shift origin to beam-spot", false),
64  m_fishEyeDistortion(this,"Distortion",0., 0., 100.),
65  m_fishEyeR(this,"FixedRadius",(double)fireworks::Context::caloR1(), 0.0, 150.0),
66 
67  m_caloDistortion(this,"Calo compression",1.0,0.01,10.),
68  m_muonDistortion(this,"Muon compression",0.2,0.01,10.),
69  m_showProjectionAxes(this,"Show projection axis", false),
70  m_projectionAxesLabelSize(this,"Projection axis label size", 0.015, 0.001, 0.2),
71  m_compressMuon(this,"Compress detectors",false),
72  m_showHF(0),
73  m_showEndcaps(0)
74 {
75  TEveProjection::EPType_e projType = (id == FWViewType::kRhoZ) ? TEveProjection::kPT_RhoZ : TEveProjection::kPT_RPhi;
76 
77  m_projMgr = new TEveProjectionManager(projType);
78  m_projMgr->IncDenyDestroy();
79  m_projMgr->SetImportEmpty(kTRUE);
80 
81  m_projMgr->GetProjection()->SetDistortion(m_fishEyeDistortion.value()*s_distortF);
82  m_projMgr->GetProjection()->SetFixR(m_fishEyeR.value());
83 
84 #ifdef TEVEPROJECTIONS_DISPLACE_ORIGIN_MODE
85  m_projMgr->GetProjection()->SetDisplaceOrigin( m_shiftOrigin.value());
86 #endif
87 
88  if ( id == FWViewType::kRhoPhi || id == FWViewType::kRhoPhiPF) {
89  m_projMgr->GetProjection()->AddPreScaleEntry(0, fireworks::Context::caloR1(), 1.0);
90  m_projMgr->GetProjection()->AddPreScaleEntry(0, 300, 0.2);
91  } else {
92  m_projMgr->GetProjection()->AddPreScaleEntry(0, fireworks::Context::caloR1(), 1.0);
93  m_projMgr->GetProjection()->AddPreScaleEntry(1, 310, 1.0);
94  m_projMgr->GetProjection()->AddPreScaleEntry(0, 370, 0.2);
95  m_projMgr->GetProjection()->AddPreScaleEntry(1, 580, 0.2);
96  }
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());
109  m_showProjectionAxes.changed_.connect(boost::bind(&FWRPZView::showProjectionAxes,this));
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( boost::bind(&FWRPZView::setEtaRng, this) );
116  m_showHF = new FWBoolParameter(this,"Include HF", true);
117  m_showHF->changed_.connect( boost::bind(&FWRPZView::setEtaRng, this) );
118  }
119 
120  m_shiftOrigin.changed_.connect(boost::bind(&FWRPZView::doShiftOriginToBeamSpot,this));
121 
122  m_fishEyeDistortion.changed_.connect(boost::bind(&FWRPZView::doFishEyeDistortion,this));
123 
124  m_fishEyeR.changed_.connect(boost::bind(&FWRPZView::doFishEyeDistortion,this));
125 
126  m_caloDistortion.changed_.connect(boost::bind(&FWRPZView::doPreScaleDistortion,this));
127  m_muonDistortion.changed_.connect(boost::bind(&FWRPZView::doPreScaleDistortion,this));
128  m_compressMuon.changed_.connect(boost::bind(&FWRPZView::doCompression,this,_1));
129 }
void doShiftOriginToBeamSpot()
Definition: FWRPZView.cc:215
void doFishEyeDistortion()
Definition: FWRPZView.cc:264
FWBoolParameter m_shiftOrigin
Definition: FWRPZView.h:97
TEveScene * eventScene()
Definition: FWEveView.h:75
FWBoolParameter m_showProjectionAxes
Definition: FWRPZView.h:103
TEveCalo2D * m_calo
Definition: FWRPZView.h:87
FWDoubleParameter m_projectionAxesLabelSize
Definition: FWRPZView.h:104
TEveProjectionAxes * m_axes
Definition: FWRPZView.h:86
TGLViewer * viewerGL() const
Definition: FWEveView.cc:197
sigc::signal< void, T > changed_
FWParameters::Bool FWBoolParameter
Definition: FWParameters.h:38
FWBoolParameter * m_showHF
Definition: FWRPZView.h:107
TEveProjectionManager * m_projMgr
Definition: FWRPZView.h:85
FWDoubleParameter m_fishEyeR
Definition: FWRPZView.h:99
void doCompression(bool)
Definition: FWRPZView.cc:294
void setEtaRng()
Definition: FWRPZView.cc:340
FWBoolParameter m_showTrackerBarrel
Definition: FWRPZView.h:94
void showProjectionAxes()
Definition: FWRPZView.cc:386
static float caloR1(bool offset=true)
Definition: Context.cc:209
FWBoolParameter m_compressMuon
Definition: FWRPZView.h:105
FWRPZViewGeometry * m_geometryList
Definition: FWRPZView.h:84
void doPreScaleDistortion()
Definition: FWRPZView.cc:277
FWBoolParameter * m_showEndcaps
Definition: FWRPZView.h:108
FWDoubleParameter m_fishEyeDistortion
Definition: FWRPZView.h:98
TEveScene * geoScene()
Definition: FWEveView.h:76
FWEveView(TEveWindowSlot *, FWViewType::EType, unsigned int version=7)
Definition: FWEveView.cc:79
FWBoolParameter m_showTrackerEndcap
Definition: FWRPZView.h:95
FWDoubleParameter m_muonDistortion
Definition: FWRPZView.h:102
FWBoolParameter m_showPixelEndcap
Definition: FWRPZView.h:93
FWDoubleParameter m_caloDistortion
Definition: FWRPZView.h:101
FWBoolParameter m_showPixelBarrel
Definition: FWRPZView.h:92
static const float s_distortF
Definition: FWRPZView.h:81
void projectionAxesLabelSize()
Definition: FWRPZView.cc:393
FWRPZView::~FWRPZView ( )
virtual

Definition at line 131 of file FWRPZView.cc.

References m_calo, and m_projMgr.

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

Member Function Documentation

void FWRPZView::addTo ( FWConfiguration iTo) const
virtual

Reimplemented from FWEveView.

Definition at line 316 of file FWRPZView.cc.

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

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

Definition at line 294 of file FWRPZView.cc.

References m_projMgr.

Referenced by FWRPZView().

295 {
296  m_projMgr->GetProjection()->SetUsePreScale(flag);
297  m_projMgr->UpdateName();
298  m_projMgr->ProjectChildren();
299  gEve->Redraw3D();
300 }
TEveProjectionManager * m_projMgr
Definition: FWRPZView.h:85
void FWRPZView::doFishEyeDistortion ( )
private

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

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

Definition at line 277 of file FWRPZView.cc.

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

Referenced by FWRPZView().

278 {
280  m_projMgr->GetProjection()->ChangePreScaleEntry(0,1,m_caloDistortion.value());
281  m_projMgr->GetProjection()->ChangePreScaleEntry(0,2,m_muonDistortion.value());
282  } else {
283  m_projMgr->GetProjection()->ChangePreScaleEntry(0,1,m_caloDistortion.value());
284  m_projMgr->GetProjection()->ChangePreScaleEntry(0,2,m_muonDistortion.value());
285  m_projMgr->GetProjection()->ChangePreScaleEntry(1,1,m_caloDistortion.value());
286  m_projMgr->GetProjection()->ChangePreScaleEntry(1,2,m_muonDistortion.value());
287  }
288  m_projMgr->UpdateName();
289  m_projMgr->ProjectChildren();
290  gEve->Redraw3D();
291 }
TEveProjectionManager * m_projMgr
Definition: FWRPZView.h:85
FWDoubleParameter m_muonDistortion
Definition: FWRPZView.h:102
FWDoubleParameter m_caloDistortion
Definition: FWRPZView.h:101
FWViewType::EType typeId() const
Definition: FWViewBase.h:41
void FWRPZView::doShiftOriginToBeamSpot ( )
private

Definition at line 215 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  {
222  p->SetDisplaceOrigin( m_shiftOrigin.value());
223  m_projMgr->ProjectChildren();
224  gEve->Redraw3D();
225  }
226 #endif
227 }
FWBoolParameter m_shiftOrigin
Definition: FWRPZView.h:97
TEveProjectionManager * m_projMgr
Definition: FWRPZView.h:85
void FWRPZView::eventBegin ( )
virtual

Reimplemented from FWEveView.

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

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

Reimplemented from FWEveView.

Definition at line 208 of file FWRPZView.cc.

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

209 {
211  viewerGL()->RequestDraw();
212 }
TGLViewer * viewerGL() const
Definition: FWEveView.cc:197
virtual void eventEnd()
Definition: FWEveView.cc:246
TEveCaloViz * FWRPZView::getEveCalo ( ) const
virtual

Reimplemented from FWEveView.

Definition at line 142 of file FWRPZView.cc.

References m_calo.

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

Definition at line 303 of file FWRPZView.cc.

References m_projMgr.

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

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

Reimplemented from FWEveView.

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

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

Definition at line 393 of file FWRPZView.cc.

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

Referenced by FWRPZView().

394 {
395  m_axes->SetLabelSize(m_projectionAxesLabelSize.value());
396  viewerGL()->RequestDraw();
397 }
FWDoubleParameter m_projectionAxesLabelSize
Definition: FWRPZView.h:104
TEveProjectionAxes * m_axes
Definition: FWRPZView.h:86
TGLViewer * viewerGL() const
Definition: FWEveView.cc:197
void FWRPZView::resetOrigin ( )

Definition at line 248 of file FWRPZView.cc.

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

Referenced by FWViewContextMenuHandlerGL::select().

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

Reimplemented from FWEveView.

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

149 {
151 
153  m_geometryList->IncDenyDestroy();
155  TEveElement* p = m_projMgr->ImportElements(m_geometryList);
156  geoScene()->AddElement(p);
157 
158  TEveCaloData* data = context().getCaloData();
159 
160  TEveCalo3D* calo3d = new TEveCalo3D(data);
161 
162  m_calo = static_cast<TEveCalo2D*> (m_projMgr->ImportElements(calo3d, eventScene()));
163 
164  if (typeId() == FWViewType::kRhoPhiPF)
165  m_calo->SetBarrelRadius(177);
166  else
167  m_calo->SetBarrelRadius(context().caloR1(false));
168 
169  m_calo->SetEndCapPos(context().caloZ1(false));
170  m_calo->SetAutoRange(false);
171  m_calo->SetScaleAbs(true);
172 
177 
178 }
TEveScene * eventScene()
Definition: FWEveView.h:75
TEveCalo2D * m_calo
Definition: FWRPZView.h:87
sigc::signal< void, T > changed_
TEveProjectionManager * m_projMgr
Definition: FWRPZView.h:85
float caloR1()
Definition: FWPFGeom.h:21
void initStdGeoElements(const FWViewType::EType id)
FWBoolParameter m_showTrackerBarrel
Definition: FWRPZView.h:94
TEveCaloDataHist * getCaloData() const
Definition: Context.h:80
FWRPZViewGeometry * m_geometryList
Definition: FWRPZView.h:84
const fireworks::Context & context()
Definition: FWEveView.h:64
float caloZ1()
Definition: FWPFGeom.h:22
void showTrackerBarrel(bool)
TEveScene * geoScene()
Definition: FWEveView.h:76
FWBoolParameter m_showTrackerEndcap
Definition: FWRPZView.h:95
char data[epos_bytes_allocation]
Definition: EPOS_Wrapper.h:82
FWBoolParameter m_showPixelEndcap
Definition: FWRPZView.h:93
void showTrackerEndcap(bool)
FWBoolParameter m_showPixelBarrel
Definition: FWRPZView.h:92
virtual void setContext(const fireworks::Context &x)
Definition: FWEveView.cc:266
FWViewType::EType typeId() const
Definition: FWViewBase.h:41
void FWRPZView::setEtaRng ( )
private

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

341 {
342  if (typeId() != FWViewType::kRhoZ)
343  {
344  // rng controllers only in RhoPhi
345  double eta_range = context().caloMaxEta();
346  if (!m_showHF->value() ) eta_range = 3.0;
347  if (!m_showEndcaps->value() ) eta_range = context().caloTransEta();
348  m_calo->SetEta(-eta_range,eta_range);
349  }
350 
352 }
static float caloTransEta()
Definition: Context.cc:229
TEveCalo2D * m_calo
Definition: FWRPZView.h:87
virtual void setupEnergyScale()
Definition: FWEveView.cc:298
FWBoolParameter * m_showHF
Definition: FWRPZView.h:107
const fireworks::Context & context()
Definition: FWEveView.h:64
FWBoolParameter * m_showEndcaps
Definition: FWRPZView.h:108
static double caloMaxEta()
Definition: Context.cc:239
FWViewType::EType typeId() const
Definition: FWViewBase.h:41
void FWRPZView::setFrom ( const FWConfiguration iFrom)
virtual

Reimplemented from FWEveView.

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

325 {
326  FWEveView::setFrom(iFrom);
327 
328  TGLOrthoCamera* camera = dynamic_cast<TGLOrthoCamera*>( &(viewerGL()->CurrentCamera()) );
329  if (camera) setFromOrthoCamera(camera, iFrom);
330 
331  if (iFrom.version() < 7)
332  {
333  const FWConfiguration* value = iFrom.valueForKey("Show projection axes");
334  if (value)
335  m_showProjectionAxes.set(value->value() == "1");
336  }
337 }
FWBoolParameter m_showProjectionAxes
Definition: FWRPZView.h:103
virtual void setFrom(const FWConfiguration &)
Definition: FWEveView.cc:355
unsigned int version() const
TGLViewer * viewerGL() const
Definition: FWEveView.cc:197
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:424
void FWRPZView::shiftOrigin ( TEveVector &  center)

Definition at line 230 of file FWRPZView.cc.

References m_projMgr, and FWEveView::viewerGL().

Referenced by FWViewContextMenuHandlerGL::select().

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

Definition at line 386 of file FWRPZView.cc.

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

Referenced by FWRPZView().

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

Reimplemented from FWEveView.

Definition at line 355 of file FWRPZView.cc.

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

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

Member Data Documentation

TEveProjectionAxes* FWRPZView::m_axes
private

Definition at line 86 of file FWRPZView.h.

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

TEveCalo2D* FWRPZView::m_calo
private

Definition at line 87 of file FWRPZView.h.

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

FWDoubleParameter FWRPZView::m_caloDistortion
private

Definition at line 101 of file FWRPZView.h.

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

FWBoolParameter FWRPZView::m_compressMuon
private

Definition at line 105 of file FWRPZView.h.

Referenced by FWRPZView(), and populateController().

FWDoubleParameter FWRPZView::m_fishEyeDistortion
private

Definition at line 98 of file FWRPZView.h.

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

FWDoubleParameter FWRPZView::m_fishEyeR
private

Definition at line 99 of file FWRPZView.h.

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

FWRPZViewGeometry* FWRPZView::m_geometryList
private

Definition at line 84 of file FWRPZView.h.

Referenced by setContext().

FWDoubleParameter FWRPZView::m_muonDistortion
private

Definition at line 102 of file FWRPZView.h.

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

FWDoubleParameter FWRPZView::m_projectionAxesLabelSize
private

Definition at line 104 of file FWRPZView.h.

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

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

Definition at line 97 of file FWRPZView.h.

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

FWBoolParameter* FWRPZView::m_showEndcaps
private

Definition at line 108 of file FWRPZView.h.

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

FWBoolParameter* FWRPZView::m_showHF
private

Definition at line 107 of file FWRPZView.h.

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

FWBoolParameter FWRPZView::m_showPixelBarrel
private

Definition at line 92 of file FWRPZView.h.

Referenced by populateController(), and setContext().

FWBoolParameter FWRPZView::m_showPixelEndcap
private

Definition at line 93 of file FWRPZView.h.

Referenced by populateController(), and setContext().

FWBoolParameter FWRPZView::m_showProjectionAxes
private

Definition at line 103 of file FWRPZView.h.

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

FWBoolParameter FWRPZView::m_showTrackerBarrel
private

Definition at line 94 of file FWRPZView.h.

Referenced by populateController(), and setContext().

FWBoolParameter FWRPZView::m_showTrackerEndcap
private

Definition at line 95 of file FWRPZView.h.

Referenced by populateController(), and setContext().

const float FWRPZView::s_distortF = 0.001
staticprivate

Definition at line 81 of file FWRPZView.h.

Referenced by doFishEyeDistortion(), and FWRPZView().

const float FWRPZView::s_distortFInv = 1000
staticprivate

Definition at line 82 of file FWRPZView.h.

Referenced by doFishEyeDistortion().