ATLAS Offline Software
Loading...
Searching...
No Matches
LVL1::JemMappingTool Class Reference

JEM crate/module/channel to eta/phi/layer mappings. More...

#include <JemMappingTool.h>

Inheritance diagram for LVL1::JemMappingTool:
Collaboration diagram for LVL1::JemMappingTool:

Public Member Functions

virtual StatusCode initialize () override
virtual StatusCode finalize () override
virtual bool mapping (int crate, int module, int channel, double &eta, double &phi, int &layer) const override
 Return eta, phi and layer mapping for given crate/module/channel.
virtual bool mapping (double eta, double phi, int layer, int &crate, int &module, int &channel) const override
 Return crate, module and channel mapping for given eta/phi/layer.

Private Attributes

std::vector< double > m_etasNegative
std::vector< double > m_granNegative
std::vector< double > m_etasPositive
std::vector< double > m_granPositive
std::vector< int > m_negChans
std::vector< int > m_posChans

Static Private Attributes

static const int s_crates = 2
static const int s_modules = 16
static const int s_channels = 44
static const int s_modulesPerQuadrant = 8
static const int s_extremeNegModule = 0
static const int s_extremePosModule = 7
static const int s_etaBinsPerRow = 4
static const double s_phiGran = M_PI/16.
static const double s_etaGran = 0.2

Detailed Description

JEM crate/module/channel to eta/phi/layer mappings.

Layer indicates core/overlap

Source: "ATLAS Level-1 Calorimeter Trigger: Jet/Energy Processor Module, Project Specification" version 1.0 The remappings at extreme eta are from a private communication from Steve Hillier.

Author
Peter Faulkner

Definition at line 33 of file JemMappingTool.h.

Member Function Documentation

◆ finalize()

StatusCode LVL1::JemMappingTool::finalize ( )
overridevirtual

Definition at line 62 of file JemMappingTool.cxx.

63{
64
65 return StatusCode::SUCCESS;
66}

◆ initialize()

StatusCode LVL1::JemMappingTool::initialize ( )
overridevirtual

Definition at line 33 of file JemMappingTool.cxx.

34{
35 msg(MSG::INFO) << "Initializing " << name() << endmsg;
36
37 // Initialise extreme eta data vectors
38 const double etasNeg[s_etaBinsPerRow] = {-4.05, -3.05, -2.8, -2.55 };
39 const double granNeg[s_etaBinsPerRow] = { 1.7, 0.3, 0.2, 0.3 };
40 const double etasPos[s_etaBinsPerRow] = { 2.55, 2.8, 3.05, 4.05 };
41 const double granPos[s_etaBinsPerRow] = { 0.3, 0.2, 0.3, 1.7 };
42 m_etasNegative.assign(etasNeg, etasNeg + s_etaBinsPerRow);
43 m_granNegative.assign(granNeg, granNeg + s_etaBinsPerRow);
44 m_etasPositive.assign(etasPos, etasPos + s_etaBinsPerRow);
45 m_granPositive.assign(granPos, granPos + s_etaBinsPerRow);
46
47 // Initialise extreme eta channel remapping vectors
48 const int negChans[s_channels] = { 1,-1, 2, 3, -1,-1, 6, 7, 0,36,10,11,
49 5, 9,14,15, 17,13,18,19, 4,12,22,23,
50 28,20,26,27, 21,25,30,31, 33,29,34,35,
51 37,41,38,39, -1,-1,42,43 };
52 const int posChans[s_channels] = { 0, 1, 2,-1, 4, 5,-1,-1, 8, 9, 3,39,
53 12,13, 6,10, 16,17,18,14, 20,21, 7,15,
54 24,25,31,23, 28,29,22,26, 32,33,34,30,
55 36,37,38,42, 40,41,-1,-1 };
56 m_negChans.assign(negChans, negChans + s_channels);
57 m_posChans.assign(posChans, posChans + s_channels);
58
59 return StatusCode::SUCCESS;
60}
#define endmsg
std::vector< double > m_etasPositive
std::vector< int > m_posChans
std::vector< double > m_etasNegative
std::vector< double > m_granNegative
std::vector< double > m_granPositive
static const int s_channels
static const int s_etaBinsPerRow
std::vector< int > m_negChans
MsgStream & msg
Definition testRead.cxx:32

◆ mapping() [1/2]

bool LVL1::JemMappingTool::mapping ( double eta,
double phi,
int layer,
int & crate,
int & module,
int & channel ) const
overridevirtual

Return crate, module and channel mapping for given eta/phi/layer.

Definition at line 119 of file JemMappingTool.cxx.

121{
122 // Not implemented
123 crate = 0;
124 module = 0;
125 channel = 0;
126 return false;
127}

◆ mapping() [2/2]

bool LVL1::JemMappingTool::mapping ( int crate,
int module,
int channel,
double & eta,
double & phi,
int & layer ) const
overridevirtual

Return eta, phi and layer mapping for given crate/module/channel.

Definition at line 70 of file JemMappingTool.cxx.

72{
73 if (crate < 0 || crate >= s_crates || module < 0 || module >= s_modules ||
74 channel < 0 || channel >= s_channels) return false;
75
76 // Channel remapping needed at extreme eta
77
78 int chan = channel;
79 const int quadMod = module % s_modulesPerQuadrant;
80 if (quadMod == s_extremeNegModule) chan = m_negChans[channel];
81 else if (quadMod == s_extremePosModule) chan = m_posChans[channel];
82 if (chan < 0) return false;
83 const int etaBin = chan % s_etaBinsPerRow;
84 const int phiBin = chan / s_etaBinsPerRow - 1; // allow for overlap
85
86 // Phi granularity doubles at FCAL
87
88 constexpr double twoPi = 2. * M_PI;
89 const double phiBase =
90 M_PI_2 * static_cast<double>(crate)
91 + M_PI * static_cast<double>(module / s_modulesPerQuadrant);
92 phi = phiBase + s_phiGran * (static_cast<double>(phiBin) + 0.5);
93 if (((quadMod == s_extremeNegModule) && (etaBin == 0)) ||
94 ((quadMod == s_extremePosModule) && (etaBin == s_etaBinsPerRow - 1))) {
95 if (chan < s_etaBinsPerRow) phi -= s_phiGran / 2.;
96 else phi += s_phiGran / 2.;
97 }
98 if (phi < 0.) phi += twoPi;
99 else if (phi >= twoPi) phi -= twoPi;
100
101 // Eta granularity varies at endcap/FCAL
102
103 if (quadMod == s_extremeNegModule) eta = m_etasNegative[etaBin];
104 else if (quadMod == s_extremePosModule) eta = m_etasPositive[etaBin];
105 else {
106 const double etaBase = s_etaGran * s_etaBinsPerRow
107 * (quadMod - s_modulesPerQuadrant/2);
108 eta = etaBase + s_etaGran * (double(etaBin) + 0.5);
109 }
110
111 // Set layer to 1 for overlap channel, 0 for core
112 layer = (phiBin < 0 || phiBin > 7) ? 1 : 0;
113
114 return true;
115}
#define M_PI
Scalar eta() const
pseudorapidity method
Scalar phi() const
phi method
static const double s_etaGran
static const int s_crates
static const int s_extremeNegModule
static const int s_modules
static const double s_phiGran
static const int s_extremePosModule
static const int s_modulesPerQuadrant
@ layer
Definition HitInfo.h:79
setSAddress setEtaMS setDirPhiMS setDirZMS setBarrelRadius setEndcapAlpha setEndcapRadius setPhiMap phiBin
setSAddress setEtaMS setDirPhiMS setDirZMS setBarrelRadius setEndcapAlpha setEndcapRadius setInterceptInner setEtaMap etaBin

Member Data Documentation

◆ m_etasNegative

std::vector<double> LVL1::JemMappingTool::m_etasNegative
private

Definition at line 65 of file JemMappingTool.h.

◆ m_etasPositive

std::vector<double> LVL1::JemMappingTool::m_etasPositive
private

Definition at line 67 of file JemMappingTool.h.

◆ m_granNegative

std::vector<double> LVL1::JemMappingTool::m_granNegative
private

Definition at line 66 of file JemMappingTool.h.

◆ m_granPositive

std::vector<double> LVL1::JemMappingTool::m_granPositive
private

Definition at line 68 of file JemMappingTool.h.

◆ m_negChans

std::vector<int> LVL1::JemMappingTool::m_negChans
private

Definition at line 71 of file JemMappingTool.h.

◆ m_posChans

std::vector<int> LVL1::JemMappingTool::m_posChans
private

Definition at line 72 of file JemMappingTool.h.

◆ s_channels

const int LVL1::JemMappingTool::s_channels = 44
staticprivate

Definition at line 54 of file JemMappingTool.h.

◆ s_crates

const int LVL1::JemMappingTool::s_crates = 2
staticprivate

Definition at line 52 of file JemMappingTool.h.

◆ s_etaBinsPerRow

const int LVL1::JemMappingTool::s_etaBinsPerRow = 4
staticprivate

Definition at line 59 of file JemMappingTool.h.

◆ s_etaGran

const double LVL1::JemMappingTool::s_etaGran = 0.2
staticprivate

Definition at line 62 of file JemMappingTool.h.

◆ s_extremeNegModule

const int LVL1::JemMappingTool::s_extremeNegModule = 0
staticprivate

Definition at line 57 of file JemMappingTool.h.

◆ s_extremePosModule

const int LVL1::JemMappingTool::s_extremePosModule = 7
staticprivate

Definition at line 58 of file JemMappingTool.h.

◆ s_modules

const int LVL1::JemMappingTool::s_modules = 16
staticprivate

Definition at line 53 of file JemMappingTool.h.

◆ s_modulesPerQuadrant

const int LVL1::JemMappingTool::s_modulesPerQuadrant = 8
staticprivate

Definition at line 56 of file JemMappingTool.h.

◆ s_phiGran

const double LVL1::JemMappingTool::s_phiGran = M_PI/16.
staticprivate

Definition at line 61 of file JemMappingTool.h.


The documentation for this class was generated from the following files: