24 #include <unordered_map>
27 using namespace InDet;
42 ATH_CHECK(
m_pSummaryTool.retrieve( DisableTool{!m_checkBadModules.value() || (!m_sctDetElStatus.empty() && !VALIDATE_STATUS_ARRAY_ACTIVATED)} ) );
73 return StatusCode::SUCCESS;
88 ATH_CHECK(clusterContainer.record(std::make_unique<SCT_ClusterContainer>(clusterContainercache.ptr())));
90 ATH_MSG_DEBUG(
"Container '" << clusterContainer.name() <<
"' initialised");
94 ATH_MSG_DEBUG(
"SCT clusters '" << clusterContainer.name() <<
"' symlinked in StoreGate");
99 ATH_MSG_DEBUG(
"Created IDCInDetBSErrContainer w/o using external cache");
103 ATH_CHECK(flaggedCondData.record( std::make_unique<IDCInDetBSErrContainer>(flaggedCondCacheHandle.
ptr())) );
104 ATH_MSG_DEBUG(
"Created SCT IDCInDetBSErrContainer using external cache");
106 std::unordered_map<IdentifierHash, IDCInDetBSErrContainer::ErrorCode> flaggedCondMap;
117 bool dontDoClusterization{
false};
120 constexpr
unsigned int totalNumberOfChannels{6279168};
122 unsigned int totalFiredStrips{0};
123 for (; rdoCollections != rdoCollectionsEnd; ++rdoCollections) {
125 totalFiredStrips += rdo->getGroupSize();
129 rdoCollections = rdoContainer->begin();
130 if (totalFiredStrips > maxAllowableStrips) {
131 ATH_MSG_WARNING(
"This event has too many hits in the SCT: " << totalFiredStrips <<
" > " << maxAllowableStrips);
132 dontDoClusterization =
true;
138 ATH_CHECK( sctDetElStatus.
isValid() ? StatusCode::SUCCESS : StatusCode::FAILURE);
141 if (not dontDoClusterization) {
142 std::unique_ptr<DataPool<SCT_Cluster>> dataItemsPool =
nullptr;
143 const bool hasExternalCache = rdoContainer->hasExternalCache();
144 if (!hasExternalCache) {
145 dataItemsPool = std::make_unique<DataPool<SCT_Cluster>>(ctx);
146 dataItemsPool->reserve(20000);
148 dataItemsPool = std::make_unique<DataPool<SCT_Cluster>>(ctx);
161 for (; rdoCollections != rdoCollectionsEnd; ++rdoCollections) {
163 ATH_MSG_DEBUG(
"RDO collection size=" << rd->size() <<
", Hash="
164 << rd->identifyHash());
165 SCT_ClusterContainer::IDC_WriteHandle lock{
166 clusterContainer->getWriteHandle(rdoCollections.hashId())};
167 if (lock.OnlineAndPresentInAnotherView()) {
169 "Item already in cache , Hash=" << rd->identifyHash());
175 ? sctDetElStatus->
isGood(rd->identifyHash())
180 sctDetElStatus->
isGood(rd->identifyHash()),
188 if ((not rd->empty()) and goodModule) {
191 unsigned int nFiredStrips{0};
193 nFiredStrips += rdo->getGroupSize();
198 constexpr
int value =
200 auto [pPair, inserted] =
201 flaggedCondMap.insert({rd->identifyHash(),
value});
203 pPair->second |=
value;
209 std::unique_ptr<SCT_ClusterCollection> clusterCollection{
213 cache, dataItemsPool.get(), ctx)};
214 if (clusterCollection) {
215 if (not clusterCollection->empty()) {
216 const IdentifierHash
hash{clusterCollection->identifyHash()};
217 ATH_CHECK(lock.addOrDelete(std::move(clusterCollection)));
219 <<
hash <<
"' added to Container\n");
234 std::vector<IdentifierHash> listOfSCTIds;
235 for (; roi != roiE; ++roi) {
236 listOfSCTIds.clear();
240 <<
" det. Elements");
241 for (
size_t i{0};
i < listOfSCTIds.size();
i++) {
242 IdentifierHash
id = listOfSCTIds[
i];
244 rdoContainer->indexFindPtr(
id)};
245 if (RDO_Collection ==
nullptr){
253 ? sctDetElStatus->
isGood(
id)
265 if ((not RDO_Collection->empty()) and goodModule) {
268 unsigned int nFiredStrips{0};
270 nFiredStrips += rdo->getGroupSize();
275 constexpr
int value =
277 auto [pPair, inserted] = flaggedCondMap.insert({
id,
value});
279 pPair->second |=
value;
286 SCT_ClusterContainer::IDC_WriteHandle lock{
287 clusterContainer->getWriteHandle(listOfSCTIds[
i])};
288 if (lock.OnlineAndPresentInAnotherView()) {
289 ATH_MSG_DEBUG(
"Item already in cache , Hash=" << listOfSCTIds[
i]);
296 std::unique_ptr<SCT_ClusterCollection> clusterCollection{
301 cache, dataItemsPool.get(), ctx)};
302 if (clusterCollection and (not clusterCollection->empty())) {
303 ATH_MSG_VERBOSE(
"REGTEST: SCT : clusterCollection contains " << clusterCollection->size() <<
" clusters");
304 ATH_CHECK(lock.addOrDelete(std::move(clusterCollection)));
317 for (
auto [
hash,
error] : flaggedCondMap) {
321 return StatusCode::SUCCESS;
327 return StatusCode::SUCCESS;