ATLAS Offline Software
Public Member Functions | Private Attributes | Static Private Attributes | List of all members
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. More...
 
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. More...
 

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 34 of file JemMappingTool.h.

Member Function Documentation

◆ finalize()

StatusCode LVL1::JemMappingTool::finalize ( )
overridevirtual

Definition at line 61 of file JemMappingTool.cxx.

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

◆ initialize()

StatusCode LVL1::JemMappingTool::initialize ( )
overridevirtual

Definition at line 32 of file JemMappingTool.cxx.

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

◆ 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 117 of file JemMappingTool.cxx.

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

◆ 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 69 of file JemMappingTool.cxx.

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

Member Data Documentation

◆ m_etasNegative

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

Definition at line 66 of file JemMappingTool.h.

◆ m_etasPositive

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

Definition at line 68 of file JemMappingTool.h.

◆ m_granNegative

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

Definition at line 67 of file JemMappingTool.h.

◆ m_granPositive

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

Definition at line 69 of file JemMappingTool.h.

◆ m_negChans

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

Definition at line 72 of file JemMappingTool.h.

◆ m_posChans

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

Definition at line 73 of file JemMappingTool.h.

◆ s_channels

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

Definition at line 55 of file JemMappingTool.h.

◆ s_crates

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

Definition at line 53 of file JemMappingTool.h.

◆ s_etaBinsPerRow

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

Definition at line 60 of file JemMappingTool.h.

◆ s_etaGran

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

Definition at line 63 of file JemMappingTool.h.

◆ s_extremeNegModule

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

Definition at line 58 of file JemMappingTool.h.

◆ s_extremePosModule

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

Definition at line 59 of file JemMappingTool.h.

◆ s_modules

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

Definition at line 54 of file JemMappingTool.h.

◆ s_modulesPerQuadrant

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

Definition at line 57 of file JemMappingTool.h.

◆ s_phiGran

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

Definition at line 62 of file JemMappingTool.h.


The documentation for this class was generated from the following files:
LVL1::JemMappingTool::s_etaGran
static const double s_etaGran
Definition: JemMappingTool.h:63
LVL1::JemMappingTool::s_etaBinsPerRow
static const int s_etaBinsPerRow
Definition: JemMappingTool.h:60
plotting.yearwise_efficiency.channel
channel
Definition: yearwise_efficiency.py:28
phi
Scalar phi() const
phi method
Definition: AmgMatrixBasePlugin.h:64
eta
Scalar eta() const
pseudorapidity method
Definition: AmgMatrixBasePlugin.h:79
M_PI
#define M_PI
Definition: ActiveFraction.h:11
LVL1::JemMappingTool::m_etasNegative
std::vector< double > m_etasNegative
Definition: JemMappingTool.h:66
LVL1::JemMappingTool::m_granNegative
std::vector< double > m_granNegative
Definition: JemMappingTool.h:67
LVL1::JemMappingTool::s_channels
static const int s_channels
Definition: JemMappingTool.h:55
python.PyAthena.module
module
Definition: PyAthena.py:134
xAOD::etaBin
setSAddress setEtaMS setDirPhiMS setDirZMS setBarrelRadius setEndcapAlpha setEndcapRadius setInterceptInner setEtaMap etaBin
Definition: L2StandAloneMuon_v1.cxx:148
LVL1::JemMappingTool::s_modules
static const int s_modules
Definition: JemMappingTool.h:54
ReadCellNoiseFromCool.chan
chan
Definition: ReadCellNoiseFromCool.py:52
endmsg
#define endmsg
Definition: AnalysisConfig_Ntuple.cxx:63
TRT::Hit::layer
@ layer
Definition: HitInfo.h:79
LVL1::JemMappingTool::m_negChans
std::vector< int > m_negChans
Definition: JemMappingTool.h:72
LVL1::JemMappingTool::s_extremePosModule
static const int s_extremePosModule
Definition: JemMappingTool.h:59
xAOD::double
double
Definition: CompositeParticle_v1.cxx:159
name
std::string name
Definition: Control/AthContainers/Root/debug.cxx:195
xAOD::phiBin
setSAddress setEtaMS setDirPhiMS setDirZMS setBarrelRadius setEndcapAlpha setEndcapRadius setPhiMap phiBin
Definition: L2StandAloneMuon_v2.cxx:144
LVL1::JemMappingTool::s_phiGran
static const double s_phiGran
Definition: JemMappingTool.h:62
LVL1::JemMappingTool::s_extremeNegModule
static const int s_extremeNegModule
Definition: JemMappingTool.h:58
LVL1::JemMappingTool::s_crates
static const int s_crates
Definition: JemMappingTool.h:53
LVL1::JemMappingTool::s_modulesPerQuadrant
static const int s_modulesPerQuadrant
Definition: JemMappingTool.h:57
LVL1::JemMappingTool::m_etasPositive
std::vector< double > m_etasPositive
Definition: JemMappingTool.h:68
LVL1::JemMappingTool::m_granPositive
std::vector< double > m_granPositive
Definition: JemMappingTool.h:69
python.AutoConfigFlags.msg
msg
Definition: AutoConfigFlags.py:7
LVL1::JemMappingTool::m_posChans
std::vector< int > m_posChans
Definition: JemMappingTool.h:73