ATLAS Offline Software
Global/GlobalSimulation/src/IO/Decision.h
Go to the documentation of this file.
1 /*
2  Copyright (C) 2002-2024 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 // Adapted for GlobalL1TopoSim
9 #ifndef GLOBALSIM_DECISION_H
10 #define GLOBALSIM_DECISION_H
11 
12 
13 #include <iosfwd>
14 
15 #include "AthenaKernel/CLASS_DEF.h"
16 
17 
18 namespace TCS {
19 
20 }
21 
22 namespace GlobalSim {
23 
24  class Decision {
25  public:
26 
27  Decision(unsigned int firstBit = 0, unsigned int nBits = 1) :
29  m_nBits(nBits),
30  m_overflow(false)
31  {};
32 
33  // destructor
34  ~Decision(){};
35 
36  // setters
37  StatusCode reset() { m_decision = 0; return StatusCode::SUCCESS; }
38  void setBit(unsigned int index, bool value);
39 
40  void setFirstBit(unsigned int startBit) { m_firstBit = startBit; }
41  void setNBits(unsigned int nBits) { m_nBits = nBits; }
42  void setOverflow(bool value) { m_overflow = value; }
43  void setAmbiguity(bool value) { m_ambiguity = value; }
44  // getters
45  bool bit(unsigned int index) const { return (m_decision & (0x1<<index)) != 0; }
46  uint64_t decision() const { return m_decision; }
47  unsigned int firstBit() const { return m_firstBit; }
48  unsigned int lastBit() const { return m_firstBit + m_nBits - 1; }
49  unsigned int nBits() const { return m_nBits; }
50  bool overflow() const { return m_overflow; }
51  bool ambiguity() const { return m_ambiguity; }
52 
53  private:
55  unsigned int m_firstBit {0};
56  unsigned int m_nBits {1};
57  bool m_overflow;
58  bool m_ambiguity{false};
59 
60  };
61 
62 }
63 
64 CLASS_DEF( GlobalSim::Decision , 256155971 , 1 )
65 
66 std::ostream & operator<<(std::ostream&, const GlobalSim::Decision &);
67 
68 #endif
GlobalSim::Decision::ambiguity
bool ambiguity() const
Definition: Global/GlobalSimulation/src/IO/Decision.h:51
plotBeamSpotCompare.x1
x1
Definition: plotBeamSpotCompare.py:216
GlobalSim::Decision::~Decision
~Decision()
Definition: Global/GlobalSimulation/src/IO/Decision.h:34
GlobalSim::Decision::m_overflow
bool m_overflow
Definition: Global/GlobalSimulation/src/IO/Decision.h:57
GlobalSim::Decision::Decision
Decision(unsigned int firstBit=0, unsigned int nBits=1)
Definition: Global/GlobalSimulation/src/IO/Decision.h:27
GlobalSim::Decision::m_nBits
unsigned int m_nBits
Definition: Global/GlobalSimulation/src/IO/Decision.h:56
xAOD::uint32_t
setEventNumber uint32_t
Definition: EventInfo_v1.cxx:127
GlobalSim::Decision::setBit
void setBit(unsigned int index, bool value)
Definition: Global/GlobalSimulation/src/IO/Decision.cxx:19
index
Definition: index.py:1
GlobalSim::Decision::m_firstBit
unsigned int m_firstBit
Definition: Global/GlobalSimulation/src/IO/Decision.h:55
GlobalSim::Decision
Definition: Global/GlobalSimulation/src/IO/Decision.h:24
GlobalSim::Decision::setFirstBit
void setFirstBit(unsigned int startBit)
Definition: Global/GlobalSimulation/src/IO/Decision.h:40
athena.value
value
Definition: athena.py:122
GlobalSim::Decision::m_ambiguity
bool m_ambiguity
Definition: Global/GlobalSimulation/src/IO/Decision.h:58
const
bool const RAWDATA *ch2 const
Definition: LArRodBlockPhysicsV0.cxx:562
GlobalSim::Decision::setOverflow
void setOverflow(bool value)
Definition: Global/GlobalSimulation/src/IO/Decision.h:42
GlobalSim::Decision::decision
uint64_t decision() const
Definition: Global/GlobalSimulation/src/IO/Decision.h:46
GlobalSim
AlgTool to obtain a GlobalSim::cTAUTOBArray This class uses ReadHandls to jFex and eFex Tau Rois If t...
Definition: dump.h:8
EL::StatusCode
::StatusCode StatusCode
StatusCode definition for legacy code.
Definition: PhysicsAnalysis/D3PDTools/EventLoop/EventLoop/StatusCode.h:22
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
xAOD::uint64_t
uint64_t
Definition: EventInfo_v1.cxx:123
GlobalSim::Decision::firstBit
unsigned int firstBit() const
Definition: Global/GlobalSimulation/src/IO/Decision.h:47
TrigCompositeUtils::Decision
xAOD::TrigComposite Decision
Definition: Event/xAOD/xAODTrigger/xAODTrigger/TrigComposite.h:20
GlobalSim::Decision::setAmbiguity
void setAmbiguity(bool value)
Definition: Global/GlobalSimulation/src/IO/Decision.h:43
GlobalSim::Decision::overflow
bool overflow() const
Definition: Global/GlobalSimulation/src/IO/Decision.h:50
GlobalSim::Decision::setNBits
void setNBits(unsigned int nBits)
Definition: Global/GlobalSimulation/src/IO/Decision.h:41
GlobalSim::Decision::lastBit
unsigned int lastBit() const
Definition: Global/GlobalSimulation/src/IO/Decision.h:48
CLASS_DEF
#define CLASS_DEF(NAME, CID, VERSION)
associate a clid and a version to a type eg
Definition: Control/AthenaKernel/AthenaKernel/CLASS_DEF.h:64
TCS
Definition: Global/GlobalSimulation/src/IO/Decision.h:18
GlobalSim::Decision::reset
StatusCode reset()
Definition: Global/GlobalSimulation/src/IO/Decision.h:37
CLASS_DEF.h
macros to associate a CLID to a type
GlobalSim::Decision::bit
bool bit(unsigned int index) const
Definition: Global/GlobalSimulation/src/IO/Decision.h:45