ATLAS Offline Software
Toggle main menu visibility
Loading...
Searching...
No Matches
TileCalorimeter
TileMonitoring
src
TileMonitorAlgorithm.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 "
TileMonitorAlgorithm.h
"
6
7
#include "
CaloEvent/CaloCell.h
"
8
#include "
CaloIdentifier/TileID.h
"
9
10
StatusCode
TileMonitorAlgorithm::initialize
() {
11
12
int
triggerIdx(0);
13
for
(
const
std::string& triggerName :
m_fillHistogramsForL1Triggers
) {
14
L1TriggerTypeBit
trigger =
getL1TriggerTypeBitFromName
(triggerName);
15
m_l1Triggers
.push_back(trigger);
16
m_l1TriggerIndices
[trigger] = triggerIdx;
17
++triggerIdx;
18
}
19
20
if
(
msgLvl
(MSG::INFO)) {
21
msg
(MSG::INFO) <<
"Will fill histograms for L1 triggers:"
;
22
for
(
int
l1TriggerIdx :
m_l1TriggerIndices
) {
23
if
(l1TriggerIdx >= 0) {
24
msg
(MSG::INFO) <<
" "
<<
m_l1TriggerBitNames
[l1TriggerIdx] <<
"["
<< l1TriggerIdx <<
"]"
;
25
}
26
}
27
msg
(MSG::INFO) <<
endmsg
;
28
}
29
30
return
AthMonitorAlgorithm::initialize
();
31
}
32
33
34
TileMonitorAlgorithm::L1TriggerTypeBit
35
TileMonitorAlgorithm::getL1TriggerTypeBitFromName
(
const
std::string& triggerBitName)
const
{
36
37
// Convert the triger name to lower case
38
std::string loCaseTriggerBitName = triggerBitName;
39
std::transform(triggerBitName.begin(), triggerBitName.end(), loCaseTriggerBitName.begin(),
::tolower
);
40
41
if
( loCaseTriggerBitName ==
"bit0_rndm"
) {
42
return
L1TriggerTypeBit::BIT0_RNDM
;
43
}
else
if
( loCaseTriggerBitName ==
"bit1_zerobias"
) {
44
return
L1TriggerTypeBit::BIT1_ZEROBIAS
;
45
}
else
if
( loCaseTriggerBitName ==
"bit2_l1cal"
) {
46
return
L1TriggerTypeBit::BIT2_L1CAL
;
47
}
else
if
( loCaseTriggerBitName ==
"bit3_muon"
) {
48
return
L1TriggerTypeBit::BIT3_MUON
;
49
}
else
if
( loCaseTriggerBitName ==
"bit4_rpc"
) {
50
return
L1TriggerTypeBit::BIT4_RPC
;
51
}
else
if
( loCaseTriggerBitName ==
"bit5_ftk"
) {
52
return
L1TriggerTypeBit::BIT5_FTK
;
53
}
else
if
( loCaseTriggerBitName ==
"bit6_ctp"
) {
54
return
L1TriggerTypeBit::BIT6_CTP
;
55
}
else
if
( loCaseTriggerBitName ==
"bit7_calib"
) {
56
return
L1TriggerTypeBit::BIT7_CALIB
;
57
}
else
if
( loCaseTriggerBitName ==
"anyphystrig"
) {
58
return
L1TriggerTypeBit::ANY_PHYSICS
;
59
}
else
{
// Otherwise, warn the user and return "AnyPhysTrig"
60
ATH_MSG_WARNING
(
"::getL1TriggerTypeBitFromName(): Unknown L1 trigger type bit name: "
61
<< triggerBitName <<
", returning AnyPhysTrig."
);
62
return
L1TriggerTypeBit::ANY_PHYSICS
;
63
}
64
}
65
66
67
std::vector<int>
TileMonitorAlgorithm::getL1TriggerIndices
(uint32_t lvl1TriggerType)
const
{
68
69
std::vector<int> triggerIndices;
70
int
triggerIdx{-1};
71
72
if
(lvl1TriggerType != 0) {
73
// First bit tells if physics (=1) or calibration (=0) event
74
if
((lvl1TriggerType >>
BIT7_CALIB
) & 1) {
// format is 0x1AAAAAAA
75
// Always try store at least AnyPhysTrig (=8)
76
triggerIdx =
m_l1TriggerIndices
[
ANY_PHYSICS
];
77
if
(triggerIdx >= 0) triggerIndices.push_back(triggerIdx);
78
// Adding the phys triggers one by one
79
for
(
int
bitTrigger = 0; bitTrigger <
BIT7_CALIB
; ++bitTrigger) {
80
if
((lvl1TriggerType >> bitTrigger) & 1) {
81
triggerIdx =
m_l1TriggerIndices
[bitTrigger];
82
if
(triggerIdx >= 0) triggerIndices.push_back(triggerIdx);
83
}
84
}
85
}
else
{
// Calibration event foramt is 0x0AAAAAAA
86
triggerIdx =
m_l1TriggerIndices
[
BIT7_CALIB
];
87
if
(triggerIdx >= 0) triggerIndices.push_back(triggerIdx);
88
}
89
}
else
{
90
// Always try store at least AnyPhysTrig (=8)
91
triggerIdx =
m_l1TriggerIndices
[
ANY_PHYSICS
];
92
if
(triggerIdx >= 0) triggerIndices.push_back(triggerIdx);
93
}
94
95
return
triggerIndices;
96
}
97
98
bool
TileMonitorAlgorithm::isPhysicsEvent
(uint32_t lvl1TriggerType)
const
{
99
// First bit tells if physics (=1) or calibration (=0) event
100
return
(lvl1TriggerType == 0) || (((lvl1TriggerType >>
BIT7_CALIB
) & 1) == 1);
101
}
102
103
TileMonitorAlgorithm::L1TriggerTypeBit
104
TileMonitorAlgorithm::getL1TriggerTypeBit
(
int
lvl1TriggerIdx)
const
{
105
return
m_l1Triggers
.at(lvl1TriggerIdx);
106
}
107
108
TileMonitorAlgorithm::Partition
109
TileMonitorAlgorithm::getPartition
(
const
CaloCell
* cell,
const
TileID
* tileID)
const
{
110
return
cell ?
getPartition
(cell->ID(), tileID) :
MAX_PART
;
111
}
112
113
TileMonitorAlgorithm::Partition
114
TileMonitorAlgorithm::getPartition
(
IdentifierHash
hash,
const
TileID
* tileID)
const
{
115
return
getPartition
(tileID->
cell_id
(hash), tileID);
116
}
117
118
119
TileMonitorAlgorithm::Partition
120
TileMonitorAlgorithm::getPartition
(
Identifier
id
,
const
TileID
* tileID)
const
{
121
122
Partition
partition =
MAX_PART
;
// by default for non Tile cell
123
124
if
(tileID->
is_tile
(
id
)) {
125
int
section
= tileID->
section
(
id
);
126
int
side = tileID->
side
(
id
);
127
128
if
(
section
== 1) {
129
partition = (side == 1) ?
PART_LBA
:
PART_LBC
;
130
}
else
if
(
section
== 2 ||
section
== 3) {
131
partition = (side == 1) ?
PART_EBA
:
PART_EBC
;
132
}
133
}
134
135
return
partition;
136
}
137
endmsg
#define endmsg
Definition
AnalysisConfig_Ntuple.cxx:61
ATH_MSG_WARNING
#define ATH_MSG_WARNING(x)
Definition
AthMsgStreamMacros.h:32
tolower
void tolower(std::string &s)
Definition
AthenaSummarySvc.cxx:100
CaloCell.h
section
void section(const std::string &sec)
Definition
TestTriggerMenuAccess.cxx:22
TileID.h
TileMonitorAlgorithm.h
AthCommonAlgorithm< Gaudi::Algorithm >::msgLvl
bool msgLvl(const MSG::Level lvl) const
Definition
AthCommonMsg.h:30
AthCommonAlgorithm< Gaudi::Algorithm >::msg
MsgStream & msg() const
Definition
AthCommonMsg.h:24
AthMonitorAlgorithm::initialize
virtual StatusCode initialize() override
initialize
Definition
AthMonitorAlgorithm.cxx:22
AtlasDetectorID::is_tile
bool is_tile(Identifier id) const
Definition
AtlasDetectorID.h:538
CaloCell
Data object for each calorimeter readout cell.
Definition
CaloCell.h:57
IdentifierHash
This is a "hash" representation of an Identifier.
Definition
IdentifierHash.h:25
TileID
Helper class for TileCal offline identifiers.
Definition
TileID.h:67
TileMonitorAlgorithm::m_l1TriggerIndices
std::vector< int > m_l1TriggerIndices
Definition
TileMonitorAlgorithm.h:104
TileMonitorAlgorithm::m_l1Triggers
std::vector< L1TriggerTypeBit > m_l1Triggers
Definition
TileMonitorAlgorithm.h:103
TileMonitorAlgorithm::Partition
Partition
Describes Tile partitions (ROS - 1).
Definition
TileMonitorAlgorithm.h:48
TileMonitorAlgorithm::PART_EBC
@ PART_EBC
Definition
TileMonitorAlgorithm.h:49
TileMonitorAlgorithm::PART_LBA
@ PART_LBA
Definition
TileMonitorAlgorithm.h:48
TileMonitorAlgorithm::PART_LBC
@ PART_LBC
Definition
TileMonitorAlgorithm.h:48
TileMonitorAlgorithm::MAX_PART
@ MAX_PART
Definition
TileMonitorAlgorithm.h:49
TileMonitorAlgorithm::PART_EBA
@ PART_EBA
Definition
TileMonitorAlgorithm.h:48
TileMonitorAlgorithm::m_fillHistogramsForL1Triggers
Gaudi::Property< std::vector< std::string > > m_fillHistogramsForL1Triggers
Definition
TileMonitorAlgorithm.h:100
TileMonitorAlgorithm::getL1TriggerTypeBitFromName
L1TriggerTypeBit getL1TriggerTypeBitFromName(const std::string &triggerBitName) const
Definition
TileMonitorAlgorithm.cxx:35
TileMonitorAlgorithm::initialize
virtual StatusCode initialize() override
initialize
Definition
TileMonitorAlgorithm.cxx:10
TileMonitorAlgorithm::getL1TriggerIndices
std::vector< int > getL1TriggerIndices(uint32_t lvl1TriggerType) const
Return indices of histograms to be filled according fired L1 trigger type.
Definition
TileMonitorAlgorithm.cxx:67
TileMonitorAlgorithm::L1TriggerTypeBit
L1TriggerTypeBit
Describes L1 trigger type bits.
Definition
TileMonitorAlgorithm.h:35
TileMonitorAlgorithm::BIT1_ZEROBIAS
@ BIT1_ZEROBIAS
Definition
TileMonitorAlgorithm.h:35
TileMonitorAlgorithm::BIT3_MUON
@ BIT3_MUON
Definition
TileMonitorAlgorithm.h:35
TileMonitorAlgorithm::BIT0_RNDM
@ BIT0_RNDM
Definition
TileMonitorAlgorithm.h:35
TileMonitorAlgorithm::BIT7_CALIB
@ BIT7_CALIB
Definition
TileMonitorAlgorithm.h:36
TileMonitorAlgorithm::BIT5_FTK
@ BIT5_FTK
Definition
TileMonitorAlgorithm.h:36
TileMonitorAlgorithm::BIT6_CTP
@ BIT6_CTP
Definition
TileMonitorAlgorithm.h:36
TileMonitorAlgorithm::BIT4_RPC
@ BIT4_RPC
Definition
TileMonitorAlgorithm.h:36
TileMonitorAlgorithm::BIT2_L1CAL
@ BIT2_L1CAL
Definition
TileMonitorAlgorithm.h:35
TileMonitorAlgorithm::ANY_PHYSICS
@ ANY_PHYSICS
Definition
TileMonitorAlgorithm.h:36
TileMonitorAlgorithm::getL1TriggerTypeBit
L1TriggerTypeBit getL1TriggerTypeBit(int lvl1TriggerIdx) const
Return Level1 Trigger type bit according trigger index.
Definition
TileMonitorAlgorithm.cxx:104
TileMonitorAlgorithm::isPhysicsEvent
bool isPhysicsEvent(uint32_t lvl1TriggerType) const
Return true if it is physics event or false for calibration event.
Definition
TileMonitorAlgorithm.cxx:98
TileMonitorAlgorithm::getPartition
Partition getPartition(const CaloCell *cell, const TileID *tileID) const
Return Partition for Tile cell or MAX_PART otherwise.
Definition
TileMonitorAlgorithm.cxx:109
TileMonitorAlgorithm::m_l1TriggerBitNames
std::vector< std::string > m_l1TriggerBitNames
Definition
TileMonitorAlgorithm.h:105
Tile_Base_ID::cell_id
Identifier cell_id(const Identifier &any_id) const
Definition
Tile_Base_ID.cxx:583
Tile_Base_ID::side
int side(const Identifier &id) const
Definition
Tile_Base_ID.cxx:155
Tile_Base_ID::section
int section(const Identifier &id) const
Definition
Tile_Base_ID.cxx:149
Identifier
Definition
IdentifierFieldParser.cxx:14
Generated on
for ATLAS Offline Software by
1.17.0