Skip to content

Commit 196c6af

Browse files
committed
Add functions for specific pad selections
* edge pads * stack boundary rows * cross region
1 parent 9c26a3d commit 196c6af

File tree

2 files changed

+50
-5
lines changed

2 files changed

+50
-5
lines changed

Detectors/TPC/base/include/TPCBase/Mapper.h

Lines changed: 14 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -396,6 +396,14 @@ class Mapper
396396

397397
bool isOutOfSector(GlobalPosition3D posEle, const Sector& sector, const float margin = 0.f) const;
398398

399+
static bool isEdgePad(int rowInSector, int padInRow);
400+
static bool isFirstOrLastRowInStack(int rowInSector);
401+
static bool isBelowSpacerCross(int rowInSector, int padInRow);
402+
static bool isHighCouplingPad(int rowInSector, int padInRow)
403+
{
404+
return isEdgePad(rowInSector, padInRow) || isFirstOrLastRowInStack(rowInSector) || isBelowSpacerCross(rowInSector, padInRow);
405+
}
406+
399407
static constexpr unsigned short getNumberOfIROCs() { return 36; }
400408
static constexpr unsigned short getNumberOfOROCs() { return 36; }
401409
static constexpr unsigned short getPadsInIROC() { return mPadsInIROC; }
@@ -523,6 +531,7 @@ class Mapper
523531
static constexpr unsigned int GLOBALPADOFFSET[NREGIONS]{0, 1200, 2400, 3840, 5280, 6720, 8160, 9760, 11360, 12960}; ///< offset of number of pads for region
524532
static constexpr unsigned int ROWSPERREGION[NREGIONS]{17, 15, 16, 15, 18, 16, 16, 14, 13, 12}; ///< number of pad rows for region
525533
static constexpr unsigned int ROWOFFSET[NREGIONS]{0, 17, 32, 48, 63, 81, 97, 113, 127, 140}; ///< offset to calculate local row from global row
534+
static constexpr unsigned int ROWOFFSETSTACK[4]{0, 63, 97, 127}; ///< offset to calculate local row from global row
526535
static constexpr float REGIONAREA[NREGIONS]{374.4f, 378.f, 453.6f, 470.88f, 864.f, 864.f, 1167.36f, 1128.96f, 1449.6f, 1456.8f}; ///< volume of each region in cm^2
527536
static constexpr float INVPADAREA[NREGIONS]{1 / 0.312f, 1 / 0.315f, 1 / 0.315f, 1 / 0.327f, 1 / 0.6f, 1 / 0.6f, 1 / 0.7296f, 1 / 0.7056f, 1 / 0.906f, 1 / 0.9105f}; ///< inverse size of the pad area padwidth*padLength
528537
static constexpr unsigned REGION[PADROWS] = {
@@ -542,7 +551,7 @@ class Mapper
542551
{0, 0, 1, 1, 1, 2, 2, 2, 3, 3, 3, 4, 4, 4}, // region 7
543552
{0, 0, 1, 1, 2, 2, 3, 3, 3, 4, 4, 5, 5}, // region 8
544553
{0, 1, 1, 2, 2, 2, 3, 3, 4, 4, 5, 5} // region 9
545-
}; ///< additional pads per row compared to first row
554+
}; ///< additional pads per row compared to first row
546555
const inline static std::vector<unsigned int> OFFSETCRULOCAL[NREGIONS]{
547556
{0, 66, 132, 198, 266, 334, 402, 472, 542, 612, 684, 756, 828, 902, 976, 1050, 1124}, // region 0
548557
{0, 76, 152, 228, 306, 384, 462, 542, 622, 702, 784, 866, 948, 1032, 1116}, // region 1
@@ -554,7 +563,7 @@ class Mapper
554563
{0, 110, 220, 332, 444, 556, 670, 784, 898, 1014, 1130, 1246, 1364, 1482}, // region 7
555564
{0, 118, 236, 356, 476, 598, 720, 844, 968, 1092, 1218, 1344, 1472}, // region 8
556565
{0, 128, 258, 388, 520, 652, 784, 918, 1052, 1188, 1324, 1462} // region 9
557-
}; ///< row offset in cru for given local pad row
566+
}; ///< row offset in cru for given local pad row
558567
const inline static std::vector<unsigned int> PADSPERROW[NREGIONS]{
559568
{66, 66, 66, 68, 68, 68, 70, 70, 70, 72, 72, 72, 74, 74, 74, 74, 76}, // region 0
560569
{76, 76, 76, 78, 78, 78, 80, 80, 80, 82, 82, 82, 84, 84, 84}, // region 1
@@ -566,7 +575,7 @@ class Mapper
566575
{110, 110, 112, 112, 112, 114, 114, 114, 116, 116, 116, 118, 118, 118}, // region 7
567576
{118, 118, 120, 120, 122, 122, 124, 124, 124, 126, 126, 128, 128}, // region 8
568577
{128, 130, 130, 132, 132, 132, 134, 134, 136, 136, 138, 138} // region 9
569-
}; ///< number of pads per row in region
578+
}; ///< number of pads per row in region
570579
static constexpr unsigned int OFFSETCRUGLOBAL[PADROWS]{
571580
0, 66, 132, 198, 266, 334, 402, 472, 542, 612, 684, 756, 828, 902, 976, 1050, 1124, // region 0
572581
0, 76, 152, 228, 306, 384, 462, 542, 622, 702, 784, 866, 948, 1032, 1116, // region 1
@@ -578,7 +587,7 @@ class Mapper
578587
0, 110, 220, 332, 444, 556, 670, 784, 898, 1014, 1130, 1246, 1364, 1482, // region 7
579588
0, 118, 236, 356, 476, 598, 720, 844, 968, 1092, 1218, 1344, 1472, // region 8
580589
0, 128, 258, 388, 520, 652, 784, 918, 1052, 1188, 1324, 1462 // region 9
581-
}; ///< row offset in cru for given global pad row
590+
}; ///< row offset in cru for given global pad row
582591

583592
static constexpr unsigned int LinksPerRegionPerEndpoint[NREGIONS][NENDPOINTS]{
584593
{8, 7}, // region 0
@@ -591,7 +600,7 @@ class Mapper
591600
{10, 10}, // region 7
592601
{10, 10}, // region 8
593602
{10, 10}, // region 9
594-
}; ///< number of links per region per end point
603+
}; ///< number of links per region per end point
595604

596605
private:
597606
Mapper(const std::string& mappingDir);

Detectors/TPC/base/src/Mapper.cxx

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -298,5 +298,41 @@ void Mapper::setTraceLengths(std::string_view inputFile, std::vector<float>& len
298298
}
299299
}
300300

301+
bool Mapper::isEdgePad(int rowInSector, int padInRow)
302+
{
303+
const auto& mapper = instance();
304+
return (padInRow == 0) || (padInRow == mapper.getNumberOfPadsInRowSector(rowInSector) - 1);
305+
}
306+
307+
bool Mapper::isFirstOrLastRowInStack(int rowInSector)
308+
{
309+
if (rowInSector == 0 || rowInSector == PADROWS - 1) {
310+
return true;
311+
}
312+
313+
const auto& mapper = instance();
314+
for (int i = 1; i < 4; ++i) {
315+
if (rowInSector == ROWOFFSETSTACK[i] || rowInSector == ROWOFFSETSTACK[i] - 1) {
316+
return true;
317+
}
318+
}
319+
return false;
320+
}
321+
322+
bool Mapper::isBelowSpacerCross(int rowInSector, int padInRow)
323+
{
324+
static std::vector<bool> ROWSBELOWCROSS{0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0};
325+
if (ROWSBELOWCROSS[rowInSector]) {
326+
return true;
327+
}
328+
329+
const auto& mapper = instance();
330+
const auto padCenter = mapper.getNumberOfPadsInRowSector(rowInSector) / 2;
331+
if (padInRow == padCenter || padInRow == padCenter - 1) {
332+
return true;
333+
}
334+
return false;
335+
}
336+
301337
} // namespace tpc
302338
} // namespace o2

0 commit comments

Comments
 (0)