File indexing completed on 2024-04-06 12:19:43
0001
0002
0003
0004
0005
0006
0007
0008
0009
0010
0011
0012
0013
0014
0015
0016
0017
0018
0019
0020
0021
0022 #ifndef L1MUDT_TRACK_ASSEMBLER_H
0023 #define L1MUDT_TRACK_ASSEMBLER_H
0024
0025
0026
0027
0028
0029 #include <bitset>
0030
0031
0032
0033
0034
0035
0036
0037
0038
0039 #include "L1Trigger/DTTrackFinder/interface/L1MuDTTrackAssParam.h"
0040 #include "L1Trigger/DTTrackFinder/interface/L1MuDTAddressArray.h"
0041 class L1MuDTSectorProcessor;
0042
0043
0044
0045
0046
0047 class L1MuDTTrackAssembler {
0048 public:
0049
0050 L1MuDTTrackAssembler(const L1MuDTSectorProcessor&);
0051
0052
0053 ~L1MuDTTrackAssembler();
0054
0055
0056 void run();
0057
0058
0059 void reset();
0060
0061
0062 void print() const;
0063
0064
0065 inline TrackClass trackClass(int id) const { return m_theTCs[id]; }
0066
0067
0068 inline const std::bitset<4>& trackBitMap(int id) const { return m_theBitMaps[id]; }
0069
0070
0071 inline bool isEmpty(int id) const { return (m_theTCs[id] == UNDEF); }
0072
0073
0074 inline int address(int id, int stat) const { return m_theAddresses[id].station(stat); }
0075
0076
0077 inline L1MuDTAddressArray address(int id) const { return m_theAddresses[id]; }
0078
0079 private:
0080
0081 void runEncoderSubUnit1(unsigned& global, unsigned& group, unsigned& priority);
0082
0083
0084 void runEncoderSubUnit2(unsigned& global, unsigned& group, unsigned& priority);
0085
0086
0087 void runAddressAssignment1(int global, int group);
0088
0089
0090 void runAddressAssignment2(int global, int group);
0091
0092
0093 static unsigned int priorityEncoder12(const std::bitset<12>& input);
0094
0095
0096 static unsigned int priorityEncoder4(const std::bitset<4>& input);
0097
0098
0099 static unsigned int priorityEncoder22(const std::bitset<22>& input);
0100
0101
0102 static unsigned int priorityEncoder21(const std::bitset<21>& input);
0103
0104
0105 static unsigned int addressEncoder12(const std::bitset<12>& input);
0106
0107
0108 static unsigned int addressEncoder12s(const std::bitset<12>& input);
0109
0110
0111 static unsigned long subBitset68(const std::bitset<68>& input, int pos, int length);
0112
0113
0114 static unsigned long subBitset56(const std::bitset<56>& input, int pos, int length);
0115
0116
0117 static std::bitset<56> getCancelationTable(unsigned int);
0118
0119 private:
0120 const L1MuDTSectorProcessor& m_sp;
0121
0122 std::bitset<68> m_thePriorityTable1;
0123 std::bitset<56> m_thePriorityTable2;
0124 unsigned int m_theLastAddress[68];
0125 unsigned int m_theLastAddressI[12];
0126
0127 TrackClass m_theTCs[2];
0128 std::bitset<4> m_theBitMaps[2];
0129 L1MuDTAddressArray m_theAddresses[2];
0130 };
0131
0132 #endif