27 int iPlane, iSegmentSupport;
29 m_GeoDat->getSectorSupportGeometry();
31 m_GeoDat->getSectorSupportPosition();
35 0, 0, sectorSupportPosition->
getOuterR() -
44 0, 0, sectorSupportPosition->
getInnerR() +
53 for (iPlane = 1; iPlane <=
m_GeoDat->getNPlanes(); iPlane++) {
56 for (iSegmentSupport = 1; iSegmentSupport <=
m_GeoDat->getNSegments() + 1;
85 int iPlane, iSegmentSupport, iSegment, j;
88 HepGeom::Transform3D t;
91 m_GeoDat->getSegmentSupportGeometry();
93 for (iPlane = 1; iPlane <=
m_GeoDat->getNPlanes(); iPlane++) {
94 for (iSegmentSupport = 1; iSegmentSupport <=
m_GeoDat->getNSegments() + 1;
97 m_GeoDat->getSegmentSupportPosition(iPlane, iSegmentSupport);
98 lx = 0.5 * (segmentSupportPos->
getLength() -
102 supportRectangle[0].setX(lx);
103 supportRectangle[0].setY(ly);
104 supportRectangle[0].setZ(0);
105 supportRectangle[1].setX(-lx);
106 supportRectangle[1].setY(ly);
107 supportRectangle[1].setZ(0);
108 supportRectangle[2].setX(-lx);
109 supportRectangle[2].setY(-ly);
110 supportRectangle[2].setZ(0);
111 supportRectangle[3].setX(lx);
112 supportRectangle[3].setY(-ly);
113 supportRectangle[3].setZ(0);
114 t = HepGeom::Translate3D(
117 segmentSupportPos->
getX(), segmentSupportPos->
getY(), 0);
119 t = HepGeom::Rotate3D(180. * CLHEP::deg,
120 HepGeom::Vector3D<double>(1., 1., 0.)) * t;
126 for (j = 0; j < 4; j++)
127 supportRectangle[j] = t * supportRectangle[j];
134 for (iPlane = 1; iPlane <=
m_GeoDat->getNPlanes(); iPlane++) {
135 for (iSegmentSupport = 1; iSegmentSupport <=
m_GeoDat->getNSegments() + 1;
140 B2ERROR(
"Segment support overlaps with corner 1."
142 <<
LogVar(
"Sector", sector)
143 <<
LogVar(
"Segment support", iSegmentSupport));
149 B2ERROR(
"Segment support overlaps with outer arc."
151 <<
LogVar(
"Sector", sector)
152 <<
LogVar(
"Segment support", iSegmentSupport));
158 B2ERROR(
"Segment support overlaps with line 2-3."
160 <<
LogVar(
"Sector", sector)
161 <<
LogVar(
"Segment support", iSegmentSupport));
167 B2ERROR(
"Segment support overlaps with inner arc."
169 <<
LogVar(
"Sector", sector)
170 <<
LogVar(
"Segment support", iSegmentSupport));
176 B2ERROR(
"Segment support overlaps with line 4-1."
178 <<
LogVar(
"Sector", sector)
179 <<
LogVar(
"Segment support", iSegmentSupport));
184 for (iPlane = 1; iPlane <=
m_GeoDat->getNPlanes(); iPlane++) {
185 for (iSegment = 1; iSegment <=
m_GeoDat->getNSegments(); iSegment++) {
187 sectorAlignment, &segmentAlignment,
true))
198 bool calledFromSectorCheck)
const
205 HepGeom::Transform3D t;
208 if (!calledFromSectorCheck) {
212 ly = 0.5 * stripGeometry->
getWidth();
218 stripRectangle[0].setX(lx);
219 stripRectangle[0].setY(ly);
220 stripRectangle[0].setZ(0);
221 stripRectangle[1].setX(-lx);
222 stripRectangle[1].setY(ly);
223 stripRectangle[1].setZ(0);
224 stripRectangle[2].setX(-lx);
225 stripRectangle[2].setY(-ly);
226 stripRectangle[2].setZ(0);
227 stripRectangle[3].setX(lx);
228 stripRectangle[3].setY(-ly);
229 stripRectangle[3].setZ(0);
233 HepGeom::Translate3D(stripPosition->
getX(), stripPosition->
getY(), 0) *
237 t = HepGeom::Rotate3D(180. * CLHEP::deg,
238 HepGeom::Vector3D<double>(1., 1., 0.)) * t;
244 for (j = 0; j < 4; j++)
245 stripRectangle[j] = t * stripRectangle[j];
246 Polygon2D stripPolygon(stripRectangle, 4);
249 B2ERROR(
"Strip overlaps with corner 1."
252 <<
LogVar(
"Strip", iStrip));
257 B2ERROR(
"Strip overlaps with outer arc."
260 <<
LogVar(
"Strip", iStrip));
261 B2ERROR(
"Overlap (section " << section <<
", layer " << layer <<
262 ", sector " << sector <<
", plane " << plane <<
263 "): strip " << iStrip <<
", outer arc.");
268 B2ERROR(
"Strip overlaps with line 2-3."
271 <<
LogVar(
"Strip", iStrip));
276 B2ERROR(
"Strip overlaps with inner arc."
279 <<
LogVar(
"Strip", iStrip));
280 B2ERROR(
"Overlap (section " << section <<
", layer " << layer <<
281 ", sector " << sector <<
", plane " << plane <<
282 "): strip " << iStrip <<
", inner arc.");
287 B2ERROR(
"Strip overlaps with line 4-1."
290 <<
LogVar(
"Strip", iStrip));
293 for (j = 0; j <=
m_GeoDat->getNSegments(); j++) {
296 B2ERROR(
"Strip overlaps with segment support."
299 <<
LogVar(
"Strip", iStrip)
300 <<
LogVar(
"Segment support", j + 1));
312 int iSection, iLayer, iSector, iPlane, iSegment, sector, segment;
313 for (iSection = 1; iSection <=
m_GeoDat->getNSections(); iSection++) {
314 for (iLayer = 1; iLayer <=
m_GeoDat->getNDetectorLayers(iSection);
316 for (iSector = 1; iSector <=
m_GeoDat->getNSectors(); iSector++) {
319 alignment->getModuleAlignment(sector);
320 if (sectorAlignment ==
nullptr)
321 B2FATAL(
"Incomplete alignment data.");
324 for (iPlane = 1; iPlane <=
m_GeoDat->getNPlanes(); iPlane++) {
325 for (iSegment = 1; iSegment <=
m_GeoDat->getNSegments(); iSegment++) {
327 iSection, iLayer, iSector, iPlane, iSegment);
330 if (segmentAlignment ==
nullptr)
331 B2FATAL(
"Incomplete alignment data.");
333 iSegment, sectorAlignment,
334 segmentAlignmentData,
false))
bool checkSegmentAlignment(int section, int layer, int sector, int plane, int segment, const KLMAlignmentData *sectorAlignment, const KLMAlignmentData *segmentAlignment, bool calledFromSectorCheck) const
Check segment alignment.