13 #include "TEveGeoNode.h"
14 #include "TEveGeoShape.h"
15 #include "TEveStraightLineSet.h"
16 #include "TEvePointSet.h"
45 TEveElement& oItemHolder,
52 TEveElement& oItemHolder,
58 if (!
geom->contains(rawid)) {
59 fwLog(
fwlog::kError) <<
"failed to get geometry of DT chamber with detid: " << rawid << std::endl;
63 TEveStraightLineSet* segmentSet =
new TEveStraightLineSet();
65 segmentSet->SetLineWidth(3);
70 if (TGeoBBox* box = dynamic_cast<TGeoBBox*>(shape->GetShape())) {
75 double localPosition[3] = {
pos.x(),
pos.y(),
pos.z()};
76 double localDirectionIn[3] = {
dir.x(),
dir.y(),
dir.z()};
77 double localDirectionOut[3] = {-
dir.x(), -
dir.y(), -
dir.z()};
83 localDirectionIn[0] = 0;
84 localDirectionOut[0] = 0;
87 Double_t distIn = box->DistFromInside(localPosition, localDirectionIn);
88 Double_t distOut = box->DistFromInside(localPosition, localDirectionOut);
91 float localSegmentInnerPoint[3] = {static_cast<float>(localPosition[0] + vIn.
x()),
92 static_cast<float>(localPosition[1] + vIn.
y()),
93 static_cast<float>(localPosition[2] + vIn.
z())};
95 float localSegmentOuterPoint[3] = {static_cast<float>(localPosition[0] + vOut.
x()),
96 static_cast<float>(localPosition[1] + vOut.
y()),
97 static_cast<float>(localPosition[2] + vOut.
z())};
99 float globalSegmentInnerPoint[3];
100 float globalSegmentOuterPoint[3];
103 rawid, localSegmentInnerPoint, globalSegmentInnerPoint, localSegmentOuterPoint, globalSegmentOuterPoint);
105 segmentSet->AddLine(globalSegmentInnerPoint[0],
106 globalSegmentInnerPoint[1],
107 globalSegmentInnerPoint[2],
108 globalSegmentOuterPoint[0],
109 globalSegmentOuterPoint[1],
110 globalSegmentOuterPoint[2]);
113 TEvePointSet* pointSet =
new TEvePointSet;
115 pointSet->SetMarkerSize(1.5);
118 std::vector<DTRecHit1D>
recHits;
123 copy(phiRecHits.begin(), phiRecHits.end(), back_inserter(
recHits));
127 copy(zRecHits.begin(), zRecHits.end(), back_inserter(
recHits));
130 for (std::vector<DTRecHit1D>::const_iterator rh =
recHits.begin(); rh !=
recHits.end(); ++rh) {
131 DTLayerId layerId = (*rh).wireId().layerId();
133 float hitLocalPos[3] = {hpos.
x(), hpos.
y(), hpos.
z()};
143 float hitGlobalPoint[3];
144 geom->localToGlobal(layerId, hitLocalPos, hitGlobalPoint);
145 pointSet->SetNextPoint(hitGlobalPoint[0], hitGlobalPoint[1], hitGlobalPoint[2]);