ATLAS Offline Software
Loading...
Searching...
No Matches
EfexDefs.cxx
Go to the documentation of this file.
1//==============================================================================
2// EfexDefs.cxx
3//==============================================================================
4
5#include <stdlib.h>
6#include <iostream>
7
9
17
18
19//==============================================================================
20// connectorForMinipod
21//==============================================================================
27int
29{
30 // Actual mapping has hadronic on connector 1 (of 0-3)
31 // and the two minipod central region on connector 3.
32 // **CHECK!!**
33 // SJH 07/07/21 Updated in line with Gareth's mapping
34 // Hopefully Gareth's mapping is correct
35 if (minipod >= 0 && minipod < 4) { return 0; } // E0-E3
36 else if (minipod >= 4 && minipod < 6) { return 2; } // E4-E5
37 else if (minipod >= 6 && minipod < 10) { return 3; } // E6-E9
38 else if (minipod >= 10 && minipod < 13) { return 1; } // H0-H2
39 else { return -1; }
40}
41
42//==============================================================================
43// connectorFirstFibre
44//==============================================================================
50int
52{
53 // Not all 12-fibre ribbons are used, so skip unused ones
54 // to map onto minipods.
55 int conn = EfexDefs::connectorForMinipod(minipod);
56 // SJH 07/07/21 Updated in line with Gareth's mapping
57 // which we believe is correct. It's rather messier
58 // than earlier assumptions
59 // **CHECK!!**
60 int numUnused = 0;
61 int reverse = 1;
62 if (conn < 0) { return -1; }
63 else if (conn == 0) { numUnused = 0; reverse = 1; }
64 else if (conn == 1) { numUnused = 3; reverse = 1; }
65 else if (conn == 2) { numUnused = 2; reverse = -1; }
66 else if (conn == 3) { numUnused = 1; reverse = -1; }
68 int ribbon = (5*rpc + minipod*reverse + numUnused) % rpc;
69 // Deal with annoying hadronic case...
70 if ( minipod == 12 )
71 ribbon = 0;
72 return ribbon * FexDefs::numFibresPerRibbon();
73}
74
75//==============================================================================
76// globalEtaIndex
77//==============================================================================
86unsigned int
87EfexDefs::globalEtaIndex(unsigned int efexLogicalID,
88 unsigned int fpgaNumber,
89 unsigned int etaWithinFpga)
90{
91 unsigned int positionID = efexLogicalID % 3; // eFEX C,B,A role
92 unsigned int etaIndex = (16 * positionID) + (fpgaNumber * 4) + etaWithinFpga;
93 etaIndex += (positionID != 0 || fpgaNumber != 0) ? 1 : 0; // Adjustment for ends
94 return etaIndex;
95}
96
97//==============================================================================
98// globalEtaValue
99//==============================================================================
107int
108EfexDefs::globalEtaValue(unsigned int efexLogicalID,
109 unsigned int fpgaNumber,
110 unsigned int etaWithinFpga)
111{
112 return (int)EfexDefs::globalEtaIndex(efexLogicalID,fpgaNumber,etaWithinFpga) - 25;
113}
static unsigned int globalEtaIndex(unsigned int efexLogicalID, unsigned int fpgaNumber, unsigned int etaWithinFpga)
Return unsigned eta bin within eFEX system (used for calibration channels).
Definition EfexDefs.cxx:87
static int connectorForMinipod(int minipod)
Return MTP connector number (0-3) for a given minipod.
Definition EfexDefs.cxx:28
static int globalEtaValue(unsigned int efexLogicalID, unsigned int fpgaNumber, unsigned int etaWithinFpga)
Return signed eta bin within eFEX system (used for trigger menu API).
Definition EfexDefs.cxx:108
static int numRibbonsPerConnector()
Definition EfexDefs.h:17
static int connectorFirstFibre(int minipod)
Return first fibre in the input MTP connector for a given minipod.
Definition EfexDefs.cxx:51
static int numFibresPerRibbon()
Definition FexDefs.h:14