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" 60 TEveGeoTopNode*
make_node(
const TString&
path, Int_t vis_level, Bool_t global_cs);
67 virtual void endJob()
override ;
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" ){
149 if (! gGeoManager->cd(path))
151 Warning(
"make_node",
"Path '%s' not found.", path.Data());
155 TEveGeoTopNode* tn =
new TEveGeoTopNode(gGeoManager, gGeoManager->GetCurrentNode());
156 tn->SetVisLevel(vis_level);
159 tn->RefMainTrans().SetFrom(*gGeoManager->GetCurrentMatrix());
162 gEve->AddToListTree(tn,
true);
185 gStyle->SetPalette(1, 0);
190 minval=0, maxval=4000;
192 minval=0, maxval=4000;
194 minval=0, maxval=1000;
196 minval=-4000, maxval=4000;
198 minval=-1000, maxval=1000;
201 TEveRGBAPalette* pal =
new TEveRGBAPalette(minval, maxval);
204 TEveStraightLineSet*
ls = 0;
206 new TEveStraightLineSet(
"MF_line_direction");
207 ls->SetPickable(
false);
208 ls->SetLineColor(kGreen);
209 ls->SetMarkerColor(kGreen);
210 ls->SetMarkerStyle(1);
213 TEveQuadSet*
q =
new TEveQuadSet(
"MF_quad_values");
214 q->Reset(TEveQuadSet::kQT_RectangleXY, kFALSE, 32);
216 q->SetAlwaysSecSelect(1);
225 TEveVectorD b01 = (v01 -v0);
226 TEveVectorD b02 = (v02 -v0);
227 TEveVectorD b03 = b01.Cross(b02);
230 trans.SetBaseVec(1, b01.fX, b01.fY, b01.fZ);
231 trans.SetBaseVec(2, b02.fX, b02.fY, b02.fZ);
232 trans.SetBaseVec(3, b03.fX, b03.fY, b03.fZ);
233 trans.SetPos(v0.Arr());
235 q->SetTransMatrix(trans.Array());
240 q->SetDefWidth(w_step);
241 q->SetDefHeight(h_step);
242 TEveVectorD d1; trans.GetBaseVec(1).GetXYZ(d1); d1 *= w_step;
243 TEveVectorD d2; trans.GetBaseVec(2).GetXYZ(d2); d2 *= h_step;
247 double line_step_size =
TMath::Min(w_step, h_step);
253 TEveVectorD
p = d1*Double_t(
i) + d2*Double_t(j) + v0;
271 q->AddQuad(w_step*
i, h_step*j);
273 if(
m_MF_isPickable) q->QuadId(
new TNamed(Form(
"Mag (%f, %f, %f) val = %f", b.
x(), b.
y(), b.
z(), b.
mag() ),
"Dong!"));
276 if (b.
mag() > 1
e-6) {
277 b.
unit(); b *= line_step_size;
278 ls->AddLine(p.fX, p.fY, p.fZ, p.fX + b.
x(),p.fY + b.
y(), p.fZ + b.
z());
281 ls->AddLine(p.fX, p.fY, p.fZ, p.fX + b.
x(),p.fY + b.
y(), p.fZ + b.
z());
284 ls->AddMarker(ls->GetLinePlex().Size()-1, 0);
285 ls->AddMarker(i*m_MF_plane_N1 + j, 0);
290 TEveScene* eps = gEve->SpawnNewScene(
"FillStyleScene");
291 gEve->GetDefaultViewer()->AddScene(eps);
292 eps->GetGLScene()->SetStyle(TGLRnrCtx::kFill);
326 m_geomList =
new TEveElementList(
"Display Geom");
344 TEveGeoManagerHolder _tgeo(const_cast<TGeoManager*>(geom.
product()));
T getParameter(std::string const &) const
T getUntrackedParameter(std::string const &, T const &) const
void remakeGeometry(const DisplayGeomRecord &dgRec)
virtual void beginJob() override
DisplayGeom(const edm::ParameterSet &)
#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
TEveGeoTopNode * make_node(const TString &path, Int_t vis_level, Bool_t global_cs)
std::vector< double > m_MF_plane_d2
void get(HolderT &iHolder) const
Cos< T >::type cos(const T &t)
virtual GlobalVector inTesla(const GlobalPoint &gp) const =0
Field value ad specified global point, in Tesla.
Vector3DBase unit() const
virtual void endJob() override
std::vector< double > m_MF_plane_d0
bool check(const edm::EventSetup &iSetup)
void AddElement(TEveElement *el)
edm::ESWatcher< DisplayGeomRecord > m_geomWatcher
virtual void analyze(const edm::Event &, const edm::EventSetup &) override
T const * product() const
void AddGlobalElement(TEveElement *el)