Project
Loading...
Searching...
No Matches
Mapper.h
Go to the documentation of this file.
1// Copyright 2019-2020 CERN and copyright holders of ALICE O2.
2// See https://alice-o2.web.cern.ch/copyright for details of the copyright holders.
3// All rights not expressly granted are reserved.
4//
5// This software is distributed under the terms of the GNU General Public
6// License v3 (GPL Version 3), copied verbatim in the file "COPYING".
7//
8// In applying this license CERN does not waive the privileges and immunities
9// granted to it by virtue of its status as an Intergovernmental Organization
10// or submit itself to any jurisdiction.
11
12#ifndef AliceO2_TPC_Mapper_H
13#define AliceO2_TPC_Mapper_H
14
15#include <map>
16#include <vector>
17#include <array>
18#include <string>
19#include <cmath>
20
21#include "DataFormatsTPC/Defs.h"
22#include "TPCBase/PadPos.h"
23#include "TPCBase/PadSecPos.h"
24#include "TPCBase/PadROCPos.h"
25#include "TPCBase/DigitPos.h"
26#include "TPCBase/FECInfo.h"
29#include "TPCBase/Sector.h"
30
31#include "MathUtils/Cartesian.h"
32
33// using o2::tpc::PadRegionInfo;
34// using o2::tpc::PartitionInfo;
35
36namespace o2
37{
38namespace tpc
39{
40
41class Mapper
42{
43 public:
44 static Mapper& instance(const std::string mappingDir = "")
45 {
46 static Mapper mapper(mappingDir);
47 return mapper;
48 }
49
50 const PadPos& padPos(GlobalPadNumber padNumber) const { return mMapGlobalPadToPadPos[padNumber % mPadsInSector]; }
51 const PadCentre& padCentre(GlobalPadNumber padNumber) const { return mMapGlobalPadCentre[padNumber % mPadsInSector]; }
52 const FECInfo& fecInfo(GlobalPadNumber padNumber) const { return mMapGlobalPadFECInfo[padNumber % mPadsInSector]; }
53
54 // const GlobalPadNumber globalPadNumber(const PadPos& padPosition) const { return
55 // mMapPadPosGlobalPad.find(padPosition)->second; }
56 GlobalPadNumber globalPadNumber(const PadPos& globalPadPosition) const
57 {
58 return mMapPadOffsetPerRow[globalPadPosition.getRow()] + globalPadPosition.getPad();
59 }
60
64 GlobalPadNumber static getGlobalPadNumber(const unsigned int lrow, const unsigned int pad, const unsigned int region) { return GLOBALPADOFFSET[region] + OFFSETCRULOCAL[region][lrow] + pad; }
65
69 static unsigned int getLocalPadNumber(const unsigned int row, const unsigned int pad) { return OFFSETCRUGLOBAL[row] + pad; }
70
72 static unsigned int getLocalRowFromGlobalRow(const unsigned int row) { return row - ROWOFFSET[REGION[row]]; }
73
78 int getCRU(const Sector& sec, GlobalPadNumber globalPad) const
79 {
80 const auto row = mMapGlobalPadToPadPos[globalPad].getRow();
81 const auto nCRUPerSector = mMapPadRegionInfo.size();
82 int region = 0;
83 for (size_t i = 1; i < nCRUPerSector; ++i) {
84 if (row < mMapPadRegionInfo[i].getGlobalRowOffset()) {
85 break;
86 }
87 ++region;
88 }
89
90 return int(sec * nCRUPerSector + region);
91 }
92
96 GlobalPadNumber getPadNumberInROC(const PadROCPos& rocPadPosition) const
97 {
98 const size_t padOffset = (rocPadPosition.getROCType() == RocType::IROC) ? 0 : mPadsInIROC;
99 const size_t rowOffset = (rocPadPosition.getROCType() == RocType::IROC) ? 0 : mNumberOfPadRowsIROC;
100
101 return mMapPadOffsetPerRow[rocPadPosition.getRow() + rowOffset] + rocPadPosition.getPad() - padOffset;
102 }
103
107 GlobalPadNumber getPadNumberInPartition(int partition, int row, int pad) const
108 {
109 const auto& info = mMapPartitionInfo[partition % mMapPartitionInfo.size()];
110 const size_t rowOffset = info.getGlobalRowOffset();
111 const size_t padOffset = mMapPadOffsetPerRow[rowOffset];
112
113 return mMapPadOffsetPerRow[row + rowOffset] + pad - padOffset;
114 }
115
120 {
121 const auto& info = mMapPadRegionInfo[cru.region() % mMapPadRegionInfo.size()];
122 const size_t rowOffset = info.getGlobalRowOffset();
123 const size_t padOffset = mMapPadOffsetPerRow[rowOffset];
124
125 return mMapPadOffsetPerRow[row + rowOffset] + pad - padOffset;
126 }
127
134 GlobalPadNumber getPadNumber(const PadSubset padSubset, const size_t padSubsetNumber, const int row,
135 const int pad) const
136 {
137 switch (padSubset) {
138 case PadSubset::ROC: {
139 return getPadNumberInROC(PadROCPos(padSubsetNumber, row, pad));
140 break;
141 }
143 return getPadNumberInPartition(padSubsetNumber, row, pad);
144 break;
145 }
146 case PadSubset::Region: {
147 return getPadNumberInRegion(CRU(padSubsetNumber), row, pad);
148 break;
149 }
150 }
151 return 0;
152 }
153
155 {
156 return mMapFECIDGlobalPad[FECInfo::globalSAMPAId(fec.getIndex(), fec.getSampaChip(), fec.getSampaChannel())];
157 }
158 GlobalPadNumber globalPadNumber(const int fecInSector, const int sampaOnFEC, const int channelOnSAMPA) const
159 {
160 return mMapFECIDGlobalPad[FECInfo::globalSAMPAId(fecInSector, sampaOnFEC, channelOnSAMPA)];
161 }
162
164 {
165 PadCentre padcent = getPadCentre(padSec.getPadPos());
166 if (padSec.getSector().side() == Side::A) {
167 padcent.SetY(-1.f * padcent.Y());
168 }
169 return LocalToGlobal(padcent, padSec.getSector());
170 }
171
173 {
174 const int row = (padRoc.getROCType() == RocType::IROC) ? padRoc.getRow() : padRoc.getRow() + mNumberOfPadRowsIROC;
175 const PadSecPos pos(padRoc.getSector(), PadPos(row, padRoc.getPad()));
176 return getPadCentre(pos);
177 }
178
179 const FECInfo& getFECInfo(const PadROCPos& padROC) const
180 {
181 const PadPos globalPadPosition = getGlobalPadPos(padROC);
182 const GlobalPadNumber padNum = globalPadNumber(globalPadPosition);
183 return fecInfo(padNum);
184 }
185
186 // ===| global sector mappings |==============================================
187 const PadCentre& getPadCentre(const PadPos& pad) const
188 {
189 const GlobalPadNumber padNumber = globalPadNumber(pad);
190 return padCentre(padNumber);
191 }
192 const PadPos& padPos(const FECInfo& fec) const
193 {
194 const GlobalPadNumber padNumber = globalPadNumber(fec);
195 return padPos(padNumber);
196 }
197
198 const PadPos& padPos(const int fecInSector, const int sampaOnFEC, const int channelOnSAMPA) const
199 {
200 const GlobalPadNumber padNumber = globalPadNumber(fecInSector, sampaOnFEC, channelOnSAMPA);
201 return padPos(padNumber);
202 }
203
204 const PadCentre& padCentre(const FECInfo& fec) const
205 {
206 const GlobalPadNumber padNumber = globalPadNumber(fec);
207 return padCentre(padNumber);
208 }
209
210 const PadCentre& padCentre(const int fecInSector, const int sampaOnFEC, const int channelOnSAMPA) const
211 {
212 const GlobalPadNumber padNumber = globalPadNumber(fecInSector, sampaOnFEC, channelOnSAMPA);
213 return padCentre(padNumber);
214 }
215
216 // ===| partition mappings |==================================================
217 const PadPos& padPos(const int partition, const int fecInPartition, const int sampaOnFEC,
218 const int channelOnSAMPA) const
219 {
220 const int fecInSector = mMapPartitionInfo[partition].getSectorFECOffset() + fecInPartition;
221 const GlobalPadNumber padNumber = globalPadNumber(fecInSector, sampaOnFEC, channelOnSAMPA);
222 return padPos(padNumber);
223 }
224
225 const PadPos padPosPartition(const int partition, const int fecInPartition, const int sampaOnFEC,
226 const int channelOnSAMPA) const
227 {
228 const PartitionInfo& partInfo = mMapPartitionInfo[partition];
229 const int fecInSector = partInfo.getSectorFECOffset() + fecInPartition;
230 const GlobalPadNumber padNumber = globalPadNumber(fecInSector, sampaOnFEC, channelOnSAMPA);
231 PadPos pos = padPos(padNumber);
232 pos.setRow(pos.getRow() - partInfo.getGlobalRowOffset());
233 return pos;
234 }
235
236 const PadPos padPosRegion(const int cruNumber, const int fecInPartition, const int sampaOnFEC,
237 const int channelOnSAMPA) const
238 {
239 const CRU cru(cruNumber);
240 const PadRegionInfo& regionInfo = mMapPadRegionInfo[cru.region()];
241 const PartitionInfo& partInfo = mMapPartitionInfo[cru.partition()];
242 const int fecInSector = partInfo.getSectorFECOffset() + fecInPartition;
243 const GlobalPadNumber padNumber = globalPadNumber(fecInSector, sampaOnFEC, channelOnSAMPA);
244 PadPos pos = padPos(padNumber);
245 pos.setRow(pos.getRow() - regionInfo.getGlobalRowOffset());
246 return pos;
247 }
248
249 const PadROCPos padROCPos(const CRU cru, const int fecInPartition, const int sampaOnFEC,
250 const int channelOnSAMPA) const
251 {
252 const PartitionInfo& partInfo = mMapPartitionInfo[cru.partition()];
253 const int fecInSector = partInfo.getSectorFECOffset() + fecInPartition;
254 const GlobalPadNumber padNumber = globalPadNumber(fecInSector, sampaOnFEC, channelOnSAMPA);
255 const ROC roc = cru.roc();
256 PadROCPos pos(roc, padPos(padNumber));
257 if (roc.isOROC()) {
258 pos.getPadPos().setRow(pos.getRow() - mNumberOfPadRowsIROC);
259 }
260 return pos;
261 }
262
263 const PadSecPos padSecPos(const CRU cru, const int fecInPartition, const int sampaOnFEC,
264 const int channelOnSAMPA) const
265 {
266 const PartitionInfo& partInfo = mMapPartitionInfo[cru.partition()];
267 const int fecInSector = partInfo.getSectorFECOffset() + fecInPartition;
268 const GlobalPadNumber padNumber = globalPadNumber(fecInSector, sampaOnFEC, channelOnSAMPA);
269 PadSecPos pos(cru.sector(), padPos(padNumber));
270 return pos;
271 }
272
275 static constexpr void getSampaAndChannelOnFEC(const int cruID, const size_t rawFECChannel, int& sampaOnFEC, int& channelOnSAMPA)
276 {
277 constexpr int sampaMapping[10] = {0, 0, 1, 1, 2, 3, 3, 4, 4, 2};
278 constexpr int channelOffset[10] = {0, 16, 0, 16, 0, 0, 16, 0, 16, 16};
279
280 const int regionIter = cruID % 2;
281 const int istreamm = ((rawFECChannel % 10) / 2);
282 const int partitionStream = istreamm + regionIter * 5;
283 sampaOnFEC = sampaMapping[partitionStream];
284 const int channel = (rawFECChannel % 2) + 2 * (rawFECChannel / 10);
285 channelOnSAMPA = channel + channelOffset[partitionStream];
286 }
287
288 const PadCentre& padCentre(const int partition, const int fecInPartition, const int sampaOnFEC,
289 const int channelOnSAMPA) const
290 {
291 const int fecInSector = mMapPartitionInfo[partition].getSectorFECOffset() + fecInPartition;
292 const GlobalPadNumber padNumber = globalPadNumber(fecInSector, sampaOnFEC, channelOnSAMPA);
293 return padCentre(padNumber);
294 }
295
296 // ===| pad number and pad row mappings |=====================================
297 int getNumberOfRows() const { return mNumberOfPadRowsIROC + mNumberOfPadRowsOROC; }
298
300 static constexpr auto getNumberOfRowsInIROC() { return mNumberOfPadRowsIROC; }
301
303 static constexpr auto getNumberOfRowsInOROC() { return mNumberOfPadRowsOROC; }
304
306 {
307 return (roc.rocType() == RocType::IROC) ? mNumberOfPadRowsIROC : mNumberOfPadRowsOROC;
308 }
309 int getNumberOfRowsRegion(int region) const
310 {
311 return mMapPadRegionInfo[region % getNumberOfPadRegions()].getNumberOfPadRows();
312 }
313 int getGlobalRowOffsetRegion(int region) const
314 {
315 return mMapPadRegionInfo[region % getNumberOfPadRegions()].getGlobalRowOffset();
316 }
318 {
319 return mMapPartitionInfo[cru % getNumberOfPartitions()].getNumberOfPadRows();
320 }
321 int getNumberOfPadRows(PadSubset padSubset, int position) const
322 {
323 switch (padSubset) {
324 case PadSubset::ROC: {
325 return getNumberOfRowsROC(position);
326 break;
327 }
329 return getNumberOfRowsPartition(position);
330 break;
331 }
332 case PadSubset::Region: {
333 return getNumberOfRowsRegion(position);
334 break;
335 }
336 }
337 return 0;
338 }
339
340 int getNumberOfPadsInRowSector(int row) const { return mMapNumberOfPadsPerRow[row]; }
341 int getPadOffsetInRowSector(int row) const { return mMapPadOffsetPerRow[row]; }
342 int getNumberOfPadsInRowROC(int roc, int row) const
343 {
344 return mMapNumberOfPadsPerRow[row + (roc % 72 >= getNumberOfIROCs()) * mNumberOfPadRowsIROC];
345 }
346 int getNumberOfPadsInRowRegion(int region, int row) const
347 {
348 return mMapNumberOfPadsPerRow[row + mMapPadRegionInfo[region % getNumberOfPadRegions()].getGlobalRowOffset()];
349 }
350 int getNumberOfPadsInRowPartition(int partition, int row) const
351 {
352 return mMapNumberOfPadsPerRow[row + mMapPartitionInfo[partition % getNumberOfPartitions()].getGlobalRowOffset()];
353 }
354 int getNumberOfPadsInRow(PadSubset padSubset, int position, int row) const
355 {
356 switch (padSubset) {
357 case PadSubset::ROC: {
358 return getNumberOfPadsInRowROC(position, row);
359 break;
360 }
362 return getNumberOfPadsInRowPartition(position, row);
363 break;
364 }
365 case PadSubset::Region: {
366 return getNumberOfPadsInRowRegion(position, row);
367 break;
368 }
369 }
370 return 0;
371 }
372
374 static constexpr int getNumberOfPadsPerSide() { return getPadsInSector() * SECTORSPERSIDE; }
375
377 const PadPos getGlobalPadPos(const PadROCPos& padROC) const
378 {
379 const char globalRow = padROC.getRow() + (padROC.getROCType() == RocType::OROC) * mNumberOfPadRowsIROC;
380 const char pad = padROC.getPad();
381 return PadPos(globalRow, pad);
382 }
383
384 // ===| Partition and Region mappings |=======================================
385 const PadRegionInfo& getPadRegionInfo(const unsigned char region) const { return mMapPadRegionInfo[region]; }
386 const std::array<PadRegionInfo, 10>& getMapPadRegionInfo() const { return mMapPadRegionInfo; }
387 int getNumberOfPadRegions() const { return int(mMapPadRegionInfo.size()); }
388
389 const PartitionInfo& getPartitionInfo(const unsigned char partition) const { return mMapPartitionInfo[partition]; }
390 const std::array<PartitionInfo, 5>& getMapPartitionInfo() const { return mMapPartitionInfo; }
391 int getNumberOfPartitions() const { return int(mMapPartitionInfo.size()); }
392
393 const DigitPos findDigitPosFromLocalPosition(const LocalPosition3D& pos, const Sector& sec) const;
395 const DigitPos findDigitPosFromGlobalPosition(const GlobalPosition3D& pos, const Sector& sector) const;
396
397 bool isOutOfSector(GlobalPosition3D posEle, const Sector& sector, const float margin = 0.f) const;
398
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
407 static constexpr unsigned short getNumberOfIROCs() { return 36; }
408 static constexpr unsigned short getNumberOfOROCs() { return 36; }
409 static constexpr unsigned short getPadsInIROC() { return mPadsInIROC; }
410 static constexpr unsigned short getPadsInOROC1() { return mPadsInOROC1; }
411 static constexpr unsigned short getPadsInOROC2() { return mPadsInOROC2; }
412 static constexpr unsigned short getPadsInOROC3() { return mPadsInOROC3; }
413 static constexpr unsigned short getPadsInOROC() { return mPadsInOROC; }
414 static constexpr unsigned short getPadsInSector() { return mPadsInSector; }
415
416 static constexpr unsigned short getNumberOfPads(const GEMstack gemStack)
417 {
418 switch (gemStack) {
419 case IROCgem: {
420 return getPadsInIROC();
421 break;
422 }
423 case OROC1gem: {
424 return getPadsInOROC1();
425 break;
426 }
427 case OROC2gem: {
428 return getPadsInOROC2();
429 break;
430 }
431 case OROC3gem: {
432 return getPadsInOROC3();
433 break;
434 }
435 }
436 return 0;
437 }
438
439 unsigned short getNumberOfPads(const ROC roc) const
440 {
441 if (roc.rocType() == RocType::IROC) {
442 return getPadsInIROC();
443 }
444 return getPadsInOROC();
445 }
446
447 const std::vector<PadPos>& getMapGlobalPadToPadPos() const { return mMapGlobalPadToPadPos; }
448 const std::vector<int>& getMapFECIDGlobalPad() const { return mMapFECIDGlobalPad; }
449
450 const std::vector<float>& getTraceLengthsIROC() const { return mTraceLengthsIROC; }
451 const std::vector<float>& getTraceLengthsOROC() const { return mTraceLengthsOROC; }
452
453 // bool loadFECInfo();
454 // bool loadPositions();
455
456 // c++11 feature don't work with root dictionary :(
457 // Mapper(const Mapper&) = delete;
458 // void operator=(const Mapper&) = delete;
459
460 // ===| rotation functions |==================================================
462 {
463 const double cs = std::cos(alpha), sn = std::sin(alpha);
464 return GlobalPosition3D(float(double(pos.X()) * cs - double(pos.Y()) * sn),
465 float(double(pos.X()) * sn + double(pos.Y() * cs)), pos.Z());
466 }
467
469 {
471 const double cs = std::cos(-alpha), sn = std::sin(-alpha);
472 return LocalPosition3D(float(double(pos.X()) * cs - double(pos.Y()) * sn),
473 float(double(pos.X()) * sn + double(pos.Y() * cs)), pos.Z());
474 }
475
477 {
478 const double cs = CosinsPerSector[sec.getSector() % SECTORSPERSIDE],
479 sn = SinsPerSector[sec.getSector() % SECTORSPERSIDE];
480 return GlobalPosition3D(float(double(pos.X()) * cs - double(pos.Y()) * sn),
481 float(double(pos.X()) * sn + double(pos.Y() * cs)), pos.Z());
482 }
483
485 {
487 const double cs = CosinsPerSector[sec.getSector() % SECTORSPERSIDE],
488 sn = -SinsPerSector[sec.getSector() % SECTORSPERSIDE];
489 return LocalPosition3D(float(double(pos.X()) * cs - double(pos.Y()) * sn),
490 float(double(pos.X()) * sn + double(pos.Y() * cs)), pos.Z());
491 }
492
493 // --- 2D
495 {
496 const double cs = std::cos(alpha), sn = std::sin(alpha);
497 return GlobalPosition2D(float(double(pos.X()) * cs - double(pos.Y()) * sn),
498 float(double(pos.X()) * sn + double(pos.Y() * cs)));
499 }
500
502 {
504 const double cs = std::cos(-alpha), sn = std::sin(-alpha);
505 return LocalPosition2D(float(double(pos.X()) * cs - double(pos.Y()) * sn),
506 float(double(pos.X()) * sn + double(pos.Y() * cs)));
507 }
508
510 {
511 const double cs = CosinsPerSector[sec.getSector() % SECTORSPERSIDE],
512 sn = SinsPerSector[sec.getSector() % SECTORSPERSIDE];
513 return GlobalPosition2D(float(double(pos.X()) * cs - double(pos.Y()) * sn),
514 float(double(pos.X()) * sn + double(pos.Y() * cs)));
515 }
516
518 {
520 const double cs = CosinsPerSector[sec.getSector() % SECTORSPERSIDE],
521 sn = -SinsPerSector[sec.getSector() % SECTORSPERSIDE];
522 return LocalPosition2D(float(double(pos.X()) * cs - double(pos.Y()) * sn),
523 float(double(pos.X()) * sn + double(pos.Y() * cs)));
524 }
525
526 static constexpr unsigned int NSECTORS{36};
527 static constexpr unsigned int NREGIONS{10};
528 static constexpr unsigned int PADROWS{152};
529 static constexpr unsigned int NENDPOINTS{2};
530 static constexpr unsigned int PADSPERREGION[NREGIONS]{1200, 1200, 1440, 1440, 1440, 1440, 1600, 1600, 1600, 1600};
531 static constexpr unsigned int GLOBALPADOFFSET[NREGIONS]{0, 1200, 2400, 3840, 5280, 6720, 8160, 9760, 11360, 12960};
532 static constexpr unsigned int ROWSPERREGION[NREGIONS]{17, 15, 16, 15, 18, 16, 16, 14, 13, 12};
533 static constexpr unsigned int ROWOFFSET[NREGIONS]{0, 17, 32, 48, 63, 81, 97, 113, 127, 140};
534 static constexpr unsigned int ROWOFFSETSTACK[4]{0, 63, 97, 127};
535 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};
536 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};
537 static constexpr unsigned REGION[PADROWS] = {
538 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
539 1, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3,
540 3, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5,
541 5, 5, 5, 5, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7,
542 7, 7, 7, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9};
543 const inline static std::vector<unsigned int> ADDITIONALPADSPERROW[NREGIONS]{
544 {0, 0, 0, 1, 1, 1, 2, 2, 2, 3, 3, 3, 4, 4, 4, 4, 5}, // region 0
545 {0, 0, 0, 1, 1, 1, 2, 2, 2, 3, 3, 3, 4, 4, 4}, // region 1
546 {0, 0, 0, 1, 1, 1, 2, 2, 2, 2, 3, 3, 3, 4, 4, 4}, // region 2
547 {0, 0, 0, 1, 1, 1, 2, 2, 2, 3, 3, 3, 4, 4, 4}, // region 3
548 {0, 0, 0, 0, 1, 1, 1, 2, 2, 2, 2, 3, 3, 3, 4, 4, 4, 4}, // region 4
549 {0, 0, 0, 1, 1, 1, 2, 2, 2, 2, 3, 3, 3, 4, 4, 4}, // region 5
550 {0, 1, 1, 1, 2, 2, 2, 3, 3, 4, 4, 4, 5, 5, 5, 6}, // region 6
551 {0, 0, 1, 1, 1, 2, 2, 2, 3, 3, 3, 4, 4, 4}, // region 7
552 {0, 0, 1, 1, 2, 2, 3, 3, 3, 4, 4, 5, 5}, // region 8
553 {0, 1, 1, 2, 2, 2, 3, 3, 4, 4, 5, 5} // region 9
554 };
555 const inline static std::vector<unsigned int> OFFSETCRULOCAL[NREGIONS]{
556 {0, 66, 132, 198, 266, 334, 402, 472, 542, 612, 684, 756, 828, 902, 976, 1050, 1124}, // region 0
557 {0, 76, 152, 228, 306, 384, 462, 542, 622, 702, 784, 866, 948, 1032, 1116}, // region 1
558 {0, 86, 172, 258, 346, 434, 522, 612, 702, 792, 882, 974, 1066, 1158, 1252, 1346}, // region 2
559 {0, 92, 184, 276, 370, 464, 558, 654, 750, 846, 944, 1042, 1140, 1240, 1340}, // region 3
560 {0, 76, 152, 228, 304, 382, 460, 538, 618, 698, 778, 858, 940, 1022, 1104, 1188, 1272, 1356}, // region 4
561 {0, 86, 172, 258, 346, 434, 522, 612, 702, 792, 882, 974, 1066, 1158, 1252, 1346}, // region 5
562 {0, 94, 190, 286, 382, 480, 578, 676, 776, 876, 978, 1080, 1182, 1286, 1390, 1494}, // region 6
563 {0, 110, 220, 332, 444, 556, 670, 784, 898, 1014, 1130, 1246, 1364, 1482}, // region 7
564 {0, 118, 236, 356, 476, 598, 720, 844, 968, 1092, 1218, 1344, 1472}, // region 8
565 {0, 128, 258, 388, 520, 652, 784, 918, 1052, 1188, 1324, 1462} // region 9
566 };
567 const inline static std::vector<unsigned int> PADSPERROW[NREGIONS]{
568 {66, 66, 66, 68, 68, 68, 70, 70, 70, 72, 72, 72, 74, 74, 74, 74, 76}, // region 0
569 {76, 76, 76, 78, 78, 78, 80, 80, 80, 82, 82, 82, 84, 84, 84}, // region 1
570 {86, 86, 86, 88, 88, 88, 90, 90, 90, 90, 92, 92, 92, 94, 94, 94}, // region 2
571 {92, 92, 92, 94, 94, 94, 96, 96, 96, 98, 98, 98, 100, 100, 100}, // region 3
572 {76, 76, 76, 76, 78, 78, 78, 80, 80, 80, 80, 82, 82, 82, 84, 84, 84, 84}, // region 4
573 {86, 86, 86, 88, 88, 88, 90, 90, 90, 90, 92, 92, 92, 94, 94, 94}, // region 5
574 {94, 96, 96, 96, 98, 98, 98, 100, 100, 102, 102, 102, 104, 104, 104, 106}, // region 6
575 {110, 110, 112, 112, 112, 114, 114, 114, 116, 116, 116, 118, 118, 118}, // region 7
576 {118, 118, 120, 120, 122, 122, 124, 124, 124, 126, 126, 128, 128}, // region 8
577 {128, 130, 130, 132, 132, 132, 134, 134, 136, 136, 138, 138} // region 9
578 };
579 static constexpr unsigned int OFFSETCRUGLOBAL[PADROWS]{
580 0, 66, 132, 198, 266, 334, 402, 472, 542, 612, 684, 756, 828, 902, 976, 1050, 1124, // region 0
581 0, 76, 152, 228, 306, 384, 462, 542, 622, 702, 784, 866, 948, 1032, 1116, // region 1
582 0, 86, 172, 258, 346, 434, 522, 612, 702, 792, 882, 974, 1066, 1158, 1252, 1346, // region 2
583 0, 92, 184, 276, 370, 464, 558, 654, 750, 846, 944, 1042, 1140, 1240, 1340, // region 3
584 0, 76, 152, 228, 304, 382, 460, 538, 618, 698, 778, 858, 940, 1022, 1104, 1188, 1272, 1356, // region 4
585 0, 86, 172, 258, 346, 434, 522, 612, 702, 792, 882, 974, 1066, 1158, 1252, 1346, // region 5
586 0, 94, 190, 286, 382, 480, 578, 676, 776, 876, 978, 1080, 1182, 1286, 1390, 1494, // region 6
587 0, 110, 220, 332, 444, 556, 670, 784, 898, 1014, 1130, 1246, 1364, 1482, // region 7
588 0, 118, 236, 356, 476, 598, 720, 844, 968, 1092, 1218, 1344, 1472, // region 8
589 0, 128, 258, 388, 520, 652, 784, 918, 1052, 1188, 1324, 1462 // region 9
590 };
591
592 static constexpr unsigned int LinksPerRegionPerEndpoint[NREGIONS][NENDPOINTS]{
593 {8, 7}, // region 0
594 {8, 7}, // region 1
595 {9, 9}, // region 2
596 {9, 9}, // region 3
597 {9, 9}, // region 4
598 {9, 9}, // region 5
599 {10, 10}, // region 6
600 {10, 10}, // region 7
601 {10, 10}, // region 8
602 {10, 10}, // region 9
603 };
604
605 private:
606 Mapper(const std::string& mappingDir);
607 // use old c++03 due to root
608 Mapper(const Mapper&) {}
609 void operator=(const Mapper&) {}
610
611 void load(const std::string& mappingDir);
612
614 void loadTraceLengths(std::string_view mappingDir = "");
615 void setTraceLengths(std::string_view inputFile, std::vector<float>& length);
616
617 void initPadRegionsAndPartitions();
618 bool readMappingFile(std::string file);
619
620 static constexpr unsigned short mPadsInIROC{5280};
621 static constexpr unsigned short mPadsInOROC1{2880};
622 static constexpr unsigned short mPadsInOROC2{3200};
623 static constexpr unsigned short mPadsInOROC3{3200};
624 static constexpr unsigned short mPadsInOROC{9280};
625 static constexpr unsigned short mPadsInSector{14560};
626 static constexpr unsigned short mNumberOfPadRowsIROC{63};
627 static constexpr unsigned short mNumberOfPadRowsOROC{89};
628
629 std::vector<float> mTraceLengthsIROC;
630 std::vector<float> mTraceLengthsOROC;
631
632 // ===| lookup tables |=======================================================
633 // static constexpr std::array<double, SECTORSPERSIDE> SinsPerSector; ///< Sinus values of sectors
634 // static constexpr std::array<double, SECTORSPERSIDE> CosinsPerSector; ///< Cosinus values of sectors
635 // for (double i=0; i<18; ++i) { cout << std::setprecision(40) << std::sin(TMath::DegToRad()*(10.+i*20.))
636 // <<","<<std::endl; }
637 static constexpr std::array<double, SECTORSPERSIDE> SinsPerSector{
638 {0.1736481776669303311866343619840336032212, 0.4999999999999999444888487687421729788184,
639 0.7660444431189780134516809084743726998568, 0.9396926207859083168827396548294927924871, 1,
640 0.9396926207859084279050421173451468348503, 0.7660444431189780134516809084743726998568,
641 0.4999999999999999444888487687421729788184, 0.1736481776669302756754831307262065820396,
642 -0.1736481776669304699645124401286011561751, -0.5000000000000001110223024625156540423632,
643 -0.7660444431189779024293784459587186574936, -0.9396926207859084279050421173451468348503, -1,
644 -0.9396926207859083168827396548294927924871, -0.7660444431189781244739833709900267422199,
645 -0.5000000000000004440892098500626161694527, -0.1736481776669303866977855932418606244028}};
646
647 // static constexpr std::array<int, 2> test{1,2};
648
649 // for (double i=0; i<18; ++i) { cout << std::setprecision(40) << std::cos(TMath::DegToRad()*(10.+i*20.))
650 // <<","<<std::endl; }
651 static constexpr std::array<double, SECTORSPERSIDE> CosinsPerSector{
652 {0.9848077530122080203156542665965389460325, 0.866025403784438707610604524234076961875,
653 0.6427876096865393629187224178167525678873, 0.34202014332566882393038554255326744169, 0.,
654 -0.3420201433256687129080830800376133993268, -0.6427876096865393629187224178167525678873,
655 -0.866025403784438707610604524234076961875, -0.9848077530122080203156542665965389460325,
656 -0.9848077530122080203156542665965389460325, -0.8660254037844385965883020617184229195118,
657 -0.6427876096865394739410248803324066102505, -0.3420201433256685463746293862641323357821, 0.,
658 0.3420201433256689904638392363267485052347, 0.6427876096865392518964199553010985255241,
659 0.8660254037844383745436971366871148347855, 0.9848077530122080203156542665965389460325}};
660
661 static constexpr std::array<double, SECTORSPERSIDE> SinsPerSectorNotShifted{
662 {0, 0.3420201433256687129080830800376133993268, 0.6427876096865392518964199553010985255241,
663 0.8660254037844385965883020617184229195118, 0.9848077530122080203156542665965389460325,
664 0.9848077530122080203156542665965389460325, 0.866025403784438707610604524234076961875,
665 0.6427876096865394739410248803324066102505, 0.3420201433256688794415367738110944628716, 0.,
666 -0.3420201433256686573969318487797863781452, -0.6427876096865392518964199553010985255241,
667 -0.8660254037844383745436971366871148347855, -0.9848077530122080203156542665965389460325,
668 -0.9848077530122081313379567291121929883957, -0.8660254037844385965883020617184229195118,
669 -0.6427876096865395849633273428480606526136, -0.3420201433256686018857806175219593569636}};
670
671 static constexpr std::array<double, SECTORSPERSIDE> CosinsPerSectorNotShifted{
672 {1, 0.9396926207859084279050421173451468348503, 0.7660444431189780134516809084743726998568,
673 0.5000000000000001110223024625156540423632, 0.1736481776669304144533612088707741349936,
674 -0.1736481776669303034310587463551200926304, -0.4999999999999997779553950749686919152737,
675 -0.7660444431189779024293784459587186574936, -0.9396926207859083168827396548294927924871, -1,
676 -0.9396926207859084279050421173451468348503, -0.7660444431189780134516809084743726998568,
677 -0.5000000000000004440892098500626161694527, -0.1736481776669303311866343619840336032212,
678 0.1736481776669299703641513588081579655409, 0.5000000000000001110223024625156540423632,
679 0.7660444431189777914070759834430646151304, 0.9396926207859084279050421173451468348503}};
680
681 // ===| Pad Mappings |========================================================
682 std::vector<PadPos> mMapGlobalPadToPadPos;
683 std::vector<PadCentre> mMapGlobalPadCentre;
684 std::map<PadPos, GlobalPadNumber>
685 mMapPadPosGlobalPad;
686 std::vector<int> mMapFECIDGlobalPad;
687 std::vector<FECInfo> mMapGlobalPadFECInfo;
688
689 // ===| Pad region and partition mappings |===================================
690 std::array<PadRegionInfo, 10> mMapPadRegionInfo;
691 std::array<PartitionInfo, 5> mMapPartitionInfo;
692
693 // ===| Pad number and row mappings |=========================================
694 std::array<int, mNumberOfPadRowsIROC + mNumberOfPadRowsOROC>
695 mMapNumberOfPadsPerRow;
696 std::array<int, mNumberOfPadRowsIROC + mNumberOfPadRowsOROC>
697 mMapPadOffsetPerRow;
698};
699
700// ===| inline functions |======================================================
702{
703 PadPos pad;
704 CRU cru;
705 for (const PadRegionInfo& padRegion : mMapPadRegionInfo) {
706 cru = CRU(sec, padRegion.getRegion());
707 pad = padRegion.findPad(pos.X(), pos.Y(), (pos.Z() >= 0) ? Side::A : Side::C); // <--- to avoid calling a non-inlined library function layer for LocalPosition3D
708 if (pad.isValid()) {
709 break;
710 }
711 }
712
713 return DigitPos(cru, pad);
714}
715
717{
718 // ===| find sector |=========================================================
719 float phi = std::atan2(pos.Y(), pos.X());
720 if (phi < 0.) {
721 phi += TWOPI;
722 }
723 const unsigned char secNum = std::floor(phi / SECPHIWIDTH);
724 // const float secPhi = secNum * SECPHIWIDTH + SECPHIWIDTH / 2.;
725 Sector sec(secNum + (pos.Z() < 0) * SECTORSPERSIDE);
726
727 // ===| rotated position |====================================================
728 // LocalPosition3D posLoc=GlobalToLocal(pos, secPhi);
729 LocalPosition3D posLoc = GlobalToLocal(pos, Sector(secNum));
730
731 return findDigitPosFromLocalPosition(posLoc, sec);
732}
734{
735 LocalPosition3D posLoc = GlobalToLocal(pos, sector);
736 return findDigitPosFromLocalPosition(posLoc, sector);
737}
738
739inline bool Mapper::isOutOfSector(GlobalPosition3D posEle, const Sector& sector, const float margin) const
740{
741 int secRight = int(sector);
742 int secLeft = int(Sector::getLeft(sector));
743 const float dSectorBoundaryRight = -SinsPerSectorNotShifted[secRight % SECTORSPERSIDE] * posEle.X() + CosinsPerSectorNotShifted[secRight % SECTORSPERSIDE] * posEle.Y();
744 const float dSectorBoundaryLeft = -SinsPerSectorNotShifted[secLeft % SECTORSPERSIDE] * posEle.X() + CosinsPerSectorNotShifted[secLeft % SECTORSPERSIDE] * posEle.Y();
745
746 if ((dSectorBoundaryLeft > 0 && dSectorBoundaryRight < 0) || (dSectorBoundaryLeft < 0 && dSectorBoundaryRight > 0)) {
747 return false;
748 }
749 if (std::abs(dSectorBoundaryLeft) > margin && std::abs(dSectorBoundaryRight) > margin) {
750 return true;
751 }
752 return false;
753}
754
755} // namespace tpc
756} // namespace o2
757
758#endif
int32_t i
uint16_t pos
Definition RawData.h:3
uint32_t roc
Definition RawData.h:3
unsigned char region() const
Definition CRU.h:64
const Sector sector() const
Definition CRU.h:65
const ROC roc() const
Definition CRU.h:61
unsigned char partition() const
Definition CRU.h:63
unsigned char getSampaChannel() const
Definition FECInfo.h:45
unsigned char getIndex() const
Definition FECInfo.h:41
unsigned char getSampaChip() const
Definition FECInfo.h:44
static constexpr int globalSAMPAId(const int fecInSector, const int sampaOnFEC, const int channelOnSAMPA)
Definition FECInfo.h:56
static LocalPosition2D GlobalToLocal(const GlobalPosition2D &pos, const double alpha)
Definition Mapper.h:501
static constexpr unsigned int ROWOFFSET[NREGIONS]
offset to calculate local row from global row
Definition Mapper.h:533
int getNumberOfRowsPartition(CRU cru) const
Definition Mapper.h:317
int getNumberOfRows() const
Definition Mapper.h:297
const FECInfo & getFECInfo(const PadROCPos &padROC) const
Definition Mapper.h:179
static constexpr unsigned short getPadsInOROC3()
Definition Mapper.h:412
static constexpr unsigned int LinksPerRegionPerEndpoint[NREGIONS][NENDPOINTS]
number of links per region per end point
Definition Mapper.h:592
const std::array< PadRegionInfo, 10 > & getMapPadRegionInfo() const
Definition Mapper.h:386
int getNumberOfPadsInRowSector(int row) const
Definition Mapper.h:340
static GlobalPadNumber getGlobalPadNumber(const unsigned int lrow, const unsigned int pad, const unsigned int region)
Definition Mapper.h:64
static bool isBelowSpacerCross(int rowInSector, int padInRow)
Definition Mapper.cxx:322
const PartitionInfo & getPartitionInfo(const unsigned char partition) const
Definition Mapper.h:389
int getGlobalRowOffsetRegion(int region) const
Definition Mapper.h:313
const PadCentre & padCentre(const int fecInSector, const int sampaOnFEC, const int channelOnSAMPA) const
Definition Mapper.h:210
const PadPos & padPos(GlobalPadNumber padNumber) const
Definition Mapper.h:50
const PadPos & padPos(const int partition, const int fecInPartition, const int sampaOnFEC, const int channelOnSAMPA) const
Definition Mapper.h:217
const std::vector< float > & getTraceLengthsIROC() const
Definition Mapper.h:450
unsigned short getNumberOfPads(const ROC roc) const
Definition Mapper.h:439
const PadPos padPosRegion(const int cruNumber, const int fecInPartition, const int sampaOnFEC, const int channelOnSAMPA) const
Definition Mapper.h:236
static const std::vector< unsigned int > ADDITIONALPADSPERROW[NREGIONS]
additional pads per row compared to first row
Definition Mapper.h:543
static constexpr unsigned short getNumberOfOROCs()
Definition Mapper.h:408
GlobalPadNumber globalPadNumber(const PadPos &globalPadPosition) const
Definition Mapper.h:56
const PadCentre & padCentre(const FECInfo &fec) const
Definition Mapper.h:204
const std::vector< PadPos > & getMapGlobalPadToPadPos() const
Definition Mapper.h:447
static constexpr auto getNumberOfRowsInIROC()
Definition Mapper.h:300
const DigitPos findDigitPosFromGlobalPosition(const GlobalPosition3D &pos) const
Definition Mapper.h:716
static LocalPosition3D GlobalToLocal(const GlobalPosition3D &pos, const Sector sec)
Definition Mapper.h:484
bool isOutOfSector(GlobalPosition3D posEle, const Sector &sector, const float margin=0.f) const
Definition Mapper.h:739
static const std::vector< unsigned int > PADSPERROW[NREGIONS]
number of pads per row in region
Definition Mapper.h:567
static const std::vector< unsigned int > OFFSETCRULOCAL[NREGIONS]
row offset in cru for given local pad row
Definition Mapper.h:555
const FECInfo & fecInfo(GlobalPadNumber padNumber) const
Definition Mapper.h:52
int getNumberOfRowsROC(ROC roc) const
Definition Mapper.h:305
static constexpr unsigned int GLOBALPADOFFSET[NREGIONS]
offset of number of pads for region
Definition Mapper.h:531
const PadROCPos padROCPos(const CRU cru, const int fecInPartition, const int sampaOnFEC, const int channelOnSAMPA) const
Definition Mapper.h:249
int getPadOffsetInRowSector(int row) const
Definition Mapper.h:341
int getNumberOfPadsInRow(PadSubset padSubset, int position, int row) const
Definition Mapper.h:354
const PadPos getGlobalPadPos(const PadROCPos &padROC) const
Convert sector, row, pad to global pad row in sector and pad number.
Definition Mapper.h:377
int getNumberOfPadsInRowROC(int roc, int row) const
Definition Mapper.h:342
static LocalPosition2D GlobalToLocal(const GlobalPosition2D &pos, const Sector sec)
Definition Mapper.h:517
static bool isEdgePad(int rowInSector, int padInRow)
Definition Mapper.cxx:301
static constexpr unsigned short getPadsInOROC1()
Definition Mapper.h:410
static unsigned int getLocalRowFromGlobalRow(const unsigned int row)
Definition Mapper.h:72
static constexpr float INVPADAREA[NREGIONS]
inverse size of the pad area padwidth*padLength
Definition Mapper.h:536
static Mapper & instance(const std::string mappingDir="")
Definition Mapper.h:44
GlobalPadNumber getPadNumber(const PadSubset padSubset, const size_t padSubsetNumber, const int row, const int pad) const
Definition Mapper.h:134
static LocalPosition3D GlobalToLocal(const GlobalPosition3D &pos, const double alpha)
Definition Mapper.h:468
const PadPos & padPos(const FECInfo &fec) const
Definition Mapper.h:192
static constexpr unsigned int ROWSPERREGION[NREGIONS]
number of pad rows for region
Definition Mapper.h:532
GlobalPadNumber globalPadNumber(const int fecInSector, const int sampaOnFEC, const int channelOnSAMPA) const
Definition Mapper.h:158
static constexpr unsigned short getPadsInIROC()
Definition Mapper.h:409
static constexpr unsigned int NSECTORS
total number of sectors in the TPC
Definition Mapper.h:526
GlobalPadNumber getPadNumberInRegion(CRU cru, int row, int pad) const
Definition Mapper.h:119
const PadRegionInfo & getPadRegionInfo(const unsigned char region) const
Definition Mapper.h:385
int getNumberOfPadsInRowPartition(int partition, int row) const
Definition Mapper.h:350
static constexpr unsigned int NREGIONS
total number of regions in one sector
Definition Mapper.h:527
static constexpr unsigned short getPadsInSector()
Definition Mapper.h:414
GlobalPadNumber globalPadNumber(const FECInfo &fec) const
Definition Mapper.h:154
int getNumberOfPadRows(PadSubset padSubset, int position) const
Definition Mapper.h:321
const PadSecPos padSecPos(const CRU cru, const int fecInPartition, const int sampaOnFEC, const int channelOnSAMPA) const
Definition Mapper.h:263
static constexpr void getSampaAndChannelOnFEC(const int cruID, const size_t rawFECChannel, int &sampaOnFEC, int &channelOnSAMPA)
Definition Mapper.h:275
const std::array< PartitionInfo, 5 > & getMapPartitionInfo() const
Definition Mapper.h:390
static bool isHighCouplingPad(int rowInSector, int padInRow)
Definition Mapper.h:402
static constexpr unsigned short getPadsInOROC()
Definition Mapper.h:413
static constexpr auto getNumberOfRowsInOROC()
Definition Mapper.h:303
static constexpr float REGIONAREA[NREGIONS]
volume of each region in cm^2
Definition Mapper.h:535
static constexpr unsigned short getNumberOfPads(const GEMstack gemStack)
Definition Mapper.h:416
int getNumberOfRowsRegion(int region) const
Definition Mapper.h:309
const PadPos & padPos(const int fecInSector, const int sampaOnFEC, const int channelOnSAMPA) const
Definition Mapper.h:198
const PadCentre & padCentre(GlobalPadNumber padNumber) const
Definition Mapper.h:51
static constexpr unsigned int ROWOFFSETSTACK[4]
offset to calculate local row from global row
Definition Mapper.h:534
int getNumberOfPadsInRowRegion(int region, int row) const
Definition Mapper.h:346
const DigitPos findDigitPosFromLocalPosition(const LocalPosition3D &pos, const Sector &sec) const
Definition Mapper.h:701
static GlobalPosition2D LocalToGlobal(const LocalPosition2D &pos, const Sector sec)
Definition Mapper.h:509
static constexpr unsigned int PADROWS
total number of pad rows
Definition Mapper.h:528
static constexpr int getNumberOfPadsPerSide()
Definition Mapper.h:374
GlobalPadNumber getPadNumberInROC(const PadROCPos &rocPadPosition) const
Definition Mapper.h:96
GlobalPadNumber getPadNumberInPartition(int partition, int row, int pad) const
Definition Mapper.h:107
static constexpr unsigned short getPadsInOROC2()
Definition Mapper.h:411
static GlobalPosition3D LocalToGlobal(const LocalPosition3D &pos, const double alpha)
Definition Mapper.h:461
const std::vector< float > & getTraceLengthsOROC() const
Definition Mapper.h:451
static constexpr unsigned int PADSPERREGION[NREGIONS]
number of pads per CRU
Definition Mapper.h:530
static GlobalPosition3D LocalToGlobal(const LocalPosition3D &pos, const Sector sec)
Definition Mapper.h:476
const std::vector< int > & getMapFECIDGlobalPad() const
Definition Mapper.h:448
int getNumberOfPartitions() const
Definition Mapper.h:391
const PadCentre & padCentre(const int partition, const int fecInPartition, const int sampaOnFEC, const int channelOnSAMPA) const
Definition Mapper.h:288
static constexpr unsigned int OFFSETCRUGLOBAL[PADROWS]
row offset in cru for given global pad row
Definition Mapper.h:579
int getNumberOfPadRegions() const
Definition Mapper.h:387
const PadCentre & getPadCentre(const PadPos &pad) const
Definition Mapper.h:187
static GlobalPosition2D LocalToGlobal(const LocalPosition2D &pos, const double alpha)
Definition Mapper.h:494
GlobalPosition2D getPadCentre(const PadROCPos &padRoc) const
Definition Mapper.h:172
static unsigned int getLocalPadNumber(const unsigned int row, const unsigned int pad)
Definition Mapper.h:69
static bool isFirstOrLastRowInStack(int rowInSector)
Definition Mapper.cxx:307
GlobalPosition2D getPadCentre(const PadSecPos &padSec) const
Definition Mapper.h:163
static constexpr unsigned short getNumberOfIROCs()
Definition Mapper.h:407
int getCRU(const Sector &sec, GlobalPadNumber globalPad) const
Definition Mapper.h:78
static constexpr unsigned REGION[PADROWS]
region for global pad row
Definition Mapper.h:537
static constexpr unsigned int NENDPOINTS
number of end points
Definition Mapper.h:529
const PadPos padPosPartition(const int partition, const int fecInPartition, const int sampaOnFEC, const int channelOnSAMPA) const
Definition Mapper.h:225
Pad and row inside a ROC.
Definition PadROCPos.h:37
const Sector getSector() const
Definition PadROCPos.h:59
int getPad() const
Definition PadROCPos.h:79
RocType getROCType() const
Definition PadROCPos.h:67
int getRow() const
Definition PadROCPos.h:75
unsigned char getGlobalRowOffset() const
Sector getSector() const
Definition PadSecPos.h:44
const PadPos & getPadPos() const
Definition PadSecPos.h:48
unsigned char getGlobalRowOffset() const
unsigned char getSectorFECOffset() const
Side side() const
Definition Sector.h:96
unsigned char getSector() const
Definition Sector.h:94
static Sector getLeft(const Sector s)
Definition Sector.h:145
GLfloat GLfloat GLfloat alpha
Definition glcorearb.h:279
GLuint GLsizei GLsizei * length
Definition glcorearb.h:790
GEMstack
TPC GEM stack types.
Definition Defs.h:53
@ IROCgem
Definition Defs.h:53
@ OROC1gem
Definition Defs.h:54
@ OROC3gem
Definition Defs.h:56
@ OROC2gem
Definition Defs.h:55
@ OROC
Definition Defs.h:49
@ IROC
Definition Defs.h:48
math_utils::Point2D< float > LocalPosition2D
Definition Defs.h:124
constexpr double TWOPI
Definition Defs.h:44
math_utils::Point3D< float > LocalPosition3D
Definition Defs.h:126
constexpr double SECPHIWIDTH
Definition Defs.h:45
constexpr unsigned char SECTORSPERSIDE
Definition Defs.h:40
math_utils::Point3D< float > GlobalPosition3D
Definition Defs.h:125
PadSubset
Definition of the different pad subsets.
Definition Defs.h:63
@ Partition
Partitions (up to 36*5)
@ ROC
ROCs (up to 72)
@ Region
Regions (up to 36*10)
@ A
Definition Defs.h:35
@ C
Definition Defs.h:36
unsigned short GlobalPadNumber
global pad number
Definition Defs.h:129
math_utils::Point2D< float > GlobalPosition2D
Definition Defs.h:123
a couple of static helper functions to create timestamp values for CCDB queries or override obsolete ...
std::vector< int > row