ATLAS Offline Software
Public Member Functions | Static Private Attributes | List of all members
LVL1::CpmMappingTool Class Reference

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

#include <CpmMappingTool.h>

Inheritance diagram for LVL1::CpmMappingTool:
Collaboration diagram for LVL1::CpmMappingTool:

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...
 

Static Private Attributes

static const int s_crates = 4
 
static const int s_modules = 14
 
static const int s_channels = 80
 
static const int s_etaBinsPerRow = 4
 
static const double s_phiGran = M_PI/32.
 
static const double s_etaGran = 0.1
 

Detailed Description

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

Layer indicates core/overlap

Source: "ATLAS Level-1 Calorimeter Trigger: Cluster Processor Module, Project Specification" version 2.03

Author
Peter Faulkner

Definition at line 32 of file CpmMappingTool.h.

Member Function Documentation

◆ finalize()

StatusCode LVL1::CpmMappingTool::finalize ( )
overridevirtual

Definition at line 35 of file CpmMappingTool.cxx.

36 {
37 
38  return StatusCode::SUCCESS;
39 }

◆ initialize()

StatusCode LVL1::CpmMappingTool::initialize ( )
overridevirtual

Definition at line 28 of file CpmMappingTool.cxx.

29 {
30  msg(MSG::INFO) << "Initializing " << name() << endmsg;
31 
32  return StatusCode::SUCCESS;
33 }

◆ mapping() [1/2]

bool LVL1::CpmMappingTool::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 84 of file CpmMappingTool.cxx.

86 {
87  // Not implemented
88  crate = 0;
89  module = 0;
90  channel = 0;
91  return false;
92 }

◆ mapping() [2/2]

bool LVL1::CpmMappingTool::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 43 of file CpmMappingTool.cxx.

45 {
46  if (crate < 0 || crate >= s_crates || module < 1 || module > s_modules ||
47  channel < 0 || channel >= s_channels) return false;
48 
49  // Channels numbered thus:
50  //
51  // : : : : :
52  // | 9 | 11 | 13 | 15 |
53  // | 8 | 10 | 12 | 14 | phi
54  // | 1 | 3 | 5 | 7 |
55  // | 0 | 2 | 4 | 6 |
56  // +----+----+----+----+
57  // eta
58 
59  const int etaBin = (channel / 2) % s_etaBinsPerRow;
60  const int phiBin = ((channel / 2) / s_etaBinsPerRow) * 2
61  + channel % 2 - 2; // allow for overlap
62 
63  // End modules only have one column
64  if ((module == 1 && etaBin != s_etaBinsPerRow - 1) ||
65  (module == s_modules && etaBin != 0)) return false;
66 
67  const double twoPi = 2.*M_PI;
68  const double phiBase = M_PI/2. * double(crate);
69  phi = phiBase + s_phiGran * (double(phiBin) + 0.5);
70  if (phi < 0.) phi += twoPi;
71  else if (phi >= twoPi) phi -= twoPi;
72 
73  const double etaBase = s_etaGran * s_etaBinsPerRow *
74  (module - 1 - s_modules/2);
75  eta = etaBase + s_etaGran * (double(etaBin) + 0.5);
76 
77  // Set layer to 1 for overlap channel, 0 for core
78  layer = (phiBin < 0 || phiBin > 15) ? 1 : 0;
79  return true;
80 }

Member Data Documentation

◆ s_channels

const int LVL1::CpmMappingTool::s_channels = 80
staticprivate

Definition at line 52 of file CpmMappingTool.h.

◆ s_crates

const int LVL1::CpmMappingTool::s_crates = 4
staticprivate

Definition at line 50 of file CpmMappingTool.h.

◆ s_etaBinsPerRow

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

Definition at line 54 of file CpmMappingTool.h.

◆ s_etaGran

const double LVL1::CpmMappingTool::s_etaGran = 0.1
staticprivate

Definition at line 57 of file CpmMappingTool.h.

◆ s_modules

const int LVL1::CpmMappingTool::s_modules = 14
staticprivate

Definition at line 51 of file CpmMappingTool.h.

◆ s_phiGran

const double LVL1::CpmMappingTool::s_phiGran = M_PI/32.
staticprivate

Definition at line 56 of file CpmMappingTool.h.


The documentation for this class was generated from the following files:
test_pyathena.eta
eta
Definition: test_pyathena.py:10
plotting.yearwise_efficiency.channel
channel
Definition: yearwise_efficiency.py:24
LVL1::CpmMappingTool::s_etaBinsPerRow
static const int s_etaBinsPerRow
Definition: CpmMappingTool.h:54
M_PI
#define M_PI
Definition: ActiveFraction.h:11
LVL1::CpmMappingTool::s_etaGran
static const double s_etaGran
Definition: CpmMappingTool.h:57
xAOD::phi
setEt phi
Definition: TrigEMCluster_v1.cxx:29
python.PyAthena.module
module
Definition: PyAthena.py:131
xAOD::etaBin
setSAddress setEtaMS setDirPhiMS setDirZMS setBarrelRadius setEndcapAlpha setEndcapRadius setInterceptInner setEtaMap etaBin
Definition: L2StandAloneMuon_v1.cxx:148
endmsg
#define endmsg
Definition: AnalysisConfig_Ntuple.cxx:63
TRT::Hit::layer
@ layer
Definition: HitInfo.h:79
LVL1::CpmMappingTool::s_modules
static const int s_modules
Definition: CpmMappingTool.h:51
xAOD::double
double
Definition: CompositeParticle_v1.cxx:159
LVL1::CpmMappingTool::s_crates
static const int s_crates
Definition: CpmMappingTool.h:50
name
std::string name
Definition: Control/AthContainers/Root/debug.cxx:228
xAOD::phiBin
setSAddress setEtaMS setDirPhiMS setDirZMS setBarrelRadius setEndcapAlpha setEndcapRadius setPhiMap phiBin
Definition: L2StandAloneMuon_v2.cxx:144
LVL1::CpmMappingTool::s_channels
static const int s_channels
Definition: CpmMappingTool.h:52
LVL1::CpmMappingTool::s_phiGran
static const double s_phiGran
Definition: CpmMappingTool.h:56
python.AutoConfigFlags.msg
msg
Definition: AutoConfigFlags.py:7