12#include <Inventor/nodes/SoSeparator.h>
13#include <Inventor/nodes/SoTranslation.h>
14#include <Inventor/nodes/SoTransform.h>
35 if (!prd || !idhelper) {
36 return new SoTransform;
40 SoTransform * theHitTransform =0;
50 const double shift = detEl->
getStationEta() > 0 ? 1.*Gaudi::Units::cm : - 1.*Gaudi::Units::cm;
52 shift * Amg::Vector3D::UnitY();
53 const double angle = (lposTGC - lposTgcShifted).
phi();
76 localRot*=theSurface.
transform().rotation ();
92 theHitTransform->translation.setValue((theHitGPos)[0], (theHitGPos)[1], (theHitGPos)[2]);
93 return theHitTransform;
105 int plane = idhelper->
gasGap(
id );
107 int isStrip = idhelper->
isStrip(
id );
109 double striplength =0.0, stripWidth = 0.0;
112 striplength =
m_tgc->detectorElement()->stripLength();
113 stripWidth =
m_tgc->detectorElement()->stripWidth(plane,
strip);
115 striplength =
m_tgc->detectorElement()->gangShortWidth(plane,
strip);
116 stripWidth =
m_tgc->detectorElement()->gangRadialLength(plane,
strip);
120 striplength += 300.0;
124 const bool settingsShowRDOs =
true;
125 SoSeparator * errDetailed =
new SoSeparator;
126 const std::vector<Identifier> rdolist =
m_tgc->rdoList();
127 if (rdolist.size() == 1 || !settingsShowRDOs)
129 errDetailed->addChild(
common()->nodeManager()->getShapeNode_Strip(striplength,
130 std::max(10.0,stripWidth),
134 VP1Msg::message(
"Warning: TGC has additional elements in rdoList: THIS HAS NEVER BEEN TESTED");
135 SoSeparator * rdos =
new SoSeparator;
141 std::optional<Amg::Vector2D>localposHIT =
m_tgc->detectorElement()->surface(
id ).Trk::Surface::globalToLocal(globalposHIT,
tolerance);
144 localposHIT.emplace();
145 localposHIT->setZero();
149 rdos->addChild(
common()->nodeManager()->getShapeNode_Strip(striplength,
150 std::max(10.0,stripWidth),
155 rdos->addChild( transparent );
162 std::optional<Amg::Vector2D> localposRDO =
m_tgc->detectorElement()->surface( rdo_id ).Trk::Surface::globalToLocal(globalposRDO,
tolerance);
169 SoTranslation * localtrans =
new SoTranslation;
171 rdos->addChild(localtrans);
173 rdos->addChild(
common()->nodeManager()->getShapeNode_Strip(striplength,
174 std::max(10.0,stripWidth),
177 localposOLD = *localposRDO;
179 errDetailed->addChild(rdos);
181 shape_detailed = errDetailed;
Scalar phi() const
phi method
T_ResultType project(ParameterMapping::type< N > parameter_map, const T_Matrix &matrix)
double angle(const GeoTrf::Vector2D &a, const GeoTrf::Vector2D &b)
SoNode * getShapeNode_Strip(double length, double width=0, double depth=0)
virtual const Trk::PlaneSurface & surface() const override
access to chamber surface (phi orientation), uses the first gas gap
int getStationEta() const
int getEtaIndex() const
a la AMDB
int getPhiIndex() const
a la AMDB
A TgcReadoutElement corresponds to a single TGC chamber; therefore typically a TGC station contains s...
double stripCenterLocX(int gasGap, int strip, double radialPos) const
Returns the local X of the strip center at a given local radial position.
Class to represent TGC measurements.
virtual const MuonGM::TgcReadoutElement * detectorElement() const override final
Returns the detector element corresponding to this PRD The pointer will be zero if the det el is not ...
PRDHandleBase(PRDCollHandleBase *)
PRDSysCommonData * common() const
PRDCollHandleBase * collHandle() const
SoTransform * createTransform() const
PRDHandle_TGC(PRDCollHandle_TGC *, const Muon::TgcPrepData *)
const Muon::TgcPrepData * m_tgc
const Muon::TgcPrepData * tgc() const
void buildShapes(SoNode *&shape_simple, SoNode *&shape_detailed)
HitsSoNodeManager * nodeManager() const
int channel(const Identifier &id) const override
int gasGap(const Identifier &id) const override
get the hashes
int isStrip(const Identifier &id) const
isStrip corresponds to measuresPhi
const Amg::Vector2D & localPosition() const
return the local position reference
Identifier identify() const
return the identifier
Abstract Base Class for tracking surfaces.
const Amg::Transform3D & transform() const
Returns HepGeom::Transform3D by reference.
virtual void localToGlobal(const Amg::Vector2D &locp, const Amg::Vector3D &mom, Amg::Vector3D &glob) const =0
Specified by each surface type: LocalToGlobal method without dynamic memory allocation.
static const TgcIdHelper * tgcIDHelper()
static SoTransform * toSoTransform(const HepGeom::Transform3D &, SoTransform *t=0)
static void message(const QString &, IVP1System *sys=0)
Eigen::Matrix< double, 3, 3 > RotationMatrix3D
Amg::RotationMatrix3D setPhi(Amg::RotationMatrix3D mat, double angle, int convention=0)
Eigen::Affine3d Transform3D
Eigen::Matrix< double, 2, 1 > Vector2D
Eigen::Matrix< double, 3, 1 > Vector3D