ATLAS Offline Software
Loading...
Searching...
No Matches
ALineInjectTestAlg.cxx
Go to the documentation of this file.
1/*
2 Copyright (C) 2002-2023 CERN for the benefit of the ATLAS collaboration
3*/
5
8#include <GaudiKernel/SystemOfUnits.h>
9ALineInjectTestAlg::ALineInjectTestAlg(const std::string& name, ISvcLocator* pSvcLocator):
10 AthCondAlgorithm{name, pSvcLocator} {}
11
13 ATH_CHECK(m_writeKey.initialize());
14 ATH_CHECK(m_idHelperSvc.retrieve());
15 return StatusCode::SUCCESS;
16}
17StatusCode ALineInjectTestAlg::execute(const EventContext& ctx) const {
19 if (writeHandle.isValid()){
20 ATH_MSG_DEBUG("CondHandle " << writeHandle.fullKey() << " is already valid."
21 << ". In theory this should not be called, but may happen"
22 << " if multiple concurrent events are being processed out of order.");
23 return StatusCode::SUCCESS;
24 }
26 std::unique_ptr<ALineContainer> writeCdo = std::make_unique<ALineContainer>();
27
28 unsigned int counter{0};
30 {
31 const MdtIdHelper& idHelper{m_idHelperSvc->mdtIdHelper()};
32 for (auto itr = idHelper.module_begin();
33 itr != idHelper.module_end(); ++itr){
34 ALinePar aline{};
35 aline.setIdentifier(*itr);
36 aline.setParameters((counter+0)*Gaudi::Units::mm,
37 (counter+1)*Gaudi::Units::mm,
38 (counter+2)*Gaudi::Units::mm,
39 (counter+3)*Gaudi::Units::deg,
40 (counter+4)*Gaudi::Units::deg,
41 (counter+5)*Gaudi::Units::deg);
42 ATH_MSG_INFO("Add "<<aline<<" to move "<<m_idHelperSvc->toStringChamber(*itr));
43 writeCdo->insert(std::move(aline));
44 counter+=6;
45
46 }
47 }
48
49 ATH_CHECK(writeHandle.record(std::move(writeCdo)));
50 return StatusCode::SUCCESS;
51}
52
#define ATH_CHECK
Evaluate an expression and check for errors.
Base class for conditions algorithms.
#define ATH_MSG_INFO(x)
#define ATH_MSG_DEBUG(x)
virtual StatusCode initialize() override
ServiceHandle< Muon::IMuonIdHelperSvc > m_idHelperSvc
SG::WriteCondHandleKey< ALineContainer > m_writeKey
ALineInjectTestAlg(const std::string &name, ISvcLocator *pSvcLocator)
virtual StatusCode execute(const EventContext &ctx) const override
void setParameters(float s, float z, float t, float rotS, float rotZ, float rotT)
Definition ALinePar.cxx:26
Base class for conditions algorithms.
static EventIDRange infiniteTime()
Produces an EventIDRange that is inifinite in Time and invalid in RunLumi.
void setIdentifier(const Identifier &id)
Setters and getters for the Athena Identifier.
const_id_iterator module_end() const
const_id_iterator module_begin() const
Iterators over full set of ids.
void addDependency(const EventIDRange &range)
StatusCode record(const EventIDRange &range, T *t)
record handle, with explicit range DEPRECATED
const DataObjID & fullKey() const