9 , ISvcLocator* pSvcLocator )
28 return StatusCode::SUCCESS;
42 <<
". In theory this should not be called, but may happen"
43 <<
" if multiple concurrent events are being processed out of order.");
45 return StatusCode::SUCCESS;
50 if (!strawStatusHandle.
isValid()){
52 return StatusCode::FAILURE;
56 if (!strawStatusHandle.
range(range)){
57 ATH_MSG_ERROR(
"Failed to get validity range of " << strawStatusHandle.
key());
58 return StatusCode::FAILURE;
61 ATH_MSG_DEBUG(
"Retrieved " << strawStatusHandle.
key() <<
" with validity " << range);
64 if (statusSummary ==
nullptr) {
65 ATH_MSG_ERROR(
"Null pointer to the straw status summary container");
66 return StatusCode::FAILURE;
70 std::unique_ptr<TRTCond::AliveStraws> writeCdo{std::make_unique<TRTCond::AliveStraws>()};
74 if (not trtDetEleHandle.
isValid() or elements==
nullptr) {
76 return StatusCode::FAILURE;
81 for (std::vector<Identifier>::const_iterator it =
m_trtId->straw_layer_begin(); it !=
m_trtId->straw_layer_end(); ++it ) {
88 unsigned int nstraws = 0;
92 nstraws = el->nStraws();
95 nstraws =
m_trtId->straw_max( *it) + 1;
97 for (
unsigned int i=0; i<nstraws ;i++) {
99 int det =
m_trtId->barrel_ec(
id) ;
100 int lay =
m_trtId->layer_or_wheel(
id) ;
105 ATH_MSG_VERBOSE(
" The sector " << det <<
" " << lay <<
" " <<
phi <<
" has status " << status);
112 writeCdo->update(i_total,i_wheel,
phi);
118 if (writeHandle.
record(range, std::move(writeCdo)).isFailure()) {
120 <<
" with EventRange " << range
121 <<
" into Conditions Store");
122 return StatusCode::FAILURE;
125 return StatusCode::SUCCESS;
132 if (det == -1) arrayindex = 1;
133 else if (det == -2) {
134 if (lay < 6) arrayindex = 2;
137 else if (det == 1) arrayindex = 4;
139 if (lay < 6) arrayindex = 5;
142 else ATH_MSG_WARNING(
" detector value is: " << det <<
", out of range -2, -1, 1, 2, so THIS IS NOT TRT!!!");
149 if (lay == 0) arrayindex = 0;
150 else if (lay == 1) arrayindex = 1;
151 else if (lay == 2) arrayindex = 2;
153 else if (det == -2) {
154 for (
int i=0; i<14; ++i){
155 if (lay==i) arrayindex=i+3;
159 if (lay == 0) arrayindex = 17;
160 else if (lay == 1) arrayindex = 18;
161 else if (lay == 2) arrayindex = 19;
164 for (
int i=0; i<14; ++i){
165 if (lay==i) arrayindex=i+20;
168 else ATH_MSG_WARNING(
" detector value is: " << det <<
", out of range -2, -1, 1, 2, so THIS IS NOT TRT!!!");
Scalar phi() const
phi method
#define ATH_CHECK
Evaluate an expression and check for errors.
#define ATH_MSG_VERBOSE(x)
#define ATH_MSG_WARNING(x)
const ServiceHandle< StoreGateSvc > & detStore() const
Base class for conditions algorithms.
This is a "hash" representation of an Identifier.
Virtual base class of TRT readout elements.
Class to hold collection of TRT detector elements.
const TRT_BaseElement * getDetectorElement(const IdentifierHash &hash) const
bool range(EventIDRange &r)
const std::string & key() const
const std::string & key() const
StatusCode record(const EventIDRange &range, T *t)
record handle, with explicit range DEPRECATED
const DataObjID & fullKey() const
bool findStatus(const IdentifierHash &hashID) const
TRTStrawCondAlg(const std::string &name, ISvcLocator *pSvcLocator)
int findArrayLocalWheelIndex(const int det, const int lay) const
virtual StatusCode execute(const EventContext &ctx) const override
SG::ReadCondHandleKey< TRTCond::StrawStatusSummary > m_strawStatusSummaryKey
SG::ReadCondHandleKey< InDetDD::TRT_DetElementContainer > m_trtDetEleContKey
virtual StatusCode initialize() override
SG::WriteCondHandleKey< TRTCond::AliveStraws > m_strawWriteKey
int findArrayTotalIndex(const int det, const int lay) const