47#define WRONG_SAMPLE(frag,chan,size) \
48msg(MSG::ERROR) << "Wrong no. of samples (" << size \
49 << ") for channel " << chan \
50 << " in frag 0x"<<MSG::hex << frag << MSG::dec \
51 << " - " << BeamFragName[frag&0x1F] << endmsg;
53#define WRONG_CHANNEL(frag,chan) \
54msg(MSG::ERROR) << "Wrong channel " << chan \
55 << " in frag 0x"<<MSG::hex << frag << MSG::dec \
56 << " - " << BeamFragName[frag&0x1F] << endmsg;
58#define FRAG_FOUND(frag,chan,size) \
59if (msgLvl(MSG::DEBUG)) \
60 msg(MSG::DEBUG) << "Found channel " << chan \
61 << " in frag 0x"<<MSG::hex << frag << MSG::dec \
62 << " - " << BeamFragName[frag&0x1F] \
63 << " of size " << size << endmsg;
66#define SIGNAL_FOUND(frag,chan,amplitude) \
67if (msgLvl(MSG::DEBUG)) \
68 msg(MSG::DEBUG) << "Found channel " << chan \
69 << " in frag 0x"<<MSG::hex << frag << MSG::dec \
70 << " - " << BeamFragName[frag&0x1F] \
71 << " with amp=" << amplitude << endmsg;
73#define MAX_DRAWERS 256
89 char frg[6] =
"0x000";
91 for (
unsigned int i=0; i<
sizeof(
m_beamIdList)/
sizeof(bool); ++i) {
95 sprintf(frg,
"0x%3.3x",i);
126 return StatusCode::SUCCESS;
241 if (
sc.isFailure()) {
243 return StatusCode::FAILURE;
253 ATH_MSG_INFO(
"Final offline units are not set, will use DSP units" );
259 ATH_MSG_INFO(
"calibrateEnergy is disabled, don't want to use DSP units" );
272 msg(MSG::INFO) <<
"drawerList " << MSG::hex;
274 for (
unsigned int dr = 0; dr <
size; ++dr) {
279 msg(MSG::INFO) <<
" 0x" << frag;
293 msg(MSG::INFO) <<
" - negative number, will read frag IDs from the data" << MSG::dec <<
endmsg;
295 msg(MSG::INFO) <<
"is empty, no drawer fragments in ntuple" << MSG::dec <<
endmsg;
306 msg(MSG::INFO) << MSG::INFO <<
"drawerType ";
307 for (
unsigned int dr = 0; dr <
size; ++dr)
317 msg(MSG::INFO) << MSG::INFO <<
"Beam Frag List " << MSG::hex;
319 for (
unsigned int dr = 0; dr <
size; ++dr) {
323 msg(MSG::INFO) <<
" 0x" << frag;
327 msg(MSG::INFO) <<
"is empty, no beam fragments in ntuple" << MSG::dec <<
endmsg;
359 return StatusCode::SUCCESS;
389 m_run = ctx.eventID().run_number();
390 m_evt = ctx.eventID().event_number();
393 if (ctx.eventID().time_stamp() > 0) {
394 m_evTime = ctx.eventID().time_stamp();
447 return StatusCode::SUCCESS;
458 return StatusCode::FAILURE;
522 return StatusCode::SUCCESS;
528 return StatusCode::SUCCESS;
540 if ( collItr!=lastColl ) {
541 m_l1ID.at(nDrawersAll) = (*collItr)->getLvl1Id();
542 m_l1Type.at(nDrawersAll) = (*collItr)->getLvl1Type();
543 m_evType.at(nDrawersAll) = (*collItr)->getDetEvType();
544 m_evBCID.at(nDrawersAll) = (*collItr)->getRODBCID();
546 m_l1ID.at(nDrawersAll) = 0xFFFFFFFF;
547 m_l1Type.at(nDrawersAll) = 0xFFFFFFFF;
548 m_evType.at(nDrawersAll) = 0xFFFFFFFF;
549 m_evBCID.at(nDrawersAll) = 0xFFFFFFFF;
556 for(; collItr != lastColl; ++collItr) {
561 if (
msgLvl(MSG::VERBOSE)) {
563 for (; beamItr != lastBeam; ++beamItr) {
565 std::vector<uint32_t> digits = (*beamItr)->get_digits();
566 msg(MSG::VERBOSE) <<
" --- TileBeamElem -- Identifier " <<
m_tileHWID->to_string(
id)
567 << MSG::hex <<
" frag: 0x" << (*collItr)->identify()
568 << MSG::dec <<
" channel " <<
m_tileHWID->channel(
id)
569 <<
" digits size " << digits.size() <<
endmsg;
570 msg(MSG::VERBOSE) <<
" --- TileBeamElem -- BeamElem : ";
571 for (
unsigned int k = 0; k < digits.size(); k++)
572 msg(MSG::VERBOSE) << digits[k] <<
" ";
576 beamItr = (*collItr)->begin();
579 int frag = (*collItr)->identify();
583 if (
m_trigType == 0 && (*collItr)->getLvl1Type() != 0 )
589 for (; beamItr != lastBeam; ++beamItr) {
592 std::vector<uint32_t> digits = (*beamItr)->get_digits();
594 int dsize = digits.size();
613 uint32_t amplitude = digits[0];
621 if(cha < 8)
m_btdc1[cha] = amplitude;
622 else if(cha < 16)
m_btdc2[cha-8] = amplitude;
631 case 0:
m_s1cou = amplitude;
break;
632 case 1:
m_s2cou = amplitude;
break;
633 case 2:
m_s3cou = amplitude;
break;
634 case 3:
m_cher1 = amplitude;
break;
635 case 4:
m_cher2 = amplitude;
break;
636 case 5:
m_muTag = amplitude;
break;
644 case 0:
m_s1cou = amplitude;
break;
645 case 1:
m_s2cou = amplitude;
break;
646 case 2:
m_s3cou = amplitude;
break;
647 case 3:
m_cher1 = amplitude;
break;
648 case 4:
m_muTag = amplitude;
break;
649 case 5:
m_cher2 = amplitude;
break;
653 case 8:
m_las0 = amplitude;
break;
654 case 9:
m_las1 = amplitude;
break;
655 case 10:
m_las2 = amplitude;
break;
656 case 11:
m_las3 = amplitude;
break;
666 case 0:
m_sc1 = amplitude;
break;
667 case 1:
m_sc2 = amplitude;
break;
682 if(cha < 14)
m_muBack[cha] = amplitude;
684 else if (cha < 16)
m_muCalib[cha - 14] = amplitude;
691 if(cha < 6)
m_muBack[cha + 8] = amplitude;
693 else if (cha < 8)
m_muCalib[cha - 6] = amplitude;
702 if (amplitude & 0xFF00)
m_trigType = amplitude >> 8;
712 case 0:
m_las0 = amplitude;
break;
713 case 1:
m_las1 = amplitude;
break;
714 case 2:
m_las2 = amplitude;
break;
715 case 3:
m_las3 = amplitude;
break;
728 for (
int k = 0; k < dsize; k++) {
747 m_qdc[cha] = amplitude;
749 }
else if (cha == 15) {
750 for (
int idx = 0; idx < dsize && idx < 18; ++idx) {
751 m_qdc[idx + 15] = digits[idx];
759 if(cha < 8)
m_ecal[cha] = amplitude;
767 if(cha < 16)
m_cispar[cha] = amplitude;
774 if (
m_run > 2211444) {
777 case 0:
m_s1cou = amplitude;
break;
778 case 1:
m_s2cou = amplitude;
break;
780 if (
m_run < 2310000) {
787 case 3:
m_cher1 = amplitude;
break;
788 case 4:
m_cher2 = amplitude;
break;
789 case 5:
m_cher3 = amplitude;
break;
790 default:
m_muBack[cha - 6] = amplitude;
795 case 0:
m_s1cou = amplitude;
break;
796 case 1:
m_s2cou = amplitude;
break;
797 case 2:
m_s3cou = amplitude;
break;
798 case 3:
m_cher1 = amplitude;
break;
799 case 4:
m_cher2 = amplitude;
break;
800 case 5:
m_cher3 = amplitude;
break;
809 case 0:
m_s1cou = amplitude;
break;
810 case 1:
m_s2cou = amplitude;
break;
811 case 2:
m_s3cou = amplitude;
break;
812 case 3:
m_muTag = amplitude;
break;
813 case 4:
m_cher1 = amplitude;
break;
814 case 5:
m_cher2 = amplitude;
break;
849 if (
m_run > 2310000 && cha < 16) {
851 }
else if (cha == 0) {
863 m_tof[cha] = amplitude;
875 m_tof[cha] = amplitude;
882 if(cha < 8)
m_tof[cha] = amplitude;
890 if ((cha > 11) && (cha < 16) && (
m_run > 2211136)) {
891 m_tof[cha] = amplitude;
899 (*m_btdc)[cha].push_back(amplitude);
907 if(cha < 16)
m_btdc2[cha] = amplitude;
915 for (
int ibit = 0; ibit < 32; ++ibit){
918 }
else if (cha == 3) {
928 for (
int ibit=0; ibit < 32; ++ibit){
931 }
else if (cha == 3) {
941 for (
int ibit = 0; ibit < 32; ++ibit){
944 }
else if (cha == 3) {
954 for (
int ibit = 0; ibit < 32; ++ibit){
957 }
else if (cha == 3) {
967 for (
int ibit = 0; ibit < 32; ++ibit){
970 }
else if (cha == 3) {
980 for (
int ibit = 0; ibit < 32; ++ibit){
983 }
else if (cha == 3) {
993 for (
int ibit = 0; ibit < 32; ++ibit){
996 }
else if (cha == 3) {
1006 for (
int ibit = 0; ibit < 32; ++ibit){
1009 }
else if (cha == 3) {
1023 for (
int i=0; i<8; ++i) {
1039 if (
m_run > 2211444) {
1055 if (
m_run > 2211444) {
1081 if (
m_run > 2211444) {
1145 if (
evtStore()->retrieve(eventInfo).isFailure()){
1146 ATH_MSG_ERROR(
"No EventInfo object found! Can't read run number!" );
1173 return StatusCode::SUCCESS;
1185 , std::vector<std::array<float, MAX_CHAN>>* eneVec
1186 , std::vector<std::array<float, MAX_CHAN>>* timeVec
1187 , std::vector<std::array<float, MAX_CHAN>>* chi2Vec
1188 , std::vector<std::array<float, MAX_CHAN>>* pedVec
1189 ,
bool saveDQstatus)
1193 if (containerKey.
empty()) {
1194 return StatusCode::FAILURE;
1197 bool isFELIX = containerKey.
key().find(
"Flx") != std::string::npos;
1216 ATH_MSG_ERROR(
"RawChannel units are not ADC counts, can't apply DSP-like calibration" );
1217 return StatusCode::FAILURE;
1233 int drawerIndex, fragType;
1238 int fragId = rawChannelCollection->identify();
1242 if ( itr != drawerMap.end() ) {
1243 drawerIndex = (*itr).second;
1248 if (drawerIndex < 0) {
1249 if ( !rawChannelCollection->empty() )
1250 ATH_MSG_DEBUG(
"frag id 0x" << MSG::hex << fragId << MSG::dec <<
" was not found among valid frag IDs when storing TRC!" );
1252 fragType = isFELIX ? fragId >> 8 :
m_drawerType[drawerIndex];
1255 <<
" Frag id 0x" << MSG::hex << fragId << MSG::dec
1256 <<
" index "<< drawerIndex );
1260 int index = drawerIndex;
1269 if (gain == 1)
index += nDrawers;
1273 double energy = rch->amplitude();
1285 (
m_TBperiod==2017 && ((fragId&0xFF)<4 && !(fragId == 0x201 || fragId == 0x203))) ||
1286 (
m_TBperiod==2018 && ((fragId&0xFF)<4 && !(fragId == 0x201 || fragId == 0x402))) ||
1287 (
m_TBperiod==2019 && ((fragId&0xFF)<5 && !(fragId == 0x201 || fragId == 0x203 || fragId >= 0x402))) ||
1288 (
m_TBperiod==2022 && ((fragId&0xFF)<4 && !(fragId == 0x201 || (
m_run >= 2210456 && fragId == 0x402)))))
1292 eneVec->at(
index)[channel] = energy;
1293 timeVec->at(
index)[channel] = rch->time();
1295 chi2Vec->at(
index)[channel] = rch->quality();
1298 pedVec->at(
index)[channel] = rch->pedestal();
1302 <<
" time=" << rch->time()
1303 <<
" chi2=" << rch->quality()
1304 <<
" ped=" << rch->pedestal()
1305 <<
" pmt-1=" << channel
1306 <<
" index " <<
index );
1310 if (saveDQstatus && !isFELIX) {
1312 int index1 = drawerIndex, index2 = drawerIndex + 1;
1321 for (
unsigned int dmu = 0; dmu <
MAX_DMU; ++dmu) {
1335 return StatusCode::SUCCESS;
1346 if (containerKey.
empty()) {
1347 return StatusCode::FAILURE;
1353 bool emptyColl =
true;
1356 int drawerIndex, fragType, channel;
1358 std::vector<float> sampleVec;
1359 std::vector<uint32_t> headerVec;
1360 std::vector<uint32_t> headerVecHi;
1368 int fragId = digitsCollection->identify();
1369 int ros = (fragId >> 8);
1370 int drawer = fragId & 0x3F;
1374 drawerIndex = (*itr).second;
1379 if (drawerIndex < 0) {
1380 if ( !digitsCollection->empty() )
1381 ATH_MSG_DEBUG(
"frag id 0x" << MSG::hex << fragId << MSG::dec <<
" was not found among valid frag IDs when storing TRC!" );
1387 <<
" Frag id 0x" << MSG::hex << fragId << MSG::dec
1388 <<
" index " << drawerIndex
1392 <<
" BCID=" << digitsCollection->getFragBCID()<<MSG::hex
1393 <<
" CRC=0x" << (digitsCollection->getFragCRC()&0xffff)
1394 <<
" DMUMask=0x" << (digitsCollection->getFragDMUMask()&0xffff)<<MSG::dec );
1397 <<
" Lvl1Type=" << digitsCollection->getLvl1Type()
1398 <<
" EvBCID=" << digitsCollection->getRODBCID()
1399 <<
" EvType=" << digitsCollection->getDetEvType() );
1401 ATH_MSG_DEBUG(
" Header=" << digitsCollection->getFragChipHeaderWords() );
1408 m_l1ID.at(drawerIndex) = digitsCollection->getLvl1Id();
1409 m_l1Type.at(drawerIndex) = digitsCollection->getLvl1Type();
1410 m_evType.at(drawerIndex) = digitsCollection->getDetEvType();
1411 m_evBCID.at(drawerIndex) = digitsCollection->getRODBCID();
1413 m_frBCID.at(drawerIndex) = digitsCollection->getFragBCID();
1421 int drawerIndexHi = drawerIndex +
m_nDrawers;
1423 if (!digitsCollection->empty()) {
1426 m_rodBCIDVec.at(drawerIndex) = digitsCollection->getRODBCID();
1427 m_sizeVec.at(drawerIndex) = digitsCollection->getFragSize();
1428 m_sizeVec.at(drawerIndexHi) = digitsCollection->getFragSize();
1432 headerVec = digitsCollection->getFragChipHeaderWords();
1433 headerVecHi = digitsCollection->getFragChipHeaderWordsHigh();
1434 CRCmask = digitsCollection->getFragDMUMask();
1435 fe_crc = CRCmask & 0xFFFF;
1436 rod_crc = CRCmask >> 16;
1438 unsigned int headsize = std::min(16U,
static_cast<unsigned int>(headerVec.size()));
1439 unsigned int headsizehi = std::min(16U,
static_cast<unsigned int>(headerVecHi.size()));
1441 for (
unsigned int ih = 0; ih < headsize; ++ih) {
1443 m_bcidVec.at(drawerIndex)[ih] = (headerVec[ih] & 0xFFF);
1450 m_feCRCVec.at(drawerIndex)[ih] = (fe_crc >> ih & 0x1);
1451 m_rodCRCVec.at(drawerIndex)[ih] = (rod_crc >> ih & 0x1);
1459 for (
unsigned int ihhi = 0; ihhi < headsizehi; ++ihhi) {
1460 m_bcidVec.at(drawerIndexHi)[ihhi] = (headerVecHi[ihhi] & 0xFFF);
1476 m_slinkCRCVec.at(drawerIndex)[0] = (digitsCollection->getFragCRC() >> 16) & 0xffff;
1477 m_dmuMaskVec.at(drawerIndex)[0] = (digitsCollection->getFragDMUMask() >> 16) & 0xffff;
1478 m_slinkCRCVec.at(drawerIndex)[1] = digitsCollection->getFragCRC() & 0xffff;
1479 m_dmuMaskVec.at(drawerIndex)[1] = digitsCollection->getFragDMUMask() & 0xffff;
1481 m_slinkCRCVec.at(drawerIndexHi)[0] = (digitsCollection->getFragCRC() >> 16) & 0xffff;
1482 m_dmuMaskVec.at(drawerIndexHi)[0] = (digitsCollection->getFragDMUMask() >> 16) & 0xffff;
1483 m_slinkCRCVec.at(drawerIndexHi)[1] = digitsCollection->getFragCRC() & 0xffff;
1484 m_dmuMaskVec.at(drawerIndexHi)[1] = digitsCollection->getFragDMUMask() & 0xffff;
1487 for (
const TileDigits* tile_digits : *digitsCollection) {
1495 int index = (gain == 1) ? drawerIndexHi : drawerIndex;
1505 (
m_TBperiod==2017 && ((fragId&0xFF)<4 && !(fragId == 0x201 || fragId == 0x203))) ||
1506 (
m_TBperiod==2018 && ((fragId&0xFF)<4 && !(fragId == 0x201 || fragId == 0x402))) ||
1507 (
m_TBperiod==2019 && ((fragId&0xFF)<5 && !(fragId == 0x201 || fragId == 0x203 || fragId >= 0x402))) ||
1508 (
m_TBperiod==2022 && ((fragId&0xFF)<4 && !(fragId == 0x201 || (
m_run >= 2210456 && fragId == 0x402)))))
1518 <<
" index " <<
index );
1521 sampleVec = tile_digits->samples();
1522 int siz = sampleVec.size();
1524 if (
msgLvl(MSG::DEBUG)) {
1525 msg(MSG::DEBUG) <<
"Digits(" << siz <<
")." << (dcnt++) <<
" {";
1526 for (
int i = 0; i < siz; i++) {
1527 msg(MSG::DEBUG) <<
static_cast<int>(sampleVec[i]) <<
" ";
1530 if (siz > nSamplesInDrawer) {
1531 msg(MSG::DEBUG) <<
"} ONLY " << nSamplesInDrawer <<
" digits saved to ntuple" <<
endmsg;
1537 if (siz > nSamplesInDrawer) siz = nSamplesInDrawer;
1538 std::transform(sampleVec.begin(), sampleVec.begin() + siz, &
m_sampleVec.at(
index).get()[0] + nSamplesInDrawer * channel, [] (
float v) {return static_cast<int>(v);});
1544 m_rodBCIDVec.at(drawerIndex) = digitsCollection->getRODBCID();
1545 m_sizeVec.at(drawerIndex) = digitsCollection->getFragSize();
1548 headerVec = digitsCollection->getFragChipHeaderWords();
1549 CRCmask = digitsCollection->getFragDMUMask();
1550 fe_crc = CRCmask & 0xFFFF;
1551 rod_crc = CRCmask >> 16;
1553 int headsize = headerVec.size();
1555 for (
int ih = 0; ih < headsize; ++ih) {
1556 m_bcidVec.at(drawerIndex)[ih] = (headerVec[ih] & 0xFFF);
1563 m_feCRCVec.at(drawerIndex)[ih] = (fe_crc >> ih & 0x1);
1564 m_rodCRCVec.at(drawerIndex)[ih] = (rod_crc >> ih & 0x1);
1572 m_slinkCRCVec.at(drawerIndex)[0] = (digitsCollection->getFragCRC() >> 16) & 0xffff;
1573 m_dmuMaskVec.at(drawerIndex)[0] = (digitsCollection->getFragDMUMask() >> 16) & 0xffff;
1574 m_slinkCRCVec.at(drawerIndex)[1] = digitsCollection->getFragCRC() & 0xffff;
1575 m_dmuMaskVec.at(drawerIndex)[1] = digitsCollection->getFragDMUMask() & 0xffff;
1581 for (
const TileDigits* tile_digits : *digitsCollection) {
1591 (
m_TBperiod==2017 && ((fragId&0xFF)<4 && !(fragId == 0x201 || fragId == 0x203))) ||
1592 (
m_TBperiod==2018 && ((fragId&0xFF)<4 && !(fragId == 0x201 || fragId == 0x402))) ||
1593 (
m_TBperiod==2019 && ((fragId&0xFF)<5 && !(fragId == 0x201 || fragId == 0x203 || fragId >= 0x402))) ||
1594 (
m_TBperiod==2022 && ((fragId&0xFF)<4 && !(fragId == 0x201 || (
m_run >= 2210456 && fragId == 0x402)))))
1604 sampleVec = tile_digits->samples();
1605 int siz = sampleVec.size();
1606 if (
msgLvl(MSG::DEBUG)) {
1607 msg(MSG::DEBUG) <<
"Digits(" << siz <<
")." << (dcnt++) <<
" {";
1609 for (
int i = 0; i < siz; i++) {
1610 msg(MSG::DEBUG) <<
static_cast<int>(sampleVec[i]) <<
" ";
1613 if (siz > nSamplesInDrawer) {
1614 msg(MSG::DEBUG) <<
"} ONLY " << nSamplesInDrawer <<
" digits saved to ntuple" <<
endmsg;
1620 if (siz > nSamplesInDrawer) siz = nSamplesInDrawer;
1621 std::transform(sampleVec.begin(), sampleVec.begin() + siz, &
m_sampleVec.at(drawerIndex).get()[0] + nSamplesInDrawer * channel, [] (
float v) {return static_cast<int>(v);});
1629 return StatusCode::FAILURE;
1631 return StatusCode::SUCCESS;
1637 if (containerKey.
empty()) {
1638 return StatusCode::FAILURE;
1644 bool emptyColl =
true;
1647 int drawerIndex, channel;
1649 std::vector<float> sampleVecLo;
1650 std::vector<float> sampleVecHi;
1654 int fragId = digitsCollection->identify();
1657 drawerIndex = (*itr).second;
1662 if (drawerIndex < 0) {
1663 if ( !digitsCollection->empty() )
1664 ATH_MSG_DEBUG(
"FELIX frag id 0x" << MSG::hex << fragId << MSG::dec <<
" was not found among valid frag IDs when storing TRC!" );
1669 <<
" FELIX Frag id 0x" << MSG::hex << fragId << MSG::dec
1670 <<
" index " << drawerIndex);
1672 ATH_MSG_DEBUG(
" Size=" << digitsCollection->getFragSize());
1675 <<
" EvBCID=" << digitsCollection->getRODBCID()
1676 <<
" EvType=" << digitsCollection->getDetEvType() );
1677 ATH_MSG_DEBUG(
" Headers = "<< digitsCollection->getFragExtraWords() );
1697 std::vector<uint32_t> extraWords = digitsCollection->getFragExtraWords();
1700 std::reference_wrapper<std::array<int,MAX_MINIDRAWER>>
1707 auto it = extraWords.begin();
1708 for (
int i = 0; i < 10; ++i) {
1716 if(!digitsCollection->empty()) {
1721 m_sizeflxVec.at(drawerIndex) = digitsCollection->getFragSize();
1726 for (
const TileDigits* tile_digits : *digitsCollection) {
1732 int index = (gain == 1) ? drawerIndexHi : drawerIndex;
1742 <<
" index " <<
index );
1746 sampleVecLo = tile_digits->samples();
1747 }
else if (gain == 1) {
1748 sampleVecHi = tile_digits->samples();
1751 int sizLo = sampleVecLo.size();
1752 int sizHi = sampleVecHi.size();
1756 if (
msgLvl(MSG::DEBUG)) {
1758 msg(MSG::DEBUG) <<
"Low gain Digits(" << sizLo <<
")." << (dcnt++) <<
" {";
1759 for (
int i = 0; i < sizLo; i++) {
1760 msg(MSG::DEBUG) <<
static_cast<int>(sampleVecLo[i]) <<
" ";
1763 if (sizLo > nSamplesInDrawer) {
1764 msg(MSG::DEBUG) <<
"} ONLY " << nSamplesInDrawer <<
" digits saved to ntuple" <<
endmsg;
1771 msg(MSG::DEBUG) <<
"High gain Digits(" << sizHi <<
")." << (dcnt++) <<
" {";
1772 for (
int i = 0; i < sizHi; i++) {
1773 msg(MSG::DEBUG) <<
static_cast<int>(sampleVecHi[i]) <<
" ";
1776 if (sizHi > nSamplesInDrawer) {
1777 msg(MSG::DEBUG) <<
"} ONLY " << nSamplesInDrawer <<
" digits saved to ntuple" <<
endmsg;
1785 if (sizLo > nSamplesInDrawer) sizLo = nSamplesInDrawer;
1786 if (sizHi > nSamplesInDrawer) sizHi = nSamplesInDrawer;
1787 std::transform(sampleVecLo.begin(), sampleVecLo.begin() + sizLo, &
m_sampleflxVec.at(
index).get()[0] + nSamplesInDrawer * channel, [] (
float v) {return static_cast<int>(v);});
1788 std::transform(sampleVecHi.begin(), sampleVecHi.begin() + sizHi, &
m_sampleflxVec.at(
index).get()[0] + nSamplesInDrawer * channel, [] (
float v) {return static_cast<int>(v);});
1789 sampleVecLo.clear();
1790 sampleVecHi.clear();
1798 return StatusCode::FAILURE;
1800 return StatusCode::SUCCESS;
1811 return StatusCode::FAILURE;
1823 for (
const TileHit& cinp : *hitVec) {
1831 int drawerIndex = ( itr !=
m_drawerMap.end() ) ?
static_cast<int>((*itr).second) : -1;
1833 if (drawerIndex < 0) {
1834 ATH_MSG_WARNING(
"frag id 0x" << MSG::hex << fragId << MSG::dec <<
" was not found among valid frag IDs when storing HITS!" );
1842 if (hitVec->
empty())
1843 return StatusCode::FAILURE;
1845 return StatusCode::SUCCESS;
1856 return StatusCode::FAILURE;
1865 bool emptyColl =
true;
1871 int fragId = hitCollection->identify();
1873 int drawerIndex = ( itr !=
m_drawerMap.end() ) ?
static_cast<int>((*itr).second) : -1;
1875 if (drawerIndex < 0) {
1876 if ( !hitCollection->empty() )
1877 ATH_MSG_WARNING(
"frag id 0x" << MSG::hex << fragId << MSG::dec <<
" was not found among valid frag IDs when storing HITS!" );
1883 <<
" Frag id 0x" << MSG::hex << fragId << MSG::dec
1884 <<
" index " << drawerIndex );
1886 if (emptyColl) emptyColl = hitCollection->empty();
1888 for (
const TileHit* cinp : *hitCollection) {
1895 return StatusCode::FAILURE;
1897 return StatusCode::SUCCESS;
1901 std::array<float, MAX_CHAN>& ehitVec,
1902 std::array<float, MAX_CHAN>& thitVec,
1910 if (
msgLvl(MSG::VERBOSE)) {
1911 msg(MSG::VERBOSE) <<
"hit hwid="
1912 <<
m_tileHWID->to_string(hwid, -1) <<
" ener=";
1914 for (
int i = 0; i <
size; ++i)
1915 msg(MSG::VERBOSE) << cinp->
energy(i) <<
" ";
1917 msg(MSG::VERBOSE) <<
"time=";
1918 for (
int i = 0; i <
size; ++i)
1919 msg(MSG::VERBOSE) << cinp->
time(i) <<
" ";
1924 double ehit=0.0, thit=0.0;
1925 for(
int i=0;i<
size;++i) {
1927 double e = cinp->
energy(i);
1928 double t = cinp->
time(i);
1930 if (-75.<t && t<75.) {
1953 (
m_TBperiod==2017 && ((fragId&0xFF)<4 && !(fragId == 0x201 || fragId == 0x203))) ||
1954 (
m_TBperiod==2018 && ((fragId&0xFF)<4 && !(fragId == 0x201 || fragId == 0x402))) ||
1955 (
m_TBperiod==2019 && ((fragId&0xFF)<5 && !(fragId == 0x201 || fragId == 0x203 || fragId >= 0x402))) ||
1956 (
m_TBperiod==2022 && ((fragId&0xFF)<4 && !(fragId == 0x201 || (
m_run >= 2210456 && fragId == 0x402)))))
1960 ehitVec[channel] = ehit;
1961 thitVec[channel] = thit;
1965 <<
" pmt-1=" << channel
2015 return StatusCode::SUCCESS;
2020 MsgStream log(msgSvc(), name());
2092 auto tree = std::make_unique<TTree>(
m_ntupleID.value().c_str(),
"TileBEAM-Ntuple");
2126 return StatusCode::SUCCESS;
2132 return StatusCode::FAILURE;
2139 ATH_MSG_DEBUG(
"succeeded retrieving cellContainer from SG" );
2141 ATH_MSG_DEBUG(
"TileTBAANtuple : about to iterate over CaloCells" );
2148 for (
const CaloCell* cell : *cellContainer) {
2150 const double energy = cell->energy();
2154 if (sampl == CaloCell_ID::PreSamplerB) {
2156 }
else if (sampl == CaloCell_ID::EMB1) {
2158 }
else if (sampl == CaloCell_ID::EMB2) {
2160 }
else if (sampl == CaloCell_ID::EMB3) {
2162 }
else if (sampl == CaloCell_ID::TileBar0) {
2164 }
else if (sampl == CaloCell_ID::TileBar1) {
2166 }
else if (sampl == CaloCell_ID::TileBar2) {
2168 }
else if (sampl == CaloCell_ID::TileExt0) {
2170 }
else if (sampl == CaloCell_ID::TileExt1) {
2172 }
else if (sampl == CaloCell_ID::TileExt2) {
2174 }
else if (sampl == CaloCell_ID::TileGap1) {
2176 }
else if (sampl == CaloCell_ID::TileGap2) {
2178 }
else if (sampl == CaloCell_ID::TileGap3) {
2183 return StatusCode::SUCCESS;
2204 return StatusCode::SUCCESS;
2213 std::vector<unsigned int> frags;
2216 if (!digitsCollection->empty()) {
2218 frags.push_back(digitsCollection->identify());
2221 size = frags.size();
2230 unsigned int rosOrder[5] = { 2, 1, 3, 4, 0 };
2231 unsigned int dr = 0;
2232 char frg[6] =
"0x000";
2238 msg(MSG::INFO) <<
"setting drawerList from data " << MSG::hex;
2239 for (
unsigned int ir = 0;
ir < 5; ++
ir) {
2240 for (
unsigned int i = 0; i <
size; ++i) {
2241 unsigned int frag = frags[i];
2242 if (frag >> 8 == rosOrder[
ir]) {
2243 sprintf(frg,
"0x%3.3x", frag);
2247 msg(MSG::INFO) <<
" 0x" << frag;
2262 msg(MSG::INFO) << MSG::INFO <<
"drawerType ";
2263 for (
unsigned int dr = 0; dr <
size; ++dr)
2290 if (!digitsCollection->empty()) {
2291 int siz = digitsCollection->front()->samples().size();
2301 return StatusCode::SUCCESS;
2321 return StatusCode::SUCCESS;
2330 std::vector<unsigned int> frags;
2333 if (!digitsCollection->empty()) {
2335 frags.push_back(digitsCollection->identify());
2339 unsigned int nFrags = frags.size();
2350 std::ostringstream os;
2351 os <<
"setting FELIX drawers from data " << std::hex;
2352 unsigned int drawerIndex = 0;
2353 for (
unsigned int frag : frags) {
2355 os <<
" 0x" << frag;
2369 ATH_MSG_ERROR(
"can't find any FELIX TileDigits collections" );
2370 ATH_MSG_ERROR(
"can't set up FELIX fragment list for ntuple" );
2379 if (!digitsCollection->empty()) {
2380 int siz = digitsCollection->front()->samples().size();
2390 return StatusCode::SUCCESS;
2407 if (fileName.size() == 0) {
2414 std::ifstream etafile;
2415 etafile.open(fileName.c_str());
2417 if (etafile.good()) {
2422 while ((runNumber !=
m_runNumber) && (!etafile.eof())) {
2423 etafile >> runNumber >>
eta;
2486 if (nDrawersAll > 0) {
2487 m_l1ID.resize(nDrawersAll + 1);
2559 for(
unsigned i=0; i<33; ++i){
m_qdc[i]=0.0; }
2568//Clear Tree TRIGGER variables
2590//Clear Tree MUON variables
2602//Clear Tree ECAL variables
2613//Clear Tree QDC variables
2619 for(
unsigned i=0; i<33; ++i){
m_qdc[i]=0.0; }
2706//Clear Tree LASER variables
2768 for (
int j = 0; j < 16; j++) {
2781//Clear Tree ADDER variables
2807//Clear Tree CISPAR variables
2860 m_btdc =
new std::vector<std::vector<int> >(16);
2941//Clear Tree BEAM variables
3004 for (
int i=0; i<16; i+=2) {
3006 m_tof[i+1] = -0xFFFF;
3009 for (
int i=0; i<16; i+=2) {
3014 for (
int i=0; i<16; i+=2) {
3020 for (std::vector<int>& btdc_amplitudes : *
m_btdc) {
3021 btdc_amplitudes.clear();
3049//Clear Tree ENETOTAL variables
3109//Clear Tree COINCBOARD variables
3175 std::ostringstream oss;
3177 std::string nSampStr=oss.str();
3179 unsigned int listSize = std::min(
m_nDrawers.value(),
static_cast<unsigned int>(
m_drawerMap.size()));
3183 std::string digit[10] = {
"0",
"1",
"2",
"3",
"4",
"5",
"6",
"7",
"8",
"9" };
3184 std::vector<std::string> suffixArr;
3191 suffixArr.resize(
length);
3193 for (
unsigned int i = 0; i < listSize; ++i) {
3195 unsigned int drawer = strtol(
m_drawerList[i].data(), NULL, 0) & 0x3F;
3199 digits = digit[drawer / 10] + digit[drawer % 10];
3200 }
else if (testbeam) {
3201 digits = digit[drawer & 7];
3204 digits = digit[drawer / 10] + digit[drawer % 10];
3209 suff.replace(suff.find(
"0x"), 2,
"");
3210 suffixArr[i] = suff +
"lo";
3213 suffixArr[i] =
m_rosName[ros] + digits +
"lo";
3220 suffixArr.resize(
length);
3222 for (
unsigned int i = 0; i < listSize; ++i) {
3224 unsigned int drawer = strtol(
m_drawerList[i].data(), NULL, 0) & 0x3F;
3228 digits = digit[drawer / 10] + digit[drawer % 10];
3229 }
else if (testbeam) {
3230 digits = digit[drawer & 7];
3233 digits = digit[drawer / 10] + digit[drawer % 10];
3238 suff.replace(suff.find(
"0x"), 2,
"");
3239 suffixArr[i] = std::move(suff);
3253 for (
unsigned int i = 0; i <
length; i++) {
3260 nSamplesInDrawer = it->second;
3264 m_bcidVec.push_back(std::array<int, MAX_DMU>());
3276 m_gainVec.push_back(std::array<int, MAX_CHAN>());
3278 m_feCRCVec.push_back(std::array<int, MAX_DMU>());
3279 m_rodCRCVec.push_back(std::array<int, MAX_DMU>());
3281 m_eneVec.push_back(std::array<float, MAX_CHAN>());
3282 m_timeVec.push_back(std::array<float, MAX_CHAN>());
3286 m_efitVec.push_back(std::array<float, MAX_CHAN>());
3287 m_tfitVec.push_back(std::array<float, MAX_CHAN>());
3288 m_pedfitVec.push_back(std::array<float, MAX_CHAN>());
3289 m_chi2Vec.push_back(std::array<float, MAX_CHAN>());
3291 m_efitcVec.push_back(std::array<float, MAX_CHAN>());
3292 m_tfitcVec.push_back(std::array<float, MAX_CHAN>());
3294 m_chi2cVec.push_back(std::array<float, MAX_CHAN>());
3296 m_eOptVec.push_back(std::array<float, MAX_CHAN>());
3297 m_tOptVec.push_back(std::array<float, MAX_CHAN>());
3298 m_pedOptVec.push_back(std::array<float, MAX_CHAN>());
3301 m_eDspVec.push_back(std::array<float, MAX_CHAN>());
3302 m_tDspVec.push_back(std::array<float, MAX_CHAN>());
3318 m_ntuplePtr->Branch((
"Evt"+suffixArr[i]).c_str(), &
m_evtVec.data()[i], (
"Evt"+suffixArr[i]+
"/I").c_str());
3319 m_ntuplePtr->Branch((
"rodBCID"+suffixArr[i]).c_str(), &
m_rodBCIDVec.data()[i], (
"rodBCID"+suffixArr[i]+
"/S").c_str());
3320 m_ntuplePtr->Branch((
"Size"+suffixArr[i]).c_str(), &
m_sizeVec.data()[i], (
"Size"+suffixArr[i]+
"/S").c_str());
3321 m_ntuplePtr->Branch((
"BCID"+suffixArr[i]).c_str(), &
m_bcidVec.back(), (
"bcid"+suffixArr[i]+
"[16]/I").c_str());
3322 m_ntuplePtr->Branch((
"DMUheader"+suffixArr[i]).c_str(), &
m_DMUheaderVec.back(), (
"DMUheader"+suffixArr[i]+
"[16]/i").c_str());
3328 m_ntuplePtr->Branch((
"DMUMask"+suffixArr[i]).c_str(), &
m_dmuMaskVec.back(), (
"dmumask"+suffixArr[i]+
"[2]/I").c_str());
3329 m_ntuplePtr->Branch((
"SlinkCRC"+suffixArr[i]).c_str(), &
m_slinkCRCVec.back(), (
"crc"+suffixArr[i]+
"[2]/I").c_str());
3334 m_ntuplePtr->Branch((
"Gain"+suffixArr[i]).c_str(),&
m_gainVec.back(), (
"gain"+suffixArr[i]+
"[48]/I").c_str());
3336 if (nSamplesInDrawer > 0) {
3337 nSampStr = std::to_string(nSamplesInDrawer);
3339 (
"sample" + suffixArr[i] +
"[48]["+nSampStr+
"]/I").c_str());
3343 m_ntuplePtr->Branch((
"feCRC" + suffixArr[i]).c_str(), &
m_feCRCVec.back(), (
"fe_crc" + suffixArr[i] +
"[16]/I").c_str());
3344 m_ntuplePtr->Branch((
"rodCRC" + suffixArr[i]).c_str(), &
m_rodCRCVec.back(), (
"rod_crc" + suffixArr[i] +
"[16]/I").c_str());
3349 m_ntuplePtr->Branch((
"Ene" + suffixArr[i]).c_str(), &
m_eneVec.back(), (
"ene" + suffixArr[i] +
"[48]/F").c_str());
3350 m_ntuplePtr->Branch((
"Time" + suffixArr[i]).c_str(), &
m_timeVec.back(), (
"time" + suffixArr[i] +
"[48]/F").c_str());
3351 m_ntuplePtr->Branch((
"Ped" + suffixArr[i]).c_str(), &
m_pedFlatVec.back(), (
"pedflat" + suffixArr[i] +
"[48]/F").c_str());
3352 m_ntuplePtr->Branch((
"Chi2ene" + suffixArr[i]).c_str(), &
m_chi2FlatVec.back(), (
"chiflat" + suffixArr[i] +
"[48]/F").c_str());
3358 m_ntuplePtr->Branch((
"Efit" + suffixArr[i]).c_str(), &
m_efitVec.back(), (
"efit" + suffixArr[i] +
"[48]/F").c_str());
3359 m_ntuplePtr->Branch((
"Tfit" + suffixArr[i]).c_str(), &
m_tfitVec.back(), (
"tfit" + suffixArr[i] +
"[48]/F").c_str());
3360 m_ntuplePtr->Branch((
"Pedfit" + suffixArr[i]).c_str(), &
m_pedfitVec.back(), (
"pedfit" + suffixArr[i] +
"[48]/F").c_str());
3361 m_ntuplePtr->Branch((
"Chi2fit" + suffixArr[i]).c_str(), &
m_chi2Vec.back(), (
"chifit" + suffixArr[i] +
"[48]/F").c_str());
3367 m_ntuplePtr->Branch((
"Efitc" + suffixArr[i]).c_str(), &
m_efitcVec.back(), (
"efitc" + suffixArr[i] +
"[48]/F").c_str());
3368 m_ntuplePtr->Branch((
"Tfitc" + suffixArr[i]).c_str(), &
m_tfitcVec.back(), (
"tfitc" + suffixArr[i] +
"[48]/F").c_str());
3369 m_ntuplePtr->Branch((
"Pedfitc" + suffixArr[i]).c_str(), &
m_pedfitcVec.back(), (
"pedfitc" + suffixArr[i] +
"[48]/F").c_str());
3370 m_ntuplePtr->Branch((
"Chi2fitc" + suffixArr[i]).c_str(), &
m_chi2cVec.back(), (
"chifitc" + suffixArr[i] +
"[48]/F").c_str());
3376 m_ntuplePtr->Branch((
"Eopt"+suffixArr[i]).c_str(), &
m_eOptVec.back(), (
"eOpt"+suffixArr[i]+
"[48]/F").c_str());
3377 m_ntuplePtr->Branch((
"Topt"+suffixArr[i]).c_str(), &
m_tOptVec.back(), (
"tOpt"+suffixArr[i]+
"[48]/F").c_str());
3378 m_ntuplePtr->Branch((
"Pedopt"+suffixArr[i]).c_str(), &
m_pedOptVec.back(), (
"pedOpt"+suffixArr[i]+
"[48]/F").c_str());
3379 m_ntuplePtr->Branch((
"Chi2opt"+suffixArr[i]).c_str(), &
m_chi2OptVec.back(), (
"chiOpt"+suffixArr[i]+
"[48]/F").c_str());
3385 m_ntuplePtr->Branch((
"Edsp"+suffixArr[i]).c_str(), &
m_eDspVec.back(), (
"eDsp"+suffixArr[i]+
"[48]/F").c_str());
3386 m_ntuplePtr->Branch((
"Tdsp"+suffixArr[i]).c_str(), &
m_tDspVec.back(), (
"tDsp"+suffixArr[i]+
"[48]/F").c_str());
3387 m_ntuplePtr->Branch((
"Chi2dsp"+suffixArr[i]).c_str(), &
m_chi2DspVec.back(), (
"chiDsp"+suffixArr[i]+
"[48]/F").c_str());
3389 m_ntuplePtr->Branch((
"ROD_DMUBCID"+suffixArr[i]).c_str(), &
m_ROD_DMUBCIDVec.back(), (
"ROD_DMUBCID"+suffixArr[i]+
"[16]/s").c_str());
3395 m_ntuplePtr->Branch((
"ROD_DMUMask"+suffixArr[i]).c_str(), &
m_ROD_DMUMaskVec.back(), (
"ROD_DMUMask"+suffixArr[i]+
"[2]/s").c_str());
3498 std::vector<std::string> suffixArr(
length,
"");
3501 for (
const std::pair<const unsigned int, unsigned int>& fragAndDrawer :
m_drawerFlxMap) {
3502 unsigned int frag = fragAndDrawer.first;
3503 unsigned int ros = frag >> 8;
3504 unsigned int drawer = frag & 0x3F;
3505 unsigned int drawerIndex = fragAndDrawer.second;
3507 std::ostringstream drawerName;
3510 drawerName << (drawer & 7);
3513 drawerName << std::setw(2) << std::setfill(
'0') << drawer;
3516 moduleNames.at(drawerIndex) = drawerName.str();
3517 suffixArr.at(drawerIndex) = drawerName.str() +
"lo";
3518 suffixArr.at(drawerIndex +
m_nDrawersFlx) = drawerName.str() +
"hi";
3523 nSamples = it->second;
3534 for (
unsigned int i = 0; i <
length; ++i) {
3560 std::string suffix = moduleNames[i];
3590 if (nSamplesInDrawer > 0) {
3591 nSampStrFlx = std::to_string(nSamplesInDrawer);
3593 (
"Flxsample" + suffixArr[i] +
"[48]["+nSampStrFlx+
"]/I").c_str());
3664 unsigned int listSize = std::min(
m_nDrawers.value(),
static_cast<unsigned int>(
m_drawerMap.size()));
3668 std::string digit[10] = {
"0",
"1",
"2",
"3",
"4",
"5",
"6",
"7",
"8",
"9" };
3669 std::vector<std::string> suffixArr;
3674 suffixArr.resize(
length);
3676 for (
unsigned int i = 0; i < listSize; ++i) {
3678 unsigned int drawer = strtol(
m_drawerList[i].data(), NULL, 0) & 0x3F;
3682 digits = digit[drawer / 10] + digit[drawer % 10];
3683 }
else if (testbeam) {
3684 digits = digit[drawer & 7];
3687 digits = digit[drawer / 10] + digit[drawer % 10];
3692 suff.replace(suff.find(
"0x"), 2,
"");
3693 suffixArr[i] = std::move(suff);
3699 for (
unsigned int i = 0; i <
length; i++) {
3704 m_ehitVec.push_back(std::array<float, MAX_CHAN>());
3705 m_thitVec.push_back(std::array<float, MAX_CHAN>());
3706 m_ehitCnt.push_back(std::array<float, MAX_CHAN>());
3707 m_thitCnt.push_back(std::array<float, MAX_CHAN>());
3716 m_ntuplePtr->Branch((
"EhitG4"+suffixArr[i]).c_str(),&
m_ehitVec.back(),(
"eHitG4"+suffixArr[i]+
"[48]/F").c_str());
3717 m_ntuplePtr->Branch((
"ThitG4"+suffixArr[i]).c_str(),&
m_thitVec.back(),(
"tHitG4"+suffixArr[i]+
"[48]/F").c_str());
3723 ATH_MSG_DEBUG(
"Adding G4 corrected hit info for " << suffixArr[i] );
3725 m_ntuplePtr->Branch((
"EhitSim"+suffixArr[i]).c_str(),&
m_ehitCnt.back(),(
"eHitSim"+suffixArr[i]+
"[48]/F").c_str());
3726 m_ntuplePtr->Branch((
"ThitSim"+suffixArr[i]).c_str(),&
m_thitCnt.back(),(
"tHitSim"+suffixArr[i]+
"[48]/F").c_str());
3748 std::fill(
vec.begin(),
vec.end(),
static_cast<T
>(-1));
3751template<
typename T,
size_t N>
3753 for (std::array<T,N>& arr :
vec) {
3754 std::fill(arr.begin(), arr.end(),
static_cast<T
>(-1));
3758template<
typename T,
size_t N>
3760 for (std::array<T,N>& arr :
vec) {
3761 std::fill(arr.begin(), arr.end(),
static_cast<T
>(0));
3767 for (
unsigned int i = 0; i <
vec.size(); ++i) {
3768 std::fill(
vec[i].
get(),
vec[i].
get() + nsamples.at(i) * nchan, -1);
Scalar eta() const
pseudorapidity method
#define ATH_CHECK
Evaluate an expression and check for errors.
#define ATH_MSG_VERBOSE(x)
#define ATH_MSG_WARNING(x)
std::vector< size_t > vec
#define CHECK(...)
Evaluate an expression and check for errors.
size_t size() const
Number of registered mappings.
AtlasHitsVector< TileHit > TileHitVector
#define WRONG_CHANNEL(frag, chan)
#define SIGNAL_FOUND(frag, chan, amplitude)
#define FRAG_FOUND(frag, chan, size)
#define WRONG_SAMPLE(frag, chan, size)
static const Attributes_t empty
AthAlgorithm(const std::string &name, ISvcLocator *pSvcLocator)
Constructor with parameters:
ServiceHandle< StoreGateSvc > & evtStore()
const ServiceHandle< StoreGateSvc > & detStore() const
bool msgLvl(const MSG::Level lvl) const
Container class for CaloCell.
CaloSampling::CaloSample CaloSample
Data object for each calorimeter readout cell.
This class groups all DetDescr information related to a CaloCell.
CaloCell_ID::CaloSample getSampling() const
cell sampling
DataModel_detail::const_iterator< DataVector > const_iterator
Standard const_iterator.
const T * get(size_type n) const
Access an element, as an rvalue.
const_iterator end() const
return const_iterator for end of container
const_iterator begin() const
return const_iterator for first entry
static std::string find_file(const std::string &logical_file_name, const std::string &search_path)
Property holding a SG store/key/clid from which a ReadHandle is made.
const std::string & key() const
Return the StoreGate ID for the referenced object.
bool empty() const
Test if the key is blank.
static const TileCablingService * getInstance()
get pointer to service instance
static unsigned int getDrawerIdxFromFragId(unsigned int fragId)
Returns a drawer hash from fragId This function assumes drawer context (i.e.
Class that holds Data Quality fragment information and provides functions to extract the data quality...
int checkHeaderParityErr(int partition, int drawer, int dmu, int gain) const
returns 1 if DMU has header word parity error
int checkSampleParityErr(int partition, int drawer, int dmu, int gain) const
returns 1 if DMU has data word parity error
HWIdentifier pmt_HWID(void) const
Return pmt hardware ID (== channel ID).
float time(int ind=0) const
Return time of ind-th sub-hit.
float energy(int ind=0) const
Return energy of ind-th sub-hit.
int size(void) const
Return length of energy/time vectors.
int getFiltNumber() const
double getSigmaPedAlpha(const unsigned int i, const unsigned int gain=0) const
double getSigmaAlpha(const unsigned int i, const unsigned int gain=0) const
double getPedestalAlpha(const unsigned int i, const unsigned int gain=0) const
double getPumpDiodeTemp() const
int getPMADC(const unsigned int j, const unsigned int gain=0) const
double getPMSigmaPedestal(const unsigned int j, const unsigned int gain=0) const
double getAlpha(const unsigned int i, const unsigned int gain=0) const
double getDiodeCurrOrd() const
int getDiodeADC(const unsigned int i, const unsigned int gain=0) const
double getDiodeSigmaPedestal(const unsigned int i, const unsigned int gain=0) const
double getDiodePedestal(const unsigned int i, const unsigned int gain=0) const
int getTDC(const unsigned int j, const unsigned int gain=0) const
double getDiodeCurrMeas() const
double getPMPedestal(const unsigned int j, const unsigned int gain=0) const
@ OnlineMegaElectronVolts
uint32_t get_bsflags() const
Condition object to keep and provide Tile Calorimeter sampling fraction and number of photoelectrons.
float getSamplingFraction(unsigned int drawerIdx, unsigned int channel) const
Return Tile Calorimeter sampling fraction.
std::vector< std::array< float, MAX_CHAN > > m_pedflxfitVec
std::vector< std::array< int, MAX_CHAN > > m_gainVec
std::vector< std::array< float, MAX_CHAN > > m_tfitcVec
SG::ReadHandleKey< TileHitVector > m_hitVectorKey
void ENETOTAL_clearBranch(void)
//////////////////////////////////////////////////////////////////////////// Clear Tree ENETOTAL vari...
StatusCode ntuple_initialize(const EventContext &ctx)
Alg standard interface function LF TODO: We could have a problem with the new feature introduced by S...
std::vector< std::array< float, MAX_CHAN > > m_chi2DspVec
Gaudi::Property< float > m_beamBN1Y1
Gaudi::Property< float > m_beamBC1Y2
StatusCode storeRawChannels(const EventContext &ctx, const SG::ReadHandleKey< TileRawChannelContainer > &containerKey, bool calibMode, std::vector< std::array< float, MAX_CHAN > > *eneVec, std::vector< std::array< float, MAX_CHAN > > *timeVec, std::vector< std::array< float, MAX_CHAN > > *chi2Vec, std::vector< std::array< float, MAX_CHAN > > *pedVec, bool saveDQstatus=false)
/ Fill ntuple with data from TRC.
Gaudi::Property< float > m_beamBC2Z_90
StatusCode initList(const EventContext &ctx)
Gaudi::Property< float > m_beamBC0Z
std::array< float, 4 > m_LarEne
std::array< unsigned int, 96 > m_coincTrig2
Gaudi::Property< float > m_beamBN2Y1
StatusCode storeBeamElements(const EventContext &ctx)
Gaudi::Property< int > m_nSamplesFlx
void DIGI_addBranch(void)
//////////////////////////////////////////////////////////////////////////// /Add Tree DIGI variables...
const TileHWID * m_tileHWID
std::vector< std::vector< int > > * m_btdc
std::array< unsigned int, 96 > m_coincTrig6
std::array< int, 16 > m_btdc1
std::vector< short > m_sizeVec
void FELIX_addBranch(void)
std::array< float, 8 > m_ecal
short CheckDMUParity(uint32_t header)
Parity of the DMU header should be odd.
void ADDER_addBranch(void)
//////////////////////////////////////////////////////////////////////////// /Add Tree ADDER variable...
std::array< float, 3 > m_ExtEne
std::vector< int > m_l1Type
Gaudi::Property< std::vector< std::string > > m_beamFragList
SG::ReadHandleKey< TileDQstatus > m_dqStatusKey
std::vector< int > m_nSamplesFlxInDrawer
void MUON_clearBranch(void)
//////////////////////////////////////////////////////////////////////////// Clear Tree MUON variable...
StatusCode initListFlx(const EventContext &ctx)
Gaudi::Property< Long64_t > m_treeSize
std::vector< std::array< uint32_t, MAX_DMU > > m_DMUheaderVec
std::vector< std::array< int, MAX_MINIDRAWER > > m_mdBcidflxVec
Gaudi::Property< float > m_beamBC1X2
std::vector< std::array< float, MAX_CHAN > > m_tDspVec
std::vector< int > m_frBCID
void ADDER_clearBranch(void)
//////////////////////////////////////////////////////////////////////////// Clear Tree ADDER variabl...
Gaudi::Property< std::string > m_ntupleID
std::vector< int * > m_adder
SG::ReadHandleKey< TileRawChannelContainer > m_fitRawChannelContainerKey
std::vector< std::array< short, MAX_DMU > > m_ROD_DMUDstrobeErrVec
const TileCablingService * m_cabling
StatusCode storeLaser(const EventContext &ctx)
Gaudi::Property< float > m_beamBC1Z
SG::ReadHandleKey< TileRawChannelContainer > m_flxOptRawChannelContainerKey
std::vector< std::array< int, MAX_MINIDRAWER > > m_mdChargeflxVec
std::array< float, 3 > m_GapEne
void ENETOTAL_addBranch(void)
//////////////////////////////////////////////////////////////////////////// /Add Tree ENETOTAL varia...
std::vector< std::array< int, MAX_MINIDRAWER > > m_mdChargeTimeflxVec
Gaudi::Property< float > m_beamBC1Z_min90
std::vector< std::array< float, MAX_CHAN > > m_tflxoptVec
double m_las_D2_AlphaPed_RMS
Gaudi::Property< std::vector< std::string > > m_drawerList
Gaudi::Property< float > m_beamBC2X2
SG::ReadHandleKey< TileRawChannelContainer > m_fitcRawChannelContainerKey
Gaudi::Property< std::string > m_etaFileName
TileRawChannelUnit::UNIT m_rchUnit
Unit for TileRawChannels (ADC, pCb, MeV).
void QDC_addBranch(void)
//////////////////////////////////////////////////////////////////////////// /Add QDC variables to th...
std::vector< std::array< int, MAX_MINIDRAWER > > m_mdCapacitorflxVec
Gaudi::Property< unsigned int > m_nDrawersFlx
std::vector< std::array< float, MAX_CHAN > > m_chi2OptVec
void setupBeamChambersTB2016_2020(void)
double m_las_PMT1_Ped_RMS
Gaudi::Property< int > m_finalUnit
std::vector< std::array< float, MAX_CHAN > > m_thitCnt
std::vector< std::array< float, MAX_CHAN > > m_chi2cVec
SG::ReadHandleKey< TileRawChannelContainer > m_flxFitRawChannelContainerKey
Gaudi::Property< float > m_beamBN2Y2
std::vector< std::array< float, MAX_CHAN > > m_chi2flxfitVec
std::vector< std::array< int, MAX_MINIDRAWER > > m_mdPedLoflxVec
bool m_calibrateEnergyThisEvent
StatusCode storeHitContainer(const EventContext &ctx)
/ Fill Ntuple with MC truth info from simulation / Namely, hit energies corrected by photoelectron st...
ServiceHandle< ITHistSvc > m_thistSvc
Gaudi::Property< float > m_beamBC2Z_0
Gaudi::Property< bool > m_completeNtuple
Gaudi::Property< bool > m_calibrateEnergy
Gaudi::Property< float > m_beamBC2X1
std::vector< std::array< float, MAX_CHAN > > m_ehitVec
std::array< unsigned int, 96 > m_coincTrig7
std::vector< std::array< int, MAX_MINIDRAWER > > m_mdRunTypeflxVec
std::vector< short > m_sizeflxVec
void MUON_addBranch(void)
//////////////////////////////////////////////////////////////////////////// /Add MUON variables to t...
void setupBeamChambersBeforeTB2015(void)
short CheckDMUFormat(uint32_t header)
bit_31 of the DMU header must be 1 and bit_17 of the DMU header must be 0
Gaudi::Property< float > m_beamBC2Z
std::vector< std::array< float, MAX_CHAN > > m_pedflxoptVec
StatusCode storeCells(const EventContext &ctx)
std::vector< std::array< float, MAX_CHAN > > m_eflxoptVec
Gaudi::Property< float > m_beamBC1Y1
void setupPropertyDefaultValue(float property, float defaultValue, const std::string &name)
Gaudi::Property< float > m_radius
SG::ReadHandleKey< TileRawChannelContainer > m_dspRawChannelContainerKey
void setupBeamChambersTB2015(void)
std::array< int, 16 > m_btdc2
Gaudi::Property< std::vector< int > > m_drawerType
SG::ReadHandleKey< TileLaserObject > m_laserObjectKey
std::vector< int > m_nSamplesInDrawer
std::vector< std::array< int, MAX_MINIDRAWER > > m_mdRunflxVec
SG::ReadCondHandleKey< TileSamplingFraction > m_samplingFractionKey
Name of TileSamplingFraction in condition store.
std::vector< std::array< float, MAX_CHAN > > m_pedfitVec
TileTBAANtuple(const std::string &name, ISvcLocator *pSvcLocator)
void LASER_addBranch(void)
//////////////////////////////////////////////////////////////////////////// /Add Tree LASER variable...
std::vector< std::array< float, MAX_CHAN > > m_eOptVec
std::vector< std::array< int, MAX_DMU > > m_bcidVec
SG::ReadHandleKey< TileDigitsContainer > m_digitsContainerKey
std::vector< std::array< int, MAX_MINIDRAWER > > m_mdPedHiflxVec
std::vector< std::array< short, 2 > > m_ROD_DMUMaskVec
std::vector< std::array< int, MAX_DMU > > m_feCRCVec
std::vector< std::unique_ptr< int[]> > m_sampleVec
StatusCode initNTuple(void)
std::map< unsigned int, unsigned int, std::less< unsigned int > > m_drawerMap
double m_las_D3_AlphaPed_RMS
std::array< float, 14 > m_muBack
std::vector< int > m_l1ID
std::vector< std::array< float, MAX_CHAN > > m_tfitVec
SG::ReadHandleKey< TileHitContainer > m_hitContainerKey
std::vector< std::array< int, MAX_MINIDRAWER > > m_mdModuleflxVec
Gaudi::Property< float > m_beamBC0X1
std::vector< int > m_adderPayload
std::vector< std::array< float, MAX_CHAN > > m_chi2flxoptVec
std::vector< std::array< float, MAX_CHAN > > m_pedFlatVec
std::vector< std::array< short, MAX_DMU > > m_ROD_DMUSstrobeErrVec
int digiChannel2PMT(int fragType, int chan)
void HIT_clearBranch(void)
//////////////////////////////////////////////////////////////////////////// /Clear Tree HIT variable...
void TRIGGER_clearBranch(void)
//////////////////////////////////////////////////////////////////////////// Clear Tree TRIGGER varia...
void LASER_clearBranch(void)
//////////////////////////////////////////////////////////////////////////// Clear Tree LASER variabl...
Gaudi::Property< float > m_beamBN1X1
std::vector< std::array< short, MAX_DMU > > m_DMUformatErrVec
void CISPAR_addBranch(void)
//////////////////////////////////////////////////////////////////////////// /Add Tree CISPAR variabl...
void CISPAR_clearBranch(void)
//////////////////////////////////////////////////////////////////////////// Clear Tree CISPAR variab...
std::array< float, 16 > m_timeAdd
std::vector< std::array< short, MAX_DMU > > m_DMUDataparityErrVec
std::array< unsigned int, 96 > m_coincTrig1
std::map< int, int > m_nSamplesFlxInDrawerMap
std::vector< std::array< short, MAX_DMU > > m_DMUHeadparityErrVec
void clear_init_minus1(std::vector< T > &vec)
TileRawChannelUnit::UNIT m_dspUnit
Unit for TileRawChannels in DSP.
std::vector< std::array< float, MAX_CHAN > > m_efitcVec
std::array< uint32_t, 33 > m_qdc
Gaudi::Property< float > m_beamBN1X2
StatusCode storeDigitsFlx(const EventContext &ctx, const SG::ReadHandleKey< TileDigitsContainer > &containerKey)
std::vector< std::array< float, MAX_CHAN > > m_chi2FlatVec
Gaudi::Property< int > m_nSamples
std::vector< std::array< short, MAX_DMU > > m_DMUmemoryErrVec
std::vector< std::array< float, MAX_CHAN > > m_thitVec
void HIT_addBranch(void)
//////////////////////////////////////////////////////////////////////////// /Add Tree HIT variables ...
double m_las_D4_AlphaPed_RMS
Gaudi::Property< float > m_beamBC1X1
std::vector< int > m_evType
Gaudi::Property< float > m_beamBC1Z_90
Gaudi::Property< int > m_eventsPerFile
std::vector< std::array< float, MAX_CHAN > > m_pedfitcVec
std::vector< std::array< float, MAX_CHAN > > m_eflxfitVec
std::vector< std::array< short, MAX_DMU > > m_ROD_DMUmemoryErrVec
std::vector< short > m_ROD_GlobalCRCVec
std::vector< std::array< short, MAX_DMU > > m_ROD_DMUHeadformatErrVec
std::vector< std::array< int, 2 > > m_slinkCRCVec
std::array< int, 16 > m_tof
double m_las_D1_AlphaPed_RMS
Gaudi::Property< float > m_beamBN2X2
std::vector< std::array< float, MAX_CHAN > > m_eDspVec
std::array< float, 3 > m_BarEne
Gaudi::Property< unsigned int > m_nDrawers
Gaudi::Property< std::string > m_streamName
SG::ReadHandleKey< TileRawChannelContainer > m_flatRawChannelContainerKey
ToolHandle< TileRawChannelBuilderFlatFilter > m_adderFilterAlgTool
double m_las_PMT2_Ped_RMS
std::vector< std::array< float, MAX_CHAN > > m_efitVec
std::vector< std::array< float, MAX_CHAN > > m_ehitCnt
double m_las_D4_Alpha_RMS
Gaudi::Property< float > m_beamBC1Z_0
std::vector< std::array< float, MAX_CHAN > > m_eneVec
void FELIX_clearBranch(void)
std::array< float, 2 > m_muCalib
std::vector< std::array< int, MAX_DMU > > m_rodCRCVec
SG::ReadHandleKey< CaloCellContainer > m_cellContainerKey
void TRIGGER_addBranch(void)
///////////////////////////////////////////////////////////////////////////
std::vector< std::array< short, MAX_DMU > > m_ROD_DMUDataformatErrVec
Gaudi::Property< int > m_TBperiod
double m_las_D2_Alpha_RMS
std::array< unsigned int, 96 > m_coincTrig8
virtual StatusCode initialize() override
std::array< unsigned int, 96 > m_coincTrig4
std::array< float, 16 > m_eneAdd
StatusCode storeDigits(const EventContext &ctx, const SG::ReadHandleKey< TileDigitsContainer > &containerKey, const TileDQstatus *dqStatus=nullptr)
/ Fill Ntuple with info from TileDigits / Return true if the collection is empty, / which means that ...
std::array< int, 16 > m_scaler
void clear_init_zero(std::vector< std::array< T, N > > &vec)
Gaudi::Property< bool > m_bsInput
virtual StatusCode execute(const EventContext &ctx) override
Execute method.
void ECAL_clearBranch(void)
//////////////////////////////////////////////////////////////////////////// Clear Tree ECAL variable...
std::array< float, 4 > m_lasExtra
void BEAM_clearBranch(void)
//////////////////////////////////////////////////////////////////////////// Clear Tree BEAM variable...
std::array< unsigned int, 96 > m_coincTrig3
double m_las_D1_Alpha_RMS
std::vector< std::array< float, MAX_CHAN > > m_tflxfitVec
void QDC_clearBranch(void)
//////////////////////////////////////////////////////////////////////////// Clear Tree QDC variables
std::vector< std::array< int, MAX_MINIDRAWER > > m_mdL1idflxVec
std::map< unsigned int, unsigned int, std::less< unsigned int > > m_drawerFlxMap
Gaudi::Property< float > m_beamBC0Y1
Gaudi::Property< float > m_beamBN1Y2
std::vector< std::array< short, MAX_DMU > > m_ROD_DMUBCIDVec
Gaudi::Property< float > m_beamBC2Z_min90
void ECAL_addBranch(void)
//////////////////////////////////////////////////////////////////////////// /Add ECAL variables to t...
std::vector< std::unique_ptr< int[]> > m_sampleflxVec
std::vector< int > m_evtflxVec
std::vector< std::array< short, MAX_DMU > > m_DMUparityErrVec
std::vector< std::array< short, MAX_DMU > > m_DMUDstrobeErrVec
Gaudi::Property< float > m_beamBC0Y2
void DIGI_clearBranch(void)
//////////////////////////////////////////////////////////////////////////// /Clear Tree DIGI variabl...
std::vector< std::array< int, MAX_CHAN > > m_gainflxVec
std::vector< std::array< short, MAX_DMU > > m_DMUSstrobeErrVec
void storeHit(const TileHit *hit, int fragType, int fragId, std::array< float, MAX_CHAN > &ehitVec, std::array< float, MAX_CHAN > &thitVec, const TileSamplingFraction *samplingFraction)
Gaudi::Property< float > m_beamBC0X2
std::array< unsigned int, 96 > m_coincTrig5
Gaudi::Property< float > m_beamBN2X1
StatusCode ntuple_clear()
Gaudi::Property< bool > m_calibMode
SG::ReadHandleKey< TileDigitsContainer > m_digitsContainerFlxKey
void COINCBOARD_clearBranch(void)
//////////////////////////////////////////////////////////////////////////// Clear Tree COINCBOARD va...
std::vector< short > m_rodBCIDflxVec
void BEAM_addBranch(void)
//////////////////////////////////////////////////////////////////////////// /Add Tree BEAM variables...
Gaudi::Property< float > m_beamBC2Y2
double m_las_D3_Alpha_RMS
std::map< int, int > m_nSamplesInDrawerMap
std::map< unsignedint, unsignedint, std::less< unsignedint > >::iterator drawerMap_iterator
std::vector< std::array< float, MAX_CHAN > > m_timeVec
Gaudi::Property< bool > m_pmtOrder
SG::ReadHandleKey< TileRawChannelContainer > m_optRawChannelContainerKey
std::vector< std::array< float, MAX_CHAN > > m_chi2Vec
SG::ReadHandleKey< TileBeamElemContainer > m_beamElemContainerKey
Gaudi::Property< float > m_beamBC2Y1
Gaudi::Property< std::vector< std::string > > m_rosName
std::vector< short > m_rodBCIDVec
std::vector< std::array< float, MAX_CHAN > > m_tOptVec
ToolHandle< TileCondToolEmscale > m_tileToolEmscale
std::vector< int > m_evBCID
std::vector< std::array< int, 2 > > m_dmuMaskVec
Gaudi::Property< bool > m_unpackAdder
void COINCBOARD_addBranch(void)
//////////////////////////////////////////////////////////////////////////// /Add Tree COINCBOARD var...
std::vector< std::array< float, MAX_CHAN > > m_pedOptVec
void clear_samples(std::vector< std::unique_ptr< int[]> > &vec, const std::vector< int > &nsamples, int nchan=MAX_CHAN)
Gaudi::Property< bool > m_useDspUnits
std::vector< int > m_evtVec
void checkIsPropertySetup(float property, const std::string &name)
StatusCode storeHitVector(const EventContext &ctx)
uint32_t runNumber() const
The current event's run number.
int ir
counter of the current depth
T * get(TKey *tobj)
get a TObject* from a TKey* (why can't a TObject be a TKey?)
SG::ReadCondHandle< T > makeHandle(const SG::ReadCondHandleKey< T > &key, const EventContext &ctx=Gaudi::Hive::currentContext())
EventInfo_v1 EventInfo
Definition of the latest event info version.