1 #include "TEveGeoNode.h"
2 #include "TEveGeoShape.h"
3 #include "TEveStraightLineSet.h"
29 TEveElement& oItemHolder,
36 TEveElement& oItemHolder,
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);
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
LocalPoint localPosition() const override
GEMDetId gemDetId() const
LocalVector localDirection() const override
Local direction.
void setupAddElement(TEveElement *el, TEveElement *parent, bool set_color=true) const
constexpr uint32_t rawId() const
get the raw id
~FWGEMSegmentProxyBuilder() override
const FWEventItem * item() const
static const int kAll3DBits
FWGEMSegmentProxyBuilder()
const FWGEMSegmentProxyBuilder & operator=(const FWGEMSegmentProxyBuilder &)=delete
TEveGeoShape * getEveShape(unsigned int id) const
void localToGlobal(unsigned int id, const float *local, float *global, bool translatep=true) const
Abs< T >::type abs(const T &t)
bool contains(unsigned int id) const
bool haveSingleProduct() const override
void buildViewType(const GEMSegment &iData, unsigned int iIndex, TEveElement &oItemHolder, FWViewType::EType type, const FWViewContext *) override
Vector3DBase unit() const
const FWGeometry * getGeom() const
Basic3DVector unit() const