#include <Fireworks/Core/interface/FWRPZView.h>
Description: <one line="" class="" summary>="">
Usage: <usage>
Definition at line 41 of file FWRPZView.h.
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().
: FWEveView(iParent, id, 7), m_geometryList(0), m_projMgr(0), m_axes(0), m_calo(0), m_showPixelBarrel(this, "Show Pixel Barrel", false ), m_showPixelEndcap(this, "Show Pixel Endcap", false), m_showTrackerBarrel(this, "Show Tracker Barrel", false ), m_showTrackerEndcap(this, "Show Tracker Endcap", false), m_shiftOrigin(this,"Shift origin to beam-spot", false), m_fishEyeDistortion(this,"Distortion",0., 0., 100.), m_fishEyeR(this,"FixedRadius",(double)fireworks::Context::caloR1(), 0.0, 150.0), m_caloDistortion(this,"Calo compression",1.0,0.01,10.), m_muonDistortion(this,"Muon compression",0.2,0.01,10.), m_showProjectionAxes(this,"Show projection axis", false), m_projectionAxesLabelSize(this,"Projection axis label size", 0.015, 0.001, 0.2), m_compressMuon(this,"Compress detectors",false), m_showHF(0), m_showEndcaps(0) { TEveProjection::EPType_e projType = (id == FWViewType::kRhoZ) ? TEveProjection::kPT_RhoZ : TEveProjection::kPT_RPhi; m_projMgr = new TEveProjectionManager(projType); m_projMgr->IncDenyDestroy(); m_projMgr->SetImportEmpty(kTRUE); m_projMgr->GetProjection()->SetDistortion(m_fishEyeDistortion.value()*s_distortF); m_projMgr->GetProjection()->SetFixR(m_fishEyeR.value()); #ifdef TEVEPROJECTIONS_DISPLACE_ORIGIN_MODE m_projMgr->GetProjection()->SetDisplaceOrigin( m_shiftOrigin.value()); #endif if ( id == FWViewType::kRhoPhi || id == FWViewType::kRhoPhiPF) { m_projMgr->GetProjection()->AddPreScaleEntry(0, fireworks::Context::caloR1(), 1.0); m_projMgr->GetProjection()->AddPreScaleEntry(0, 300, 0.2); } else { m_projMgr->GetProjection()->AddPreScaleEntry(0, fireworks::Context::caloR1(), 1.0); m_projMgr->GetProjection()->AddPreScaleEntry(1, 310, 1.0); m_projMgr->GetProjection()->AddPreScaleEntry(0, 370, 0.2); m_projMgr->GetProjection()->AddPreScaleEntry(1, 580, 0.2); } // camera viewerGL()->SetCurrentCamera(TGLViewer::kCameraOrthoXOY); if ( TGLOrthoCamera* camera = dynamic_cast<TGLOrthoCamera*>( &(viewerGL()->CurrentCamera()) ) ) { camera->SetZoomMax(1e6); } geoScene()->GetGLScene()->SetSelectable(kFALSE); m_axes = new TEveProjectionAxes(m_projMgr); m_axes->SetRnrState(m_showProjectionAxes.value()); m_axes->SetLabelSize(m_projectionAxesLabelSize.value()); m_showProjectionAxes.changed_.connect(boost::bind(&FWRPZView::showProjectionAxes,this)); m_projectionAxesLabelSize.changed_.connect(boost::bind(&FWRPZView::projectionAxesLabelSize,this)); eventScene()->AddElement(m_axes); if ( id != FWViewType::kRhoZ ) { m_showEndcaps = new FWBoolParameter(this,"Include EndCaps", true); m_showEndcaps->changed_.connect( boost::bind(&FWRPZView::setEtaRng, this) ); m_showHF = new FWBoolParameter(this,"Include HF", true); m_showHF->changed_.connect( boost::bind(&FWRPZView::setEtaRng, this) ); } m_shiftOrigin.changed_.connect(boost::bind(&FWRPZView::doShiftOriginToBeamSpot,this)); m_fishEyeDistortion.changed_.connect(boost::bind(&FWRPZView::doFishEyeDistortion,this)); m_fishEyeR.changed_.connect(boost::bind(&FWRPZView::doFishEyeDistortion,this)); m_caloDistortion.changed_.connect(boost::bind(&FWRPZView::doPreScaleDistortion,this)); m_muonDistortion.changed_.connect(boost::bind(&FWRPZView::doPreScaleDistortion,this)); m_compressMuon.changed_.connect(boost::bind(&FWRPZView::doCompression,this,_1)); }
FWRPZView::~FWRPZView | ( | ) | [virtual] |
FWRPZView::FWRPZView | ( | const FWRPZView & | ) | [private] |
void FWRPZView::addTo | ( | FWConfiguration & | iTo | ) | const [virtual] |
Reimplemented from FWEveView.
Definition at line 317 of file FWRPZView.cc.
References FWEveView::addToOrthoCamera(), and FWEveView::viewerGL().
{ FWEveView::addTo(iTo); TGLOrthoCamera* camera = dynamic_cast<TGLOrthoCamera*>( &(viewerGL()->CurrentCamera()) ); if (camera) addToOrthoCamera(camera, iTo); }
void FWRPZView::doCompression | ( | bool | flag | ) | [private] |
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().
{ TEveProjection* p = m_projMgr->GetProjection(); if (p->GetDistortion() != m_fishEyeDistortion.value()*s_distortFInv) p->SetDistortion(m_fishEyeDistortion.value()*s_distortF); if (p->GetFixR() != m_fishEyeR.value()) p->SetFixR(m_fishEyeR.value()); m_projMgr->ProjectChildren(); gEve->Redraw3D(); }
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().
{ if ( typeId() == FWViewType::kRhoPhi || typeId() == FWViewType::kRhoPhiPF ) { m_projMgr->GetProjection()->ChangePreScaleEntry(0,1,m_caloDistortion.value()); m_projMgr->GetProjection()->ChangePreScaleEntry(0,2,m_muonDistortion.value()); } else { m_projMgr->GetProjection()->ChangePreScaleEntry(0,1,m_caloDistortion.value()); m_projMgr->GetProjection()->ChangePreScaleEntry(0,2,m_muonDistortion.value()); m_projMgr->GetProjection()->ChangePreScaleEntry(1,1,m_caloDistortion.value()); m_projMgr->GetProjection()->ChangePreScaleEntry(1,2,m_muonDistortion.value()); } m_projMgr->UpdateName(); m_projMgr->ProjectChildren(); gEve->Redraw3D(); }
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().
{ #ifdef TEVEPROJECTIONS_DISPLACE_ORIGIN_MODE TEveProjection* p = m_projMgr->GetProjection(); if (p->GetDisplaceOrigin() != m_shiftOrigin.value()) { p->SetDisplaceOrigin( m_shiftOrigin.value()); m_projMgr->ProjectChildren(); gEve->Redraw3D(); } #endif }
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().
{ if (context().getBeamSpot()) { FWBeamSpot& b = *(context().getBeamSpot()); fwLog(fwlog::kDebug) << Form("%s::eventBegin Set projection center (%f, %f, %f) \n", typeName().c_str(), b.x0(), b.y0(), b.z0()); // projection center TEveVector center(b.x0(), b.y0(), b.z0()); m_projMgr->GetProjection()->SetCenter(center); // camera move TGLCamera& cam = viewerGL()->CurrentCamera(); cam.SetExternalCenter(true); if (typeId() != FWViewType::kRhoZ) { double r = TMath::Sqrt( b.x0()*b.x0() + b.y0()*b.y0()); cam.SetCenterVec(b.z0(), TMath::Sign(r, b.y0()), 0); } else { cam.SetCenterVec(b.x0(), b.y0(), b.z0()); } } }
void FWRPZView::eventEnd | ( | ) | [virtual] |
Reimplemented from FWEveView.
Definition at line 209 of file FWRPZView.cc.
References FWEveView::viewerGL().
{ FWEveView::eventEnd(); viewerGL()->RequestDraw(); }
TEveCaloViz * FWRPZView::getEveCalo | ( | ) | const [virtual] |
Reimplemented from FWEveView.
Definition at line 143 of file FWRPZView.cc.
References m_calo.
{ return static_cast<TEveCaloViz*>(m_calo); }
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().
{ float oldLayer = m_projMgr->GetCurrentDepth(); m_projMgr->SetCurrentDepth(iLayer); //make sure current depth is reset even if an exception is thrown boost::shared_ptr<TEveProjectionManager> sentry(m_projMgr, boost::bind(&TEveProjectionManager::SetCurrentDepth, _1,oldLayer)); m_projMgr->ImportElements(iChildren,iProjectedParent); }
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, ViewerParameterGUI::requestTab(), and FWViewBase::typeId().
{ FWEveView::populateController(gui); ViewerParameterGUI& det = gui.requestTab("Detector");; det.addParam(&m_showPixelBarrel); if (typeId() == FWViewType::kRhoZ) det.addParam(&m_showPixelEndcap); det.addParam(&m_showTrackerBarrel); if (typeId() == FWViewType::kRhoZ) det.addParam(&m_showTrackerEndcap); #ifdef TEVEPROJECTIONS_DISPLACE_ORIGIN_MODE gui.requestTab("Projection").addParam(&m_shiftOrigin); #endif gui.requestTab("Projection"). addParam(&m_showProjectionAxes). addParam(&m_projectionAxesLabelSize). separator(); TGCompositeFrame* f = gui.getTabContainer(); f->AddFrame(new TGLabel(f, "FishEye:")); gui.addParam(&m_fishEyeDistortion). addParam(&m_fishEyeR). separator(); f->AddFrame(new TGLabel(f, "PreScales:")); gui.requestTab("Projection"). addParam(&m_compressMuon). addParam(&m_muonDistortion). addParam(&m_caloDistortion); if (typeId() == FWViewType::kRhoPhi || typeId() == FWViewType::kRhoPhiPF) { gui.requestTab("Calo"). addParam(m_showHF). addParam(m_showEndcaps); } }
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().
{ m_axes->SetLabelSize(m_projectionAxesLabelSize.value()); viewerGL()->RequestDraw(); }
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().
{ // set center back to beam spot #ifdef TEVEPROJECTIONS_DISPLACE_ORIGIN_MODE FWBeamSpot& b = *(context().getBeamSpot()); TEveVector center(b.x0(), b.y0(), b.z0()); m_projMgr->GetProjection()->SetCenter(center); m_projMgr->ProjectChildren(); gEve->Redraw3D(); #endif }
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, FWRPZViewGeometry::showPixelBarrel(), FWRPZViewGeometry::showPixelEndcap(), FWRPZViewGeometry::showTrackerBarrel(), FWRPZViewGeometry::showTrackerEndcap(), and FWViewBase::typeId().
{ FWEveView::setContext(ctx); m_geometryList = new FWRPZViewGeometry(ctx); m_geometryList->IncDenyDestroy(); m_geometryList->initStdGeoElements(typeId()); TEveElement* p = m_projMgr->ImportElements(m_geometryList); geoScene()->AddElement(p); TEveCaloData* data = context().getCaloData(); TEveCalo3D* calo3d = new TEveCalo3D(data); m_calo = static_cast<TEveCalo2D*> (m_projMgr->ImportElements(calo3d, eventScene())); if (typeId() == FWViewType::kRhoPhiPF) m_calo->SetBarrelRadius(177); else m_calo->SetBarrelRadius(context().caloR1(false)); m_calo->SetEndCapPos(context().caloZ1(false)); m_calo->SetAutoRange(false); m_calo->SetScaleAbs(true); m_showPixelBarrel.changed_.connect(boost::bind(&FWRPZViewGeometry::showPixelBarrel,m_geometryList,_1)); m_showPixelEndcap.changed_.connect(boost::bind(&FWRPZViewGeometry::showPixelEndcap,m_geometryList,_1)); m_showTrackerBarrel.changed_.connect(boost::bind(&FWRPZViewGeometry::showTrackerBarrel,m_geometryList,_1)); m_showTrackerEndcap.changed_.connect(boost::bind(&FWRPZViewGeometry::showTrackerEndcap,m_geometryList,_1)); }
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().
{ if (typeId() != FWViewType::kRhoZ) { // rng controllers only in RhoPhi double eta_range = context().caloMaxEta(); if (!m_showHF->value() ) eta_range = 3.0; if (!m_showEndcaps->value() ) eta_range = context().caloTransEta(); m_calo->SetEta(-eta_range,eta_range); } FWEveView::setupEnergyScale(); }
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::setFromOrthoCamera(), FWConfiguration::value(), relativeConstraints::value, FWConfiguration::valueForKey(), FWConfiguration::version(), and FWEveView::viewerGL().
{ FWEveView::setFrom(iFrom); TGLOrthoCamera* camera = dynamic_cast<TGLOrthoCamera*>( &(viewerGL()->CurrentCamera()) ); if (camera) setFromOrthoCamera(camera, iFrom); if (iFrom.version() < 7) { const FWConfiguration* value = iFrom.valueForKey("Show projection axes"); if (value) m_showProjectionAxes.set(value->value() == "1"); } }
void FWRPZView::shiftOrigin | ( | TEveVector & | center | ) |
Definition at line 231 of file FWRPZView.cc.
References m_projMgr, and FWEveView::viewerGL().
Referenced by FWViewContextMenuHandlerGL::select().
{ #ifdef TEVEPROJECTIONS_DISPLACE_ORIGIN_MODE // re-project with new center m_projMgr->GetProjection()->SetCenter(center); m_projMgr->ProjectChildren(); // draw projected center float* pc = m_projMgr->GetProjection()->GetProjectedCenter(); viewerGL()->CurrentCamera().SetExternalCenter(true); viewerGL()->CurrentCamera().SetCenterVec(pc[0], pc[1], pc[2]); viewerGL()->SetDrawCameraCenter(true); gEve->Redraw3D(); #endif }
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().
{ m_axes->SetRnrState(m_showProjectionAxes.value()); gEve->Redraw3D(); viewerGL()->RequestDraw(); }
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().
{ if (! m_calo->GetData()->Empty()) { m_calo->AssertCellIdCache(); Float_t sumEt, sumE; TEveCaloData::CellData_t cellData; typedef std::vector<TEveCaloData::vCellId_t*> vBinCells_t; typedef std::vector<TEveCaloData::vCellId_t*>::iterator vBinCells_i; vBinCells_t cellLists = m_calo->fCellLists; for (vBinCells_i it = cellLists.begin(); it != cellLists.end(); it++) { TEveCaloData::vCellId_t* binCells = *it; if (binCells) { sumEt = 0; sumE = 0; TEveCaloData::vCellId_i a = binCells->end(); for (TEveCaloData::vCellId_i k = binCells->begin(); k != a; ++k) { m_calo->GetData()->GetCellData((*k), cellData); sumEt += cellData.Value(true); sumE += cellData.Value(false); } // printf("vote sum %f %f \n", sumEt , sumE); context().voteMaxEtAndEnergy(sumEt, sumE); } } } }
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().
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().
Definition at line 105 of file FWRPZView.h.
Referenced by FWRPZView(), populateController(), and projectionAxesLabelSize().
TEveProjectionManager* FWRPZView::m_projMgr [private] |
Definition at line 86 of file FWRPZView.h.
Referenced by doCompression(), doFishEyeDistortion(), doPreScaleDistortion(), doShiftOriginToBeamSpot(), eventBegin(), FWRPZView(), importElements(), resetOrigin(), setContext(), shiftOrigin(), and ~FWRPZView().
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().
Definition at line 104 of file FWRPZView.h.
Referenced by FWRPZView(), populateController(), setFrom(), and showProjectionAxes().
Definition at line 95 of file FWRPZView.h.
Referenced by populateController(), and setContext().
Definition at line 96 of file FWRPZView.h.
Referenced by populateController(), and setContext().
const float FWRPZView::s_distortF = 0.001 [static, private] |
Definition at line 82 of file FWRPZView.h.
Referenced by doFishEyeDistortion(), and FWRPZView().
const float FWRPZView::s_distortFInv = 1000 [static, private] |
Definition at line 83 of file FWRPZView.h.
Referenced by doFishEyeDistortion().