1 #include "TEveGeoNode.h" 2 #include "TEveStraightLineSet.h" 4 #include "TEvePointSet.h" 30 unsigned int iIndex, TEveElement& oItemHolder,
const FWViewContext* )
38 << rawid << std::endl;
42 TEveStraightLineSet* segmentSet =
new TEveStraightLineSet();
44 segmentSet->SetLineWidth( 5 );
50 if( TGeoBBox* box = dynamic_cast<TGeoBBox*>( shape->GetShape()))
56 double localPosition[3] = { pos.
x(), pos.
y(), pos.
z() };
57 double localDirectionIn[3] = { dir.
x(), dir.
y(), dir.
z() };
58 double localDirectionOut[3] = { -dir.
x(), -dir.
y(), -dir.
z() };
60 Double_t distIn = box->DistFromInside( localPosition, localDirectionIn );
61 Double_t distOut = box->DistFromInside( localPosition, localDirectionOut );
64 float localSegmentInnerPoint[3] = {
static_cast<float>(localPosition[0] + vIn.
x()),
65 static_cast<float>(localPosition[1] + vIn.
y()),
66 static_cast<float>(localPosition[2] + vIn.
z())
69 float localSegmentOuterPoint[3] = {
static_cast<float>(localPosition[0] + vOut.
x()),
70 static_cast<float>(localPosition[1] + vOut.
y()),
71 static_cast<float>(localPosition[2] + vOut.
z())
74 float globalSegmentInnerPoint[3];
75 float globalSegmentOuterPoint[3];
77 geom->
localToGlobal( rawid, localSegmentInnerPoint, globalSegmentInnerPoint, localSegmentOuterPoint, globalSegmentOuterPoint );
79 segmentSet->AddLine( globalSegmentInnerPoint[0], globalSegmentInnerPoint[1], globalSegmentInnerPoint[2],
80 globalSegmentOuterPoint[0], globalSegmentOuterPoint[1], globalSegmentOuterPoint[2] );
83 TEvePointSet* pointSet =
new TEvePointSet;
85 pointSet->SetMarkerSize(0.5);
86 pointSet->SetMarkerColor(1);
89 for (
auto rh = recHits.begin(); rh!= recHits.end(); rh++){
90 auto me0id = rh->me0Id();
92 float hitLocalPos[3]= {hpos.
x(), hpos.
y(), hpos.
z()};
93 float hitGlobalPoint[3];
95 pointSet->SetNextPoint(hitGlobalPoint[0], hitGlobalPoint[1], hitGlobalPoint[2]);
#define REGISTER_PROXYBUILDER_METHODS()
#define REGISTER_FWPROXYBUILDER(_name_, _type_, _purpose_, _view_)
const FWME0SegmentProxyBuilder & operator=(const FWME0SegmentProxyBuilder &)=delete
const std::vector< ME0RecHit > & specificRecHits() const
static const int kAllRPZBits
ME0DetId me0DetId() const
void setupAddElement(TEveElement *el, TEveElement *parent, bool set_color=true) const
FWME0SegmentProxyBuilder(void)
const FWEventItem * item() const
static const int kAll3DBits
uint32_t rawId() const
get the raw id
TEveGeoShape * getEveShape(unsigned int id) const
void localToGlobal(unsigned int id, const float *local, float *global, bool translatep=true) const
bool contains(unsigned int id) const
LocalVector localDirection() const override
Local direction.
LocalPoint localPosition() const override
Vector3DBase unit() const
~FWME0SegmentProxyBuilder(void) override
const FWGeometry * getGeom() const