ATLAS Offline Software
Loading...
Searching...
No Matches
LVL1::gFEX Namespace Reference

Enumerations

enum class  FPGA { A , B , C , N_FPGAS }

Functions

FPGA getFPGA (float eta)
 Get the FPGA code from the tower eta.
std::string FPGAToString (FPGA fpga)
 Get the name of an FPGA.
FPGA FPGAFromString (std::string name)
 Get the enum from the name of an FPGA. Returning N_FPGA means that the string wasn't correct.
float towerArea (float eta)
 Get the GCaloTower areas from their eta bins.

Enumeration Type Documentation

◆ FPGA

enum class LVL1::gFEX::FPGA
strong
Enumerator
N_FPGAS 

Definition at line 16 of file GTowerHelpers.h.

Function Documentation

◆ FPGAFromString()

FPGA LVL1::gFEX::FPGAFromString ( std::string name)

Get the enum from the name of an FPGA. Returning N_FPGA means that the string wasn't correct.

Definition at line 45 of file GTowerHelpers.cxx.

46 {
47 // Convert the string to uppercase
48 std::transform(name.begin(), name.end(), name.begin(), toupper);
49 if (name == "A")
50 return FPGA::A;
51 else if (name == "B")
52 return FPGA::B;
53 else if (name == "C")
54 return FPGA::C;
55 else
56 return FPGA::N_FPGAS;
57 }

◆ FPGAToString()

std::string LVL1::gFEX::FPGAToString ( FPGA fpga)

Get the name of an FPGA.

Definition at line 29 of file GTowerHelpers.cxx.

30 {
31 switch (fpga)
32 {
33 case FPGA::A:
34 return "A";
35 case FPGA::B:
36 return "B";
37 case FPGA::C:
38 return "C";
39 default:
40 return "NOTANFPGA";
41 }
42 }

◆ getFPGA()

FPGA LVL1::gFEX::getFPGA ( float eta)

Get the FPGA code from the tower eta.

Definition at line 15 of file GTowerHelpers.cxx.

16 {
17 if (eta > -2.5 && eta <= 0)
18 return FPGA::A;
19 else if (eta > 0 && eta <= 2.5)
20 return FPGA::B;
21 else if (std::abs(eta) > 2.5)
22 return FPGA::C;
23 else
24 // Given the conditions above this should never trigger...
25 return FPGA::N_FPGAS;
26 }
Scalar eta() const
pseudorapidity method

◆ towerArea()

float LVL1::gFEX::towerArea ( float eta)

Get the GCaloTower areas from their eta bins.

Definition at line 59 of file GTowerHelpers.cxx.

60 {
61 eta = std::abs(eta);
62 if (eta < 2.4)
63 return 1;
64 else if (eta < 2.5)
65 return 0.5;
66 else if (eta < 3.1)
67 return 1;
68 else
69 return 4;
70 }