ATLAS Offline Software
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"
9 
10 #include <memory>
11 
13 {
14  ATH_MSG_DEBUG("initialize " << name());
15 
18 
19  return StatusCode::SUCCESS;
20 }
21 
23 {
24  const EventContext& ctx = Gaudi::Hive::currentContext();
25  // ____________ Construct Write Cond Handle and check its validity ____________
27  if (writeGeoAlignHandle.isValid()) {
28  ATH_MSG_DEBUG("Found valid write handle");
29  return StatusCode::SUCCESS;
30  }
31 
32  // ____________ Get Read Cond Object ____________
34  ATH_CHECK(readLArAlignHandle.isValid());
35  ATH_MSG_DEBUG("Retrieved DetCondKeyTrans object form the Condition Store");
36  writeGeoAlignHandle.addDependency(readLArAlignHandle);
37 
38  // ____________ Construct new Write Cond Object and apply alignments ____________
39  std::unique_ptr<GeoAlignmentStore> writeCdo = std::make_unique<GeoAlignmentStore>();
40  if(m_alignHelper.applyAlignments(detStore(),*readLArAlignHandle,writeCdo.get()).isFailure()) {
41  ATH_MSG_ERROR("Failed to apply LAr alignments");
42  return StatusCode::FAILURE;
43  }
44  writeCdo->lockDelta();
45  writeCdo->lockPosCache();
46 
47  ATH_CHECK(writeGeoAlignHandle.record(std::move(writeCdo)));
48  ATH_MSG_INFO("recorded new GeoAlignmentStore object for LAr with key " << writeGeoAlignHandle.key()
49  << " and range " << writeGeoAlignHandle.getRange());
50 
51  return StatusCode::SUCCESS;
52 }
SG::ReadCondHandle
Definition: ReadCondHandle.h:44
ATH_MSG_INFO
#define ATH_MSG_INFO(x)
Definition: AthMsgStreamMacros.h:31
GeoAlignmentStore::lockDelta
void lockDelta()
: Locks the delta transform cache
Definition: GeoAlignmentStore.cxx:20
AthCommonDataStore< AthCommonMsg< Algorithm > >::detStore
const ServiceHandle< StoreGateSvc > & detStore() const
The standard StoreGateSvc/DetectorStore Returns (kind of) a pointer to the StoreGateSvc.
Definition: AthCommonDataStore.h:95
ATH_MSG_ERROR
#define ATH_MSG_ERROR(x)
Definition: AthMsgStreamMacros.h:33
LArAlignCondAlg::execute
virtual StatusCode execute() override
Definition: LArAlignCondAlg.cxx:22
EL::StatusCode
::StatusCode StatusCode
StatusCode definition for legacy code.
Definition: PhysicsAnalysis/D3PDTools/EventLoop/EventLoop/StatusCode.h:22
ATH_MSG_DEBUG
#define ATH_MSG_DEBUG(x)
Definition: AthMsgStreamMacros.h:29
LArAlignCondAlg::m_writeGeoAlignKey
SG::WriteCondHandleKey< GeoAlignmentStore > m_writeGeoAlignKey
Definition: LArAlignCondAlg.h:41
ATH_CHECK
#define ATH_CHECK
Definition: AthCheckMacros.h:40
LArAlignCondAlg::m_readLArAlignKey
SG::ReadCondHandleKey< DetCondKeyTrans > m_readLArAlignKey
Definition: LArAlignCondAlg.h:36
GeoAlignmentStore.h
LArAlignCondAlg::initialize
virtual StatusCode initialize() override
Definition: LArAlignCondAlg.cxx:12
LArAlignHelper::applyAlignments
StatusCode applyAlignments(const ServiceHandle< StoreGateSvc > &detStore, const DetCondKeyTrans *detCondKeyTrans, GeoAlignmentStore *alignmentStore) const
Definition: LArAlignHelper.cxx:20
LArAlignCondAlg::m_alignHelper
LArAlignHelper m_alignHelper
Definition: LArAlignCondAlg.h:46
name
std::string name
Definition: Control/AthContainers/Root/debug.cxx:195
SG::CondHandleKey::initialize
StatusCode initialize(bool used=true)
LArAlignCondAlg.h
GeoAlignmentStore::lockPosCache
void lockPosCache()
: Locks the position cache
Definition: GeoAlignmentStore.cxx:23
SG::WriteCondHandle
Definition: WriteCondHandle.h:26