ATLAS Offline Software
L1Topo/L1TopoInterfaces/L1TopoInterfaces/Decision.h
Go to the documentation of this file.
1 /*
2  Copyright (C) 2002-2018 CERN for the benefit of the ATLAS collaboration
3 */
4 // Decision.h
5 // TopoCore
6 // Created by Joerg Stelzer on 11/16/12.
7 
8 #ifndef __TopoCore__Decision__
9 #define __TopoCore__Decision__
10 
12 
13 #include <iostream>
14 #include <vector>
15 #include <stdint.h>
16 
17 namespace TCS {
18 
19  class Decision {
20  public:
21 
22  Decision(unsigned int firstBit = 0, unsigned int nBits = 1) :
24  m_nBits(nBits),
25  m_overflow(false)
26  {};
27 
28  // destructor
29  ~Decision(){};
30 
31  // setters
33  void setBit(unsigned int index, bool value);
34 
35  void setFirstBit(unsigned int startBit) { m_firstBit = startBit; }
36  void setNBits(unsigned int nBits) { m_nBits = nBits; }
37  void setOverflow(bool value) { m_overflow = value; }
38  void setAmbiguity(bool value) { m_ambiguity = value; }
39  // getters
40  bool bit(unsigned int index) const { return (m_decision & (0x1<<index)) != 0; }
41  uint64_t decision() const { return m_decision; }
42  unsigned int firstBit() const { return m_firstBit; }
43  unsigned int lastBit() const { return m_firstBit + m_nBits - 1; }
44  unsigned int nBits() const { return m_nBits; }
45  bool overflow() const { return m_overflow; }
46  bool ambiguity() const { return m_ambiguity; }
47 
48  private:
50  unsigned int m_firstBit {0};
51  unsigned int m_nBits {1};
52  bool m_overflow;
53  bool m_ambiguity = false;
54 
55  };
56 
57 }
58 
59 std::ostream & operator<<(std::ostream&, const TCS::Decision &);
60 
61 #endif
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
TCS::Decision::Decision
Decision(unsigned int firstBit=0, unsigned int nBits=1)
Definition: L1Topo/L1TopoInterfaces/L1TopoInterfaces/Decision.h:22
xAOD::uint32_t
setEventNumber uint32_t
Definition: EventInfo_v1.cxx:127
index
Definition: index.py:1
TCS::Decision::ambiguity
bool ambiguity() const
Definition: L1Topo/L1TopoInterfaces/L1TopoInterfaces/Decision.h:46
TCS::Decision::overflow
bool overflow() const
Definition: L1Topo/L1TopoInterfaces/L1TopoInterfaces/Decision.h:45
TCS::Decision::m_ambiguity
bool m_ambiguity
Definition: L1Topo/L1TopoInterfaces/L1TopoInterfaces/Decision.h:53
TCS::Decision::lastBit
unsigned int lastBit() const
Definition: L1Topo/L1TopoInterfaces/L1TopoInterfaces/Decision.h:43
athena.value
value
Definition: athena.py:122
TCS::Decision::~Decision
~Decision()
Definition: L1Topo/L1TopoInterfaces/L1TopoInterfaces/Decision.h:29
TCS::Decision::decision
uint64_t decision() const
Definition: L1Topo/L1TopoInterfaces/L1TopoInterfaces/Decision.h:41
TCS::Decision::setBit
void setBit(unsigned int index, bool value)
Definition: L1Topo/L1TopoInterfaces/Root/Decision.cxx:12
TCS::Decision::nBits
unsigned int nBits() const
Definition: L1Topo/L1TopoInterfaces/L1TopoInterfaces/Decision.h:44
TCS::Decision::reset
StatusCode reset()
Definition: L1Topo/L1TopoInterfaces/L1TopoInterfaces/Decision.h:32
StatusCode.h
xAOD::uint64_t
uint64_t
Definition: EventInfo_v1.cxx:123
TCS::Decision
Definition: L1Topo/L1TopoInterfaces/L1TopoInterfaces/Decision.h:19
TCS::Decision::setNBits
void setNBits(unsigned int nBits)
Definition: L1Topo/L1TopoInterfaces/L1TopoInterfaces/Decision.h:36
TCS::Decision::setOverflow
void setOverflow(bool value)
Definition: L1Topo/L1TopoInterfaces/L1TopoInterfaces/Decision.h:37
operator<<
std::ostream & operator<<(std::ostream &, const TCS::Decision &)
Definition: L1Topo/L1TopoInterfaces/Root/Decision.cxx:24
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
Definition: Global/GlobalSimulation/src/IO/Decision.h:18
TCS::Decision::bit
bool bit(unsigned int index) const
Definition: L1Topo/L1TopoInterfaces/L1TopoInterfaces/Decision.h:40
TCS::Decision::m_decision
uint32_t m_decision
Definition: L1Topo/L1TopoInterfaces/L1TopoInterfaces/Decision.h:49
TCS::Decision::setFirstBit
void setFirstBit(unsigned int startBit)
Definition: L1Topo/L1TopoInterfaces/L1TopoInterfaces/Decision.h:35
TCS::Decision::setAmbiguity
void setAmbiguity(bool value)
Definition: L1Topo/L1TopoInterfaces/L1TopoInterfaces/Decision.h:38
TCS::StatusCode
Definition: Trigger/TrigT1/L1Topo/L1TopoCommon/L1TopoCommon/StatusCode.h:15