ATLAS Offline Software
Loading...
Searching...
No Matches
SCT_ConfigurationConditionsTestAlg.cxx
Go to the documentation of this file.
1/*
2 Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration
3*/
4
8
9// Local includes
11
12// Athena includes
13#include "Identifier/Identifier.h"
15
16SCT_ConfigurationConditionsTestAlg::SCT_ConfigurationConditionsTestAlg(const std::string& name, ISvcLocator* pSvcLocator) :
17 AthReentrantAlgorithm(name, pSvcLocator)
18{
19}
20
22 ATH_MSG_INFO("in initialize()");
23
24 ATH_CHECK(m_configConditions.retrieve());
25
26 ATH_CHECK(detStore()->retrieve(m_sctId, "SCT_ID"));
27
28 return StatusCode::SUCCESS;
29}
30
31StatusCode SCT_ConfigurationConditionsTestAlg::execute(const EventContext& ctx) const {
32 ATH_MSG_INFO("in execute()");
33
34 // Bad modules
35 unsigned int nBadMods{static_cast<unsigned int>(m_configConditions->badModules(ctx)->size())};
36
37 // Bad links
38 unsigned int nBadLink0{0}, nBadLink1{0}, nBadLinkBoth{0};
39 const std::map<IdentifierHash, std::pair<bool, bool>>* badLinks{m_configConditions->badLinks(ctx)};
40 std::map<IdentifierHash, std::pair<bool, bool>>::const_iterator linkItr{badLinks->begin()};
41 std::map<IdentifierHash, std::pair<bool, bool>>::const_iterator linkEnd{badLinks->end()};
42 while (linkItr != linkEnd) {
43 std::pair<bool, bool> status{(*linkItr).second};
44 if (!status.first and status.second ) ++nBadLink0;
45 if (status.first and !status.second) ++nBadLink1;
46 if (!status.first and !status.second) ++nBadLinkBoth;
47 ++linkItr;
48 }
49
50 // Bad chips
51 unsigned int nBadChips{0};
52 const std::map<Identifier, unsigned int>* badChips{m_configConditions->badChips(ctx)};
53 std::map<Identifier, unsigned int>::const_iterator chipItr{badChips->begin()};
54 std::map<Identifier, unsigned int>::const_iterator chipEnd{badChips->end()};
55 while (chipItr != chipEnd) {
56 unsigned int status{(*chipItr).second};
57 for (unsigned int i{0}; i<12; i++) nBadChips += ((status & (1<<i)) == 0 ? 0 : 1);
58 ++chipItr;
59 }
60
61 // Bad strips
62 std::set<Identifier> badStripsAll;
63 m_configConditions->badStrips(badStripsAll, ctx);
64 unsigned int nBadStrips{static_cast<unsigned int>(badStripsAll.size())};
65
66 // Bad strips (w/o bad modules and chips)
67 std::set<Identifier> badStripsExclusive;
68 m_configConditions->badStrips(badStripsExclusive, ctx, true, true);
69 unsigned int nBadStripsExclusive{static_cast<unsigned int>(badStripsExclusive.size())};
70 unsigned int nBadStripsExclusiveBEC[]{0,0,0};
71
72 std::set<Identifier>::const_iterator stripItr{badStripsExclusive.begin()};
73 std::set<Identifier>::const_iterator stripEnd{badStripsExclusive.end()};
74
75 while (stripItr != stripEnd) {
76 int bec{m_sctId->barrel_ec(*stripItr)};
77 nBadStripsExclusiveBEC[(bec/2)+1] += 1;
78 ++stripItr;
79 }
80
81 ATH_MSG_INFO("-----------------------------------------------------------------------");
82 ATH_MSG_INFO("Number of bad modules = " << nBadMods );
83 ATH_MSG_INFO("Number of bad link 0 = " << nBadLink0 );
84 ATH_MSG_INFO("Number of bad link 1 = " << nBadLink1 );
85 ATH_MSG_INFO("Number of bad link both = " << nBadLinkBoth );
86 ATH_MSG_INFO("Number of bad chips = " << nBadChips );
87 ATH_MSG_INFO("Number of bad strips = " << nBadStrips );
88 ATH_MSG_INFO("Number of bad strips exclusive = " << nBadStripsExclusive);
89 ATH_MSG_INFO("Number of bad strips exclusive (ECC, B, ECA) = "
90 << nBadStripsExclusiveBEC[0] << ", "
91 << nBadStripsExclusiveBEC[1] << ", "
92 << nBadStripsExclusiveBEC[2] << ", ");
93 ATH_MSG_INFO("-----------------------------------------------------------------------");
94
95 return StatusCode::SUCCESS;
96}
97
98
100 ATH_MSG_INFO("in finalize()");
101 return StatusCode::SUCCESS;
102}
#define ATH_CHECK
Evaluate an expression and check for errors.
#define ATH_MSG_INFO(x)
This is an Identifier helper class for the SCT subdetector.
const ServiceHandle< StoreGateSvc > & detStore() const
An algorithm that can be simultaneously executed in multiple threads.
SCT_ConfigurationConditionsTestAlg(const std::string &name, ISvcLocator *pSvcLocator)
virtual StatusCode execute(const EventContext &ctx) const override
ToolHandle< ISCT_ConfigurationConditionsTool > m_configConditions