ATLAS Offline Software
Toggle main menu visibility
Loading...
Searching...
No Matches
Calorimeter
CaloAlignment
CaloAlignmentAlgs
src
CaloSuperCellAlignCondAlg.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 "
CaloSuperCellAlignCondAlg.h
"
6
7
#include "
CaloIdentifier/CaloIdManager.h
"
8
#include "
CaloDetDescrUtils/CaloSuperCellUtils.h
"
9
10
#include <memory>
11
12
StatusCode
CaloSuperCellAlignCondAlg::initialize
()
13
{
14
ATH_MSG_DEBUG
(
"initialize "
<< name());
15
16
ATH_CHECK
(
m_scidTool
.retrieve());
17
ATH_CHECK
(
m_readCaloMgrKey
.initialize());
18
ATH_CHECK
(
m_writeCaloSuperCellMgrKey
.initialize());
19
20
return
StatusCode::SUCCESS;
21
}
22
23
StatusCode
CaloSuperCellAlignCondAlg::execute
(
const
EventContext& ctx)
const
24
{
25
// ____________ Construct Write Cond Handle and check its validity ____________
26
SG::WriteCondHandle<CaloSuperCellDetDescrManager>
writeCaloSuperCellMgrHandle{
m_writeCaloSuperCellMgrKey
,ctx};
27
if
(writeCaloSuperCellMgrHandle.
isValid
()) {
28
ATH_MSG_DEBUG
(
"Found valid write handle"
);
29
return
StatusCode::SUCCESS;
30
}
31
32
// ____________ Get Read Cond Object ____________
33
SG::ReadCondHandle<CaloDetDescrManager>
readCaloMgrHandle{
m_readCaloMgrKey
,ctx};
34
ATH_CHECK
(readCaloMgrHandle.
isValid
());
35
ATH_MSG_DEBUG
(
"Retrieved CaloDetDescrManager object form the Condition Store"
);
36
writeCaloSuperCellMgrHandle.
addDependency
(readCaloMgrHandle);
37
38
// ____________ Build new CaloSuperCellDetDescrManager _________________
39
std::unique_ptr<CaloSuperCellDetDescrManager> mgr = std::make_unique<CaloSuperCellDetDescrManager>();
40
41
const
CaloIdManager
* caloId_mgr{
nullptr
};
42
ATH_CHECK
(
detStore
()->retrieve(caloId_mgr,
"CaloIdManager"
));
43
44
mgr->set_helper(caloId_mgr->
getCaloCell_SuperCell_ID
());
45
mgr->set_helper(caloId_mgr);
46
mgr->initialize();
47
48
createDescriptors
(mgr.get());
49
createElements
(mgr.get());
50
51
// ____________ Apply Alignment Corrections ____________________________
52
ATH_CHECK
(
updateElements
(mgr.get(),*readCaloMgrHandle,
m_scidTool
.get()));
53
updateDescriptors
(mgr.get(),*readCaloMgrHandle,
m_scidTool
.get());
54
55
ATH_CHECK
(writeCaloSuperCellMgrHandle.
record
(std::move(mgr)));
56
ATH_MSG_INFO
(
"recorded new CaloSuperCellDetDescr Manager condition object with key "
<< writeCaloSuperCellMgrHandle.
key
()
57
<<
" and range "
<< writeCaloSuperCellMgrHandle.
getRange
());
58
59
return
StatusCode::SUCCESS;
60
}
ATH_CHECK
#define ATH_CHECK
Evaluate an expression and check for errors.
Definition
AthCheckMacros.h:40
ATH_MSG_INFO
#define ATH_MSG_INFO(x)
Definition
AthMsgStreamMacros.h:31
ATH_MSG_DEBUG
#define ATH_MSG_DEBUG(x)
Definition
AthMsgStreamMacros.h:29
CaloIdManager.h
CaloSuperCellAlignCondAlg.h
updateDescriptors
void updateDescriptors(CaloSuperCellDetDescrManager *mgr, const CaloDetDescrManager *cellmgr, const ICaloSuperCellIDTool *scidTool)
Definition
CaloSuperCellUtils.cxx:230
CaloSuperCellUtils.h
This is a collection of helper functions for building Calo Super Cell detector manager,...
createDescriptors
void createDescriptors(CaloSuperCellDetDescrManager *mgr)
Definition
CaloSuperCellUtils.cxx:155
createElements
void createElements(CaloSuperCellDetDescrManager *mgr)
Definition
CaloSuperCellUtils.cxx:176
updateElements
StatusCode updateElements(CaloSuperCellDetDescrManager *mgr, const CaloDetDescrManager *cellmgr, const ICaloSuperCellIDTool *scidTool)
Definition
CaloSuperCellUtils.cxx:190
AthCommonAlgorithm< Gaudi::Algorithm >::detStore
const ServiceHandle< StoreGateSvc > & detStore() const
Definition
AthCommonDataStore.h:95
CaloIdManager
This class initializes the Calo (LAr and Tile) offline identifiers.
Definition
CaloIdManager.h:45
CaloIdManager::getCaloCell_SuperCell_ID
const CaloCell_SuperCell_ID * getCaloCell_SuperCell_ID(void) const
Definition
CaloIdManager.cxx:110
CaloSuperCellAlignCondAlg::execute
virtual StatusCode execute(const EventContext &ctx) const override
Definition
CaloSuperCellAlignCondAlg.cxx:23
CaloSuperCellAlignCondAlg::m_writeCaloSuperCellMgrKey
SG::WriteCondHandleKey< CaloSuperCellDetDescrManager > m_writeCaloSuperCellMgrKey
Definition
CaloSuperCellAlignCondAlg.h:38
CaloSuperCellAlignCondAlg::initialize
virtual StatusCode initialize() override
Definition
CaloSuperCellAlignCondAlg.cxx:12
CaloSuperCellAlignCondAlg::m_scidTool
ToolHandle< ICaloSuperCellIDTool > m_scidTool
Definition
CaloSuperCellAlignCondAlg.h:43
CaloSuperCellAlignCondAlg::m_readCaloMgrKey
SG::ReadCondHandleKey< CaloDetDescrManager > m_readCaloMgrKey
Definition
CaloSuperCellAlignCondAlg.h:33
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