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

#include <Decision.h>

Collaboration diagram for GlobalSim::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 24 of file Global/GlobalSimulation/src/IO/Decision.h.

Constructor & Destructor Documentation

◆ Decision()

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

Definition at line 27 of file Global/GlobalSimulation/src/IO/Decision.h.

27  :
29  m_nBits(nBits),
30  m_overflow(false)
31  {};

◆ ~Decision()

GlobalSim::Decision::~Decision ( )
inline

Definition at line 34 of file Global/GlobalSimulation/src/IO/Decision.h.

34 {};

Member Function Documentation

◆ ambiguity()

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

Definition at line 51 of file Global/GlobalSimulation/src/IO/Decision.h.

51 { return m_ambiguity; }

◆ bit()

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

Definition at line 45 of file Global/GlobalSimulation/src/IO/Decision.h.

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

◆ decision()

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

Definition at line 46 of file Global/GlobalSimulation/src/IO/Decision.h.

46 { return m_decision; }

◆ firstBit()

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

Definition at line 47 of file Global/GlobalSimulation/src/IO/Decision.h.

47 { return m_firstBit; }

◆ lastBit()

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

Definition at line 48 of file Global/GlobalSimulation/src/IO/Decision.h.

48 { return m_firstBit + m_nBits - 1; }

◆ nBits()

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

Definition at line 49 of file Global/GlobalSimulation/src/IO/Decision.h.

49 { return m_nBits; }

◆ overflow()

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

Definition at line 50 of file Global/GlobalSimulation/src/IO/Decision.h.

50 { return m_overflow; }

◆ reset()

StatusCode GlobalSim::Decision::reset ( )
inline

Definition at line 37 of file Global/GlobalSimulation/src/IO/Decision.h.

37 { m_decision = 0; return StatusCode::SUCCESS; }

◆ setAmbiguity()

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

Definition at line 43 of file Global/GlobalSimulation/src/IO/Decision.h.

43 { m_ambiguity = value; }

◆ setBit()

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

Definition at line 19 of file Global/GlobalSimulation/src/IO/Decision.cxx.

19  {
20  if(index >= m_nBits) {
21  std::stringstream ss;
22  ss << "Setting bit "
23  << index << ", but max index allowed is " << m_nBits-1;
24  throw std::runtime_error(ss.str());
25  }
26 
27  if(set) {
28  m_decision |= (0x1<<index);
29  } else {
30  m_decision &= ~(0x1<<index);
31  }
32  }

◆ setFirstBit()

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

Definition at line 40 of file Global/GlobalSimulation/src/IO/Decision.h.

40 { m_firstBit = startBit; }

◆ setNBits()

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

Definition at line 41 of file Global/GlobalSimulation/src/IO/Decision.h.

41 { m_nBits = nBits; }

◆ setOverflow()

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

Definition at line 42 of file Global/GlobalSimulation/src/IO/Decision.h.

42 { m_overflow = value; }

Member Data Documentation

◆ m_ambiguity

bool GlobalSim::Decision::m_ambiguity {false}
private

Definition at line 58 of file Global/GlobalSimulation/src/IO/Decision.h.

◆ m_decision

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

Definition at line 54 of file Global/GlobalSimulation/src/IO/Decision.h.

◆ m_firstBit

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

Definition at line 55 of file Global/GlobalSimulation/src/IO/Decision.h.

◆ m_nBits

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

Definition at line 56 of file Global/GlobalSimulation/src/IO/Decision.h.

◆ m_overflow

bool GlobalSim::Decision::m_overflow
private

Definition at line 57 of file Global/GlobalSimulation/src/IO/Decision.h.


The documentation for this class was generated from the following files:
plotBeamSpotCompare.x1
x1
Definition: plotBeamSpotCompare.py:216
GlobalSim::Decision::m_overflow
bool m_overflow
Definition: Global/GlobalSimulation/src/IO/Decision.h:57
PowhegControl_ttHplus_NLO.ss
ss
Definition: PowhegControl_ttHplus_NLO.py:83
GlobalSim::Decision::m_nBits
unsigned int m_nBits
Definition: Global/GlobalSimulation/src/IO/Decision.h:56
index
Definition: index.py:1
GlobalSim::Decision::m_firstBit
unsigned int m_firstBit
Definition: Global/GlobalSimulation/src/IO/Decision.h:55
athena.value
value
Definition: athena.py:122
GlobalSim::Decision::m_ambiguity
bool m_ambiguity
Definition: Global/GlobalSimulation/src/IO/Decision.h:58
GlobalSim::Decision::nBits
unsigned int nBits() const
Definition: Global/GlobalSimulation/src/IO/Decision.h:49
GlobalSim::Decision::m_decision
uint32_t m_decision
Definition: Global/GlobalSimulation/src/IO/Decision.h:54
GlobalSim::Decision::firstBit
unsigned int firstBit() const
Definition: Global/GlobalSimulation/src/IO/Decision.h:47
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