ATLAS Offline Software
Public Member Functions | Private Attributes | List of all members
TCS::Decision Class Reference

#include <Decision.h>

Collaboration diagram for TCS::Decision:

Public Member Functions

 Decision (unsigned int firstBit=0, unsigned int nBits=1)
 
 ~Decision ()
 
StatusCode reset ()
 
void setBit (unsigned int index, bool value)
 
void setFirstBit (unsigned int startBit)
 
void setNBits (unsigned int nBits)
 
void setOverflow (bool value)
 
void setAmbiguity (bool value)
 
bool bit (unsigned int index) const
 
uint64_t decision () const
 
unsigned int firstBit () const
 
unsigned int lastBit () const
 
unsigned int nBits () const
 
bool overflow () const
 
bool ambiguity () const
 

Private Attributes

uint32_t m_decision {0}
 
unsigned int m_firstBit {0}
 
unsigned int m_nBits {1}
 
bool m_overflow
 
bool m_ambiguity = false
 

Detailed Description

Definition at line 19 of file L1Topo/L1TopoInterfaces/L1TopoInterfaces/Decision.h.

Constructor & Destructor Documentation

◆ Decision()

TCS::Decision::Decision ( unsigned int  firstBit = 0,
unsigned int  nBits = 1 
)
inline

Definition at line 22 of file L1Topo/L1TopoInterfaces/L1TopoInterfaces/Decision.h.

22  :
24  m_nBits(nBits),
25  m_overflow(false)
26  {};

◆ ~Decision()

TCS::Decision::~Decision ( )
inline

Definition at line 29 of file L1Topo/L1TopoInterfaces/L1TopoInterfaces/Decision.h.

29 {};

Member Function Documentation

◆ ambiguity()

bool TCS::Decision::ambiguity ( ) const
inline

Definition at line 46 of file L1Topo/L1TopoInterfaces/L1TopoInterfaces/Decision.h.

46 { return m_ambiguity; }

◆ bit()

bool TCS::Decision::bit ( unsigned int  index) const
inline

Definition at line 40 of file L1Topo/L1TopoInterfaces/L1TopoInterfaces/Decision.h.

40 { return (m_decision & (0x1<<index)) != 0; }

◆ decision()

uint64_t TCS::Decision::decision ( ) const
inline

Definition at line 41 of file L1Topo/L1TopoInterfaces/L1TopoInterfaces/Decision.h.

41 { return m_decision; }

◆ firstBit()

unsigned int TCS::Decision::firstBit ( ) const
inline

Definition at line 42 of file L1Topo/L1TopoInterfaces/L1TopoInterfaces/Decision.h.

42 { return m_firstBit; }

◆ lastBit()

unsigned int TCS::Decision::lastBit ( ) const
inline

Definition at line 43 of file L1Topo/L1TopoInterfaces/L1TopoInterfaces/Decision.h.

43 { return m_firstBit + m_nBits - 1; }

◆ nBits()

unsigned int TCS::Decision::nBits ( ) const
inline

Definition at line 44 of file L1Topo/L1TopoInterfaces/L1TopoInterfaces/Decision.h.

44 { return m_nBits; }

◆ overflow()

bool TCS::Decision::overflow ( ) const
inline

Definition at line 45 of file L1Topo/L1TopoInterfaces/L1TopoInterfaces/Decision.h.

45 { return m_overflow; }

◆ reset()

StatusCode TCS::Decision::reset ( )
inline

◆ setAmbiguity()

void TCS::Decision::setAmbiguity ( bool  value)
inline

◆ setBit()

void TCS::Decision::setBit ( unsigned int  index,
bool  value 
)

Definition at line 12 of file L1Topo/L1TopoInterfaces/Root/Decision.cxx.

12  {
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 }

◆ setFirstBit()

void TCS::Decision::setFirstBit ( unsigned int  startBit)
inline

Definition at line 35 of file L1Topo/L1TopoInterfaces/L1TopoInterfaces/Decision.h.

35 { m_firstBit = startBit; }

◆ setNBits()

void TCS::Decision::setNBits ( unsigned int  nBits)
inline

Definition at line 36 of file L1Topo/L1TopoInterfaces/L1TopoInterfaces/Decision.h.

36 { m_nBits = nBits; }

◆ setOverflow()

void TCS::Decision::setOverflow ( bool  value)
inline

Member Data Documentation

◆ m_ambiguity

bool TCS::Decision::m_ambiguity = false
private

◆ m_decision

uint32_t TCS::Decision::m_decision {0}
private

◆ m_firstBit

unsigned int TCS::Decision::m_firstBit {0}
private

◆ m_nBits

unsigned int TCS::Decision::m_nBits {1}
private

◆ m_overflow

bool TCS::Decision::m_overflow
private

The documentation for this class was generated from the following files:
plotBeamSpotCompare.x1
x1
Definition: plotBeamSpotCompare.py:216
TCS::Decision::m_firstBit
unsigned int m_firstBit
Definition: L1Topo/L1TopoInterfaces/L1TopoInterfaces/Decision.h:50
TCS::StatusCode::SUCCESS
@ SUCCESS
Definition: Trigger/TrigT1/L1Topo/L1TopoCommon/L1TopoCommon/StatusCode.h:17
TCS::Decision::m_nBits
unsigned int m_nBits
Definition: L1Topo/L1TopoInterfaces/L1TopoInterfaces/Decision.h:51
index
Definition: index.py:1
TCS::Decision::m_ambiguity
bool m_ambiguity
Definition: L1Topo/L1TopoInterfaces/L1TopoInterfaces/Decision.h:53
athena.value
value
Definition: athena.py:122
TCS::Decision::nBits
unsigned int nBits() const
Definition: L1Topo/L1TopoInterfaces/L1TopoInterfaces/Decision.h:44
TCS_EXCEPTION
#define TCS_EXCEPTION(MSG)
Definition: Trigger/TrigT1/L1Topo/L1TopoCommon/L1TopoCommon/Exception.h:14
CxxUtils::set
constexpr std::enable_if_t< is_bitmask_v< E >, E & > set(E &lhs, E rhs)
Convenience function to set bits in a class enum bitmask.
Definition: bitmask.h:224
DeMoScan.index
string index
Definition: DeMoScan.py:362
TCS::Decision::firstBit
unsigned int firstBit() const
Definition: L1Topo/L1TopoInterfaces/L1TopoInterfaces/Decision.h:42
TCS::Decision::m_overflow
bool m_overflow
Definition: L1Topo/L1TopoInterfaces/L1TopoInterfaces/Decision.h:52
TCS::Decision::m_decision
uint32_t m_decision
Definition: L1Topo/L1TopoInterfaces/L1TopoInterfaces/Decision.h:49