13 #include "TEveGeoNode.h"
14 #include "TEveStraightLineSet.h"
41 unsigned int iIndex, TEveElement& oItemHolder,
const FWViewContext* )
44 unsigned int rawid = iData.cscDetId().rawId();
49 << rawid << std::endl;
53 TEveStraightLineSet* segmentSet =
new TEveStraightLineSet();
55 segmentSet->SetLineWidth( 3 );
59 if( TGeoTrap* trap = dynamic_cast<TGeoTrap*>( shape->GetShape()))
65 Double_t localPosition[3] = { pos.
x(), pos.
y(), pos.
z() };
66 Double_t localDirectionIn[3] = { dir.
x(), dir.
y(), dir.
z() };
67 Double_t localDirectionOut[3] = { -dir.
x(), -dir.
y(), -dir.
z() };
69 float distIn = trap->DistFromInside( localPosition, localDirectionIn );
70 float distOut = trap->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())
78 float localSegmentOuterPoint[3] = {
static_cast<float>(localPosition[0] + vOut.
x()),
79 static_cast<float>(localPosition[1] + vOut.
y()),
80 static_cast<float>(localPosition[2] + vOut.
z())
83 float globalSegmentInnerPoint[3];
84 float globalSegmentOuterPoint[3];
86 geom->
localToGlobal( rawid, localSegmentInnerPoint, globalSegmentInnerPoint, localSegmentOuterPoint, globalSegmentOuterPoint );
88 segmentSet->AddLine( globalSegmentInnerPoint[0], globalSegmentInnerPoint[1], globalSegmentInnerPoint[2],
89 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
const FWEventItem * item() const
static const int kAll3DBits
TEveGeoShape * getEveShape(unsigned int id) const
REGISTER_PROXYBUILDER_METHODS()
void localToGlobal(unsigned int id, const float *local, float *global, bool translatep=true) const
bool contains(unsigned int id) const
Vector3DBase unit() const
const FWCSCSegmentProxyBuilder & operator=(const FWCSCSegmentProxyBuilder &)
virtual ~FWCSCSegmentProxyBuilder(void)
FWCSCSegmentProxyBuilder(void)
const FWGeometry * getGeom() const