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);
104 boost::algorithm::to_upper(component);
106 if (component ==
"NONE") {
108 }
else if (component ==
"ABSBZ") {
110 }
else if (component ==
"ABSBR") {
112 }
else if (component ==
"ABSBPHI") {
114 }
else if (component ==
"BR") {
116 }
else if (component ==
"BPHI") {
146 if (!gGeoManager->cd(path)) {
147 Warning(
"make_node",
"Path '%s' not found.", path.Data());
151 TEveGeoTopNode* tn =
new TEveGeoTopNode(gGeoManager, gGeoManager->GetCurrentNode());
152 tn->SetVisLevel(vis_level);
154 tn->RefMainTrans().SetFrom(*gGeoManager->GetCurrentMatrix());
157 gEve->AddToListTree(tn,
true);
173 gStyle->SetPalette(1,
nullptr);
178 minval = 0, maxval = 4000;
180 minval = 0, maxval = 4000;
182 minval = 0, maxval = 1000;
184 minval = -4000, maxval = 4000;
186 minval = -1000, maxval = 1000;
189 TEveRGBAPalette* pal =
new TEveRGBAPalette(minval, maxval);
191 TEveStraightLineSet*
ls =
nullptr;
193 ls =
new TEveStraightLineSet(
"MF_line_direction");
194 ls->SetPickable(
false);
195 ls->SetLineColor(kGreen);
196 ls->SetMarkerColor(kGreen);
197 ls->SetMarkerStyle(1);
200 TEveQuadSet*
q =
new TEveQuadSet(
"MF_quad_values");
201 q->Reset(TEveQuadSet::kQT_RectangleXY, kFALSE, 32);
203 q->SetAlwaysSecSelect(
true);
211 TEveVectorD b01 = (v01 - v0);
212 TEveVectorD b02 = (v02 - v0);
213 TEveVectorD b03 = b01.Cross(b02);
216 trans.SetBaseVec(1, b01.fX, b01.fY, b01.fZ);
217 trans.SetBaseVec(2, b02.fX, b02.fY, b02.fZ);
218 trans.SetBaseVec(3, b03.fX, b03.fY, b03.fZ);
219 trans.SetPos(v0.Arr());
221 q->SetTransMatrix(trans.Array());
226 q->SetDefWidth(w_step);
227 q->SetDefHeight(h_step);
229 trans.GetBaseVec(1).GetXYZ(d1);
232 trans.GetBaseVec(2).GetXYZ(d2);
237 double line_step_size =
TMath::Min(w_step, h_step);
241 TEveVectorD
p = d1 * Double_t(
i) + d2 * Double_t(
j) + v0;
259 q->AddQuad(w_step *
i, h_step *
j);
262 q->QuadId(
new TNamed(Form(
"Mag (%f, %f, %f) val = %f", b.
x(), b.
y(), b.
z(), b.
mag()),
"Dong!"));
265 if (b.
mag() > 1
e-6) {
268 ls->AddLine(p.fX, p.fY, p.fZ, p.fX + b.
x(), p.fY + b.
y(), p.fZ + b.
z());
270 ls->AddLine(p.fX, p.fY, p.fZ, p.fX + b.
x(), p.fY + b.
y(), p.fZ + b.
z());
273 ls->AddMarker(ls->GetLinePlex().Size() - 1, 0);
274 ls->AddMarker(i * m_MF_plane_N1 + j, 0);
279 TEveScene*
eps = gEve->SpawnNewScene(
"FillStyleScene");
280 gEve->GetDefaultViewer()->AddScene(eps);
281 eps->GetGLScene()->SetStyle(TGLRnrCtx::kFill);
312 m_geomList =
new TEveElementList(
"Display Geom");
T getUntrackedParameter(std::string const &, T const &) const
void remakeGeometry(const DisplayGeomRecord &dgRec)
DisplayGeom(const edm::ParameterSet &)
virtual GlobalVector inTesla(const GlobalPoint &gp) const =0
Field value ad specified global point, in Tesla.
#define DEFINE_FWK_MODULE(type)
Sin< T >::type sin(const T &t)
Geom::Phi< T > phi() const
std::vector< double > m_MF_plane_d1
edm::Service< EveService > m_eve
bool getData(T &iHolder) const
TEveGeoTopNode * make_node(const TString &path, Int_t vis_level, Bool_t global_cs)
std::vector< double > m_MF_plane_d2
ProductT const & get(ESGetToken< ProductT, DepRecordT > const &iToken) const
Cos< T >::type cos(const T &t)
edm::ESGetToken< MagneticField, IdealMagneticFieldRecord > m_magFieldToken
Vector3DBase unit() const
std::vector< double > m_MF_plane_d0
T getParameter(std::string const &) const
bool check(const edm::EventSetup &iSetup)
void AddElement(TEveElement *el)
edm::ESWatcher< DisplayGeomRecord > m_geomWatcher
static constexpr float d1
void analyze(const edm::Event &, const edm::EventSetup &) override
void AddGlobalElement(TEveElement *el)
const edm::ESGetToken< TGeoManager, DisplayGeomRecord > m_displayGeomToken