CMS 3D CMS Logo

L1MuBMTrackAssembler.h
Go to the documentation of this file.
1 //-------------------------------------------------
2 //
20 //
21 //--------------------------------------------------
22 #ifndef L1MUBM_TRACK_ASSEBMLER_H
23 #define L1MUBM_TRACK_ASSEBMLER_H
24 
25 //---------------
26 // C++ Headers --
27 //---------------
28 
29 #include <bitset>
30 
31 //----------------------
32 // Base Class Headers --
33 //----------------------
34 
36 
37 //------------------------------------
38 // Collaborating Class Declarations --
39 //------------------------------------
40 
44 
45 // ---------------------
46 // -- Class Interface --
47 // ---------------------
48 
50 public:
53 
55  ~L1MuBMTrackAssembler() override;
56 
58  void run() override;
59 
61  void reset() override;
62 
64  void print() const;
65 
67  inline TrackClass trackClass(int id) const { return m_theTCs[id]; }
68 
70  inline const std::bitset<4>& trackBitMap(int id) const { return m_theBitMaps[id]; }
71 
73  inline bool isEmpty(int id) const { return (m_theTCs[id] == UNDEF); }
74 
76  inline int address(int id, int stat) const { return m_theAddresses[id].station(stat); }
77 
79  inline L1MuBMAddressArray address(int id) const { return m_theAddresses[id]; }
80 
81 private:
83  void runEncoderSubUnit1(unsigned& global, unsigned& group, unsigned& priority);
84 
86  void runEncoderSubUnit2(unsigned& global, unsigned& group, unsigned& priority);
87 
89  void runAddressAssignment1(int global, int group);
90 
92  void runAddressAssignment2(int global, int group);
93 
95  static unsigned int priorityEncoder12(const std::bitset<12>& input);
96 
98  static unsigned int priorityEncoder4(const std::bitset<4>& input);
99 
101  static unsigned int priorityEncoder22(const std::bitset<22>& input);
102 
104  static unsigned int priorityEncoder21(const std::bitset<21>& input);
105 
107  static unsigned int addressEncoder12(const std::bitset<12>& input);
108 
110  static unsigned int addressEncoder12s(const std::bitset<12>& input);
111 
113  static unsigned long subBitset68(const std::bitset<68>& input, int pos, int length);
114 
116  static unsigned long subBitset56(const std::bitset<56>& input, int pos, int length);
117 
119  static std::bitset<56> getCancelationTable(unsigned int);
120 
121 private:
123 
124  std::bitset<68> m_thePriorityTable1;
125  std::bitset<56> m_thePriorityTable2;
126  unsigned int m_theLastAddress[68];
127  unsigned int m_theLastAddressI[12];
128 
129  TrackClass m_theTCs[2]; // Track Classes of the 2 candidates
130  std::bitset<4> m_theBitMaps[2]; // bitmaps of Track Class
131  L1MuBMAddressArray m_theAddresses[2]; // relative addresses of the 2 candidates
132 };
133 
134 #endif
L1MuBMTrackAssembler::address
int address(int id, int stat) const
get address of a single station of selected track candidate
Definition: L1MuBMTrackAssembler.h:76
L1MuBMTrackAssembler::address
L1MuBMAddressArray address(int id) const
get address-array of selected track candidate
Definition: L1MuBMTrackAssembler.h:79
L1MuBMTrackAssParam.h
input
static const std::string input
Definition: EdmProvDump.cc:48
L1MuBMTrackAssembler
Definition: L1MuBMTrackAssembler.h:49
L1MuBMTrackAssembler::priorityEncoder22
static unsigned int priorityEncoder22(const std::bitset< 22 > &input)
22 bit priority encoder
Definition: L1MuBMTrackAssembler.cc:1331
L1MuBMTrackAssembler::runEncoderSubUnit1
void runEncoderSubUnit1(unsigned &global, unsigned &group, unsigned &priority)
run the first Priority Encoder Sub-Unit
Definition: L1MuBMTrackAssembler.cc:493
L1MuBMTrackAssembler::subBitset68
static unsigned long subBitset68(const std::bitset< 68 > &input, int pos, int length)
get sub-bitmap of a 68-bit word
Definition: L1MuBMTrackAssembler.cc:1398
L1AbstractProcessor.h
L1MuBMTrackAssembler::priorityEncoder12
static unsigned int priorityEncoder12(const std::bitset< 12 > &input)
12 bit priority encoder
Definition: L1MuBMTrackAssembler.cc:1303
L1MuBMAddressArray
Definition: L1MuBMAddressArray.h:50
pos
Definition: PixelAliasList.h:18
L1MuBMAddressArray::station
unsigned short station(int stat) const
get address of a given station [1-4]
Definition: L1MuBMAddressArray.h:80
L1MuBMSectorProcessor
Definition: L1MuBMSectorProcessor.h:54
L1MuBMTrackAssembler::runAddressAssignment2
void runAddressAssignment2(int global, int group)
run the second Address Assignment Sub-Unit
Definition: L1MuBMTrackAssembler.cc:1043
L1MuBMTrackAssembler::~L1MuBMTrackAssembler
~L1MuBMTrackAssembler() override
destructor
Definition: L1MuBMTrackAssembler.cc:51
L1MuBMTrackAssembler::m_theBitMaps
std::bitset< 4 > m_theBitMaps[2]
Definition: L1MuBMTrackAssembler.h:130
L1MuBMTrackAssembler::runAddressAssignment1
void runAddressAssignment1(int global, int group)
run the first Address Assignment Sub-Unit
Definition: L1MuBMTrackAssembler.cc:741
L1MuBMTrackAssembler::run
void run() override
run Track Assembler
Definition: L1MuBMTrackAssembler.cc:60
hgcalPlots.stat
stat
Definition: hgcalPlots.py:1111
L1MuBMTrackAssembler::trackBitMap
const std::bitset< 4 > & trackBitMap(int id) const
return bitmap of found track
Definition: L1MuBMTrackAssembler.h:70
L1MuBMTrackAssembler::m_thePriorityTable1
std::bitset< 68 > m_thePriorityTable1
Definition: L1MuBMTrackAssembler.h:124
L1MuBMTrackAssembler::m_thePriorityTable2
std::bitset< 56 > m_thePriorityTable2
Definition: L1MuBMTrackAssembler.h:125
L1AbstractProcessor
Definition: L1AbstractProcessor.h:34
TrackClass
TrackClass
Definition: L1MuBMTrackAssParam.h:21
L1MuBMTrackAssembler::priorityEncoder21
static unsigned int priorityEncoder21(const std::bitset< 21 > &input)
21 bit priority encoder
Definition: L1MuBMTrackAssembler.cc:1345
L1MuBMTrackAssembler::m_theAddresses
L1MuBMAddressArray m_theAddresses[2]
Definition: L1MuBMTrackAssembler.h:131
L1MuBMTrackAssembler::priorityEncoder4
static unsigned int priorityEncoder4(const std::bitset< 4 > &input)
4 bit priority encoder
Definition: L1MuBMTrackAssembler.cc:1317
L1MuBMTrackAssembler::m_theLastAddressI
unsigned int m_theLastAddressI[12]
Definition: L1MuBMTrackAssembler.h:127
L1MuBMTrackAssembler::getCancelationTable
static std::bitset< 56 > getCancelationTable(unsigned int)
cancel Out Table
Definition: L1MuBMTrackAssembler.cc:1426
L1MuBMTrackAssembler::L1MuBMTrackAssembler
L1MuBMTrackAssembler(const L1MuBMSectorProcessor &)
constructor
Definition: L1MuBMTrackAssembler.cc:45
L1MuBMTrackAssembler::runEncoderSubUnit2
void runEncoderSubUnit2(unsigned &global, unsigned &group, unsigned &priority)
run the second Priority Encoder Sub-Unit
Definition: L1MuBMTrackAssembler.cc:622
L1MuBMTrackAssembler::isEmpty
bool isEmpty(int id) const
is it a valid Track Class?
Definition: L1MuBMTrackAssembler.h:73
L1MuBMTrackAssembler::trackClass
TrackClass trackClass(int id) const
return Track Class of found track
Definition: L1MuBMTrackAssembler.h:67
L1MuBMTrackAssembler::print
void print() const
print result of Track Assembler
Definition: L1MuBMTrackAssembler.cc:479
L1MuBMTrackAssembler::m_theTCs
TrackClass m_theTCs[2]
Definition: L1MuBMTrackAssembler.h:129
L1MuBMTrackAssembler::addressEncoder12
static unsigned int addressEncoder12(const std::bitset< 12 > &input)
12 bit address encoder
Definition: L1MuBMTrackAssembler.cc:1359
triggerObjects_cff.id
id
Definition: triggerObjects_cff.py:31
UNDEF
Definition: L1MuBMTrackAssParam.h:21
L1MuBMTrackAssembler::addressEncoder12s
static unsigned int addressEncoder12s(const std::bitset< 12 > &input)
special 12 bit address encoder
Definition: L1MuBMTrackAssembler.cc:1377
L1MuBMAddressArray.h
L1MuBMTrackAssembler::subBitset56
static unsigned long subBitset56(const std::bitset< 56 > &input, int pos, int length)
get sub-bitmap of a 56-bit word
Definition: L1MuBMTrackAssembler.cc:1412
L1MuBMTrackAssembler::m_sp
const L1MuBMSectorProcessor & m_sp
Definition: L1MuBMTrackAssembler.h:122
L1MuBMTrackAssembler::m_theLastAddress
unsigned int m_theLastAddress[68]
Definition: L1MuBMTrackAssembler.h:126
watchdog.group
group
Definition: watchdog.py:82
L1MuBMTrackAssembler::reset
void reset() override
reset Track Assembler
Definition: L1MuBMTrackAssembler.cc:461