ATLAS Offline Software
Toggle main menu visibility
Loading...
Searching...
No Matches
LArCalorimeter
LArAlignment
LArAlignmentAlgs
src
LArAlignCondAlg.cxx
Go to the documentation of this file.
1
/*
2
Copyright (C) 2002-2022 CERN for the benefit of the ATLAS collaboration
3
*/
4
5
#include "
LArAlignCondAlg.h
"
6
7
#include "GeoModelKernel/GeoAlignableTransform.h"
8
#include "
GeoModelUtilities/GeoAlignmentStore.h
"
9
10
#include <memory>
11
12
StatusCode
LArAlignCondAlg::initialize
()
13
{
14
ATH_MSG_DEBUG
(
"initialize "
<< name());
15
16
ATH_CHECK
(
m_readLArAlignKey
.initialize());
17
ATH_CHECK
(
m_writeGeoAlignKey
.initialize());
18
19
return
StatusCode::SUCCESS;
20
}
21
22
StatusCode
LArAlignCondAlg::execute
(
const
EventContext& ctx)
const
23
{
24
// ____________ Construct Write Cond Handle and check its validity ____________
25
SG::WriteCondHandle<GeoAlignmentStore>
writeGeoAlignHandle{
m_writeGeoAlignKey
,ctx};
26
if
(writeGeoAlignHandle.
isValid
()) {
27
ATH_MSG_DEBUG
(
"Found valid write handle"
);
28
return
StatusCode::SUCCESS;
29
}
30
31
// ____________ Get Read Cond Object ____________
32
SG::ReadCondHandle<DetCondKeyTrans>
readLArAlignHandle{
m_readLArAlignKey
,ctx};
33
ATH_CHECK
(readLArAlignHandle.
isValid
());
34
ATH_MSG_DEBUG
(
"Retrieved DetCondKeyTrans object form the Condition Store"
);
35
writeGeoAlignHandle.
addDependency
(readLArAlignHandle);
36
37
// ____________ Construct new Write Cond Object and apply alignments ____________
38
std::unique_ptr<GeoAlignmentStore> writeCdo = std::make_unique<GeoAlignmentStore>();
39
if
(
m_alignHelper
.applyAlignments(
detStore
(),*readLArAlignHandle,writeCdo.get()).isFailure()) {
40
ATH_MSG_ERROR
(
"Failed to apply LAr alignments"
);
41
return
StatusCode::FAILURE;
42
}
43
writeCdo->lockDelta();
44
writeCdo->lockPosCache();
45
46
ATH_CHECK
(writeGeoAlignHandle.
record
(std::move(writeCdo)));
47
ATH_MSG_INFO
(
"recorded new GeoAlignmentStore object for LAr with key "
<< writeGeoAlignHandle.
key
()
48
<<
" and range "
<< writeGeoAlignHandle.
getRange
());
49
50
return
StatusCode::SUCCESS;
51
}
ATH_CHECK
#define ATH_CHECK
Evaluate an expression and check for errors.
Definition
AthCheckMacros.h:40
ATH_MSG_ERROR
#define ATH_MSG_ERROR(x)
Definition
AthMsgStreamMacros.h:33
ATH_MSG_INFO
#define ATH_MSG_INFO(x)
Definition
AthMsgStreamMacros.h:31
ATH_MSG_DEBUG
#define ATH_MSG_DEBUG(x)
Definition
AthMsgStreamMacros.h:29
GeoAlignmentStore.h
LArAlignCondAlg.h
AthCommonAlgorithm< Gaudi::Algorithm >::detStore
const ServiceHandle< StoreGateSvc > & detStore() const
Definition
AthCommonDataStore.h:95
LArAlignCondAlg::m_writeGeoAlignKey
SG::WriteCondHandleKey< GeoAlignmentStore > m_writeGeoAlignKey
Definition
LArAlignCondAlg.h:41
LArAlignCondAlg::m_readLArAlignKey
SG::ReadCondHandleKey< DetCondKeyTrans > m_readLArAlignKey
Definition
LArAlignCondAlg.h:36
LArAlignCondAlg::execute
virtual StatusCode execute(const EventContext &ctx) const override
Definition
LArAlignCondAlg.cxx:22
LArAlignCondAlg::m_alignHelper
LArAlignHelper m_alignHelper
Definition
LArAlignCondAlg.h:46
LArAlignCondAlg::initialize
virtual StatusCode initialize() override
Definition
LArAlignCondAlg.cxx:12
SG::ReadCondHandle
Definition
ReadCondHandle.h:40
SG::ReadCondHandle::isValid
bool isValid()
Definition
ReadCondHandle.h:205
SG::WriteCondHandle
Definition
WriteCondHandle.h:26
SG::WriteCondHandle::key
const std::string & key() const
Definition
WriteCondHandle.h:44
SG::WriteCondHandle::addDependency
void addDependency(const EventIDRange &range)
Definition
WriteCondHandle.h:279
SG::WriteCondHandle::getRange
const EventIDRange & getRange() const
Definition
WriteCondHandle.h:93
SG::WriteCondHandle::record
StatusCode record(const EventIDRange &range, T *t)
record handle, with explicit range DEPRECATED
Definition
WriteCondHandle.h:161
SG::WriteCondHandle::isValid
bool isValid() const
Definition
WriteCondHandle.h:252
Generated on
for ATLAS Offline Software by
1.17.0