1 #include "TEveGeoNode.h"
2 #include "TEveGeoShape.h"
3 #include "TEveStraightLineSet.h"
5 #include "TEvePointSet.h"
30 TEveElement& oItemHolder,
35 if (!
geom->contains(rawid)) {
36 fwLog(
fwlog::kError) <<
"failed to get geometry of ME0 chamber with rawid: " << rawid << std::endl;
40 TEveStraightLineSet* segmentSet =
new TEveStraightLineSet();
42 segmentSet->SetLineWidth(5);
47 if (TGeoBBox* box = dynamic_cast<TGeoBBox*>(shape->GetShape())) {
52 double localPosition[3] = {
pos.x(),
pos.y(),
pos.z()};
53 double localDirectionIn[3] = {
dir.x(),
dir.y(),
dir.z()};
54 double localDirectionOut[3] = {-
dir.x(), -
dir.y(), -
dir.z()};
56 Double_t distIn = box->DistFromInside(localPosition, localDirectionIn);
57 Double_t distOut = box->DistFromInside(localPosition, localDirectionOut);
60 float localSegmentInnerPoint[3] = {static_cast<float>(localPosition[0] + vIn.
x()),
61 static_cast<float>(localPosition[1] + vIn.
y()),
62 static_cast<float>(localPosition[2] + vIn.
z())};
64 float localSegmentOuterPoint[3] = {static_cast<float>(localPosition[0] + vOut.
x()),
65 static_cast<float>(localPosition[1] + vOut.
y()),
66 static_cast<float>(localPosition[2] + vOut.
z())};
68 float globalSegmentInnerPoint[3];
69 float globalSegmentOuterPoint[3];
72 rawid, localSegmentInnerPoint, globalSegmentInnerPoint, localSegmentOuterPoint, globalSegmentOuterPoint);
74 segmentSet->AddLine(globalSegmentInnerPoint[0],
75 globalSegmentInnerPoint[1],
76 globalSegmentInnerPoint[2],
77 globalSegmentOuterPoint[0],
78 globalSegmentOuterPoint[1],
79 globalSegmentOuterPoint[2]);
82 TEvePointSet* pointSet =
new TEvePointSet;
84 pointSet->SetMarkerSize(0.5);
85 pointSet->SetMarkerColor(1);
89 auto me0id = rh->me0Id();
91 float hitLocalPos[3] = {hpos.
x(), hpos.
y(), hpos.
z()};
92 float hitGlobalPoint[3];
93 geom->localToGlobal(me0id, hitLocalPos, hitGlobalPoint);
94 pointSet->SetNextPoint(hitGlobalPoint[0], hitGlobalPoint[1], hitGlobalPoint[2]);