ATLAS Offline Software
Toggle main menu visibility
Loading...
Searching...
No Matches
MuonSpectrometer
MuonCalib
MuonCalibExtraTree
MuonCalibExtraTreeEvent
src
MuonCalibTriggerInfo.cxx
Go to the documentation of this file.
1
/*
2
Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration
3
*/
4
5
#include "
MuonCalibExtraTreeEvent/MuonCalibTriggerInfo.h
"
6
7
#include <iostream>
8
9
#include "
AthenaKernel/getMessageSvc.h
"
10
#include "GaudiKernel/MsgStream.h"
11
12
namespace
MuonCalib
{
13
14
std::vector<std::pair<std::vector<int>, std::string> >
MuonCalibTriggerTypeHelper::m_typeToBitAndStringMapping
;
15
16
std::vector<int>
MuonCalibTriggerTypeHelper::triggerBits
(
MuonCalibTriggerType
type
) {
17
initMap
();
18
if
(!
validType
(
type
))
type
=
NUMBEROFKNOWNTRIGGERS
;
19
return
m_typeToBitAndStringMapping
[
type
].first;
20
}
21
22
std::string
MuonCalibTriggerTypeHelper::itemName
(
MuonCalibTriggerType
type
) {
23
initMap
();
24
if
(!
validType
(
type
))
type
=
NUMBEROFKNOWNTRIGGERS
;
25
return
m_typeToBitAndStringMapping
[
type
].second;
26
}
27
28
bool
MuonCalibTriggerTypeHelper::validType
(
MuonCalibTriggerType
type
) {
return
(
type
>=
L1_EM3
&&
type
<
NUMBEROFKNOWNTRIGGERS
); }
29
30
bool
MuonCalibTriggerTypeHelper::isRpcTrigger
(
MuonCalibTriggerType
type
) {
31
if
(
type
==
L1_MU0_LOW_RPC
||
type
==
L1_MU6_RPC
||
type
==
L1_MU0_HIGH_RPC
)
return
true
;
32
return
false
;
33
}
34
35
bool
MuonCalibTriggerTypeHelper::isTgcTrigger
(
MuonCalibTriggerType
type
) {
36
if
(
type
==
L1_MU0_TGC_HALO
||
type
==
L1_MU0_TGC
||
type
==
L1_MU6_TGC
)
return
true
;
37
return
false
;
38
}
39
40
bool
MuonCalibTriggerTypeHelper::isMbtsTrigger
(
MuonCalibTriggerType
type
) {
41
if
(
type
==
L1_MBTS_1_COMM
||
type
==
L1_MBTS_2_COMM
)
return
true
;
42
return
false
;
43
}
44
45
bool
MuonCalibTriggerTypeHelper::isLVL1CaloTrigger
(
MuonCalibTriggerType
type
) {
46
if
(
type
==
L1_EM3
||
type
==
L1_TAU5
||
type
==
L1_J5
||
type
==
L1_XE20
)
return
true
;
47
return
false
;
48
}
49
50
void
MuonCalibTriggerTypeHelper::addEntry
(
MuonCalibTriggerType
type
,
int
bit,
const
std::string& name) {
51
if
(!
validType
(
type
)) {
52
MsgStream log(
Athena::getMessageSvc
(),
"MuonCalibTriggerTypeHelper"
);
53
log << MSG::WARNING <<
"MuonCalibTriggerTypeHelper::addEntry -> invalid trigger type"
<<
endmsg
;
54
return
;
55
}
56
std::vector<int> bits;
57
bits.push_back(bit);
58
m_typeToBitAndStringMapping
[
type
] = std::make_pair(bits, name);
59
}
60
61
void
MuonCalibTriggerTypeHelper::addEntry
(
MuonCalibTriggerType
type
, std::vector<int>& bits,
const
std::string& name) {
62
if
(!
validType
(
type
)) {
63
MsgStream log(
Athena::getMessageSvc
(),
"MuonCalibTriggerTypeHelper"
);
64
log << MSG::WARNING <<
"MuonCalibTriggerTypeHelper::addEntry -> invalid trigger type"
<<
endmsg
;
65
return
;
66
}
67
m_typeToBitAndStringMapping
[
type
] = std::make_pair(bits, name);
68
}
69
70
void
MuonCalibTriggerTypeHelper::initMap
() {
71
if
(!
m_typeToBitAndStringMapping
.empty())
return
;
72
m_typeToBitAndStringMapping
.resize(
NUMBEROFKNOWNTRIGGERS
+ 1);
73
74
addEntry
(
L1_EM3
, 0,
"L1_EM3"
);
75
addEntry
(
L1_TAU5
, 64,
"L1_TAU5"
);
76
addEntry
(
L1_J5
, 96,
"L1_J5"
);
77
addEntry
(
L1_XE20
, 129,
"L1_XE20"
);
78
79
std::vector<int> bits;
80
bits.push_back(23);
81
for
(
int
i = 30; i <= 45; ++i) bits.push_back(i);
82
addEntry
(
L1_MBTS_1_COMM
, bits,
"L1_MBTS_1_COMM"
);
83
84
bits.clear();
85
bits.push_back(24);
86
for
(
int
i = 46; i <= 61; ++i) bits.push_back(i);
87
addEntry
(
L1_MBTS_2_COMM
, bits,
"L1_MBTS_2_COMM"
);
88
addEntry
(
L1_MU0_LOW_RPC
, 89,
"L1_MU0_LOW_RPC"
);
89
addEntry
(
L1_MU6_RPC
, 90,
"L1_MU6_RPC"
);
90
addEntry
(
L1_MU0_HIGH_RPC
, 93,
"L1_MU0_HIGH_RPC"
);
91
addEntry
(
L1_MU0_TGC_HALO
, 88,
"L1_MU0_TGC_HALO"
);
92
addEntry
(
L1_MU0_TGC
, 91,
"L1_MU0_TGC"
);
93
addEntry
(
L1_MU6_TGC
, 92,
"L1_MU6_TGC"
);
94
addEntry
(
NUMBEROFKNOWNTRIGGERS
, -1,
"UNKNOWN"
);
95
}
96
97
MuonCalibTriggerInfo::MuonCalibTriggerInfo
() :
98
m_type
(
UNKNOWNTRIGGERTYPE
),
m_tbpbit
(0),
m_tapbit
(0),
m_tavbit
(0),
m_delay
(0.),
m_bcIndex
(0) {}
99
100
MuonCalibTriggerInfo::MuonCalibTriggerInfo
(
MuonCalibTriggerType
type
,
double
delay
) :
101
m_type
(
type
),
m_tbpbit
(0),
m_tapbit
(0),
m_tavbit
(0),
m_delay
(
delay
),
m_bcIndex
(0) {}
102
103
MuonCalibTriggerInfo::MuonCalibTriggerInfo
(
int
tbpbit,
int
tapbit,
int
tavbit,
int
bcIndex
) :
104
m_type
(
UNKNOWNTRIGGERTYPE
),
m_tbpbit
(tbpbit),
m_tapbit
(tapbit),
m_tavbit
(tavbit),
m_delay
(0.),
m_bcIndex
(
bcIndex
) {}
105
106
void
MuonCalibTriggerTypeHelper::dumpMapping
() {
107
initMap
();
108
MsgStream log(
Athena::getMessageSvc
(),
"MuonCalibTriggerTypeHelper"
);
109
log << MSG::INFO <<
"MuonCalibTriggerTypeHelper::dumpMapping, map size "
<<
m_typeToBitAndStringMapping
.size() <<
endmsg
;
110
std::vector<std::pair<std::vector<int>, std::string> >
::const_iterator
it =
m_typeToBitAndStringMapping
.begin();
111
std::vector<std::pair<std::vector<int>, std::string> >
::const_iterator
it_end =
m_typeToBitAndStringMapping
.end();
112
int
index
= 0;
113
for
(; it != it_end; ++it) {
114
log << MSG::INFO <<
"index "
<<
index
++ <<
" type "
<< it->second <<
" nbits "
<< it->first.size() <<
" bits "
<<
endmsg
;
115
for
(
unsigned
int
i = 0; i < it->first.size(); ++i) { log << MSG::INFO <<
" "
<< it->first[i] <<
endmsg
; }
116
}
117
}
118
119
}
// namespace MuonCalib
endmsg
#define endmsg
Definition
AnalysisConfig_Ntuple.cxx:54
MuonCalibTriggerInfo.h
const_iterator
MuonCalib::MuonCalibTriggerInfo::m_tavbit
int m_tavbit
trig bit after veto
Definition
MuonCalibTriggerInfo.h:109
MuonCalib::MuonCalibTriggerInfo::MuonCalibTriggerInfo
MuonCalibTriggerInfo()
default constructor
Definition
MuonCalibTriggerInfo.cxx:97
MuonCalib::MuonCalibTriggerInfo::m_bcIndex
int m_bcIndex
trig bc Index
Definition
MuonCalibTriggerInfo.h:111
MuonCalib::MuonCalibTriggerInfo::type
MuonCalibTriggerType type() const
destructor
Definition
MuonCalibTriggerInfo.h:82
MuonCalib::MuonCalibTriggerInfo::m_type
MuonCalibTriggerType m_type
type
Definition
MuonCalibTriggerInfo.h:106
MuonCalib::MuonCalibTriggerInfo::bcIndex
int bcIndex() const
return the bcIndex of the trigger
Definition
MuonCalibTriggerInfo.h:97
MuonCalib::MuonCalibTriggerInfo::m_delay
double m_delay
delay of signal wrt firing trigger
Definition
MuonCalibTriggerInfo.h:110
MuonCalib::MuonCalibTriggerInfo::m_tbpbit
int m_tbpbit
trig bit before pre-scale
Definition
MuonCalibTriggerInfo.h:107
MuonCalib::MuonCalibTriggerInfo::m_tapbit
int m_tapbit
trig bit after pre-scale
Definition
MuonCalibTriggerInfo.h:108
MuonCalib::MuonCalibTriggerInfo::delay
double delay() const
return the delay of the signal wrt firing trigger
Definition
MuonCalibTriggerInfo.h:94
MuonCalib::MuonCalibTriggerTypeHelper::m_typeToBitAndStringMapping
static std::vector< std::pair< std::vector< int >, std::string > > m_typeToBitAndStringMapping
Definition
MuonCalibTriggerInfo.h:64
MuonCalib::MuonCalibTriggerTypeHelper::itemName
static std::string itemName(MuonCalibTriggerType type)
get trigger bit for a given type
Definition
MuonCalibTriggerInfo.cxx:22
MuonCalib::MuonCalibTriggerTypeHelper::isLVL1CaloTrigger
static bool isLVL1CaloTrigger(MuonCalibTriggerType type)
check whether type is valid
Definition
MuonCalibTriggerInfo.cxx:45
MuonCalib::MuonCalibTriggerTypeHelper::isMbtsTrigger
static bool isMbtsTrigger(MuonCalibTriggerType type)
check whether type is valid
Definition
MuonCalibTriggerInfo.cxx:40
MuonCalib::MuonCalibTriggerTypeHelper::isTgcTrigger
static bool isTgcTrigger(MuonCalibTriggerType type)
check whether type is valid
Definition
MuonCalibTriggerInfo.cxx:35
MuonCalib::MuonCalibTriggerTypeHelper::triggerBits
static std::vector< int > triggerBits(MuonCalibTriggerType type)
get trigger bit for a given type
Definition
MuonCalibTriggerInfo.cxx:16
MuonCalib::MuonCalibTriggerTypeHelper::validType
static bool validType(MuonCalibTriggerType type)
check whether type is valid
Definition
MuonCalibTriggerInfo.cxx:28
MuonCalib::MuonCalibTriggerTypeHelper::dumpMapping
static void dumpMapping()
dump mapping
Definition
MuonCalibTriggerInfo.cxx:106
MuonCalib::MuonCalibTriggerTypeHelper::initMap
static void initMap()
Definition
MuonCalibTriggerInfo.cxx:70
MuonCalib::MuonCalibTriggerTypeHelper::addEntry
static void addEntry(MuonCalibTriggerType type, int bit, const std::string &name)
Definition
MuonCalibTriggerInfo.cxx:50
MuonCalib::MuonCalibTriggerTypeHelper::isRpcTrigger
static bool isRpcTrigger(MuonCalibTriggerType type)
check whether type is valid
Definition
MuonCalibTriggerInfo.cxx:30
getMessageSvc.h
singleton-like access to IMessageSvc via open function and helper
Athena::getMessageSvc
IMessageSvc * getMessageSvc(bool quiet=false)
Definition
getMessageSvc.cxx:20
MuonCalib
CscCalcPed - algorithm that finds the Cathode Strip Chamber pedestals from an RDO.
Definition
CscCalcPed.cxx:21
MuonCalib::MuonCalibTriggerType
MuonCalibTriggerType
enum for all trigger type
Definition
MuonCalibTriggerInfo.h:16
MuonCalib::L1_MU0_TGC
@ L1_MU0_TGC
Definition
MuonCalibTriggerInfo.h:27
MuonCalib::L1_MU0_HIGH_RPC
@ L1_MU0_HIGH_RPC
Definition
MuonCalibTriggerInfo.h:25
MuonCalib::L1_MU0_TGC_HALO
@ L1_MU0_TGC_HALO
Definition
MuonCalibTriggerInfo.h:26
MuonCalib::L1_MU6_RPC
@ L1_MU6_RPC
Definition
MuonCalibTriggerInfo.h:24
MuonCalib::UNKNOWNTRIGGERTYPE
@ UNKNOWNTRIGGERTYPE
Definition
MuonCalibTriggerInfo.h:30
MuonCalib::L1_MU0_LOW_RPC
@ L1_MU0_LOW_RPC
Definition
MuonCalibTriggerInfo.h:23
MuonCalib::L1_XE20
@ L1_XE20
Definition
MuonCalibTriggerInfo.h:20
MuonCalib::NUMBEROFKNOWNTRIGGERS
@ NUMBEROFKNOWNTRIGGERS
Definition
MuonCalibTriggerInfo.h:29
MuonCalib::L1_J5
@ L1_J5
Definition
MuonCalibTriggerInfo.h:19
MuonCalib::L1_MBTS_1_COMM
@ L1_MBTS_1_COMM
Definition
MuonCalibTriggerInfo.h:21
MuonCalib::L1_TAU5
@ L1_TAU5
Definition
MuonCalibTriggerInfo.h:18
MuonCalib::L1_MBTS_2_COMM
@ L1_MBTS_2_COMM
Definition
MuonCalibTriggerInfo.h:22
MuonCalib::L1_EM3
@ L1_EM3
Definition
MuonCalibTriggerInfo.h:17
MuonCalib::L1_MU6_TGC
@ L1_MU6_TGC
Definition
MuonCalibTriggerInfo.h:28
index
Definition
index.py:1
type
Generated on
for ATLAS Offline Software by
1.17.0