ATLAS Offline Software
Toggle main menu visibility
Loading...
Searching...
No Matches
LArCalorimeter
LArCabling
src
LArHVCablingSimTool.cxx
Go to the documentation of this file.
1
/*
2
Copyright (C) 2002-2021 CERN for the benefit of the ATLAS collaboration
3
*/
4
5
#include "
LArCabling/LArHVCablingSimTool.h
"
6
#include "
LArCabling/LArHVIdMappingReader.h
"
7
#include "
LArIdentifier/LArElectrodeID.h
"
8
#include "
LArIdentifier/LArHVLineID.h
"
9
#include "
AthenaPoolUtilities/AthenaAttributeList.h
"
10
11
12
//==================================================================================
13
LArHVCablingSimTool::LArHVCablingSimTool
(
const
std::string&
type
,
14
const
std::string& name,
15
const
IInterface* parent )
16
:
AthAlgTool
(
type
,name,parent),
17
m_hvlineHelper
(nullptr)
18
{
19
declareProperty
(
"MappingFolder"
,
m_mappingFolder
=
"/LAR/Identifier/HVLineToElectrodeMap"
);
20
}
21
22
23
24
//===========================================
25
StatusCode
LArHVCablingSimTool::initialize
()
26
//============================================
27
{
28
ATH_MSG_DEBUG
(
" ====> Initializing LArHVCablingSimTool... "
);
29
30
ATH_CHECK
(
detStore
()->retrieve(
m_hvlineHelper
,
"LArHVLineID"
) );
31
32
const
LArElectrodeID
* electrodeHelper =
nullptr
;
33
ATH_CHECK
(
detStore
()->retrieve(electrodeHelper,
"LArElectrodeID"
) );
34
35
const
AthenaAttributeList
* attrList =
nullptr
;
36
ATH_CHECK
(
detStore
()->retrieve(attrList,
m_mappingFolder
) );
37
38
LArHVIdMappingReader
reader;
39
std::map<HWIdentifier,HWIdentifier> electrode_hvline_map;
40
ATH_CHECK
( reader.read (attrList,
41
*
m_hvlineHelper
,
42
*electrodeHelper,
43
electrode_hvline_map,
44
m_hvline_electrode_map
) );
45
46
ATH_MSG_DEBUG
(
" ====> ...initialized LArHVCablingSimTool "
);
47
return
StatusCode::SUCCESS;
48
}
49
50
51
//========================================================================================
52
const
std::vector<HWIdentifier>&
53
LArHVCablingSimTool::getLArElectrodeIDvec
(
const
HWIdentifier
& hvlineId)
const
54
//========================================================================================
55
{
56
ATH_MSG_VERBOSE
(
"Entering getLArElectrodeIDvec( hvlineId )"
);
57
58
std::map<HWIdentifier,std::vector<HWIdentifier> >
::const_iterator
elecIt=
m_hvline_electrode_map
.find(hvlineId);
59
if
( elecIt !=
m_hvline_electrode_map
.end()){
60
return
(elecIt)->second;
61
}
62
else
{
63
int
part =
m_hvlineHelper
->partition(hvlineId);
64
int
canl =
m_hvlineHelper
->can_line(hvlineId);
65
int
cann =
m_hvlineHelper
->can_node(hvlineId);
66
int
hvli =
m_hvlineHelper
->hv_line(hvlineId);
67
ATH_MSG_WARNING
(
"LArHVCablingSimTool: getLArElectrodeIDvec did not find electrode for hvline ["
68
<< part <<
"."
<< canl <<
"."
<< cann <<
"."
<< hvli <<
"]"
);
69
static
const
std::vector<HWIdentifier> invalid;
70
return
(invalid);
71
}
72
}
ATH_CHECK
#define ATH_CHECK
Evaluate an expression and check for errors.
Definition
AthCheckMacros.h:40
ATH_MSG_VERBOSE
#define ATH_MSG_VERBOSE(x)
Definition
AthMsgStreamMacros.h:28
ATH_MSG_WARNING
#define ATH_MSG_WARNING(x)
Definition
AthMsgStreamMacros.h:32
ATH_MSG_DEBUG
#define ATH_MSG_DEBUG(x)
Definition
AthMsgStreamMacros.h:29
AthenaAttributeList.h
LArElectrodeID.h
LArHVCablingSimTool.h
LArHVIdMappingReader.h
Helper to read HV ID mapping data from a file or conditions.
LArHVLineID.h
AthAlgTool::AthAlgTool
AthAlgTool(const std::string &type, const std::string &name, const IInterface *parent)
Constructor with parameters:
Definition
AthAlgTool.cxx:16
AthCommonDataStore< AthCommonMsg< AlgTool > >::declareProperty
Gaudi::Details::PropertyBase & declareProperty(Gaudi::Property< T, V, H > &t)
Definition
AthCommonDataStore.h:145
AthCommonDataStore< AthCommonMsg< AlgTool > >::detStore
const ServiceHandle< StoreGateSvc > & detStore() const
Definition
AthCommonDataStore.h:95
AthenaAttributeList
An AttributeList represents a logical row of attributes in a metadata table.
Definition
PersistentDataModel/PersistentDataModel/AthenaAttributeList.h:46
const_iterator
HWIdentifier
Definition
HWIdentifier.h:13
LArElectrodeID
Helper for the Liquid Argon Calorimeter cell at the electrode level.
Definition
LArElectrodeID.h:95
LArHVCablingSimTool::m_hvlineHelper
const LArHVLineID * m_hvlineHelper
Definition
LArHVCablingSimTool.h:51
LArHVCablingSimTool::initialize
virtual StatusCode initialize() override
Definition
LArHVCablingSimTool.cxx:25
LArHVCablingSimTool::m_hvline_electrode_map
std::map< HWIdentifier, std::vector< HWIdentifier > > m_hvline_electrode_map
Definition
LArHVCablingSimTool.h:52
LArHVCablingSimTool::getLArElectrodeIDvec
const std::vector< HWIdentifier > & getLArElectrodeIDvec(const HWIdentifier &hvlineId) const
Return a vector of LArElectrodeID corresponding to a given LArHVLineID.
Definition
LArHVCablingSimTool.cxx:53
LArHVCablingSimTool::LArHVCablingSimTool
LArHVCablingSimTool(const std::string &type, const std::string &name, const IInterface *parent)
Definition
LArHVCablingSimTool.cxx:13
LArHVCablingSimTool::m_mappingFolder
std::string m_mappingFolder
Definition
LArHVCablingSimTool.h:49
LArHVIdMappingReader
Helper to read HV ID mapping data from a file or conditions.
Definition
LArHVIdMappingReader.h:33
type
Generated on
for ATLAS Offline Software by
1.17.0