18 #include "TGLViewer.h" 19 #include "TGLScenePad.h" 20 #include "TEveManager.h" 21 #include "TEveElement.h" 22 #include "TEveScene.h" 23 #include "TEveProjections.h" 24 #include "TEveProjectionAxes.h" 26 #include "TEveProjectionManager.h" 48 m_geometryList(nullptr),
54 m_showPixelBarrel(this,
"Show Pixel Barrel",
false),
55 m_showPixelEndcap(this,
"Show Pixel Endcap",
false),
56 m_showTrackerBarrel(this,
"Show Tracker Barrel",
false),
57 m_showTrackerEndcap(this,
"Show Tracker Endcap",
false),
58 m_showRpcEndcap(this,
"Show RPC Endcap",
false),
59 m_showGEM(this,
"Show GEM",
false),
60 m_showME0(this,
"Show ME0",
false),
62 m_showMtdBarrel(this,
"Show MTD Barrel",
false),
63 m_showMtdEndcap(this,
"Show MTD Endcap",
false),
65 m_shiftOrigin(this,
"Shift origin to beam-spot",
false),
66 m_fishEyeDistortion(this,
"Distortion", 0., 0., 100.),
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),
75 m_showEndcaps(nullptr) {
76 TEveProjection::EPType_e projType = (
id ==
FWViewType::kRhoZ) ? TEveProjection::kPT_RhoZ : TEveProjection::kPT_RPhi;
78 m_projMgr =
new TEveProjectionManager(projType);
85 #ifdef TEVEPROJECTIONS_DISPLACE_ORIGIN_MODE 91 m_projMgr->GetProjection()->AddPreScaleEntry(0, 300, 0.2);
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);
100 viewerGL()->SetCurrentCamera(TGLViewer::kCameraOrthoXOY);
101 if (TGLOrthoCamera* camera = dynamic_cast<TGLOrthoCamera*>(&(
viewerGL()->CurrentCamera()))) {
102 camera->SetZoomMax(1e6);
104 geoScene()->GetGLScene()->SetSelectable(kFALSE);
153 TEveCalo3D* calo3d =
new TEveCalo3D(
data);
158 m_calo->SetBarrelRadius(177);
163 m_calo->SetAutoRange(
false);
164 m_calo->SetScaleAbs(
true);
183 float c[3] = {0, 0, 0};
187 TEveVector center(
c[0],
c[1],
c[2]);
188 m_projMgr->GetProjection()->SetCenter(center);
191 TGLCamera& cam =
viewerGL()->CurrentCamera();
192 cam.SetExternalCenter(
true);
194 double r = center.Mag();
195 cam.SetCenterVec(center.fZ, TMath::Sign(
r, center.fY), 0);
197 cam.SetCenterVec(
c[0],
c[1],
c[2]);
217 #ifdef TEVEPROJECTIONS_DISPLACE_ORIGIN_MODE 219 TEveProjection*
p =
m_projMgr->GetProjection();
229 #ifdef TEVEPROJECTIONS_DISPLACE_ORIGIN_MODE 231 m_projMgr->GetProjection()->SetCenter(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);
247 #ifdef TEVEPROJECTIONS_DISPLACE_ORIGIN_MODE 249 TEveVector center(
b.x0(),
b.y0(),
b.z0());
250 m_projMgr->GetProjection()->SetCenter(center);
258 TEveProjection*
p =
m_projMgr->GetProjection();
291 float oldLayer =
m_projMgr->GetCurrentDepth();
294 std::shared_ptr<TEveProjectionManager> sentry(
295 m_projMgr, std::bind(&TEveProjectionManager::SetCurrentDepth, std::placeholders::_1, oldLayer));
296 m_projMgr->ImportElements(iChildren, iProjectedParent);
301 TGLOrthoCamera* camera =
dynamic_cast<TGLOrthoCamera*
>(&(
viewerGL()->CurrentCamera()));
309 TGLOrthoCamera* camera =
dynamic_cast<TGLOrthoCamera*
>(&(
viewerGL()->CurrentCamera()));
328 m_calo->SetEta(-eta_range, eta_range);
335 if (!
m_calo->GetData()->Empty()) {
336 m_calo->AssertCellIdCache();
338 TEveCaloData::CellData_t cellData;
339 typedef std::vector<TEveCaloData::vCellId_t*> vBinCells_t;
340 typedef std::vector<TEveCaloData::vCellId_t*>::iterator vBinCells_i;
342 vBinCells_t cellLists =
m_calo->GetBinLists();
343 for (vBinCells_i it = cellLists.begin(); it != cellLists.end(); it++) {
344 TEveCaloData::vCellId_t* binCells = *it;
348 TEveCaloData::vCellId_i
a = binCells->end();
350 for (TEveCaloData::vCellId_i
k = binCells->begin();
k !=
a; ++
k) {
351 m_calo->GetData()->GetCellData((*
k), cellData);
352 sumEt += cellData.Value(
true);
353 sumE += cellData.Value(
false);
396 #ifdef TEVEPROJECTIONS_DISPLACE_ORIGIN_MODE 404 f->AddFrame(
new TGLabel(
f,
"FishEye:"));
407 f->AddFrame(
new TGLabel(
f,
"PreScales:"));
static float caloTransEta()
void doShiftOriginToBeamSpot()
void doFishEyeDistortion()
FWBoolParameter m_shiftOrigin
void setupEventCenter() override
CmsShowCommon * commonPrefs() const
FWBoolParameter m_showProjectionAxes
FWRPZView(TEveWindowSlot *iParent, FWViewType::EType)
TEveCaloViz * getEveCalo() const override
FWBoolParameter m_showME0
FWDoubleParameter m_projectionAxesLabelSize
FWBeamSpot * getBeamSpot() const
ViewerParameterGUI & requestTab(const char *)
ViewerParameterGUI & separator()
void voteCaloMaxVal() override
void setFrom(const FWConfiguration &) override
virtual void setupEventCenter()
TEveCaloDataHist * getCaloData() const
void setContext(const fireworks::Context &) override
virtual void setupEnergyScale()
void populateController(ViewerParameterGUI &) const override
FWBoolParameter m_showMtdEndcap
TEveProjectionAxes * m_axes
FWParameters::Bool FWBoolParameter
const fireworks::Context * m_context
bool haveExtraDet(const char *) const
FWBoolParameter m_showMtdBarrel
FWBoolParameter * m_showHF
void addTo(FWConfiguration &) const override
TEveProjectionManager * m_projMgr
const VersionInfo & versionInfo() const
FWDoubleParameter m_fishEyeR
FWBoolParameter m_showRpcEndcap
void initStdGeoElements(const FWViewType::EType id)
FWGeometry * getGeom() const
FWBoolParameter m_showTrackerBarrel
void voteMaxEtAndEnergy(float Et, float energy) const
void showProjectionAxes()
static float caloR1(bool offset=true)
void addToOrthoCamera(TGLOrthoCamera *, FWConfiguration &) const
void showPixelEndcap(bool)
void eventBegin() override
FWBoolParameter m_compressMuon
FWRPZViewGeometry * m_geometryList
void shiftOrigin(TEveVector ¢er)
const fireworks::Context & context()
void showPixelBarrel(bool)
void populateController(ViewerParameterGUI &) const override
void setFrom(const FWConfiguration &) override
void doPreScaleDistortion()
FWBoolParameter * m_showEndcaps
FWBoolParameter m_showGEM
static const float s_distortFInv
void showTrackerBarrel(bool)
FWDoubleParameter m_fishEyeDistortion
void importElements(TEveElement *iProjectableChild, float layer, TEveElement *iProjectedParent=nullptr)
ViewerParameterGUI & addParam(const FWParameterBase *)
FWBoolParameter m_showTrackerEndcap
TGCompositeFrame * getTabContainer()
const FWConfiguration * valueForKey(const std::string &iKey) const
char data[epos_bytes_allocation]
static double caloMaxEta()
FWDoubleParameter m_muonDistortion
FWBoolParameter m_showPixelEndcap
FWDoubleParameter m_caloDistortion
void showTrackerEndcap(bool)
sigc::signal< void(T)> changed_
FWViewType::EType typeId() const
void addTo(FWConfiguration &) const override
void getEventCenter(float *inC) const
TGLViewer * viewerGL() const
FWBoolParameter m_showPixelBarrel
void setFromOrthoCamera(TGLOrthoCamera *, const FWConfiguration &)
static const float s_distortF
void projectionAxesLabelSize()
virtual void setContext(const fireworks::Context &x)
unsigned int version() const