23 #include <unordered_map>
26 using namespace InDet;
37 ATH_CHECK(
m_pSummaryTool.retrieve( DisableTool{!m_checkBadModules.value() || (!m_sctDetElStatus.empty() && !VALIDATE_STATUS_ARRAY_ACTIVATED)} ) );
68 return StatusCode::SUCCESS;
83 ATH_CHECK(clusterContainer.record(std::make_unique<SCT_ClusterContainer>(clusterContainercache.ptr())));
85 ATH_MSG_DEBUG(
"Container '" << clusterContainer.name() <<
"' initialised");
89 ATH_MSG_DEBUG(
"SCT clusters '" << clusterContainer.name() <<
"' symlinked in StoreGate");
94 ATH_MSG_DEBUG(
"Created IDCInDetBSErrContainer w/o using external cache");
98 ATH_CHECK(flaggedCondData.record( std::make_unique<IDCInDetBSErrContainer>(flaggedCondCacheHandle.
ptr())) );
99 ATH_MSG_DEBUG(
"Created SCT IDCInDetBSErrContainer using external cache");
101 std::unordered_map<IdentifierHash, IDCInDetBSErrContainer::ErrorCode> flaggedCondMap;
112 bool dontDoClusterization{
false};
115 constexpr
unsigned int totalNumberOfChannels{6279168};
117 unsigned int totalFiredStrips{0};
118 for (; rdoCollections != rdoCollectionsEnd; ++rdoCollections) {
120 totalFiredStrips += rdo->getGroupSize();
124 rdoCollections = rdoContainer->begin();
125 if (totalFiredStrips > maxAllowableStrips) {
126 ATH_MSG_WARNING(
"This event has too many hits in the SCT: " << totalFiredStrips <<
" > " << maxAllowableStrips);
127 dontDoClusterization =
true;
133 ATH_CHECK( sctDetElStatus.
isValid() ? StatusCode::SUCCESS : StatusCode::FAILURE);
136 if (not dontDoClusterization) {
137 std::unique_ptr<DataPool<SCT_Cluster>> dataItemsPool =
nullptr;
138 const bool hasExternalCache = rdoContainer->hasExternalCache();
139 if (!hasExternalCache) {
140 dataItemsPool = std::make_unique<DataPool<SCT_Cluster>>(ctx);
141 dataItemsPool->reserve(20000);
143 dataItemsPool = std::make_unique<DataPool<SCT_Cluster>>(ctx);
156 for (; rdoCollections != rdoCollectionsEnd; ++rdoCollections) {
158 ATH_MSG_DEBUG(
"RDO collection size=" << rd->size() <<
", Hash="
159 << rd->identifyHash());
160 SCT_ClusterContainer::IDC_WriteHandle lock{
161 clusterContainer->getWriteHandle(rdoCollections.hashId())};
162 if (lock.OnlineAndPresentInAnotherView()) {
164 "Item already in cache , Hash=" << rd->identifyHash());
170 ? sctDetElStatus->
isGood(rd->identifyHash())
175 sctDetElStatus->
isGood(rd->identifyHash()),
183 if ((not rd->empty()) and goodModule) {
186 unsigned int nFiredStrips{0};
188 nFiredStrips += rdo->getGroupSize();
193 constexpr
int value =
195 auto [pPair, inserted] =
196 flaggedCondMap.insert({rd->identifyHash(),
value});
198 pPair->second |=
value;
204 std::unique_ptr<SCT_ClusterCollection> clusterCollection{
208 cache, dataItemsPool.get(), ctx)};
209 if (clusterCollection) {
210 if (not clusterCollection->empty()) {
211 const IdentifierHash
hash{clusterCollection->identifyHash()};
212 ATH_CHECK(lock.addOrDelete(std::move(clusterCollection)));
214 <<
hash <<
"' added to Container\n");
229 std::vector<IdentifierHash> listOfSCTIds;
230 for (; roi != roiE; ++roi) {
231 listOfSCTIds.clear();
235 <<
" det. Elements");
236 for (
size_t i{0};
i < listOfSCTIds.size();
i++) {
237 IdentifierHash
id = listOfSCTIds[
i];
239 rdoContainer->indexFindPtr(
id)};
240 if (RDO_Collection ==
nullptr){
248 ? sctDetElStatus->
isGood(
id)
260 if ((not RDO_Collection->empty()) and goodModule) {
263 unsigned int nFiredStrips{0};
265 nFiredStrips += rdo->getGroupSize();
270 constexpr
int value =
272 auto [pPair, inserted] = flaggedCondMap.insert({
id,
value});
274 pPair->second |=
value;
281 SCT_ClusterContainer::IDC_WriteHandle lock{
282 clusterContainer->getWriteHandle(listOfSCTIds[
i])};
283 if (lock.OnlineAndPresentInAnotherView()) {
284 ATH_MSG_DEBUG(
"Item already in cache , Hash=" << listOfSCTIds[
i]);
291 std::unique_ptr<SCT_ClusterCollection> clusterCollection{
296 cache, dataItemsPool.get(), ctx)};
297 if (clusterCollection and (not clusterCollection->empty())) {
298 ATH_MSG_VERBOSE(
"REGTEST: SCT : clusterCollection contains " << clusterCollection->size() <<
" clusters");
299 ATH_CHECK(lock.addOrDelete(std::move(clusterCollection)));
312 for (
auto [
hash,
error] : flaggedCondMap) {
316 return StatusCode::SUCCESS;
322 return StatusCode::SUCCESS;