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

Definition at line 133 of file FWRPZView.cc.

References m_calo, and m_projMgr.

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

Member Function Documentation

void FWRPZView::addTo ( FWConfiguration iTo) const
virtual

Reimplemented from FWEveView.

Definition at line 313 of file FWRPZView.cc.

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

314 {
315  FWEveView::addTo(iTo);
316  TGLOrthoCamera* camera = dynamic_cast<TGLOrthoCamera*>( &(viewerGL()->CurrentCamera()) );
317  if (camera) addToOrthoCamera(camera, iTo);
318 }
void addToOrthoCamera(TGLOrthoCamera *, FWConfiguration &) const
Definition: FWEveView.cc:418
TGLViewer * viewerGL() const
Definition: FWEveView.cc:194
virtual void addTo(FWConfiguration &) const
Definition: FWEveView.cc:346
void FWRPZView::doCompression ( bool  flag)
private

Definition at line 291 of file FWRPZView.cc.

References m_projMgr.

Referenced by FWRPZView().

292 {
293  m_projMgr->GetProjection()->SetUsePreScale(flag);
294  m_projMgr->UpdateName();
295  m_projMgr->ProjectChildren();
296  gEve->Redraw3D();
297 }
TEveProjectionManager * m_projMgr
Definition: FWRPZView.h:84
void FWRPZView::doFishEyeDistortion ( )
private

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

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

Definition at line 274 of file FWRPZView.cc.

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

Referenced by FWRPZView().

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

Definition at line 212 of file FWRPZView.cc.

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

Referenced by FWRPZView().

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

Reimplemented from FWEveView.

Definition at line 185 of file FWRPZView.cc.

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

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

Reimplemented from FWEveView.

Definition at line 144 of file FWRPZView.cc.

References m_calo.

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

Definition at line 300 of file FWRPZView.cc.

References m_projMgr.

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

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

Reimplemented from FWEveView.

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

398 {
400 
401  ViewerParameterGUI& det = gui.requestTab("Detector");;
403 
404  if (typeId() == FWViewType::kRhoZ)
405  {
409  bool showGEM = m_context->getGeom()->versionInfo().haveExtraDet("GEM");
410  if (showGEM) det.addParam(&m_showGEM);
411  }
412 
413 #ifdef TEVEPROJECTIONS_DISPLACE_ORIGIN_MODE
414  gui.requestTab("Projection").addParam(&m_shiftOrigin);
415 #endif
416 
417  gui.requestTab("Projection").
418  addParam(&m_showProjectionAxes).
419  addParam(&m_projectionAxesLabelSize).
420  separator();
421 
422  TGCompositeFrame* f = gui.getTabContainer();
423 
424  f->AddFrame(new TGLabel(f, "FishEye:"));
426  addParam(&m_fishEyeR).
427  separator();
428 
429  f->AddFrame(new TGLabel(f, "PreScales:"));
430 
431  gui.requestTab("Projection").
432  addParam(&m_compressMuon).
433  addParam(&m_muonDistortion).
434  addParam(&m_caloDistortion);
435 
436 
438  {
439  gui.requestTab("Calo").
440  addParam(m_showHF).
441  addParam(m_showEndcaps);
442  }
443 }
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:556
const FWGeometry * getGeom() const
Definition: Context.h:83
ViewerParameterGUI & requestTab(const char *)
const fireworks::Context * m_context
Definition: FWEveView.h:111
const VersionInfo & versionInfo() const
Definition: FWGeometry.h:117
FWBoolParameter * m_showHF
Definition: FWRPZView.h:108
FWDoubleParameter m_fishEyeR
Definition: FWRPZView.h:100
FWBoolParameter m_showRpcEndcap
Definition: FWRPZView.h:95
bool haveExtraDet(const char *) const
Definition: FWGeometry.cc:379
FWBoolParameter m_showTrackerBarrel
Definition: FWRPZView.h:93
double f[11][100]
FWBoolParameter m_compressMuon
Definition: FWRPZView.h:106
FWBoolParameter * m_showEndcaps
Definition: FWRPZView.h:109
FWBoolParameter m_showGEM
Definition: FWRPZView.h:96
FWDoubleParameter m_fishEyeDistortion
Definition: FWRPZView.h:99
ViewerParameterGUI & addParam(const FWParameterBase *)
TGCompositeFrame * getTabContainer()
FWDoubleParameter m_muonDistortion
Definition: FWRPZView.h:103
FWBoolParameter m_showPixelEndcap
Definition: FWRPZView.h:92
FWDoubleParameter m_caloDistortion
Definition: FWRPZView.h:102
FWBoolParameter m_showPixelBarrel
Definition: FWRPZView.h:91
FWViewType::EType typeId() const
Definition: FWViewBase.h:41
void FWRPZView::projectionAxesLabelSize ( )
private

Definition at line 390 of file FWRPZView.cc.

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

Referenced by FWRPZView().

391 {
392  m_axes->SetLabelSize(m_projectionAxesLabelSize.value());
393  viewerGL()->RequestDraw();
394 }
FWDoubleParameter m_projectionAxesLabelSize
Definition: FWRPZView.h:105
TEveProjectionAxes * m_axes
Definition: FWRPZView.h:85
TGLViewer * viewerGL() const
Definition: FWEveView.cc:194
void FWRPZView::resetOrigin ( )

Definition at line 245 of file FWRPZView.cc.

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

Referenced by FWViewContextMenuHandlerGL::select().

246 {
247  // set center back to beam spot
248 
249 #ifdef TEVEPROJECTIONS_DISPLACE_ORIGIN_MODE
250  FWBeamSpot& b = *(context().getBeamSpot());
251  TEveVector center(b.x0(), b.y0(), b.z0());
252  m_projMgr->GetProjection()->SetCenter(center);
253 
254  m_projMgr->ProjectChildren();
255  gEve->Redraw3D();
256 #endif
257 }
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:84
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)
virtual

Reimplemented from FWEveView.

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

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

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

338 {
339  if (typeId() != FWViewType::kRhoZ)
340  {
341  // rng controllers only in RhoPhi
342  double eta_range = context().caloMaxEta();
343  if (!m_showHF->value() ) eta_range = 3.0;
344  if (!m_showEndcaps->value() ) eta_range = context().caloTransEta();
345  m_calo->SetEta(-eta_range,eta_range);
346  }
347 
349 }
static float caloTransEta()
Definition: Context.cc:229
TEveCalo2D * m_calo
Definition: FWRPZView.h:86
virtual void setupEnergyScale()
Definition: FWEveView.cc:307
FWBoolParameter * m_showHF
Definition: FWRPZView.h:108
const fireworks::Context & context()
Definition: FWEveView.h:67
FWBoolParameter * m_showEndcaps
Definition: FWRPZView.h:109
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 321 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().

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

Definition at line 227 of file FWRPZView.cc.

References m_projMgr, and FWEveView::viewerGL().

Referenced by FWViewContextMenuHandlerGL::select().

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

Definition at line 383 of file FWRPZView.cc.

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

Referenced by FWRPZView().

384 {
385  m_axes->SetRnrState(m_showProjectionAxes.value());
386  gEve->Redraw3D();
387  viewerGL()->RequestDraw();
388 }
FWBoolParameter m_showProjectionAxes
Definition: FWRPZView.h:104
TEveProjectionAxes * m_axes
Definition: FWRPZView.h:85
TGLViewer * viewerGL() const
Definition: FWEveView.cc:194
void FWRPZView::voteCaloMaxVal ( )
virtual

Reimplemented from FWEveView.

Definition at line 352 of file FWRPZView.cc.

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

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

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

TEveCalo2D* FWRPZView::m_calo
private

Definition at line 86 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 83 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_showGEM
private

Definition at line 96 of file FWRPZView.h.

Referenced by populateController(), and setContext().

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

Referenced by populateController(), and setContext().

FWBoolParameter FWRPZView::m_showPixelEndcap
private

Definition at line 92 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_showRpcEndcap
private

Definition at line 95 of file FWRPZView.h.

Referenced by populateController(), and setContext().

FWBoolParameter FWRPZView::m_showTrackerBarrel
private

Definition at line 93 of file FWRPZView.h.

Referenced by populateController(), and setContext().

FWBoolParameter FWRPZView::m_showTrackerEndcap
private

Definition at line 94 of file FWRPZView.h.

Referenced by setContext().

const float FWRPZView::s_distortF = 0.001
staticprivate

Definition at line 80 of file FWRPZView.h.

Referenced by doFishEyeDistortion(), and FWRPZView().

const float FWRPZView::s_distortFInv = 1000
staticprivate

Definition at line 81 of file FWRPZView.h.

Referenced by doFishEyeDistortion().