29 uint16_t subDetectorId, uint16_t rodId,
const TgcSlbData* slb,
30 std::vector<TgcRawData*>& vChannel)
const {
55 bool isFirstHit =
true;
61 const int TRIGGER_DATA_OFFSET = 40;
64 if (*(bitArray + ibit)) {
70 vChannel.push_back(rCh);
75 <<
" slb type =" << slb->
getType());
79 <<
" BC:" << iBc <<
" subDetId:" << subDetectorId
80 <<
" rodId:" << rodId <<
" sswId:"
91 uint16_t subDetectorId, uint16_t rodId,
const TgcSlbData* slb,
92 std::vector<TgcRawData*>& vChannel)
const {
97 bool isFirstHit =
true;
110 for (
int i = 0; i <
N_LPT_D; ++i) {
116 iBc, subDetectorId, rodId, slb->
getSswId(),
119 delta[i], 0, i, pos[i]);
120 vChannel.push_back(rCh);
125 "Tgc TgcSlbDataHelper::convertCoincidence :"
126 <<
" slb type =" << slb->
getType());
131 ?
"TgcRawData : LPT_D_W "
132 :
"TgcRawData : LPT_D_S ")
133 <<
" BC:" << iBc <<
" subDetId:" << subDetectorId
134 <<
" rodId:" << rodId <<
" sswId:" << slb->
getSswId()
136 <<
" slbId:" << slb->
getSlbId() <<
" sub: " << i
137 <<
" pos:" << pos[i] <<
" delta:" << delta[i]);
144 for (
int i = 0; i <
N_LPT_D; ++i) {
150 iBc, subDetectorId, rodId, slb->
getSswId(),
153 delta[i], 0, i, pos[i]);
154 vChannel.push_back(rCh);
158 "Tgc TgcSlbDataHelper::convertCoincidence :"
159 <<
" slb type =" << slb->
getType());
164 ?
"TgcRawData : LPT_D_W "
165 :
"TgcRawData : LPT_D_S ")
166 <<
" BC:" << iBc <<
" subDetId:" << subDetectorId
167 <<
" rodId:" << rodId <<
" sswId:" << slb->
getSswId()
169 <<
" slbId:" << slb->
getSlbId() <<
" sub: " << i
170 <<
" pos:" << pos[i] <<
" delta:" << delta[i]);
176 for (
int i = 0; i <
N_LPT_TW; ++i) {
183 iBc, subDetectorId, rodId, slb->
getSswId(),
186 delta[i], 0, i, pos[i]);
187 vChannel.push_back(rCh);
190 "Tgc TgcSlbDataHelper::convertCoincidence :"
191 <<
" slb type =" << slb->
getType());
195 <<
" BC:" << iBc <<
" subDetId:"
196 << subDetectorId <<
" rodId:" << rodId
200 <<
" sub: " << i <<
" pos:" << pos[i]);
206 for (
int i = 0; i <
N_LPT_TS; ++i) {
219 iBc, subDetectorId, rodId, slb->
getSswId(),
222 delta[i], seg, subc, pos[i]);
223 vChannel.push_back(rCh);
226 "Tgc TgcSlbDataHelper::convertCoincidence :"
227 <<
" slb type =" << slb->
getType());
231 "TgcRawData : LPT_T_S "
232 <<
" BC:" << iBc <<
" subDetId:" << subDetectorId
233 <<
" rodId:" << rodId <<
" sswId:" << slb->
getSswId()
235 <<
" slbId:" << slb->
getSlbId() <<
" seg: " << seg
236 <<
" sub: " << subc <<
" pos:" << pos[i]);
247 for (
int i = 0; i <
N_LPT_I; ++i) {
262 SLB_TYPE_INNER_WIRE),
268 static_cast<uint16_t
>(
276 vChannel.push_back(rCh);
279 "Tgc TgcSlbDataHelper::convertCoincidence :"
280 <<
" slb type =" << slb->
getType());
288 <<
" BC:" << rCh->
bcTag() <<
" subDetId:"
290 <<
" sswId:" << rCh->
sswId() <<
" sbLoc:"
292 <<
" seg: " << rCh->
segment() <<
" sub: "
302 sector =
getSector(forward, subDetectorId, rodId, slb);
319 for (
size_t i = 0; i < 2; ++i) {
324 bool veto[2] = {
false};
326 iBc, subDetectorId, rodId, slb->
getL1Id(),
327 slb->
getBcId(), cand3plus, forward, sector, i,
329 vChannel.push_back(rCh);
332 "Tgc TgcSlbDataHelper::convertCoincidence :"
333 <<
" slb type =" << slb->
getType());
338 <<
" BC:" << iBc <<
" subDetId:" << subDetectorId
339 <<
" rodId:" << rodId <<
" sswId:" << slb->
getSswId()
341 <<
" slbId:" << slb->
getSlbId() <<
" roi:" << roi[i]
368 for (
size_t i = 0; i < numberOfHit; ++i) {
375 hipt[i], hitId[i], sub[i], deltaHPT[i])) {
376 std::string hpt_Type =
"E";
388 "Tgc TgcSlbDataHelper::convertCoincidence :"
389 <<
" slb type =" << slb->
getType());
393 << hpt_Type <<
" BC:" << iBc
394 <<
" subDetId:" << subDetectorId
395 <<
" rodId:" << rodId
399 << std::dec <<
" chip:" << chip[i]
400 <<
" index:" <<
index[i] <<
" hitId:"
401 << hitId[i] <<
" delta:" << deltaHPT[i]);
408 rCh =
new TgcRawData(iBc, subDetectorId, rodId,
410 strip[i], forward, sector, chip[i],
412 sub[i], deltaHPT[i], inner[i]);
414 vChannel.push_back(rCh);
417 "Tgc TgcSlbDataHelper::convertCoincidence :"
418 <<
" slb type =" << slb->
getType());
421 auto hptType = [&]() {
422 std::string hptType =
"E";
435 << hptType() <<
" BC:" << iBc
436 <<
" subDetId:" << subDetectorId <<
" rodId:" << rodId
439 <<
" slbId:" << slb->
getSlbId() << std::dec
440 <<
" chip:" << chip[i] <<
" index:" <<
index[i]
441 <<
" hitId:" << hitId[i] <<
" delta:" << deltaHPT[i]);
518 value = value || ((ibit < 200) && (ibit > 193));
519 value = value || ((ibit < 162) && (ibit > 149));
520 value = value || ((ibit < 118) && (ibit > 109));
521 value = value || ((ibit < 78) && (ibit > 73));
522 value = value || ((ibit < 42) && (ibit > 39));
543 int delta[],
int pos[])
const {
548 for (
int blk = 0; blk <
N_LPT_D; blk++) {
549 uint32_t binary =
getVal(bitArray, ibit, 9);
552 delta[blk] = binary & 0x07;
553 if (delta[blk] == 0) {
560 if ((binary & 0x08) == 0) {
566 pos[blk] = (binary & 0x1F0) >> 4;
575 bool hit[],
int pos[])
const {
584 binary =
getVal(bitArray, ibit, 6);
586 hit[blk] = ((binary & 0x20) != 0);
589 pos[blk] = (binary & 0x1F);
596 binary =
getVal(bitArray, ibit, 3);
598 hit[blk] = ((binary & 0x04) != 0);
601 pos[blk] = (binary & 0x03) * 8;
604 binary =
getVal(bitArray, ibit, 3);
606 pos[blk] += (binary & 0x07);
613 binary =
getVal(bitArray, ibit, 6);
615 hit[blk] = ((binary & 0x20) != 0);
618 pos[blk] = (binary & 0x1F);
629 for (
int blk = 0; blk <
N_LPT_TS; blk++) {
630 uint32_t binary =
getVal(bitArray, ibit, 5);
632 hit[blk] = ((binary & 0x10) != 0);
635 pos[blk] = (binary & 0x0F);
648 for (
int blk = 0; blk <
N_LPT_I; blk++) {
649 uint32_t binary =
getVal(bitArray, ibit, 1);
650 hit[blk] = (binary & 0x1);
656 bool hit[],
bool muplus[], uint16_t pt[],
657 bool overlap[], uint16_t roi[])
const {
664 for (
size_t icand = 0; icand < 2; icand++) {
666 muplus[icand] =
false;
668 overlap[icand] =
false;
674 cand3plus = (*(bitArray + 199));
679 binary =
getVal(bitArray, ibit, 3);
684 hit[0] = (binary != 7) && (binary != 0);
688 muplus[0] = (*(bitArray + 169));
692 binary =
getVal(bitArray, ibit, 6);
699 binary =
getVal(bitArray, ibit, 3);
704 hit[1] = (binary != 7) && (binary != 0);
707 muplus[1] = (*(bitArray + 168));
711 binary =
getVal(bitArray, ibit, 6);
717 bool hit[],
bool muplus[], uint16_t pt[],
718 bool overlap[], uint16_t roi[])
const {
725 for (
size_t icand = 0; icand < 2; icand++) {
727 muplus[icand] =
false;
729 overlap[icand] =
false;
735 cand3plus = (*(bitArray + 199));
740 binary =
getVal(bitArray, ibit, 3);
745 hit[0] = (binary != 7) && (binary != 0);
749 muplus[0] = (*(bitArray + 169));
753 binary =
getVal(bitArray, ibit, 8);
760 binary =
getVal(bitArray, ibit, 3);
765 hit[1] = (binary != 7) && (binary != 0);
769 muplus[1] = (*(bitArray + 168));
773 binary =
getVal(bitArray, ibit, 8);
779 bool strip[], uint16_t chip[],
781 uint16_t hitId[], uint16_t pos[],
782 int16_t delta[])
const {
796 for (
size_t idx = 0; idx < 2; ++idx) {
798 strip[icand] =
false;
799 index[icand] = 1 - idx;
807 sign = *(bitArray + ibit);
825 hipt[icand] = *(bitArray + ibit);
845 for (
size_t idx = 0; idx < 2; ++idx) {
847 strip[icand] =
false;
848 index[icand] = 1 - idx;
856 sign = *(bitArray + ibit);
874 hipt[icand] = *(bitArray + ibit);
885 if (hitId[icand] == 0 && hit[icand]) {
898 for (
size_t idx = 0; idx < 2; ++idx) {
901 index[icand] = 1 - idx;
910 sign = *(bitArray + ibit);
921 delta[icand] = -dPhi;
928 hipt[icand] = *(bitArray + ibit);
940 if (hitId[icand] == 0 && hit[icand]) {
952 bool strip[], uint16_t chip[],
954 uint16_t hitId[], uint16_t pos[],
955 int16_t delta[])
const {
972 strip[icand] =
false;
981 sign = *(bitArray + ibit);
999 hipt[icand] = *(bitArray + ibit);
1021 for (
size_t ichip = 1; ichip <= 3; ++ichip) {
1022 for (
size_t idx = 0; idx < 2; ++idx) {
1023 chip[icand] = ichip;
1024 strip[icand] =
false;
1025 index[icand] = 1 - idx;
1033 sign = *(bitArray + ibit);
1051 hipt[icand] = *(bitArray + ibit);
1075 for (
size_t ichip = 0; ichip <= 1; ++ichip) {
1080 for (
size_t idx = 0; idx < 2; ++idx) {
1081 chip[icand] = ichip;
1082 strip[icand] =
true;
1083 index[icand] = 1 - idx;
1092 sign = *(bitArray + ibit);
1096 delta[icand] = dPhi;
1103 delta[icand] = -dPhi;
1110 hipt[icand] = *(bitArray + ibit);
1135 chip[icand + 1] = ichip;
1136 strip[icand + 1] =
true;
1137 index[icand + 1] = 1 - idx;
1138 hit[icand + 1] =
true;
1139 delta[icand + 1] = delta[icand];
1140 pos[icand + 1] = pos[icand];
1141 hitId[icand + 1] = hitId[icand] + 4;
1145 chip[icand + 1] = ichip;
1146 strip[icand + 1] =
true;
1147 index[icand + 1] = 1 - idx;
1148 hit[icand + 1] =
false;
1149 delta[icand + 1] = 0;
1151 hitId[icand + 1] = 0;
1152 hipt[icand + 1] = 0;
1166 bool hipt, uint16_t hitId,
1174 isOK = (hitId != 0) && (hitId != 7);
1177 isOK = isOK && (abs(delta) < 8);
1181 isOK = (hitId == 0);
1193 uint16_t binary = 0;
1194 size_t ibit = start +
width - 1;
1195 for (
size_t i = 0; i <
width; ++i) {
1196 if (bitArray[ibit]) {
Athena::TPCnvVers::Old Athena::TPCnvVers::Current Athena::TPCnvVers::Old Athena::TPCnvVers::Current Athena::TPCnvVers::Old Athena::TPCnvVers::Current Athena::TPCnvVers::Current Athena::TPCnvVers::Current Athena::TPCnvVers::Current Athena::TPCnvVers::Current TgcRawData
AthMessaging(IMessageSvc *msgSvc, const std::string &name)
Constructor.
static bool isValid_HPT(bool hit, bool strip, uint16_t chip, uint16_t index, bool hipt, uint16_t hitId, uint16_t pos, int16_t delta)
Check if it is valid high-pT coincidence or not.
void getLPTforInner(const bool *bitArray, bool hit[]) const
Decode low-pT coincidence (tracklet) information for inner from bit array.
void convertToHits(uint16_t subDetectorId, uint16_t rodId, const TgcSlbData *slb, std::vector< TgcRawData * > &vChannel) const
Convert to Hits.
void getHPT_E(const bool *bitArray, bool hit[], bool strip[], uint16_t chip[], uint16_t index[], bool hipt[], uint16_t hitId[], uint16_t sub[], int16_t delta[]) const
Decode high-pT coincidence information for endcap region from bit array.
static bool isAdjacent(int ibit)
Adjacent or not.
void getLPTforTripletStrip(const bool *bitArray, bool hit[], int pos[]) const
Decode low-pT coincidence (tracklet) information for triplet strip from bit array.
void getSL_F(const bool *bitArray, bool &cand3plus, bool hit[], bool muplus[], uint16_t pt[], bool overlap[], uint16_t roi[]) const
Decode Sector Logic coincidence information for forward region from bit array.
static bool setType(uint16_t subDetectorId, uint16_t rodId, TgcSlbData *slb, int moduleType)
Set SLB Type based on sswId and moduleType.
static uint16_t getVal(const bool *bitArray, std::size_t start, std::size_t width)
Get a value in a range of a bitArray.
void getSL_E(const bool *bitArray, bool &cand3plus, bool hit[], bool muplus[], uint16_t pt[], bool overlap[], uint16_t roi[]) const
Decode Sector Logic coincidence information for endcap region from bit array.
void convertToCoincidences(uint16_t subDetectorId, uint16_t rodId, const TgcSlbData *slb, std::vector< TgcRawData * > &vChannel) const
Convert to coincidences.
void getLPTforTripletWire(const bool *bitArray, bool hit[], int pos[]) const
Decode low-pT coincidence (tracklet) information for triplet wire from bit array.
virtual ~TgcSlbDataHelper()
Destructor.
TgcSlbDataHelper()
Constructor.
void getHPT_F(const bool *bitArray, bool hit[], bool strip[], uint16_t chip[], uint16_t index[], bool hipt[], uint16_t hitId[], uint16_t sub[], int16_t delta[]) const
Decode high-pT coincidence information for forward region from bit array.
static uint16_t getSector(bool forward, uint16_t subDetectorId, uint16_t rodId, const TgcSlbData *slb)
Set sector for HpT/SL based on slbId.
void getLPTforDoublet(const bool *bitArray, bool hit[], int delta[], int pos[]) const
Decode low-pT coincidence (tracklet) information for doublet from bit array.
This is the SLB data class which represents an SLB block.
uint32_t getL1Id() const
Get l1Id.
uint16_t getBcId() const
Get bcId.
uint16_t getSswId() const
Get sswId.
void setType(int vType)
Set SLB type.
int getType() const
Get SLB type.
uint16_t getSbLoc() const
Get sbLoc.
const bool * getBitArray(const uint16_t bcTag) const
Get bitArray for a BC tag.
uint16_t getSlbId() const
Get slbId.
An unit object of TGC ROD output.
uint16_t position() const
uint16_t subMatrix() const
uint16_t subDetectorId() const
std::vector< std::string > veto
these patterns are anded