ATLAS Offline Software
L1Topo/L1TopoInterfaces/L1TopoInterfaces/Count.h
Go to the documentation of this file.
1 /*
2  Copyright (C) 2002-2018 CERN for the benefit of the ATLAS collaboration
3 */
4 // Count.h
5 // TopoCore
6 // Created by Carlos Moreno on 15/01/21.
7 
8 #ifndef __TopoCore__Count__
9 #define __TopoCore__Count__
10 
12 
13 #include <iostream>
14 #include <vector>
15 #include <stdint.h>
16 #include <bitset>
17 
18 namespace TCS {
19 
20  class Count {
21  public:
22 
23  Count(unsigned int firstBit = 0,
24  unsigned int nBits = 1,
25  unsigned int sizeCount = 1 ) :
27  m_nBits(nBits),
29  {};
30 
31  // Destructor
32  ~Count(){};
33 
34  // setters
36 
37  void setFirstBit(unsigned int startBit) { m_firstBit = startBit; }
38  void setNBits(unsigned int nBits) { m_nBits = nBits; }
39  void setSizeCount(unsigned int sizeCount);// { m_sizeCount = sizeCount; }
40 
41  // getters
42  // TO-DO add function to get count bits for a determined position
43  // TO-DO make ready for executing multiple algorithms in one instance
44 
45  std::bitset<128> getCountBits() const { return m_count; }
46  unsigned int firstBit() const { return m_firstBit; }
47  unsigned int lastBit() const { return m_firstBit + m_nBits - 1; }
48  unsigned int nBits() const { return m_nBits; }
49  unsigned int sizeCount() const { return m_sizeCount; }
50 
51  private:
52  std::bitset<128> m_count {0};
53  unsigned int m_firstBit {0};
54  unsigned int m_nBits {1};
55  unsigned int m_sizeCount {1};
56 
57  };
58 
59 }
60 
61 //std::ostream & operator<<(std::ostream&, const TCS:Count &);
62 
63 #endif
TCS::StatusCode::SUCCESS
@ SUCCESS
Definition: Trigger/TrigT1/L1Topo/L1TopoCommon/L1TopoCommon/StatusCode.h:17
TCS::Count::setFirstBit
void setFirstBit(unsigned int startBit)
Definition: L1Topo/L1TopoInterfaces/L1TopoInterfaces/Count.h:37
TCS::Count::~Count
~Count()
Definition: L1Topo/L1TopoInterfaces/L1TopoInterfaces/Count.h:32
TCS::Count::getCountBits
std::bitset< 128 > getCountBits() const
Definition: L1Topo/L1TopoInterfaces/L1TopoInterfaces/Count.h:45
TCS::Count::reset
StatusCode reset()
Definition: L1Topo/L1TopoInterfaces/L1TopoInterfaces/Count.h:35
TCS::Count::m_nBits
unsigned int m_nBits
Definition: L1Topo/L1TopoInterfaces/L1TopoInterfaces/Count.h:54
TCS::Count::sizeCount
unsigned int sizeCount() const
Definition: L1Topo/L1TopoInterfaces/L1TopoInterfaces/Count.h:49
TCS::Count::m_count
std::bitset< 128 > m_count
Definition: L1Topo/L1TopoInterfaces/L1TopoInterfaces/Count.h:52
TCS::Count::firstBit
unsigned int firstBit() const
Definition: L1Topo/L1TopoInterfaces/L1TopoInterfaces/Count.h:46
StatusCode.h
TCS::Count::m_sizeCount
unsigned int m_sizeCount
Definition: L1Topo/L1TopoInterfaces/L1TopoInterfaces/Count.h:55
TCS::Count::m_firstBit
unsigned int m_firstBit
Definition: L1Topo/L1TopoInterfaces/L1TopoInterfaces/Count.h:53
TCS::Count::lastBit
unsigned int lastBit() const
Definition: L1Topo/L1TopoInterfaces/L1TopoInterfaces/Count.h:47
TCS::Count::setNBits
void setNBits(unsigned int nBits)
Definition: L1Topo/L1TopoInterfaces/L1TopoInterfaces/Count.h:38
TCS::Count
Definition: L1Topo/L1TopoInterfaces/L1TopoInterfaces/Count.h:20
TCS::Count::Count
Count(unsigned int firstBit=0, unsigned int nBits=1, unsigned int sizeCount=1)
Definition: L1Topo/L1TopoInterfaces/L1TopoInterfaces/Count.h:23
TCS
Definition: Global/GlobalSimulation/src/IO/Decision.h:18
TCS::Count::setSizeCount
void setSizeCount(unsigned int sizeCount)
Definition: L1Topo/L1TopoInterfaces/Root/Count.cxx:12
TCS::Count::nBits
unsigned int nBits() const
Definition: L1Topo/L1TopoInterfaces/L1TopoInterfaces/Count.h:48
TCS::StatusCode
Definition: Trigger/TrigT1/L1Topo/L1TopoCommon/L1TopoCommon/StatusCode.h:15