1 #include "TEveGeoNode.h"
2 #include "TEveStraightLineSet.h"
28 TEveElement& oItemHolder,
35 TEveElement& oItemHolder,
41 if (!
geom->contains(rawid)) {
42 fwLog(
fwlog::kError) <<
"failed to get geometry of GEM chamber with rawid: " << rawid << std::endl;
46 TEveStraightLineSet* segmentSet =
new TEveStraightLineSet();
48 segmentSet->SetLineWidth(3);
49 segmentSet->SetMarkerColor(
item()->defaultDisplayProperties().color());
50 segmentSet->SetMarkerSize(0.5);
52 TEveGeoShape* shape =
geom->getEveShape(rawid);
54 if (TGeoTrap* box = dynamic_cast<TGeoTrap*>(shape->GetShape()))
56 shape->SetMainTransparency(75);
57 shape->SetMainColor(
item()->defaultDisplayProperties().color());
58 segmentSet->AddElement(shape);
64 double localPosition[3] = {
pos.x(),
pos.y(),
pos.z()};
65 double localDirectionIn[3] = {
dir.x(),
dir.y(),
dir.z()};
66 double localDirectionOut[3] = {-
dir.x(), -
dir.y(), -
dir.z()};
68 Double_t distIn = box->DistFromInside(localPosition, localDirectionIn);
69 Double_t distOut = box->DistFromInside(localPosition, localDirectionOut);
72 float localSegmentInnerPoint[3] = {static_cast<float>(localPosition[0] + vIn.
x()),
73 static_cast<float>(localPosition[1] + vIn.
y()),
74 static_cast<float>(localPosition[2] + vIn.
z())};
76 float localSegmentOuterPoint[3] = {static_cast<float>(localPosition[0] + vOut.
x()),
77 static_cast<float>(localPosition[1] + vOut.
y()),
78 static_cast<float>(localPosition[2] + vOut.
z())};
80 float globalSegmentInnerPoint[3];
81 float globalSegmentOuterPoint[3];
84 rawid, localSegmentInnerPoint, globalSegmentInnerPoint, localSegmentOuterPoint, globalSegmentOuterPoint);
86 segmentSet->AddMarker(globalSegmentInnerPoint[0], globalSegmentInnerPoint[1], globalSegmentInnerPoint[2]);
88 segmentSet->AddLine(globalSegmentInnerPoint[0],
89 globalSegmentInnerPoint[1],
90 globalSegmentInnerPoint[2],
91 globalSegmentOuterPoint[0],
92 globalSegmentOuterPoint[1],
93 globalSegmentOuterPoint[2]);