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]);
int superLayer() const
Return the superlayer number.
void setupAddElement(TEveElement *el, TEveElement *parent, bool set_color=true) const
virtual DTChamberId chamberId() const
The (specific) DetId of the chamber on which the segment resides.
LocalVector localDirection() const override
Local direction in Chamber frame.
LocalPoint localPosition() const override
Local position in Chamber frame.
const DTSLRecSegment2D * zSegment() const
The Z segment: 0 if not zed projection available.
Basic3DVector unit() const
TEveGeoShape * getEveShape(unsigned int id) const
const FWGeometry * getGeom() const
const DTChamberRecSegment2D * phiSegment() const
The superPhi segment: 0 if no phi projection available.
std::vector< DTRecHit1D > specificRecHits() const
Access to specific components.
constexpr uint32_t rawId() const
get the raw id
const FWEventItem * item() const