1 #include "TEveGeoNode.h"
2 #include "TEveStraightLineSet.h"
4 #include "TEvePointSet.h"
29 TEveElement& oItemHolder,
34 if (!
geom->contains(rawid)) {
35 fwLog(
fwlog::kError) <<
"failed to get geometry of ME0 chamber with rawid: " << rawid << std::endl;
39 TEveStraightLineSet* segmentSet =
new TEveStraightLineSet();
41 segmentSet->SetLineWidth(5);
46 if (TGeoBBox* box = dynamic_cast<TGeoBBox*>(shape->GetShape())) {
51 double localPosition[3] = {
pos.x(),
pos.y(),
pos.z()};
52 double localDirectionIn[3] = {
dir.x(),
dir.y(),
dir.z()};
53 double localDirectionOut[3] = {-
dir.x(), -
dir.y(), -
dir.z()};
55 Double_t distIn = box->DistFromInside(localPosition, localDirectionIn);
56 Double_t distOut = box->DistFromInside(localPosition, localDirectionOut);
59 float localSegmentInnerPoint[3] = {static_cast<float>(localPosition[0] + vIn.
x()),
60 static_cast<float>(localPosition[1] + vIn.
y()),
61 static_cast<float>(localPosition[2] + vIn.
z())};
63 float localSegmentOuterPoint[3] = {static_cast<float>(localPosition[0] + vOut.
x()),
64 static_cast<float>(localPosition[1] + vOut.
y()),
65 static_cast<float>(localPosition[2] + vOut.
z())};
67 float globalSegmentInnerPoint[3];
68 float globalSegmentOuterPoint[3];
71 rawid, localSegmentInnerPoint, globalSegmentInnerPoint, localSegmentOuterPoint, globalSegmentOuterPoint);
73 segmentSet->AddLine(globalSegmentInnerPoint[0],
74 globalSegmentInnerPoint[1],
75 globalSegmentInnerPoint[2],
76 globalSegmentOuterPoint[0],
77 globalSegmentOuterPoint[1],
78 globalSegmentOuterPoint[2]);
81 TEvePointSet* pointSet =
new TEvePointSet;
83 pointSet->SetMarkerSize(0.5);
84 pointSet->SetMarkerColor(1);
88 auto me0id = rh->me0Id();
90 float hitLocalPos[3] = {hpos.
x(), hpos.
y(), hpos.
z()};
91 float hitGlobalPoint[3];
92 geom->localToGlobal(me0id, hitLocalPos, hitGlobalPoint);
93 pointSet->SetNextPoint(hitGlobalPoint[0], hitGlobalPoint[1], hitGlobalPoint[2]);