14 #include "TEveGeoNode.h"
15 #include "TEveStraightLineSet.h"
42 unsigned int iIndex, TEveElement& oItemHolder,
const FWViewContext* )
45 unsigned int rawid = iData.cscDetId().rawId();
50 << rawid << std::endl;
54 TEveStraightLineSet* segmentSet =
new TEveStraightLineSet();
56 segmentSet->SetLineWidth( 3 );
60 if( TGeoTrap* trap = dynamic_cast<TGeoTrap*>( shape->GetShape()))
66 Double_t localPosition[3] = { pos.
x(), pos.
y(), pos.
z() };
67 Double_t localDirectionIn[3] = { dir.
x(), dir.
y(), dir.
z() };
68 Double_t localDirectionOut[3] = { -dir.
x(), -dir.
y(), -dir.
z() };
70 float distIn = trap->DistFromInside( localPosition, localDirectionIn );
71 float distOut = trap->DistFromInside( localPosition, localDirectionOut );
74 float localSegmentInnerPoint[3] = {
static_cast<float>(localPosition[0] + vIn.
x()),
75 static_cast<float>(localPosition[1] + vIn.
y()),
76 static_cast<float>(localPosition[2] + vIn.
z())
79 float localSegmentOuterPoint[3] = {
static_cast<float>(localPosition[0] + vOut.
x()),
80 static_cast<float>(localPosition[1] + vOut.
y()),
81 static_cast<float>(localPosition[2] + vOut.
z())
84 float globalSegmentInnerPoint[3];
85 float globalSegmentOuterPoint[3];
87 geom->
localToGlobal( rawid, localSegmentInnerPoint, globalSegmentInnerPoint, localSegmentOuterPoint, globalSegmentOuterPoint );
89 segmentSet->AddLine( globalSegmentInnerPoint[0], globalSegmentInnerPoint[1], globalSegmentInnerPoint[2],
90 globalSegmentOuterPoint[0], globalSegmentOuterPoint[1], globalSegmentOuterPoint[2] );
#define REGISTER_FWPROXYBUILDER(_name_, _type_, _purpose_, _view_)
static const int kAllRPZBits
void setupAddElement(TEveElement *el, TEveElement *parent, bool set_color=true) const
void localToGlobal(unsigned int id, const float *local, float *global) const
const FWEventItem * item() const
static const int kAll3DBits
TEveGeoShape * getEveShape(unsigned int id) const
REGISTER_PROXYBUILDER_METHODS()
bool contains(unsigned int id) const
Vector3DBase unit() const
const FWCSCSegmentProxyBuilder & operator=(const FWCSCSegmentProxyBuilder &)
virtual ~FWCSCSegmentProxyBuilder(void)
FWCSCSegmentProxyBuilder(void)
const FWGeometry * getGeom() const