ATLAS Offline Software
Toggle main menu visibility
Loading...
Searching...
No Matches
Trigger
TrigT1
L1Topo
L1TopoInterfaces
Root
Decision.cxx
Go to the documentation of this file.
1
/*
2
Copyright (C) 2002-2026 CERN for the benefit of the ATLAS collaboration
3
*/
4
// Decision.cxx
5
// TopoCore
6
// Created by Joerg Stelzer on 11/16/12.
7
8
#include "
L1TopoInterfaces/Decision.h
"
9
#include "
L1TopoCommon/Exception.h
"
10
11
void
12
TCS::Decision::setBit
(
unsigned
int
index
,
bool
set
) {
13
if
(
index
>=
m_nBits
) {
14
TCS_EXCEPTION
(
"Trying to set bit "
<<
index
<<
", while max index allowed is "
<<
m_nBits
-1);
15
}
16
if
(
set
) {
17
m_decision
|= (0x1<<
index
);
18
}
else
{
19
m_decision
&= ~(0x1<<
index
);
20
}
21
}
22
23
std::ostream &
24
operator<<
(std::ostream & o,
const
TCS::Decision
& dec) {
25
unsigned
int
bit = dec.
nBits
();
26
if
(dec.
nBits
()==1) {
27
o <<
"decision (1 bit, position "
<< dec.
firstBit
() <<
"): "
;
28
}
else
{
29
o <<
"decision ("
<< dec.
nBits
() <<
" bits, position "
<< dec.
firstBit
() <<
" - "
<< dec.
lastBit
() <<
"): "
;
30
}
31
while
(bit!=0) {
32
o << (dec.
bit
(--bit)?1:0);
33
}
34
o <<
"(overflow "
<<dec.
overflow
()<<
")"
;
35
return
o;
36
}
Decision.h
Exception.h
TCS_EXCEPTION
#define TCS_EXCEPTION(MSG)
Definition
Trigger/TrigT1/L1Topo/L1TopoCommon/L1TopoCommon/Exception.h:15
TCS::Decision
Definition
Decision.h:19
TCS::Decision::overflow
bool overflow() const
Definition
Decision.h:45
TCS::Decision::m_nBits
unsigned int m_nBits
Definition
Decision.h:51
TCS::Decision::lastBit
unsigned int lastBit() const
Definition
Decision.h:43
TCS::Decision::bit
bool bit(unsigned int index) const
Definition
Decision.h:40
TCS::Decision::m_decision
uint32_t m_decision
Definition
Decision.h:49
TCS::Decision::nBits
unsigned int nBits() const
Definition
Decision.h:44
TCS::Decision::setBit
void setBit(unsigned int index, bool value)
Definition
Decision.cxx:12
TCS::Decision::firstBit
unsigned int firstBit() const
Definition
Decision.h:42
set
STL class.
TCS::operator<<
std::ostream & operator<<(std::ostream &os, const TCS::Bin &bin)
Definition
AnomalyDetectionBDT.cxx:50
index
Definition
index.py:1
Generated on
for ATLAS Offline Software by
1.17.0