58 ATH_MSG_DEBUG(
" ***************** Start of process STGC Collection with hash Id: " <<
hash);
60 auto stgcPrepDataContainer = xAODcontainers.prd;
62 if ( stgcPrepDataContainer->indexFindPtr(
hash) !=
nullptr ) {
63 ATH_MSG_DEBUG(
"In processCollection: collection already contained in the sTGC PrepData container");
64 return StatusCode::FAILURE;
72 ATH_MSG_DEBUG(
"In processCollection: collection already available in the sTgc PrepData container (via cache)");
73 return StatusCode::SUCCESS;
77 std::unique_ptr<sTgcPrepDataCollection> prdColl = std::make_unique<sTgcPrepDataCollection>(
hash);
82 int getId = id_helper.
get_id(
hash, moduleId, &context);
90 std::vector<sTgcPrepData> sTgcStripPrds;
91 std::vector<sTgcPrepData> sTgcWirePrds;
92 std::vector<sTgcPrepData> sTgcPadPrds;
93 sTgcStripPrds.reserve(rdoColl->
size());
94 sTgcPadPrds.reserve(rdoColl->
size());
95 sTgcWirePrds.reserve(rdoColl->
size());
102 if(!muonDetMgr.isValid()){
103 ATH_MSG_ERROR(
"Null pointer to the read MuonDetectorManager conditions object");
104 return StatusCode::FAILURE;
114 ATH_MSG_WARNING(
"The given Identifier "<<rdoId.get_compact()<<
" ("<<
m_idHelperSvc->toString(rdoId)<<
") is no sTGC Identifier, continuing");
118 std::vector<Identifier> rdoList;
119 rdoList.push_back(rdoId);
126 if (channelType < 0 || channelType > 2) {
128 return StatusCode::FAILURE;
132 if ( !getLocalPos ) {
134 return StatusCode::FAILURE;
144 int calibratedCharge =
static_cast<int>(calibStrip.
charge);
145 if (calibratedCharge < 0 && channelType == 1) {
146 if (!hitNegativeCharge) {
147 ATH_MSG_WARNING(
"One sTGC RDO or more, such as one with pdo = "<<rdo->charge() <<
" counts, corresponds to a negative charge (" << calibratedCharge <<
"). Skipping these RDOs");
148 hitNegativeCharge =
true;
154 if (channelType == sTgcIdHelper::sTgcChannelTypes::Pad) {
178 std::vector<sTgcPrepData>& sTgcPrds = channelType ==
sTgcIdHelper::Pad ? sTgcPadPrds :
182 auto it = std::find_if(sTgcPrds.begin(), sTgcPrds.end(), [&rdoId](
const sTgcPrepData& prd) {
183 return (prd.identify() == rdoId);
185 if (
it == sTgcPrds.end()) {
186 sTgcPrds.emplace_back(rdoId,
hash, std::move(localPos), std::move(rdoList), std::move(
cov), detEl, calibratedCharge, calibStrip.
time);
188 }
else if (
it->time() > calibStrip.
time) {
189 *
it =
sTgcPrepData(rdoId,
hash, std::move(localPos), std::move(rdoList), std::move(
cov), detEl, calibratedCharge, calibStrip.
time);
197 prdColl->
push_back(std::make_unique<sTgcPrepData>(rdoId,
210 std::vector<std::unique_ptr<Muon::sTgcPrepData>> sTgcStripClusters;
213 for ( std::unique_ptr<Muon::sTgcPrepData>&
it : sTgcStripClusters ) {
219 prdColl->
push_back(std::make_unique<sTgcPrepData>(std::move(prd)));
223 prdColl->
push_back(std::make_unique<sTgcPrepData>(std::move(prd)));
238 <<
", cov: "<<prd->localCovariance()(0,0)
241 outHit = xAODcontainers.pad->push_back(std::make_unique<xAOD::sTgcPadHit>());
243 lCov(0,0) = prd->localCovariance()(0,0);
246 outHit->setMeasurement<2>(
m_idHelperSvc->detElementHash(prdId),
250 outHit = xAODcontainers.wire->push_back(std::make_unique<xAOD::sTgcWireHit>());
252 auto stripHit = xAODcontainers.strip->push_back(std::make_unique<xAOD::sTgcStripCluster>());
253 stripHit->setStripCharges(prd->stripCharges());
254 stripHit->setStripNumbers(prd->stripNumbers());
255 stripHit->setStripTimes(prd->stripTimes());
261 if (
chType != sTgcIdHelper::sTgcChannelTypes::Pad){
264 lCov(0,0) = prd->localCovariance()(0,0);
265 outHit->setMeasurement<1>(
m_idHelperSvc->detElementHash(prdId),
270 outHit->setChannelNumber(
channel);
271 outHit->setGasGap(
gasGap);
272 outHit->setAuthor(prd->author());
273 outHit->setTime(prd->time());
274 outHit->setCharge(prd->charge());
275 outHit->setIdentifier(prdId.get_compact());
277 outHit->setReadoutElement(
m_detMgrR4->getsTgcReadoutElement(prdId));
287 return StatusCode::SUCCESS;