1 #include "TEveGeoNode.h"
2 #include "TEveGeoShape.h"
3 #include "TEveStraightLineSet.h"
5 #include "TEvePointSet.h"
30 TEveElement& oItemHolder,
36 fwLog(
fwlog::kError) <<
"failed to get geometry of ME0 chamber with rawid: " << rawid << std::endl;
40 TEveStraightLineSet* segmentSet =
new TEveStraightLineSet();
42 segmentSet->SetLineWidth(5);
47 if (TGeoBBox* box = dynamic_cast<TGeoBBox*>(shape->GetShape())) {
52 double localPosition[3] = {pos.
x(), pos.
y(), pos.
z()};
53 double localDirectionIn[3] = {dir.
x(), dir.
y(), dir.
z()};
54 double localDirectionOut[3] = {-dir.
x(), -dir.
y(), -dir.
z()};
56 Double_t distIn = box->DistFromInside(localPosition, localDirectionIn);
57 Double_t distOut = box->DistFromInside(localPosition, localDirectionOut);
60 float localSegmentInnerPoint[3] = {
static_cast<float>(localPosition[0] + vIn.
x()),
61 static_cast<float>(localPosition[1] + vIn.
y()),
62 static_cast<float>(localPosition[2] + vIn.
z())};
64 float localSegmentOuterPoint[3] = {
static_cast<float>(localPosition[0] + vOut.
x()),
65 static_cast<float>(localPosition[1] + vOut.
y()),
66 static_cast<float>(localPosition[2] + vOut.
z())};
68 float globalSegmentInnerPoint[3];
69 float globalSegmentOuterPoint[3];
72 rawid, localSegmentInnerPoint, globalSegmentInnerPoint, localSegmentOuterPoint, globalSegmentOuterPoint);
74 segmentSet->AddLine(globalSegmentInnerPoint[0],
75 globalSegmentInnerPoint[1],
76 globalSegmentInnerPoint[2],
77 globalSegmentOuterPoint[0],
78 globalSegmentOuterPoint[1],
79 globalSegmentOuterPoint[2]);
82 TEvePointSet* pointSet =
new TEvePointSet;
84 pointSet->SetMarkerSize(0.5);
85 pointSet->SetMarkerColor(1);
89 auto me0id = rh->me0Id();
91 float hitLocalPos[3] = {hpos.
x(), hpos.
y(), hpos.
z()};
92 float hitGlobalPoint[3];
94 pointSet->SetNextPoint(hitGlobalPoint[0], hitGlobalPoint[1], hitGlobalPoint[2]);
LocalPoint localPosition() const override
#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
constexpr uint32_t rawId() const
get the raw id
FWME0SegmentProxyBuilder(void)
const FWEventItem * item() const
static const int kAll3DBits
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
Vector3DBase unit() const
LocalVector localDirection() const override
Local direction.
~FWME0SegmentProxyBuilder(void) override
const FWGeometry * getGeom() const
Basic3DVector unit() const