Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2024-04-06 12:11:35

0001 // -*- C++ -*-
0002 //
0003 // Package:     cmsShow36
0004 // Class  :     FW3DView
0005 //
0006 // Implementation:
0007 //     [Notes on implementation]
0008 //
0009 // Original Author:
0010 //         Created:  Wed Apr  7 14:40:47 CEST 2010
0011 //
0012 
0013 // system include files
0014 #include <functional>
0015 
0016 // user include files
0017 #include "TGLViewer.h"
0018 #include "TGLScenePad.h"
0019 #include "TEveCalo.h"
0020 #include "TEveScene.h"
0021 
0022 #include "Fireworks/Core/interface/FW3DView.h"
0023 #include "Fireworks/Core/interface/Context.h"
0024 #include "Fireworks/Core/interface/FWViewContext.h"
0025 #include "Fireworks/Core/interface/CmsShowViewPopup.h"
0026 #include "Fireworks/Core/interface/FWViewEnergyScale.h"
0027 
0028 //
0029 // constants, enums and typedefs
0030 //
0031 
0032 //
0033 // static data member definitions
0034 //
0035 
0036 //
0037 // constructors and destructor
0038 //
0039 FW3DView::FW3DView(TEveWindowSlot* slot, FWViewType::EType typeId) : FW3DViewBase(slot, typeId), m_calo(nullptr) {
0040   viewerGL()->CurrentCamera().SetFixDefCenter(kTRUE);
0041 }
0042 
0043 FW3DView::~FW3DView() { m_calo->Destroy(); }
0044 
0045 TEveCaloViz* FW3DView::getEveCalo() const { return static_cast<TEveCaloViz*>(m_calo); }
0046 
0047 void FW3DView::setContext(const fireworks::Context& ctx) {
0048   FW3DViewBase::setContext(ctx);
0049 
0050   TEveCaloData* data = context().getCaloData();
0051   m_calo = new TEveCalo3D(data);
0052   m_calo->SetElementName("calo barrel");
0053 
0054   m_calo->SetBarrelRadius(context().caloR1(false));
0055   m_calo->SetEndCapPos(context().caloZ1(false));
0056   m_calo->SetFrameTransparency(80);
0057   m_calo->SetAutoRange(false);
0058   m_calo->SetScaleAbs(true);
0059   eventScene()->AddElement(m_calo);
0060 }