8 const std::string&
name,
11 m_regionSelector(
"RegSelTool/RegSelTool_STGC",this)
26 ATH_CHECK(m_stgcPrepContainerKey.initialize(!m_stgcPrepContainerKey.empty()));
28 return StatusCode::SUCCESS;
35 ATH_MSG_DEBUG(
"StgcDataPreparator::prepareData() was called.");
39 std::vector<const Muon::sTgcPrepDataCollection*> stgcCols;
40 std::vector<IdentifierHash> stgcHashList;
41 std::vector<IdentifierHash> stgcHashList_cache;
44 if(m_stgcPrepContainerKey.empty()) {
46 return StatusCode::SUCCESS;
48 auto stgcPrepContainerHandle =
SG::makeHandle(m_stgcPrepContainerKey);
49 if (!stgcPrepContainerHandle.isValid()) {
50 ATH_MSG_ERROR(
"Cannot retrieve sTgc PRD Container key: " << m_stgcPrepContainerKey.key());
51 return StatusCode::FAILURE;
53 ATH_MSG_DEBUG(
"sTgc PRD Container retrieved with key: " << m_stgcPrepContainerKey.key());
57 if (m_use_RoIBasedDataAccess) {
62 if (iroi) m_regionSelector->lookup( Gaudi::Hive::currentContext() )->HashIDList(*iroi, stgcHashList);
65 m_regionSelector->lookup( Gaudi::Hive::currentContext() )->HashIDList(fullscan_roi, stgcHashList);
69 std::vector<uint32_t> stgcRobList;
70 m_regionSelector->lookup( Gaudi::Hive::currentContext() )->ROBIDList(*iroi, stgcRobList);
72 if (!stgcHashList.empty()) {
79 if( STGCcoll ==
nullptr ) {
83 if( STGCcoll->size() == 0) {
88 stgcHashList_cache.push_back(
id);
89 stgcCols.push_back(STGCcoll);
98 for(
const auto stgccoll : *stgcPrds) {
99 stgcCols.push_back(stgccoll);
106 stgcHits.reserve( stgcHits.size() + stgc->size() );
112 lutDigit.
eta = prepData->globalPosition().eta();
113 lutDigit.
phi = prepData->globalPosition().phi();
114 lutDigit.
r = prepData->globalPosition().perp();
115 lutDigit.
z = prepData->globalPosition().z();
116 lutDigit.
stationEta = m_idHelperSvc->stgcIdHelper().stationEta(prepData->identify());
117 lutDigit.
stationPhi = m_idHelperSvc->stgcIdHelper().stationPhi(prepData->identify());
118 lutDigit.
stationName = m_idHelperSvc->stgcIdHelper().stationName(prepData->identify());
119 lutDigit.
channelType = m_idHelperSvc->stgcIdHelper().channelType(prepData->identify());
123 lutDigit.
layerNumber = m_idHelperSvc->stgcIdHelper().gasGap(prepData->identify())-1 + 4*(m_idHelperSvc->stgcIdHelper().multilayer(prepData->identify())-1);
124 stgcHits.push_back(lutDigit);
126 ATH_MSG_DEBUG(
"StgcDataPreparator: global eta/phi/r/z station eta/phi/name channel_type layer " << lutDigit.
eta <<
"/" << lutDigit.
phi <<
"/" << lutDigit.
r <<
"/" << lutDigit.
z <<
" " << lutDigit.
stationEta <<
"/" << lutDigit.
stationPhi <<
"/" << lutDigit.
stationName <<
" " << lutDigit.
channelType <<
" " << (m_idHelperSvc->stgcIdHelper().gasGap(prepData->identify())-1 + 4*(m_idHelperSvc->stgcIdHelper().multilayer(prepData->identify())-1)) );
131 return StatusCode::SUCCESS;