CMS 3D CMS Logo

FPGAWord.h
Go to the documentation of this file.
1 #ifndef L1Trigger_TrackFindingTracklet_interface_FPGAWord_h
2 #define L1Trigger_TrackFindingTracklet_interface_FPGAWord_h
3 
4 #include <string>
5 #include <cassert>
6 
7 namespace trklet {
8 
9  class FPGAWord {
10  public:
11  FPGAWord();
12 
13  FPGAWord(int value, int nbits, bool positive = true, int line = -1, const char* file = nullptr);
14 
15  ~FPGAWord() = default;
16 
17  void set(int value, int nbits, bool positive = true, int line = -1, const char* file = nullptr);
18 
19  std::string str() const;
20 
21  //return the nbits starting with the lsb. lsb=0 means the least significant bit
22  unsigned int bits(unsigned int lsb, unsigned int nbit) const;
23 
24  int value() const { return value_; }
25  int nbits() const { return nbits_; }
26 
27  bool atExtreme() const;
28 
29  bool operator==(const FPGAWord& other) const;
30 
31  private:
32  int value_{-1};
33  int nbits_{-1};
34  bool positive_{true};
35  };
36 }; // namespace trklet
37 #endif
trklet::FPGAWord::str
std::string str() const
Definition: FPGAWord.cc:54
trklet::FPGAWord::set
void set(int value, int nbits, bool positive=true, int line=-1, const char *file=nullptr)
Definition: FPGAWord.cc:14
trklet::FPGAWord::nbits_
int nbits_
Definition: FPGAWord.h:33
trklet::FPGAWord::nbits
int nbits() const
Definition: FPGAWord.h:25
trklet::FPGAWord::~FPGAWord
~FPGAWord()=default
trklet::FPGAWord::bits
unsigned int bits(unsigned int lsb, unsigned int nbit) const
Definition: FPGAWord.cc:74
trklet::FPGAWord::operator==
bool operator==(const FPGAWord &other) const
Definition: FPGAWord.cc:86
trackingPlots.other
other
Definition: trackingPlots.py:1465
trklet::FPGAWord
Definition: FPGAWord.h:9
AlCaHLTBitMon_QueryRunRegistry.string
string
Definition: AlCaHLTBitMon_QueryRunRegistry.py:256
trklet::FPGAWord::atExtreme
bool atExtreme() const
Definition: FPGAWord.cc:79
FrontierConditions_GlobalTag_cff.file
file
Definition: FrontierConditions_GlobalTag_cff.py:13
value
Definition: value.py:1
trklet::FPGAWord::value_
int value_
Definition: FPGAWord.h:32
trklet
Definition: AllProjectionsMemory.h:9
trklet::FPGAWord::value
int value() const
Definition: FPGAWord.h:24
mps_splice.line
line
Definition: mps_splice.py:76
trklet::FPGAWord::FPGAWord
FPGAWord()
Definition: FPGAWord.cc:8
trklet::FPGAWord::positive_
bool positive_
Definition: FPGAWord.h:34