17#include <Inventor/nodes/SoSeparator.h>
18#include <Inventor/nodes/SoTranslation.h>
19#include <Inventor/nodes/SoNode.h>
20#include <Inventor/nodes/SoTransform.h>
21#include <Inventor/nodes/SoPointSet.h>
22#include <Inventor/nodes/SoLineSet.h>
66 VP1Msg::message(
"HitToSoNode::getTGCAngle WARNING: could not get TGC idhelper!");
70 if ( !idhelper->
isStrip(
id))
return 0.0;
91 int stripNo = idhelper->
channel(
id);
92 int gasGap = idhelper->
gasGap(
id);
98 const double shift = detEl->
getStationEta() > 0 ? 1.*Gaudi::Units::cm : - 1.*Gaudi::Units::cm;
100 + shift * Amg::Vector3D::UnitY();
102 return (lposTGC - lposTgcShifted).phi();
113 if ( useSurfacePositionOnly ) {
115 theHitTransform->translation.setValue(theSurface.
center()[0], theSurface.
center()[1], theSurface.
center()[2]);
123 return theHitTransform;
132 if (!idhelper||!detEl) {
133 return new SoTransform;
137 SoTransform * theHitTransform =0;
146 localRot.setIdentity();
158 localRot *= theSurface.
transform().rotation();
173 if (!useSurfacePositionOnly){
175 theHitTransform->translation.setValue((theHitGPos)[0], (theHitGPos)[1], (theHitGPos)[2]);
177 return theHitTransform;
185 VP1Msg::message(
"HitToSoNode::buildTubeShapes ERROR: Trk::CylinderBounds conversion failed");
197 double strawLength=2.0*halflength;
198 if (strawLength<160.0)
199 strawLength = 2*349.3150-strawLength;
201 SoPointSet * scatPointSet =
new SoPointSet;
202 SoVertexProperty * scatVtxProperty =
new SoVertexProperty;
203 scatVtxProperty->vertex.set1Value(0,0.0f,0.0f,strawLength);
204 scatPointSet->numPoints=1;
205 scatPointSet->vertexProperty.setValue(scatVtxProperty);
207 shape_detailed->addChild(scatPointSet);
208 shape_simple->addChild(scatPointSet);
215 SoNode * simpleShape =
m_d->nodeManager.getShapeNode_DriftTube( halflength, 0.0 );
216 shape_simple->addChild(simpleShape);
219 shape_detailed->addChild(simpleShape);
221 shape_detailed->addChild(
m_d->nodeManager.getShapeNode_DriftTube( halflength, radius ));
230 double stripLength =100.0, stripWidth = 10.0, stripThickness=1.0;
231 std::optional<Amg::Vector2D> localposROT=std::nullopt;
246 localposROT.emplace();
247 localposROT->setZero();
252 SoSeparator * gpSep =
new SoSeparator;
253 SoTranslation * localtransGP =
new SoTranslation;
254 localtransGP->translation.setValue(
static_cast<float>( (*localposROT)[
Trk::locX]),
255 static_cast<float>( (*localposROT)[
Trk::locY]),
258 gpSep->addChild(localtransGP);
259 gpSep->addChild(
m_d->nodeManager.getShapeNode_Cross(10));
260 shape_detailed->addChild(gpSep);
264 SoTranslation * localtrans0 =
new SoTranslation;
265 localtrans0->translation.setValue(
static_cast<float>( (*localposStrip)[
Trk::locX]),
266 static_cast<float>( (*localposStrip)[
Trk::locY]),
270 shape_simple->addChild(localtrans0);
271 shape_simple->addChild(
m_d->nodeManager.getShapeNode_Strip(stripLength));
273 shape_detailed->addChild(localtrans0);
274 shape_detailed->addChild(
m_d->nodeManager.getShapeNode_Strip(stripLength,stripWidth,stripThickness));
276 SoTranslation * localtrans1 =
new SoTranslation;
277 localtrans1->translation.setValue(
static_cast<float>( -(*localposStrip)[
Trk::locX]),
278 static_cast<float>( -(*localposStrip)[
Trk::locY]),
280 shape_simple->addChild(localtrans1);
281 shape_detailed->addChild(localtrans1);
283 delete localposStrip;
289 if (!idhelper)
return;
291 if (idhelper->
is_rpc(
id)) {
fillRPCValues(
id, baseDetEl, striplength, stripWidth, stripThickness, localposStrip);
return;}
292 if (idhelper->
is_tgc(
id)) {
fillTGCValues(
id, baseDetEl, striplength, stripWidth, stripThickness, localposStrip);
return;}
293 if (idhelper->
is_csc(
id)) {
fillCSCValues(
id, baseDetEl, striplength, stripWidth, stripThickness, localposStrip);
return;}
294 if (idhelper->
is_stgc(
id)) {
fillSTGCValues(
id, baseDetEl, striplength, stripWidth, stripThickness, localposStrip);
return;}
295 if (idhelper->
is_mm(
id)) {
fillMMValues(
id, baseDetEl, striplength, stripWidth, stripThickness, localposStrip);
return;}
298 fillSiValues(
id, baseDetEl, striplength, stripWidth, stripThickness, localposStrip);
return;
301 VP1Msg::message(
"Warning: HitToSoNode::fillValues(...) unknown technology.");
309 if (!idhelper || !detEl){
315 int plane = idhelper->
gasGap(
id );
317 int isStrip = idhelper->
isStrip(
id );
322 stripThickness = 3*0.8+0.1;
326 stripThickness = 3*0.8;
328 stripWidth=std::max(10.0,stripWidth);
358 if (!idhelper || !detEl){
367 stripThickness = (measPhi==1) ? 0.9: 0.8;
394 if (!idhelper || !detEl){
405 stripThickness = (measPhi==1) ? 0.9: 0.8;
432 if (!idhelper || !detEl){
459 if (!idhelper || !detEl){
501 stripWidth = detEl->
phiPitch( *localposStrip );
502 stripThickness = detEl->
thickness()/10.0;
double angle(const GeoTrf::Vector2D &a, const GeoTrf::Vector2D &b)
This class provides an interface to generate or decode an identifier for the upper levels of the dete...
bool is_indet(Identifier id) const
bool is_stgc(Identifier id) const
bool is_rpc(Identifier id) const
bool is_sct(Identifier id) const
bool is_tgc(Identifier id) const
bool is_pixel(Identifier id) const
bool is_muon(Identifier id) const
bool is_csc(Identifier id) const
bool is_mm(Identifier id) const
int chamberLayer(const Identifier &id) const
bool measuresPhi(const Identifier &id) const override
const double driftdischeight
HitsSoNodeManager nodeManager
void fillRPCValues(Identifier &id, const Trk::TrkDetElementBase *baseDetEl, double &striplength, double &stripWidth, double &stripThickness, Amg::Vector2D *&localposStrip)
void fillTGCValues(Identifier &id, const Trk::TrkDetElementBase *baseDetEl, double &striplength, double &stripWidth, double &stripThickness, Amg::Vector2D *&localposStrip)
void fillCSCValues(Identifier &id, const Trk::TrkDetElementBase *baseDetEl, double &striplength, double &stripWidth, double &stripThickness, Amg::Vector2D *&localposStrip)
void fillValues(Identifier &id, const Trk::TrkDetElementBase *baseDetEl, double &striplength, double &stripWidth, double &stripThickness, Amg::Vector2D *&localposStrip)
SoTransform * createTransform(const Trk::RIO_OnTrack &rio, bool useSurfacePositionOnly) const
void buildTubeShapes(const Trk::RIO_OnTrack &rio, SoSeparator *&shape_simple, SoSeparator *&shape_detailed, bool blockGP, double length, bool doProjection)
HitToSoNode(IVP1System *sys=0)
void buildStripShapes(const Trk::RIO_OnTrack &rio, SoSeparator *&shape_simple, SoSeparator *&shape_detailed, bool blockGP)
double getTGCAngle(Identifier id) const
returns the phi angle of the passed phi strip identifier.
void fillSTGCValues(Identifier &id, const Trk::TrkDetElementBase *baseDetEl, double &striplength, double &stripWidth, double &stripThickness, Amg::Vector2D *&localposStrip)
void fillMMValues(Identifier &id, const Trk::TrkDetElementBase *baseDetEl, double &striplength, double &stripWidth, double &stripThickness, Amg::Vector2D *&localposStrip)
SoTransform * createTGC_Transform(const Trk::RIO_OnTrack &rio, bool useSurfacePositionOnly) const
TGCs are rotated.
void fillSiValues(Identifier &id, const Trk::TrkDetElementBase *baseDetEl, double &striplength, double &stripWidth, double &stripThickness, Amg::Vector2D *&localposStrip)
Class to hold geometrical description of a silicon detector element.
double phiPitch() const
Pitch (inline methods)
Amg::Vector2D rawLocalPositionOfCell(const SiCellId &cellId) const
Returns position (center) of cell.
double etaPitch() const
Pitch (inline methods)
Represents 'corrected' measurements from the TRT (for example, corrected for wire sag).
virtual bool stripPosition(const Identifier &id, Amg::Vector2D &pos) const override final
strip position If the strip number is outside the range of valid strips, the function will return fal...
double stripLength(int chamberLayer, int measuresPhi, int stripNumber, double &epsilon) const
double cathodeReadoutPitch(int chLayer, int measuresPhi) const
Amg::Vector3D stripPos(const Identifier &id) const
takes into account internal alignment parameters, hence gives accurate answer
virtual const Trk::PlaneSurface & surface() const override
access to chamber surface (phi orientation), uses the first gas gap
const TgcReadoutElement * getTgcReadoutElement(const Identifier &id) const
access via extended identifier (requires unpacking)
int getStationEta() const
An RpcReadoutElement corresponds to a single RPC module; therefore typicaly a barrel muon station con...
double StripLength(bool measphi) const
returns the strip length for the phi or eta plane
Amg::Vector3D stripPos(const Identifier &id) const
double StripWidth(bool measphi) const
returns the strip width for the phi or eta plane
A TgcReadoutElement corresponds to a single TGC chamber; therefore typically a TGC station contains s...
Amg::Vector3D channelPos(const Identifier &id) const
Returns the position of the active channel (wireGang or strip)
double stripLength() const
Returns the length of each strip which is equal to the height of the chamber.
double gangShortWidth(int gasGap, int gang) const
Returns the length of the most bottom wire in the gang.
double stripWidth(int gasGap, int strip) const
Returns the width of a given strip in the gasGap i.
double stripCenterLocX(int gasGap, int strip, double radialPos) const
Returns the local X of the strip center at a given local radial position.
double gangRadialLength(int gasGap, int gang) const
Returns the length of the wire gang along the radial direction [pitch x N_{wire}^{gang}...
An sTgcReadoutElement corresponds to a single STGC module; therefore typicaly a barrel muon station c...
virtual bool stripPosition(const Identifier &id, Amg::Vector2D &pos) const override final
strip position - should be renamed to channel position If the strip number is outside the range of va...
bool measuresPhi(const Identifier &id) const override
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
Bounds for a cylindrical Surface.
double halflengthZ() const
This method returns the halflengthZ.
double get(ParamDefs par) const
Retrieve specified parameter (const version).
const LocalParameters & localParameters() const
Interface method to get the LocalParameters.
virtual bool globalToLocal(const Amg::Vector3D &glob, const Amg::Vector3D &mom, Amg::Vector2D &loc) const override final
Specified for PlaneSurface: GlobalToLocal method without dynamic memory allocation - boolean checks i...
Class to handle RIO On Tracks ROT) for InDet and Muons, it inherits from the common MeasurementBase.
virtual const TrkDetElementBase * detectorElement() const =0
returns the detector element, assoicated with the PRD of this class
Identifier identify() const
return the identifier -extends MeasurementBase
virtual const Amg::Vector3D & globalPosition() const override=0
Interface method to get the global Position.
Abstract Base Class for tracking surfaces.
virtual bool globalToLocal(const Amg::Vector3D &glob, const Amg::Vector3D &mom, Amg::Vector2D &loc) const =0
Specified by each surface type: GlobalToLocal method without dynamic memory allocation - boolean chec...
const Amg::Transform3D & transform() const
Returns HepGeom::Transform3D by reference.
const Amg::Vector3D & center() const
Returns the center position of the Surface.
This is the base class for all tracking detector elements with read-out relevant information.
virtual const SurfaceBounds & bounds() const =0
Return the boundaries of the element.
virtual const Surface & surface() const =0
Return surface associated with this detector element.
static const RpcIdHelper * rpcIDHelper()
static const TgcIdHelper * tgcIDHelper()
static const sTgcIdHelper * stgcIDHelper()
static const AtlasDetectorID * atlasIDHelper()
static const MuonGM::MuonDetectorManager * muonDetMgr()
static const MmIdHelper * mmIDHelper()
static const CscIdHelper * cscIDHelper()
VP1HelperClassBase(IVP1System *sys=0, QString helpername="")
void messageVerbose(const QString &) const
static SoTransform * toSoTransform(const HepGeom::Transform3D &, SoTransform *t=0)
static void message(const QString &, IVP1System *sys=0)
std::string toString(const Translation3D &translation, int precision=4)
GeoPrimitvesToStringConverter.
Eigen::Matrix< double, 3, 3 > RotationMatrix3D
Amg::RotationMatrix3D setPhi(Amg::RotationMatrix3D mat, double angle, int convention=0)
Amg::Transform3D getTransformFromRotTransl(Amg::RotationMatrix3D rot, Amg::Vector3D transl_vec)
Eigen::Affine3d Transform3D
Eigen::Matrix< double, 2, 1 > Vector2D
Eigen::Matrix< double, 3, 1 > Vector3D