26 #include <boost/algorithm/string/case_conv.hpp>
28 #include "TEveManager.h"
29 #include "TEveTrack.h"
30 #include "TEveTrackPropagator.h"
32 #include "TGeoManager.h"
33 #include "TGeoMatrix.h"
34 #include "TEveGeoNode.h"
35 #include "TEveTrans.h"
36 #include "TEveScene.h"
37 #include "TEveViewer.h"
39 #include "TGLScenePad.h"
40 #include "TGLRnrCtx.h"
41 #include "TEvePointSet.h"
45 #include "TEveQuadSet.h"
46 #include "TEveStraightLineSet.h"
47 #include "TEveRGBAPalette.h"
59 TEveGeoTopNode*
make_node(
const TString&
path, Int_t vis_level, Bool_t global_cs);
91 : m_eve(), m_geomList(nullptr), m_MF_component(0), m_geomWatcher(this, &
DisplayGeom::remakeGeometry) {
97 boost::algorithm::to_upper(component);
99 if (component ==
"NONE") {
101 }
else if (component ==
"ABSBZ") {
103 }
else if (component ==
"ABSBR") {
105 }
else if (component ==
"ABSBPHI") {
107 }
else if (component ==
"BR") {
109 }
else if (component ==
"BPHI") {
135 if (!gGeoManager->cd(
path)) {
136 Warning(
"make_node",
"Path '%s' not found.",
path.Data());
140 TEveGeoTopNode* tn =
new TEveGeoTopNode(gGeoManager, gGeoManager->GetCurrentNode());
141 tn->SetVisLevel(vis_level);
143 tn->RefMainTrans().SetFrom(*gGeoManager->GetCurrentMatrix());
146 gEve->AddToListTree(tn,
true);
163 gStyle->SetPalette(1,
nullptr);
168 minval = 0, maxval = 4000;
170 minval = 0, maxval = 4000;
172 minval = 0, maxval = 1000;
174 minval = -4000, maxval = 4000;
176 minval = -1000, maxval = 1000;
179 TEveRGBAPalette* pal =
new TEveRGBAPalette(minval, maxval);
181 TEveStraightLineSet*
ls =
nullptr;
183 new TEveStraightLineSet(
"MF_line_direction");
184 ls->SetPickable(
false);
185 ls->SetLineColor(kGreen);
186 ls->SetMarkerColor(kGreen);
187 ls->SetMarkerStyle(1);
190 TEveQuadSet*
q =
new TEveQuadSet(
"MF_quad_values");
191 q->Reset(TEveQuadSet::kQT_RectangleXY, kFALSE, 32);
193 q->SetAlwaysSecSelect(
true);
201 TEveVectorD b01 = (v01 -
v0);
202 TEveVectorD b02 = (v02 -
v0);
203 TEveVectorD b03 = b01.Cross(b02);
206 trans.SetBaseVec(1, b01.fX, b01.fY, b01.fZ);
207 trans.SetBaseVec(2, b02.fX, b02.fY, b02.fZ);
208 trans.SetBaseVec(3, b03.fX, b03.fY, b03.fZ);
209 trans.SetPos(
v0.Arr());
211 q->SetTransMatrix(trans.Array());
216 q->SetDefWidth(w_step);
217 q->SetDefHeight(h_step);
219 trans.GetBaseVec(1).GetXYZ(
d1);
222 trans.GetBaseVec(2).GetXYZ(d2);
227 double line_step_size =
TMath::Min(w_step, h_step);
231 TEveVectorD
p =
d1 * Double_t(
i) + d2 * Double_t(
j) +
v0;
249 q->AddQuad(w_step *
i, h_step *
j);
252 q->QuadId(
new TNamed(Form(
"Mag (%f, %f, %f) val = %f",
b.x(),
b.y(),
b.z(),
b.mag()),
"Dong!"));
255 if (
b.mag() > 1
e-6) {
258 ls->AddLine(
p.fX,
p.fY,
p.fZ,
p.fX +
b.x(),
p.fY +
b.y(),
p.fZ +
b.z());
260 ls->AddLine(
p.fX,
p.fY,
p.fZ,
p.fX +
b.x(),
p.fY +
b.y(),
p.fZ +
b.z());
263 ls->AddMarker(
ls->GetLinePlex().Size() - 1, 0);
269 TEveScene* eps = gEve->SpawnNewScene(
"FillStyleScene");
270 gEve->GetDefaultViewer()->AddScene(eps);
271 eps->GetGLScene()->SetStyle(TGLRnrCtx::kFill);
302 m_geomList =
new TEveElementList(
"Display Geom");
317 TEveGeoManagerHolder _tgeo(const_cast<TGeoManager*>(
geom.product()));