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