102{
103
104 SoNode * node{nullptr};
105
106
107 const MuonGM::sTgcReadoutElement *
elem =
element();
109
113
114
117 elem->stripGlobalPosition(
id, globalPos);
118 elem->stripPosition(
id, pos);
119
120
121 double shortWidth=0, longWidth=0,
length=0;
122 const Trk::PlaneSurface surface =
elem->surface(
id);
123
124
128 std::array<Amg::Vector2D, 4> corners{
130 elem->padCorners(
id, corners);
131 shortWidth = (corners.at(1) - corners.at(0)).norm();
132 longWidth = (corners.at(3) - corners.at(2)).norm();
133
135 }
136
139 const MuonGM::MuonChannelDesign* design =
elem->getDesign(
id);
141 shortWidth =
elem->channelPitch(
id);
142 longWidth = shortWidth;
143
145 }
146
147 else {
149 const MuonGM::MuonChannelDesign* design =
elem->getDesign(
id);
150 if (!design) {
151
152 std::cout << "No wire design for hit " << id << std::endl;;
153 return node;
154 }
155
156
157
158 double fulllength = design->
xSize();
161 if (std::abs(locY) > 0.5 * design->
minYSize()) {
163 length = (0.5 * design->
maxYSize() - std::abs(locY)) / dY * fulllength;
164 if (std::abs(locY) > 873) {
165
166 length += 0.5 * fulllength;
167 }
168 elem->surface(
id).localToGlobal(
170 Amg::Vector3D::Zero(), globalPos);
171 } else {
173 }
174
175 shortWidth =
elem->channelPitch(
id);
176 longWidth = shortWidth;
177
179 }
180 return node;
181}
constexpr std::array< T, N > make_array(const T &def_val)
Helper function to initialize in-place arrays with non-zero values.
SoNode * getShapeNode_Wire(double length, double minWidth=0, double maxWidth=0, double depth=0)
SoNode * getShapeNode_Strip(double length, double width=0, double depth=0)
SoNode * getShapeNode_Pad(double length, double minWidth=0, double maxWidth=0, double depth=0)
static const sTgcIdHelper * stgcIDHelper()
HitsSoNodeManager * nodeManager() const
VP1RawDataCommonData * common() const
const MuonGM::sTgcReadoutElement * element() const
std::string m_channelTypeStr
int channelType(const Identifier &id) const
int channel(const Identifier &id) const override
Eigen::Matrix< double, 2, 1 > Vector2D
Eigen::Matrix< double, 3, 1 > Vector3D
double firstPos() const
Returns the position of the first strip along the x-axis.
double channelLength(int channel) const
STRIPS ONLY: calculate channel length for a given strip number.