18 namespace CDCTrigger {
19 constexpr int tsInfoWidth = 21;
21 using tsOut = std::array<unsigned, 4>;
22 using tsOutArray = std::array<tsOut, 5>;
23 tsOut decodeTSHit(std::string tsIn)
25 constexpr unsigned lenID = 8;
26 constexpr unsigned lenPriorityTime = 9;
27 constexpr unsigned lenLR = 2;
28 constexpr unsigned lenPriorityPosition = 2;
29 constexpr std::array<unsigned, 4> tsLens = {lenID, lenPriorityTime, lenLR, lenPriorityPosition};
30 std::array<unsigned, 5> tsPos = { 0 };
31 std::partial_sum(tsLens.begin(), tsLens.end(), tsPos.begin() + 1);
33 tsOutput[0] = std::bitset<tsLens[0]>(tsIn.substr(tsPos[0], tsLens[0])).to_ulong();
34 tsOutput[1] = std::bitset<tsLens[1]>(tsIn.substr(tsPos[1], tsLens[1])).to_ulong();
35 tsOutput[2] = std::bitset<tsLens[2]>(tsIn.substr(tsPos[2], tsLens[2])).to_ulong();
36 tsOutput[3] = std::bitset<tsLens[3]>(tsIn.substr(tsPos[3], tsLens[3])).to_ulong();
40 static constexpr std::array<int, 9> nWiresInSuperLayer = {160, 160, 192, 224, 256, 288, 320, 352, 384};
42 static constexpr int nTrackers = 4;
51 unsigned short globalSegmentID(
unsigned short localID,
unsigned short iSL)
53 auto itr = nWiresInSuperLayer.begin();
54 unsigned short globalID = std::accumulate(itr, itr + iSL, 0);
Abstract base class for different kinds of events.