13 #include "TEveGeoNode.h"
14 #include "TEveStraightLineSet.h"
15 #include "TEvePointSet.h"
44 TEveElement& oItemHolder,
51 TEveElement& oItemHolder,
57 if (!
geom->contains(rawid)) {
58 fwLog(
fwlog::kError) <<
"failed to get geometry of DT chamber with detid: " << rawid << std::endl;
62 TEveStraightLineSet* segmentSet =
new TEveStraightLineSet();
64 segmentSet->SetLineWidth(3);
69 if (TGeoBBox* box = dynamic_cast<TGeoBBox*>(shape->GetShape())) {
74 double localPosition[3] = {
pos.x(),
pos.y(),
pos.z()};
75 double localDirectionIn[3] = {
dir.x(),
dir.y(),
dir.z()};
76 double localDirectionOut[3] = {-
dir.x(), -
dir.y(), -
dir.z()};
82 localDirectionIn[0] = 0;
83 localDirectionOut[0] = 0;
86 Double_t distIn = box->DistFromInside(localPosition, localDirectionIn);
87 Double_t distOut = box->DistFromInside(localPosition, localDirectionOut);
90 float localSegmentInnerPoint[3] = {static_cast<float>(localPosition[0] + vIn.
x()),
91 static_cast<float>(localPosition[1] + vIn.
y()),
92 static_cast<float>(localPosition[2] + vIn.
z())};
94 float localSegmentOuterPoint[3] = {static_cast<float>(localPosition[0] + vOut.
x()),
95 static_cast<float>(localPosition[1] + vOut.
y()),
96 static_cast<float>(localPosition[2] + vOut.
z())};
98 float globalSegmentInnerPoint[3];
99 float globalSegmentOuterPoint[3];
102 rawid, localSegmentInnerPoint, globalSegmentInnerPoint, localSegmentOuterPoint, globalSegmentOuterPoint);
104 segmentSet->AddLine(globalSegmentInnerPoint[0],
105 globalSegmentInnerPoint[1],
106 globalSegmentInnerPoint[2],
107 globalSegmentOuterPoint[0],
108 globalSegmentOuterPoint[1],
109 globalSegmentOuterPoint[2]);
112 TEvePointSet* pointSet =
new TEvePointSet;
114 pointSet->SetMarkerSize(1.5);
117 std::vector<DTRecHit1D>
recHits;
122 copy(phiRecHits.begin(), phiRecHits.end(), back_inserter(
recHits));
126 copy(zRecHits.begin(), zRecHits.end(), back_inserter(
recHits));
129 for (std::vector<DTRecHit1D>::const_iterator rh =
recHits.begin(); rh !=
recHits.end(); ++rh) {
130 DTLayerId layerId = (*rh).wireId().layerId();
132 float hitLocalPos[3] = {hpos.
x(), hpos.
y(), hpos.
z()};
142 float hitGlobalPoint[3];
143 geom->localToGlobal(layerId, hitLocalPos, hitGlobalPoint);
144 pointSet->SetNextPoint(hitGlobalPoint[0], hitGlobalPoint[1], hitGlobalPoint[2]);