ATLAS Offline Software
Toggle main menu visibility
Loading...
Searching...
No Matches
Trigger
TrigT1
TrigT1CaloCalibTools
src
L1CaloMatchCell2Tower.cxx
Go to the documentation of this file.
1
/*
2
* Copyright (C) 2002-2021 CERN for the benefit of the ATLAS collaboration.
3
*/
18
19
#include "
TrigT1CaloCalibTools/L1CaloMatchCell2Tower.h
"
20
#include "
TileConditions/TileCablingService.h
"
21
#include "
CaloEvent/CaloCell.h
"
22
#include "
CaloIdentifier/CaloIdManager.h
"
23
#include "
CaloIdentifier/TileID.h
"
24
#include "
CaloIdentifier/CaloLVL1_ID.h
"
25
#include "Identifier/Identifier.h"
26
#include "
StoreGate/ReadCondHandle.h
"
27
28
29
using namespace
LVL1
;
30
31
32
StatusCode
L1CaloMatchCell2Tower::initialize
()
33
{
34
ATH_CHECK
( detStore()->retrieve (
m_caloMgr
) );
35
ATH_CHECK
( detStore()->retrieve (
m_tileID
,
"TileID"
) );
36
ATH_CHECK
( detStore()->retrieve (
m_lvl1Helper
,
"CaloLVL1_ID"
) );
37
ATH_CHECK
(
m_cablingKey
.initialize() );
38
ATH_CHECK
(
m_ttSvc
.retrieve() );
39
m_tileCablingService
=
TileCablingService::getInstance
();
40
return
StatusCode::SUCCESS;
41
}
42
43
44
void
L1CaloMatchCell2Tower::matchCell2Tower
(
const
CaloCell
* caloCell,
45
Identifier
& ttId1,
46
Identifier
& ttId2)
const
47
{
48
SG::ReadCondHandle<LArOnOffIdMapping>
cabling (
m_cablingKey
);
49
matchCell2Tower
(**cabling, caloCell, ttId1, ttId2);
50
}
51
52
53
void
L1CaloMatchCell2Tower::matchCell2Tower
(
const
LArOnOffIdMapping
& cabling,
54
const
CaloCell
* caloCell,
55
Identifier
& ttId1,
56
Identifier
& ttId2)
const
57
{
58
const
Identifier
invalidId
(0);
59
ttId1 =
invalidId
;
60
ttId2 =
invalidId
;
61
const
Identifier
cellId(caloCell->
ID
());
62
63
const
CaloCell_ID
* caloCellHelper =
m_caloMgr
->getCaloCell_ID();
64
65
// Tile cells
66
if
(caloCellHelper->
is_tile
(cellId)) {
67
68
int
section
= caloCellHelper->
section
(cellId);
69
int
sample = caloCellHelper->
sample
(cellId);
70
71
// gap detector - D4 & C10 cells
72
// both pmt of D4 belong to the same TT
73
if
(
section
==3 && (sample==1 || sample==2) ) {
74
ttId1 =
m_tileCablingService
->cell2tt_id(cellId);
75
76
// barrel & ext. barrel - D cells
77
}
else
if
( (
section
==1 ||
section
==2) && sample==2) {
78
79
// special treatment of D-cells
80
// each pmt is affected to a different trigger tower
81
// each D-CaloCell is then added to 2 TT. This must ne taken into account when computing the TT energy
82
// from the CaloCells by dividing the D-cell energy by 2.
83
ttId1 =
m_tileCablingService
->pmt2tt_id(
m_tileID
->pmt_id(cellId, 0));
84
ttId2 =
m_tileCablingService
->pmt2tt_id(
m_tileID
->pmt_id(cellId, 1));
85
86
// barrel & ext. barrel - A & BC cells
87
}
else
if
( (
section
==1 ||
section
==2) && (sample==0 || sample==1) ) {
88
ttId1 =
m_tileCablingService
->cell2tt_id(cellId);
89
}
90
91
//LArg cells
92
}
else
{
93
//whichTTID ttId returns a layer_id, not a tower_id !
94
const
Identifier
layerId(
m_ttSvc
->whichTTID(cellId));
95
96
// We are not calling here m_ttSvc->is_in_lvl1(cellId) but use directly its code for a performance reason
97
// By doing so we save a redundant and costly call to m_ttSvc->whichTTID()
98
bool
lvl1(
true
);
99
if
(caloCellHelper->
is_em_barrel
(cellId)) {
100
int
samp=caloCellHelper->
sampling
(cellId);
101
if
(samp==0) {
102
int
eta
=caloCellHelper->
eta
(cellId);
103
if
(
eta
==60) {
104
lvl1 = false ;
105
}
106
}
107
}
else
{
108
if
(
m_lvl1Helper
->is_hec(layerId)) {
109
int
layer(
m_lvl1Helper
->layer(layerId));
110
if
(layer == 3){
111
lvl1 = false ;
112
}
113
}
114
}
115
116
if
(lvl1) {
117
// check if the channel is connected
118
HWIdentifier
channelID = cabling.createSignalChannelID(cellId);
119
if
(cabling.isOnlineConnected(channelID)) {
120
121
// As we don't want the layer information embedded in the identifier, we recreate a tower Id
122
ttId1 =
m_lvl1Helper
->tower_id(
m_lvl1Helper
->pos_neg_z(layerId),
m_lvl1Helper
->sampling(layerId),
m_lvl1Helper
->region(layerId),
m_lvl1Helper
->eta(layerId),
m_lvl1Helper
->phi(layerId));
123
}
124
}
125
}
126
127
}
eta
Scalar eta() const
pseudorapidity method
Definition
AmgMatrixBasePlugin.h:83
ATH_CHECK
#define ATH_CHECK
Evaluate an expression and check for errors.
Definition
AthCheckMacros.h:40
CaloCell.h
CaloIdManager.h
CaloLVL1_ID.h
invalidId
static const ITkStripOnlineId invalidId
Definition
ITkStripCablingTool.cxx:31
L1CaloMatchCell2Tower.h
Map from calo cells to trigger towers.
ReadCondHandle.h
section
void section(const std::string &sec)
Definition
TestTriggerMenuAccess.cxx:22
TileCablingService.h
TileID.h
CaloCell_Base_ID::sampling
int sampling(const Identifier id) const
LAr field values (NOT_VALID == invalid request).
CaloCell_Base_ID::section
int section(const Identifier id) const
Tile field values (NOT_VALID == invalid request).
CaloCell_Base_ID::is_em_barrel
bool is_em_barrel(const Identifier id) const
test if the id belongs to the EM barrel
CaloCell_Base_ID::sample
int sample(const Identifier id) const
Tile field values (NOT_VALID == invalid request).
CaloCell_Base_ID::is_tile
bool is_tile(const Identifier id) const
test if the id belongs to the Tiles
CaloCell_Base_ID::eta
int eta(const Identifier id) const
LAr field values (NOT_VALID == invalid request).
CaloCell_ID
Helper class for offline cell identifiers.
Definition
CaloCell_ID.h:34
CaloCell
Data object for each calorimeter readout cell.
Definition
CaloCell.h:57
CaloCell::ID
Identifier ID() const
get ID (from cached data member) non-virtual and inline for fast access
Definition
CaloCell.h:295
HWIdentifier
Definition
HWIdentifier.h:13
LArOnOffIdMapping
Definition
LArOnOffIdMapping.h:20
LVL1::L1CaloMatchCell2Tower::m_tileCablingService
const TileCablingService * m_tileCablingService
Definition
L1CaloMatchCell2Tower.h:61
LVL1::L1CaloMatchCell2Tower::m_ttSvc
ToolHandle< CaloTriggerTowerService > m_ttSvc
Definition
L1CaloMatchCell2Tower.h:64
LVL1::L1CaloMatchCell2Tower::m_lvl1Helper
const CaloLVL1_ID * m_lvl1Helper
Definition
L1CaloMatchCell2Tower.h:60
LVL1::L1CaloMatchCell2Tower::initialize
virtual StatusCode initialize() override
Definition
L1CaloMatchCell2Tower.cxx:32
LVL1::L1CaloMatchCell2Tower::m_caloMgr
const CaloIdManager * m_caloMgr
Definition
L1CaloMatchCell2Tower.h:58
LVL1::L1CaloMatchCell2Tower::m_cablingKey
SG::ReadCondHandleKey< LArOnOffIdMapping > m_cablingKey
Definition
L1CaloMatchCell2Tower.h:67
LVL1::L1CaloMatchCell2Tower::m_tileID
const TileID * m_tileID
Definition
L1CaloMatchCell2Tower.h:59
LVL1::L1CaloMatchCell2Tower::matchCell2Tower
virtual void matchCell2Tower(const CaloCell *caloCell, Identifier &ttId1, Identifier &ttId2) const override
Definition
L1CaloMatchCell2Tower.cxx:44
SG::ReadCondHandle
Definition
ReadCondHandle.h:40
TileCablingService::getInstance
static const TileCablingService * getInstance()
get pointer to service instance
Definition
TileCablingService.cxx:24
Identifier
Definition
IdentifierFieldParser.cxx:14
LVL1
eFexTowerBuilder creates xAOD::eFexTowerContainer from supercells (LATOME) and triggerTowers (TREX) i...
Definition
IZdcDataAccess.h:13
Generated on
for ATLAS Offline Software by
1.17.0