100 {
101
102
103
104
105
106
107
108
109
110
111
112
113
117
119 Identifier firstIdml1;
120
122 const MuonGM::MdtReadoutElement* detElMl1 = nullptr;
123
124 if (!detElMl0) {
125 msg << MSG::WARNING <<
"MdtIntersectGeometry::init() - failed to get readout element for ML0" <<
endmsg;
126 return;
127 }
128
129
131
132
133 if (nml == 2) {
136 }
137
138
139
140
141
142 bool goodMl0{false}, goodMl1{false};
144 goodMl0 =
m_dbData->isGoodMultilayer(firstIdml0);
145 goodMl1 = detElMl1 ?
m_dbData->isGoodMultilayer(firstIdml1) :
false;
146 } else {
147 goodMl0 = true;
148 goodMl1 = true;
149 }
150 int firstMlIndex = 1;
151 if (goodMl0 && !goodMl1) {
152 nml = 1;
153 detElMl1 = nullptr;
154 } else if (!goodMl0 && goodMl1) {
155 nml = 1;
156
157 detElMl0 = detElMl1;
158 detElMl1 = nullptr;
159 firstIdml0 = firstIdml1;
160 firstMlIndex = 2;
161 } else if (!goodMl0 && !goodMl1) {
162 msg << MSG::WARNING <<
"MdtIntersectGeometry::init() - neither multilayer is good" <<
endmsg;
163 return;
164 }
166
167
171
172
175
176 TrkDriftCircleMath::LocVec2D firstTube0(firstTubeMl0.y(), firstTubeMl0.z());
177 TrkDriftCircleMath::LocVec2D firstTube1(firstTubeMl1.y(), firstTubeMl1.z());
178
179
180 Identifier secondIdml0 =
m_idHelperSvc->mdtIdHelper().channelID(name,
eta,
phi, firstMlIndex, 1, 2);
182
185
186
187 Identifier firstIdml0lay1 =
m_idHelperSvc->mdtIdHelper().channelID(name,
eta,
phi, firstMlIndex, 2, 1);
189
190 double tubeDist = (secondTubeMl0 - firstTubeMl0).
y();
191 double tubeStage = (firstTubeMl0lay1 - firstTubeMl0).
y();
192 double layDist = (firstTubeMl0lay1 - firstTubeMl0).
z();
193
194 m_mdtGeometry = std::make_unique<TrkDriftCircleMath::MdtChamberGeometry>(
195 m_chid,
m_idHelperSvc, nml, nlay, ntube0, ntube1, firstTube0, firstTube1, tubeDist, tubeStage, layDist, detElMl0->
center().theta());
196
197
198 if (!goodMl0 && goodMl1)
m_mdtGeometry->isSecondMultiLayer(
true);
199
202 }
unsigned int nMDTinStation() const
How many MDT chambers are in the station.
Amg::Vector3D tubePos(const Identifier &id) const
Returns the global position of the given tube.
virtual const Amg::Vector3D & center(const Identifier &) const override final
Return the center of the surface associated with this identifier In the case of silicon it returns th...
const MdtReadoutElement * getMdtReadoutElement(const Identifier &id) const
access via extended identifier (requires unpacking)
IdentifierHash detectorElementHash() const
Returns the IdentifierHash of the detector element.
virtual Amg::Transform3D GlobalToAmdbLRSTransform() const
Amg::Transform3D m_transform
const Amg::Transform3D & transform() const
void fillDeadTubes(const MuonGM::MdtReadoutElement *mydetEl, MsgStream &msg)
std::shared_ptr< TrkDriftCircleMath::MdtChamberGeometry > m_mdtGeometry
Eigen::Matrix< double, 3, 1 > Vector3D