ATLAS Offline Software
Toggle main menu visibility
Loading...
Searching...
No Matches
Trigger
TrigT1
TrigT1CaloMappingTools
src
CpmMappingTool.cxx
Go to the documentation of this file.
1
/*
2
Copyright (C) 2002-2021 CERN for the benefit of the ATLAS collaboration
3
*/
4
5
#include <cmath>
6
7
#include "GaudiKernel/IInterface.h"
8
#include "GaudiKernel/MsgStream.h"
9
#include "GaudiKernel/StatusCode.h"
10
11
#include "
CpmMappingTool.h
"
12
13
namespace
LVL1
{
14
15
// Static constants
16
17
const
int
CpmMappingTool::s_crates
;
18
const
int
CpmMappingTool::s_modules
;
19
const
int
CpmMappingTool::s_channels
;
20
21
const
int
CpmMappingTool::s_etaBinsPerRow
;
22
23
const
double
CpmMappingTool::s_etaGran
= 0.1;
24
const
double
CpmMappingTool::s_phiGran
=
M_PI
/32.;
25
26
// Initialise the mappings
27
28
StatusCode
CpmMappingTool::initialize
()
29
{
30
msg
(MSG::INFO) <<
"Initializing "
<<
name
() <<
endmsg
;
31
32
return
StatusCode::SUCCESS;
33
}
34
35
StatusCode
CpmMappingTool::finalize
()
36
{
37
38
return
StatusCode::SUCCESS;
39
}
40
41
// Return eta, phi and layer mapping for given crate/module/channel
42
43
bool
CpmMappingTool::mapping
(
const
int
crate,
const
int
module,
44
const
int
channel,
double
&
eta
,
double
&
phi
,
int
& layer)
const
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
}
81
82
// Return crate, module and channel mapping for given eta/phi/layer
83
84
bool
CpmMappingTool::mapping
(
const
double
/*eta*/
,
const
double
/*phi*/
,
85
const
int
/*layer*/
,
int
& crate,
int
& module,
int
& channel)
const
86
{
87
// Not implemented
88
crate = 0;
89
module
= 0;
90
channel = 0;
91
return
false
;
92
}
93
94
}
// end namespace
M_PI
#define M_PI
Definition
ActiveFraction.h:14
eta
Scalar eta() const
pseudorapidity method
Definition
AmgMatrixBasePlugin.h:83
phi
Scalar phi() const
phi method
Definition
AmgMatrixBasePlugin.h:67
endmsg
#define endmsg
Definition
AnalysisConfig_Ntuple.cxx:54
CpmMappingTool.h
LVL1::CpmMappingTool::s_etaBinsPerRow
static const int s_etaBinsPerRow
Definition
CpmMappingTool.h:54
LVL1::CpmMappingTool::s_channels
static const int s_channels
Definition
CpmMappingTool.h:52
LVL1::CpmMappingTool::finalize
virtual StatusCode finalize() override
Definition
CpmMappingTool.cxx:35
LVL1::CpmMappingTool::initialize
virtual StatusCode initialize() override
Definition
CpmMappingTool.cxx:28
LVL1::CpmMappingTool::s_modules
static const int s_modules
Definition
CpmMappingTool.h:51
LVL1::CpmMappingTool::s_etaGran
static const double s_etaGran
Definition
CpmMappingTool.h:57
LVL1::CpmMappingTool::s_crates
static const int s_crates
Definition
CpmMappingTool.h:50
LVL1::CpmMappingTool::mapping
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.
Definition
CpmMappingTool.cxx:43
LVL1::CpmMappingTool::s_phiGran
static const double s_phiGran
Definition
CpmMappingTool.h:56
LVL1
eFexTowerBuilder creates xAOD::eFexTowerContainer from supercells (LATOME) and triggerTowers (TREX) i...
Definition
IZdcDataAccess.h:13
TrigConf::name
Definition
HLTChainList.h:35
msg
MsgStream & msg
Definition
testRead.cxx:32
Generated on
for ATLAS Offline Software by
1.17.0