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]);
#define REGISTER_PROXYBUILDER_METHODS()
#define REGISTER_FWPROXYBUILDER(_name_, _type_, _purpose_, _view_)
int superLayer() const
Return the superlayer number.
static const int kAllRPZBits
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.
~FWDTSegmentProxyBuilder(void) override
LocalPoint localPosition() const override
Local position in Chamber frame.
const DTSLRecSegment2D * zSegment() const
The Z segment: 0 if not zed projection available.
static const int kAll3DBits
void buildViewType(const DTRecSegment4D &iData, unsigned int iIndex, TEveElement &oItemHolder, FWViewType::EType type, const FWViewContext *) override
bool haveSingleProduct() const override
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 FWDTSegmentProxyBuilder & operator=(const FWDTSegmentProxyBuilder &)=delete
const FWEventItem * item() const
FWDTSegmentProxyBuilder(void)