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;
364 const EventContext& ctx = Gaudi::Hive::currentContext();
390 m_run = ctx.eventID().run_number();
391 m_evt = ctx.eventID().event_number();
394 if (ctx.eventID().time_stamp() > 0) {
395 m_evTime = ctx.eventID().time_stamp();
448 return StatusCode::SUCCESS;
459 return StatusCode::FAILURE;
523 return StatusCode::SUCCESS;
529 return StatusCode::SUCCESS;
541 if ( collItr!=lastColl ) {
542 m_l1ID.at(nDrawersAll) = (*collItr)->getLvl1Id();
543 m_l1Type.at(nDrawersAll) = (*collItr)->getLvl1Type();
544 m_evType.at(nDrawersAll) = (*collItr)->getDetEvType();
545 m_evBCID.at(nDrawersAll) = (*collItr)->getRODBCID();
547 m_l1ID.at(nDrawersAll) = 0xFFFFFFFF;
548 m_l1Type.at(nDrawersAll) = 0xFFFFFFFF;
549 m_evType.at(nDrawersAll) = 0xFFFFFFFF;
550 m_evBCID.at(nDrawersAll) = 0xFFFFFFFF;
557 for(; collItr != lastColl; ++collItr) {
562 if (
msgLvl(MSG::VERBOSE)) {
564 for (; beamItr != lastBeam; ++beamItr) {
566 std::vector<uint32_t> digits = (*beamItr)->get_digits();
567 msg(MSG::VERBOSE) <<
" --- TileBeamElem -- Identifier " <<
m_tileHWID->to_string(
id)
568 << MSG::hex <<
" frag: 0x" << (*collItr)->identify()
569 << MSG::dec <<
" channel " <<
m_tileHWID->channel(
id)
570 <<
" digits size " << digits.size() <<
endmsg;
571 msg(MSG::VERBOSE) <<
" --- TileBeamElem -- BeamElem : ";
572 for (
unsigned int k = 0; k < digits.size(); k++)
573 msg(MSG::VERBOSE) << digits[k] <<
" ";
577 beamItr = (*collItr)->begin();
580 int frag = (*collItr)->identify();
584 if (
m_trigType == 0 && (*collItr)->getLvl1Type() != 0 )
590 for (; beamItr != lastBeam; ++beamItr) {
593 std::vector<uint32_t> digits = (*beamItr)->get_digits();
595 int dsize = digits.size();
614 uint32_t amplitude = digits[0];
622 if(cha < 8)
m_btdc1[cha] = amplitude;
623 else if(cha < 16)
m_btdc2[cha-8] = amplitude;
632 case 0:
m_s1cou = amplitude;
break;
633 case 1:
m_s2cou = amplitude;
break;
634 case 2:
m_s3cou = amplitude;
break;
635 case 3:
m_cher1 = amplitude;
break;
636 case 4:
m_cher2 = amplitude;
break;
637 case 5:
m_muTag = amplitude;
break;
645 case 0:
m_s1cou = amplitude;
break;
646 case 1:
m_s2cou = amplitude;
break;
647 case 2:
m_s3cou = amplitude;
break;
648 case 3:
m_cher1 = amplitude;
break;
649 case 4:
m_muTag = amplitude;
break;
650 case 5:
m_cher2 = amplitude;
break;
654 case 8:
m_las0 = amplitude;
break;
655 case 9:
m_las1 = amplitude;
break;
656 case 10:
m_las2 = amplitude;
break;
657 case 11:
m_las3 = amplitude;
break;
667 case 0:
m_sc1 = amplitude;
break;
668 case 1:
m_sc2 = amplitude;
break;
683 if(cha < 14)
m_muBack[cha] = amplitude;
685 else if (cha < 16)
m_muCalib[cha - 14] = amplitude;
692 if(cha < 6)
m_muBack[cha + 8] = amplitude;
694 else if (cha < 8)
m_muCalib[cha - 6] = amplitude;
703 if (amplitude & 0xFF00)
m_trigType = amplitude >> 8;
713 case 0:
m_las0 = amplitude;
break;
714 case 1:
m_las1 = amplitude;
break;
715 case 2:
m_las2 = amplitude;
break;
716 case 3:
m_las3 = amplitude;
break;
729 for (
int k = 0; k < dsize; k++) {
748 m_qdc[cha] = amplitude;
750 }
else if (cha == 15) {
751 for (
int idx = 0; idx < dsize && idx < 18; ++idx) {
752 m_qdc[idx + 15] = digits[idx];
760 if(cha < 8)
m_ecal[cha] = amplitude;
768 if(cha < 16)
m_cispar[cha] = amplitude;
775 if (
m_run > 2211444) {
778 case 0:
m_s1cou = amplitude;
break;
779 case 1:
m_s2cou = amplitude;
break;
781 if (
m_run < 2310000) {
788 case 3:
m_cher1 = amplitude;
break;
789 case 4:
m_cher2 = amplitude;
break;
790 case 5:
m_cher3 = amplitude;
break;
791 default:
m_muBack[cha - 6] = amplitude;
796 case 0:
m_s1cou = amplitude;
break;
797 case 1:
m_s2cou = amplitude;
break;
798 case 2:
m_s3cou = amplitude;
break;
799 case 3:
m_cher1 = amplitude;
break;
800 case 4:
m_cher2 = amplitude;
break;
801 case 5:
m_cher3 = amplitude;
break;
810 case 0:
m_s1cou = amplitude;
break;
811 case 1:
m_s2cou = amplitude;
break;
812 case 2:
m_s3cou = amplitude;
break;
813 case 3:
m_muTag = amplitude;
break;
814 case 4:
m_cher1 = amplitude;
break;
815 case 5:
m_cher2 = amplitude;
break;
850 if (
m_run > 2310000 && cha < 16) {
852 }
else if (cha == 0) {
864 m_tof[cha] = amplitude;
876 m_tof[cha] = amplitude;
883 if(cha < 8)
m_tof[cha] = amplitude;
891 if ((cha > 11) && (cha < 16) && (
m_run > 2211136)) {
892 m_tof[cha] = amplitude;
900 (*m_btdc)[cha].push_back(amplitude);
908 if(cha < 16)
m_btdc2[cha] = amplitude;
916 for (
int ibit = 0; ibit < 32; ++ibit){
919 }
else if (cha == 3) {
929 for (
int ibit=0; ibit < 32; ++ibit){
932 }
else if (cha == 3) {
942 for (
int ibit = 0; ibit < 32; ++ibit){
945 }
else if (cha == 3) {
955 for (
int ibit = 0; ibit < 32; ++ibit){
958 }
else if (cha == 3) {
968 for (
int ibit = 0; ibit < 32; ++ibit){
971 }
else if (cha == 3) {
981 for (
int ibit = 0; ibit < 32; ++ibit){
984 }
else if (cha == 3) {
994 for (
int ibit = 0; ibit < 32; ++ibit){
997 }
else if (cha == 3) {
1007 for (
int ibit = 0; ibit < 32; ++ibit){
1010 }
else if (cha == 3) {
1024 for (
int i=0; i<8; ++i) {
1040 if (
m_run > 2211444) {
1056 if (
m_run > 2211444) {
1082 if (
m_run > 2211444) {
1146 if (
evtStore()->retrieve(eventInfo).isFailure()){
1147 ATH_MSG_ERROR(
"No EventInfo object found! Can't read run number!" );
1174 return StatusCode::SUCCESS;
1186 , std::vector<std::array<float, MAX_CHAN>>* eneVec
1187 , std::vector<std::array<float, MAX_CHAN>>* timeVec
1188 , std::vector<std::array<float, MAX_CHAN>>* chi2Vec
1189 , std::vector<std::array<float, MAX_CHAN>>* pedVec
1190 ,
bool saveDQstatus)
1194 if (containerKey.
empty()) {
1195 return StatusCode::FAILURE;
1198 bool isFELIX = containerKey.
key().find(
"Flx") != std::string::npos;
1217 ATH_MSG_ERROR(
"RawChannel units are not ADC counts, can't apply DSP-like calibration" );
1218 return StatusCode::FAILURE;
1234 int drawerIndex, fragType;
1239 int fragId = rawChannelCollection->identify();
1243 if ( itr != drawerMap.end() ) {
1244 drawerIndex = (*itr).second;
1249 if (drawerIndex < 0) {
1250 if ( !rawChannelCollection->empty() )
1251 ATH_MSG_DEBUG(
"frag id 0x" << MSG::hex << fragId << MSG::dec <<
" was not found among valid frag IDs when storing TRC!" );
1253 fragType = isFELIX ? fragId >> 8 :
m_drawerType[drawerIndex];
1256 <<
" Frag id 0x" << MSG::hex << fragId << MSG::dec
1257 <<
" index "<< drawerIndex );
1261 int index = drawerIndex;
1270 if (gain == 1)
index += nDrawers;
1274 double energy = rch->amplitude();
1286 (
m_TBperiod==2017 && ((fragId&0xFF)<4 && !(fragId == 0x201 || fragId == 0x203))) ||
1287 (
m_TBperiod==2018 && ((fragId&0xFF)<4 && !(fragId == 0x201 || fragId == 0x402))) ||
1288 (
m_TBperiod==2019 && ((fragId&0xFF)<5 && !(fragId == 0x201 || fragId == 0x203 || fragId >= 0x402))) ||
1289 (
m_TBperiod==2022 && ((fragId&0xFF)<4 && !(fragId == 0x201 || (
m_run >= 2210456 && fragId == 0x402)))))
1293 eneVec->at(
index)[channel] = energy;
1294 timeVec->at(
index)[channel] = rch->time();
1296 chi2Vec->at(
index)[channel] = rch->quality();
1299 pedVec->at(
index)[channel] = rch->pedestal();
1303 <<
" time=" << rch->time()
1304 <<
" chi2=" << rch->quality()
1305 <<
" ped=" << rch->pedestal()
1306 <<
" pmt-1=" << channel
1307 <<
" index " <<
index );
1311 if (saveDQstatus && !isFELIX) {
1313 int index1 = drawerIndex, index2 = drawerIndex + 1;
1322 for (
unsigned int dmu = 0; dmu <
MAX_DMU; ++dmu) {
1336 return StatusCode::SUCCESS;
1347 if (containerKey.
empty()) {
1348 return StatusCode::FAILURE;
1354 bool emptyColl =
true;
1357 int drawerIndex, fragType, channel;
1359 std::vector<float> sampleVec;
1360 std::vector<uint32_t> headerVec;
1361 std::vector<uint32_t> headerVecHi;
1369 int fragId = digitsCollection->identify();
1370 int ros = (fragId >> 8);
1371 int drawer = fragId & 0x3F;
1375 drawerIndex = (*itr).second;
1380 if (drawerIndex < 0) {
1381 if ( !digitsCollection->empty() )
1382 ATH_MSG_DEBUG(
"frag id 0x" << MSG::hex << fragId << MSG::dec <<
" was not found among valid frag IDs when storing TRC!" );
1388 <<
" Frag id 0x" << MSG::hex << fragId << MSG::dec
1389 <<
" index " << drawerIndex
1393 <<
" BCID=" << digitsCollection->getFragBCID()<<MSG::hex
1394 <<
" CRC=0x" << (digitsCollection->getFragCRC()&0xffff)
1395 <<
" DMUMask=0x" << (digitsCollection->getFragDMUMask()&0xffff)<<MSG::dec );
1398 <<
" Lvl1Type=" << digitsCollection->getLvl1Type()
1399 <<
" EvBCID=" << digitsCollection->getRODBCID()
1400 <<
" EvType=" << digitsCollection->getDetEvType() );
1402 ATH_MSG_DEBUG(
" Header=" << digitsCollection->getFragChipHeaderWords() );
1409 m_l1ID.at(drawerIndex) = digitsCollection->getLvl1Id();
1410 m_l1Type.at(drawerIndex) = digitsCollection->getLvl1Type();
1411 m_evType.at(drawerIndex) = digitsCollection->getDetEvType();
1412 m_evBCID.at(drawerIndex) = digitsCollection->getRODBCID();
1414 m_frBCID.at(drawerIndex) = digitsCollection->getFragBCID();
1422 int drawerIndexHi = drawerIndex +
m_nDrawers;
1424 if (!digitsCollection->empty()) {
1427 m_rodBCIDVec.at(drawerIndex) = digitsCollection->getRODBCID();
1428 m_sizeVec.at(drawerIndex) = digitsCollection->getFragSize();
1429 m_sizeVec.at(drawerIndexHi) = digitsCollection->getFragSize();
1433 headerVec = digitsCollection->getFragChipHeaderWords();
1434 headerVecHi = digitsCollection->getFragChipHeaderWordsHigh();
1435 CRCmask = digitsCollection->getFragDMUMask();
1436 fe_crc = CRCmask & 0xFFFF;
1437 rod_crc = CRCmask >> 16;
1439 unsigned int headsize = std::min(16U,
static_cast<unsigned int>(headerVec.size()));
1440 unsigned int headsizehi = std::min(16U,
static_cast<unsigned int>(headerVecHi.size()));
1442 for (
unsigned int ih = 0; ih < headsize; ++ih) {
1444 m_bcidVec.at(drawerIndex)[ih] = (headerVec[ih] & 0xFFF);
1451 m_feCRCVec.at(drawerIndex)[ih] = (fe_crc >> ih & 0x1);
1452 m_rodCRCVec.at(drawerIndex)[ih] = (rod_crc >> ih & 0x1);
1460 for (
unsigned int ihhi = 0; ihhi < headsizehi; ++ihhi) {
1461 m_bcidVec.at(drawerIndexHi)[ihhi] = (headerVecHi[ihhi] & 0xFFF);
1477 m_slinkCRCVec.at(drawerIndex)[0] = (digitsCollection->getFragCRC() >> 16) & 0xffff;
1478 m_dmuMaskVec.at(drawerIndex)[0] = (digitsCollection->getFragDMUMask() >> 16) & 0xffff;
1479 m_slinkCRCVec.at(drawerIndex)[1] = digitsCollection->getFragCRC() & 0xffff;
1480 m_dmuMaskVec.at(drawerIndex)[1] = digitsCollection->getFragDMUMask() & 0xffff;
1482 m_slinkCRCVec.at(drawerIndexHi)[0] = (digitsCollection->getFragCRC() >> 16) & 0xffff;
1483 m_dmuMaskVec.at(drawerIndexHi)[0] = (digitsCollection->getFragDMUMask() >> 16) & 0xffff;
1484 m_slinkCRCVec.at(drawerIndexHi)[1] = digitsCollection->getFragCRC() & 0xffff;
1485 m_dmuMaskVec.at(drawerIndexHi)[1] = digitsCollection->getFragDMUMask() & 0xffff;
1488 for (
const TileDigits* tile_digits : *digitsCollection) {
1496 int index = (gain == 1) ? drawerIndexHi : drawerIndex;
1506 (
m_TBperiod==2017 && ((fragId&0xFF)<4 && !(fragId == 0x201 || fragId == 0x203))) ||
1507 (
m_TBperiod==2018 && ((fragId&0xFF)<4 && !(fragId == 0x201 || fragId == 0x402))) ||
1508 (
m_TBperiod==2019 && ((fragId&0xFF)<5 && !(fragId == 0x201 || fragId == 0x203 || fragId >= 0x402))) ||
1509 (
m_TBperiod==2022 && ((fragId&0xFF)<4 && !(fragId == 0x201 || (
m_run >= 2210456 && fragId == 0x402)))))
1519 <<
" index " <<
index );
1522 sampleVec = tile_digits->samples();
1523 int siz = sampleVec.size();
1525 if (
msgLvl(MSG::DEBUG)) {
1526 msg(MSG::DEBUG) <<
"Digits(" << siz <<
")." << (dcnt++) <<
" {";
1527 for (
int i = 0; i < siz; i++) {
1528 msg(MSG::DEBUG) <<
static_cast<int>(sampleVec[i]) <<
" ";
1531 if (siz > nSamplesInDrawer) {
1532 msg(MSG::DEBUG) <<
"} ONLY " << nSamplesInDrawer <<
" digits saved to ntuple" <<
endmsg;
1538 if (siz > nSamplesInDrawer) siz = nSamplesInDrawer;
1539 std::transform(sampleVec.begin(), sampleVec.begin() + siz, &
m_sampleVec.at(
index).get()[0] + nSamplesInDrawer * channel, [] (
float v) {return static_cast<int>(v);});
1545 m_rodBCIDVec.at(drawerIndex) = digitsCollection->getRODBCID();
1546 m_sizeVec.at(drawerIndex) = digitsCollection->getFragSize();
1549 headerVec = digitsCollection->getFragChipHeaderWords();
1550 CRCmask = digitsCollection->getFragDMUMask();
1551 fe_crc = CRCmask & 0xFFFF;
1552 rod_crc = CRCmask >> 16;
1554 int headsize = headerVec.size();
1556 for (
int ih = 0; ih < headsize; ++ih) {
1557 m_bcidVec.at(drawerIndex)[ih] = (headerVec[ih] & 0xFFF);
1564 m_feCRCVec.at(drawerIndex)[ih] = (fe_crc >> ih & 0x1);
1565 m_rodCRCVec.at(drawerIndex)[ih] = (rod_crc >> ih & 0x1);
1573 m_slinkCRCVec.at(drawerIndex)[0] = (digitsCollection->getFragCRC() >> 16) & 0xffff;
1574 m_dmuMaskVec.at(drawerIndex)[0] = (digitsCollection->getFragDMUMask() >> 16) & 0xffff;
1575 m_slinkCRCVec.at(drawerIndex)[1] = digitsCollection->getFragCRC() & 0xffff;
1576 m_dmuMaskVec.at(drawerIndex)[1] = digitsCollection->getFragDMUMask() & 0xffff;
1582 for (
const TileDigits* tile_digits : *digitsCollection) {
1592 (
m_TBperiod==2017 && ((fragId&0xFF)<4 && !(fragId == 0x201 || fragId == 0x203))) ||
1593 (
m_TBperiod==2018 && ((fragId&0xFF)<4 && !(fragId == 0x201 || fragId == 0x402))) ||
1594 (
m_TBperiod==2019 && ((fragId&0xFF)<5 && !(fragId == 0x201 || fragId == 0x203 || fragId >= 0x402))) ||
1595 (
m_TBperiod==2022 && ((fragId&0xFF)<4 && !(fragId == 0x201 || (
m_run >= 2210456 && fragId == 0x402)))))
1605 sampleVec = tile_digits->samples();
1606 int siz = sampleVec.size();
1607 if (
msgLvl(MSG::DEBUG)) {
1608 msg(MSG::DEBUG) <<
"Digits(" << siz <<
")." << (dcnt++) <<
" {";
1610 for (
int i = 0; i < siz; i++) {
1611 msg(MSG::DEBUG) <<
static_cast<int>(sampleVec[i]) <<
" ";
1614 if (siz > nSamplesInDrawer) {
1615 msg(MSG::DEBUG) <<
"} ONLY " << nSamplesInDrawer <<
" digits saved to ntuple" <<
endmsg;
1621 if (siz > nSamplesInDrawer) siz = nSamplesInDrawer;
1622 std::transform(sampleVec.begin(), sampleVec.begin() + siz, &
m_sampleVec.at(drawerIndex).get()[0] + nSamplesInDrawer * channel, [] (
float v) {return static_cast<int>(v);});
1630 return StatusCode::FAILURE;
1632 return StatusCode::SUCCESS;
1638 if (containerKey.
empty()) {
1639 return StatusCode::FAILURE;
1645 bool emptyColl =
true;
1648 int drawerIndex, channel;
1650 std::vector<float> sampleVecLo;
1651 std::vector<float> sampleVecHi;
1655 int fragId = digitsCollection->identify();
1658 drawerIndex = (*itr).second;
1663 if (drawerIndex < 0) {
1664 if ( !digitsCollection->empty() )
1665 ATH_MSG_DEBUG(
"FELIX frag id 0x" << MSG::hex << fragId << MSG::dec <<
" was not found among valid frag IDs when storing TRC!" );
1670 <<
" FELIX Frag id 0x" << MSG::hex << fragId << MSG::dec
1671 <<
" index " << drawerIndex);
1673 ATH_MSG_DEBUG(
" Size=" << digitsCollection->getFragSize());
1676 <<
" EvBCID=" << digitsCollection->getRODBCID()
1677 <<
" EvType=" << digitsCollection->getDetEvType() );
1678 ATH_MSG_DEBUG(
" Headers = "<< digitsCollection->getFragExtraWords() );
1698 std::vector<uint32_t> extraWords = digitsCollection->getFragExtraWords();
1701 std::reference_wrapper<std::array<int,MAX_MINIDRAWER>>
1708 auto it = extraWords.begin();
1709 for (
int i = 0; i < 10; ++i) {
1717 if(!digitsCollection->empty()) {
1722 m_sizeflxVec.at(drawerIndex) = digitsCollection->getFragSize();
1727 for (
const TileDigits* tile_digits : *digitsCollection) {
1733 int index = (gain == 1) ? drawerIndexHi : drawerIndex;
1743 <<
" index " <<
index );
1747 sampleVecLo = tile_digits->samples();
1748 }
else if (gain == 1) {
1749 sampleVecHi = tile_digits->samples();
1752 int sizLo = sampleVecLo.size();
1753 int sizHi = sampleVecHi.size();
1757 if (
msgLvl(MSG::DEBUG)) {
1759 msg(MSG::DEBUG) <<
"Low gain Digits(" << sizLo <<
")." << (dcnt++) <<
" {";
1760 for (
int i = 0; i < sizLo; i++) {
1761 msg(MSG::DEBUG) <<
static_cast<int>(sampleVecLo[i]) <<
" ";
1764 if (sizLo > nSamplesInDrawer) {
1765 msg(MSG::DEBUG) <<
"} ONLY " << nSamplesInDrawer <<
" digits saved to ntuple" <<
endmsg;
1772 msg(MSG::DEBUG) <<
"High gain Digits(" << sizHi <<
")." << (dcnt++) <<
" {";
1773 for (
int i = 0; i < sizHi; i++) {
1774 msg(MSG::DEBUG) <<
static_cast<int>(sampleVecHi[i]) <<
" ";
1777 if (sizHi > nSamplesInDrawer) {
1778 msg(MSG::DEBUG) <<
"} ONLY " << nSamplesInDrawer <<
" digits saved to ntuple" <<
endmsg;
1786 if (sizLo > nSamplesInDrawer) sizLo = nSamplesInDrawer;
1787 if (sizHi > nSamplesInDrawer) sizHi = nSamplesInDrawer;
1788 std::transform(sampleVecLo.begin(), sampleVecLo.begin() + sizLo, &
m_sampleflxVec.at(
index).get()[0] + nSamplesInDrawer * channel, [] (
float v) {return static_cast<int>(v);});
1789 std::transform(sampleVecHi.begin(), sampleVecHi.begin() + sizHi, &
m_sampleflxVec.at(
index).get()[0] + nSamplesInDrawer * channel, [] (
float v) {return static_cast<int>(v);});
1790 sampleVecLo.clear();
1791 sampleVecHi.clear();
1799 return StatusCode::FAILURE;
1801 return StatusCode::SUCCESS;
1812 return StatusCode::FAILURE;
1824 for (
const TileHit& cinp : *hitVec) {
1832 int drawerIndex = ( itr !=
m_drawerMap.end() ) ?
static_cast<int>((*itr).second) : -1;
1834 if (drawerIndex < 0) {
1835 ATH_MSG_WARNING(
"frag id 0x" << MSG::hex << fragId << MSG::dec <<
" was not found among valid frag IDs when storing HITS!" );
1843 if (hitVec->
empty())
1844 return StatusCode::FAILURE;
1846 return StatusCode::SUCCESS;
1857 return StatusCode::FAILURE;
1866 bool emptyColl =
true;
1872 int fragId = hitCollection->identify();
1874 int drawerIndex = ( itr !=
m_drawerMap.end() ) ?
static_cast<int>((*itr).second) : -1;
1876 if (drawerIndex < 0) {
1877 if ( !hitCollection->empty() )
1878 ATH_MSG_WARNING(
"frag id 0x" << MSG::hex << fragId << MSG::dec <<
" was not found among valid frag IDs when storing HITS!" );
1884 <<
" Frag id 0x" << MSG::hex << fragId << MSG::dec
1885 <<
" index " << drawerIndex );
1887 if (emptyColl) emptyColl = hitCollection->empty();
1889 for (
const TileHit* cinp : *hitCollection) {
1896 return StatusCode::FAILURE;
1898 return StatusCode::SUCCESS;
1902 std::array<float, MAX_CHAN>& ehitVec,
1903 std::array<float, MAX_CHAN>& thitVec,
1910 int size = cinp->
size();
1911 if (
msgLvl(MSG::VERBOSE)) {
1912 msg(MSG::VERBOSE) <<
"hit hwid="
1913 <<
m_tileHWID->to_string(hwid, -1) <<
" ener=";
1915 for (
int i = 0; i < size; ++i)
1916 msg(MSG::VERBOSE) << cinp->
energy(i) <<
" ";
1918 msg(MSG::VERBOSE) <<
"time=";
1919 for (
int i = 0; i < size; ++i)
1920 msg(MSG::VERBOSE) << cinp->
time(i) <<
" ";
1925 double ehit=0.0, thit=0.0;
1926 for(
int i=0;i<size;++i) {
1928 double e = cinp->
energy(i);
1929 double t = cinp->
time(i);
1931 if (-75.<t && t<75.) {
1954 (
m_TBperiod==2017 && ((fragId&0xFF)<4 && !(fragId == 0x201 || fragId == 0x203))) ||
1955 (
m_TBperiod==2018 && ((fragId&0xFF)<4 && !(fragId == 0x201 || fragId == 0x402))) ||
1956 (
m_TBperiod==2019 && ((fragId&0xFF)<5 && !(fragId == 0x201 || fragId == 0x203 || fragId >= 0x402))) ||
1957 (
m_TBperiod==2022 && ((fragId&0xFF)<4 && !(fragId == 0x201 || (
m_run >= 2210456 && fragId == 0x402)))))
1961 ehitVec[channel] = ehit;
1962 thitVec[channel] = thit;
1966 <<
" pmt-1=" << channel
2016 return StatusCode::SUCCESS;
2021 MsgStream log(msgSvc(), name());
2093 auto tree = std::make_unique<TTree>(
m_ntupleID.value().c_str(),
"TileBEAM-Ntuple");
2127 return StatusCode::SUCCESS;
2133 return StatusCode::FAILURE;
2140 ATH_MSG_DEBUG(
"succeeded retrieving cellContainer from SG" );
2142 ATH_MSG_DEBUG(
"TileTBAANtuple : about to iterate over CaloCells" );
2149 for (
const CaloCell* cell : *cellContainer) {
2151 const double energy = cell->energy();
2155 if (sampl == CaloCell_ID::PreSamplerB) {
2157 }
else if (sampl == CaloCell_ID::EMB1) {
2159 }
else if (sampl == CaloCell_ID::EMB2) {
2161 }
else if (sampl == CaloCell_ID::EMB3) {
2163 }
else if (sampl == CaloCell_ID::TileBar0) {
2165 }
else if (sampl == CaloCell_ID::TileBar1) {
2167 }
else if (sampl == CaloCell_ID::TileBar2) {
2169 }
else if (sampl == CaloCell_ID::TileExt0) {
2171 }
else if (sampl == CaloCell_ID::TileExt1) {
2173 }
else if (sampl == CaloCell_ID::TileExt2) {
2175 }
else if (sampl == CaloCell_ID::TileGap1) {
2177 }
else if (sampl == CaloCell_ID::TileGap2) {
2179 }
else if (sampl == CaloCell_ID::TileGap3) {
2184 return StatusCode::SUCCESS;
2205 return StatusCode::SUCCESS;
2214 std::vector<unsigned int> frags;
2217 if (!digitsCollection->empty()) {
2219 frags.push_back(digitsCollection->identify());
2222 size = frags.size();
2231 unsigned int rosOrder[5] = { 2, 1, 3, 4, 0 };
2232 unsigned int dr = 0;
2233 char frg[6] =
"0x000";
2239 msg(MSG::INFO) <<
"setting drawerList from data " << MSG::hex;
2240 for (
unsigned int ir = 0;
ir < 5; ++
ir) {
2241 for (
unsigned int i = 0; i < size; ++i) {
2242 unsigned int frag = frags[i];
2243 if (frag >> 8 == rosOrder[
ir]) {
2244 sprintf(frg,
"0x%3.3x", frag);
2248 msg(MSG::INFO) <<
" 0x" << frag;
2263 msg(MSG::INFO) << MSG::INFO <<
"drawerType ";
2264 for (
unsigned int dr = 0; dr < size; ++dr)
2273 if (size < 1) size = 1;
2291 if (!digitsCollection->empty()) {
2292 int siz = digitsCollection->front()->samples().size();
2302 return StatusCode::SUCCESS;
2322 return StatusCode::SUCCESS;
2331 std::vector<unsigned int> frags;
2334 if (!digitsCollection->empty()) {
2336 frags.push_back(digitsCollection->identify());
2340 unsigned int nFrags = frags.size();
2351 std::ostringstream os;
2352 os <<
"setting FELIX drawers from data " << std::hex;
2353 unsigned int drawerIndex = 0;
2354 for (
unsigned int frag : frags) {
2356 os <<
" 0x" << frag;
2370 ATH_MSG_ERROR(
"can't find any FELIX TileDigits collections" );
2371 ATH_MSG_ERROR(
"can't set up FELIX fragment list for ntuple" );
2380 if (!digitsCollection->empty()) {
2381 int siz = digitsCollection->front()->samples().size();
2391 return StatusCode::SUCCESS;
2408 if (fileName.size() == 0) {
2415 std::ifstream etafile;
2416 etafile.open(fileName.c_str());
2418 if (etafile.good()) {
2423 while ((runNumber !=
m_runNumber) && (!etafile.eof())) {
2424 etafile >> runNumber >>
eta;
2487 if (nDrawersAll > 0) {
2488 m_l1ID.resize(nDrawersAll + 1);
2560 for(
unsigned i=0; i<33; ++i){
m_qdc[i]=0.0; }
2569//Clear Tree TRIGGER variables
2591//Clear Tree MUON variables
2603//Clear Tree ECAL variables
2614//Clear Tree QDC variables
2620 for(
unsigned i=0; i<33; ++i){
m_qdc[i]=0.0; }
2707//Clear Tree LASER variables
2769 for (
int j = 0; j < 16; j++) {
2782//Clear Tree ADDER variables
2808//Clear Tree CISPAR variables
2861 m_btdc =
new std::vector<std::vector<int> >(16);
2942//Clear Tree BEAM variables
3005 for (
int i=0; i<16; i+=2) {
3007 m_tof[i+1] = -0xFFFF;
3010 for (
int i=0; i<16; i+=2) {
3015 for (
int i=0; i<16; i+=2) {
3021 for (std::vector<int>& btdc_amplitudes : *
m_btdc) {
3022 btdc_amplitudes.clear();
3050//Clear Tree ENETOTAL variables
3110//Clear Tree COINCBOARD variables
3176 std::ostringstream oss;
3178 std::string nSampStr=oss.str();
3180 unsigned int listSize = std::min(
m_nDrawers.value(),
static_cast<unsigned int>(
m_drawerMap.size()));
3184 std::string digit[10] = {
"0",
"1",
"2",
"3",
"4",
"5",
"6",
"7",
"8",
"9" };
3185 std::vector<std::string> suffixArr;
3192 suffixArr.resize(
length);
3194 for (
unsigned int i = 0; i < listSize; ++i) {
3200 digits = digit[drawer / 10] + digit[drawer % 10];
3201 }
else if (testbeam) {
3202 digits = digit[drawer & 7];
3205 digits = digit[drawer / 10] + digit[drawer % 10];
3210 suff.replace(suff.find(
"0x"), 2,
"");
3211 suffixArr[i] = suff +
"lo";
3214 suffixArr[i] =
m_rosName[ros] + digits +
"lo";
3221 suffixArr.resize(
length);
3223 for (
unsigned int i = 0; i < listSize; ++i) {
3229 digits = digit[drawer / 10] + digit[drawer % 10];
3230 }
else if (testbeam) {
3231 digits = digit[drawer & 7];
3234 digits = digit[drawer / 10] + digit[drawer % 10];
3239 suff.replace(suff.find(
"0x"), 2,
"");
3240 suffixArr[i] = std::move(suff);
3254 for (
unsigned int i = 0; i <
length; i++) {
3261 nSamplesInDrawer = it->second;
3265 m_bcidVec.push_back(std::array<int, MAX_DMU>());
3277 m_gainVec.push_back(std::array<int, MAX_CHAN>());
3279 m_feCRCVec.push_back(std::array<int, MAX_DMU>());
3280 m_rodCRCVec.push_back(std::array<int, MAX_DMU>());
3282 m_eneVec.push_back(std::array<float, MAX_CHAN>());
3283 m_timeVec.push_back(std::array<float, MAX_CHAN>());
3287 m_efitVec.push_back(std::array<float, MAX_CHAN>());
3288 m_tfitVec.push_back(std::array<float, MAX_CHAN>());
3289 m_pedfitVec.push_back(std::array<float, MAX_CHAN>());
3290 m_chi2Vec.push_back(std::array<float, MAX_CHAN>());
3292 m_efitcVec.push_back(std::array<float, MAX_CHAN>());
3293 m_tfitcVec.push_back(std::array<float, MAX_CHAN>());
3295 m_chi2cVec.push_back(std::array<float, MAX_CHAN>());
3297 m_eOptVec.push_back(std::array<float, MAX_CHAN>());
3298 m_tOptVec.push_back(std::array<float, MAX_CHAN>());
3299 m_pedOptVec.push_back(std::array<float, MAX_CHAN>());
3302 m_eDspVec.push_back(std::array<float, MAX_CHAN>());
3303 m_tDspVec.push_back(std::array<float, MAX_CHAN>());
3319 m_ntuplePtr->Branch((
"Evt"+suffixArr[i]).c_str(), &
m_evtVec.data()[i], (
"Evt"+suffixArr[i]+
"/I").c_str());
3320 m_ntuplePtr->Branch((
"rodBCID"+suffixArr[i]).c_str(), &
m_rodBCIDVec.data()[i], (
"rodBCID"+suffixArr[i]+
"/S").c_str());
3321 m_ntuplePtr->Branch((
"Size"+suffixArr[i]).c_str(), &
m_sizeVec.data()[i], (
"Size"+suffixArr[i]+
"/S").c_str());
3322 m_ntuplePtr->Branch((
"BCID"+suffixArr[i]).c_str(), &
m_bcidVec.back(), (
"bcid"+suffixArr[i]+
"[16]/I").c_str());
3323 m_ntuplePtr->Branch((
"DMUheader"+suffixArr[i]).c_str(), &
m_DMUheaderVec.back(), (
"DMUheader"+suffixArr[i]+
"[16]/i").c_str());
3329 m_ntuplePtr->Branch((
"DMUMask"+suffixArr[i]).c_str(), &
m_dmuMaskVec.back(), (
"dmumask"+suffixArr[i]+
"[2]/I").c_str());
3330 m_ntuplePtr->Branch((
"SlinkCRC"+suffixArr[i]).c_str(), &
m_slinkCRCVec.back(), (
"crc"+suffixArr[i]+
"[2]/I").c_str());
3335 m_ntuplePtr->Branch((
"Gain"+suffixArr[i]).c_str(),&
m_gainVec.back(), (
"gain"+suffixArr[i]+
"[48]/I").c_str());
3337 if (nSamplesInDrawer > 0) {
3338 nSampStr = std::to_string(nSamplesInDrawer);
3340 (
"sample" + suffixArr[i] +
"[48]["+nSampStr+
"]/I").c_str());
3344 m_ntuplePtr->Branch((
"feCRC" + suffixArr[i]).c_str(), &
m_feCRCVec.back(), (
"fe_crc" + suffixArr[i] +
"[16]/I").c_str());
3345 m_ntuplePtr->Branch((
"rodCRC" + suffixArr[i]).c_str(), &
m_rodCRCVec.back(), (
"rod_crc" + suffixArr[i] +
"[16]/I").c_str());
3350 m_ntuplePtr->Branch((
"Ene" + suffixArr[i]).c_str(), &
m_eneVec.back(), (
"ene" + suffixArr[i] +
"[48]/F").c_str());
3351 m_ntuplePtr->Branch((
"Time" + suffixArr[i]).c_str(), &
m_timeVec.back(), (
"time" + suffixArr[i] +
"[48]/F").c_str());
3352 m_ntuplePtr->Branch((
"Ped" + suffixArr[i]).c_str(), &
m_pedFlatVec.back(), (
"pedflat" + suffixArr[i] +
"[48]/F").c_str());
3353 m_ntuplePtr->Branch((
"Chi2ene" + suffixArr[i]).c_str(), &
m_chi2FlatVec.back(), (
"chiflat" + suffixArr[i] +
"[48]/F").c_str());
3359 m_ntuplePtr->Branch((
"Efit" + suffixArr[i]).c_str(), &
m_efitVec.back(), (
"efit" + suffixArr[i] +
"[48]/F").c_str());
3360 m_ntuplePtr->Branch((
"Tfit" + suffixArr[i]).c_str(), &
m_tfitVec.back(), (
"tfit" + suffixArr[i] +
"[48]/F").c_str());
3361 m_ntuplePtr->Branch((
"Pedfit" + suffixArr[i]).c_str(), &
m_pedfitVec.back(), (
"pedfit" + suffixArr[i] +
"[48]/F").c_str());
3362 m_ntuplePtr->Branch((
"Chi2fit" + suffixArr[i]).c_str(), &
m_chi2Vec.back(), (
"chifit" + suffixArr[i] +
"[48]/F").c_str());
3368 m_ntuplePtr->Branch((
"Efitc" + suffixArr[i]).c_str(), &
m_efitcVec.back(), (
"efitc" + suffixArr[i] +
"[48]/F").c_str());
3369 m_ntuplePtr->Branch((
"Tfitc" + suffixArr[i]).c_str(), &
m_tfitcVec.back(), (
"tfitc" + suffixArr[i] +
"[48]/F").c_str());
3370 m_ntuplePtr->Branch((
"Pedfitc" + suffixArr[i]).c_str(), &
m_pedfitcVec.back(), (
"pedfitc" + suffixArr[i] +
"[48]/F").c_str());
3371 m_ntuplePtr->Branch((
"Chi2fitc" + suffixArr[i]).c_str(), &
m_chi2cVec.back(), (
"chifitc" + suffixArr[i] +
"[48]/F").c_str());
3377 m_ntuplePtr->Branch((
"Eopt"+suffixArr[i]).c_str(), &
m_eOptVec.back(), (
"eOpt"+suffixArr[i]+
"[48]/F").c_str());
3378 m_ntuplePtr->Branch((
"Topt"+suffixArr[i]).c_str(), &
m_tOptVec.back(), (
"tOpt"+suffixArr[i]+
"[48]/F").c_str());
3379 m_ntuplePtr->Branch((
"Pedopt"+suffixArr[i]).c_str(), &
m_pedOptVec.back(), (
"pedOpt"+suffixArr[i]+
"[48]/F").c_str());
3380 m_ntuplePtr->Branch((
"Chi2opt"+suffixArr[i]).c_str(), &
m_chi2OptVec.back(), (
"chiOpt"+suffixArr[i]+
"[48]/F").c_str());
3386 m_ntuplePtr->Branch((
"Edsp"+suffixArr[i]).c_str(), &
m_eDspVec.back(), (
"eDsp"+suffixArr[i]+
"[48]/F").c_str());
3387 m_ntuplePtr->Branch((
"Tdsp"+suffixArr[i]).c_str(), &
m_tDspVec.back(), (
"tDsp"+suffixArr[i]+
"[48]/F").c_str());
3388 m_ntuplePtr->Branch((
"Chi2dsp"+suffixArr[i]).c_str(), &
m_chi2DspVec.back(), (
"chiDsp"+suffixArr[i]+
"[48]/F").c_str());
3390 m_ntuplePtr->Branch((
"ROD_DMUBCID"+suffixArr[i]).c_str(), &
m_ROD_DMUBCIDVec.back(), (
"ROD_DMUBCID"+suffixArr[i]+
"[16]/s").c_str());
3396 m_ntuplePtr->Branch((
"ROD_DMUMask"+suffixArr[i]).c_str(), &
m_ROD_DMUMaskVec.back(), (
"ROD_DMUMask"+suffixArr[i]+
"[2]/s").c_str());
3499 std::vector<std::string> suffixArr(
length,
"");
3502 for (
const std::pair<const unsigned int, unsigned int>& fragAndDrawer :
m_drawerFlxMap) {
3503 unsigned int frag = fragAndDrawer.first;
3504 unsigned int ros = frag >> 8;
3505 unsigned int drawer = frag & 0x3F;
3506 unsigned int drawerIndex = fragAndDrawer.second;
3508 std::ostringstream drawerName;
3511 drawerName << (drawer & 7);
3514 drawerName << std::setw(2) << std::setfill(
'0') << drawer;
3517 moduleNames.at(drawerIndex) = drawerName.str();
3518 suffixArr.at(drawerIndex) = drawerName.str() +
"lo";
3519 suffixArr.at(drawerIndex +
m_nDrawersFlx) = drawerName.str() +
"hi";
3524 nSamples = it->second;
3535 for (
unsigned int i = 0; i <
length; ++i) {
3561 std::string suffix = moduleNames[i];
3591 if (nSamplesInDrawer > 0) {
3592 nSampStrFlx = std::to_string(nSamplesInDrawer);
3594 (
"Flxsample" + suffixArr[i] +
"[48]["+nSampStrFlx+
"]/I").c_str());
3665 unsigned int listSize = std::min(
m_nDrawers.value(),
static_cast<unsigned int>(
m_drawerMap.size()));
3669 std::string digit[10] = {
"0",
"1",
"2",
"3",
"4",
"5",
"6",
"7",
"8",
"9" };
3670 std::vector<std::string> suffixArr;
3675 suffixArr.resize(
length);
3677 for (
unsigned int i = 0; i < listSize; ++i) {
3683 digits = digit[drawer / 10] + digit[drawer % 10];
3684 }
else if (testbeam) {
3685 digits = digit[drawer & 7];
3688 digits = digit[drawer / 10] + digit[drawer % 10];
3693 suff.replace(suff.find(
"0x"), 2,
"");
3694 suffixArr[i] = std::move(suff);
3700 for (
unsigned int i = 0; i <
length; i++) {
3705 m_ehitVec.push_back(std::array<float, MAX_CHAN>());
3706 m_thitVec.push_back(std::array<float, MAX_CHAN>());
3707 m_ehitCnt.push_back(std::array<float, MAX_CHAN>());
3708 m_thitCnt.push_back(std::array<float, MAX_CHAN>());
3717 m_ntuplePtr->Branch((
"EhitG4"+suffixArr[i]).c_str(),&
m_ehitVec.back(),(
"eHitG4"+suffixArr[i]+
"[48]/F").c_str());
3718 m_ntuplePtr->Branch((
"ThitG4"+suffixArr[i]).c_str(),&
m_thitVec.back(),(
"tHitG4"+suffixArr[i]+
"[48]/F").c_str());
3724 ATH_MSG_DEBUG(
"Adding G4 corrected hit info for " << suffixArr[i] );
3726 m_ntuplePtr->Branch((
"EhitSim"+suffixArr[i]).c_str(),&
m_ehitCnt.back(),(
"eHitSim"+suffixArr[i]+
"[48]/F").c_str());
3727 m_ntuplePtr->Branch((
"ThitSim"+suffixArr[i]).c_str(),&
m_thitCnt.back(),(
"tHitSim"+suffixArr[i]+
"[48]/F").c_str());
3749 std::fill(
vec.begin(),
vec.end(),
static_cast<T
>(-1));
3752template<
typename T,
size_t N>
3754 for (std::array<T,N>& arr :
vec) {
3755 std::fill(arr.begin(), arr.end(),
static_cast<T
>(-1));
3759template<
typename T,
size_t N>
3761 for (std::array<T,N>& arr :
vec) {
3762 std::fill(arr.begin(), arr.end(),
static_cast<T
>(0));
3768 for (
unsigned int i = 0; i <
vec.size(); ++i) {
3769 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.
char data[hepevt_bytes_allocation_ATLAS]
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
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)
virtual StatusCode execute() override
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.