1 #include "TEveGeoNode.h" 2 #include "TEveGeoShape.h" 3 #include "TEveStraightLineSet.h" 29 TEveElement& oItemHolder,
36 TEveElement& oItemHolder,
42 if (!
geom->contains(rawid)) {
43 fwLog(
fwlog::kError) <<
"failed to get geometry of GEM chamber with rawid: " << rawid << std::endl;
47 TEveStraightLineSet* segmentSet =
new TEveStraightLineSet();
49 segmentSet->SetLineWidth(3);
50 segmentSet->SetMarkerColor(
item()->defaultDisplayProperties().color());
51 segmentSet->SetMarkerSize(0.5);
53 TEveGeoShape* shape =
geom->getEveShape(rawid);
55 if (TGeoTrap* box = dynamic_cast<TGeoTrap*>(shape->GetShape()))
57 shape->SetMainTransparency(75);
58 shape->SetMainColor(
item()->defaultDisplayProperties().color());
59 segmentSet->AddElement(shape);
65 double localPosition[3] = {
pos.x(),
pos.y(),
pos.z()};
66 double localDirectionIn[3] = {
dir.x(),
dir.y(),
dir.z()};
67 double localDirectionOut[3] = {-
dir.x(), -
dir.y(), -
dir.z()};
69 Double_t distIn = box->DistFromInside(localPosition, localDirectionIn);
70 Double_t distOut = box->DistFromInside(localPosition, localDirectionOut);
73 float localSegmentInnerPoint[3] = {
static_cast<float>(localPosition[0] + vIn.
x()),
74 static_cast<float>(localPosition[1] + vIn.
y()),
75 static_cast<float>(localPosition[2] + vIn.
z())};
77 float localSegmentOuterPoint[3] = {
static_cast<float>(localPosition[0] + vOut.
x()),
78 static_cast<float>(localPosition[1] + vOut.
y()),
79 static_cast<float>(localPosition[2] + vOut.
z())};
81 float globalSegmentInnerPoint[3];
82 float globalSegmentOuterPoint[3];
85 rawid, localSegmentInnerPoint, globalSegmentInnerPoint, localSegmentOuterPoint, globalSegmentOuterPoint);
87 segmentSet->AddMarker(globalSegmentInnerPoint[0], globalSegmentInnerPoint[1], globalSegmentInnerPoint[2]);
89 segmentSet->AddLine(globalSegmentInnerPoint[0],
90 globalSegmentInnerPoint[1],
91 globalSegmentInnerPoint[2],
92 globalSegmentOuterPoint[0],
93 globalSegmentOuterPoint[1],
94 globalSegmentOuterPoint[2]);
#define REGISTER_PROXYBUILDER_METHODS()
#define REGISTER_FWPROXYBUILDER(_name_, _type_, _purpose_, _view_)
static const int kAllRPZBits
void setupAddElement(TEveElement *el, TEveElement *parent, bool set_color=true) const
LocalPoint localPosition() const override
LocalVector localDirection() const override
Local direction.
~FWGEMSegmentProxyBuilder() override
static const int kAll3DBits
FWGEMSegmentProxyBuilder()
const FWGEMSegmentProxyBuilder & operator=(const FWGEMSegmentProxyBuilder &)=delete
Abs< T >::type abs(const T &t)
bool haveSingleProduct() const override
Basic3DVector unit() const
void buildViewType(const GEMSegment &iData, unsigned int iIndex, TEveElement &oItemHolder, FWViewType::EType type, const FWViewContext *) override
const FWGeometry * getGeom() const
constexpr uint32_t rawId() const
get the raw id
GEMDetId gemDetId() const
const FWEventItem * item() const