ATLAS Offline Software
Loading...
Searching...
No Matches
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
10
11
12//==================================================================================
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//===========================================
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
39 std::map<HWIdentifier,HWIdentifier> electrode_hvline_map;
40 ATH_CHECK( reader.read (attrList,
42 *electrodeHelper,
43 electrode_hvline_map,
45
46 ATH_MSG_DEBUG(" ====> ...initialized LArHVCablingSimTool ");
47 return StatusCode::SUCCESS;
48}
49
50
51//========================================================================================
52const std::vector<HWIdentifier>&
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}
#define ATH_CHECK
Evaluate an expression and check for errors.
#define ATH_MSG_VERBOSE(x)
#define ATH_MSG_WARNING(x)
#define ATH_MSG_DEBUG(x)
Helper to read HV ID mapping data from a file or conditions.
AthAlgTool(const std::string &type, const std::string &name, const IInterface *parent)
Constructor with parameters:
Gaudi::Details::PropertyBase & declareProperty(Gaudi::Property< T, V, H > &t)
const ServiceHandle< StoreGateSvc > & detStore() const
An AttributeList represents a logical row of attributes in a metadata table.
Helper for the Liquid Argon Calorimeter cell at the electrode level.
const LArHVLineID * m_hvlineHelper
virtual StatusCode initialize() override
std::map< HWIdentifier, std::vector< HWIdentifier > > m_hvline_electrode_map
const std::vector< HWIdentifier > & getLArElectrodeIDvec(const HWIdentifier &hvlineId) const
Return a vector of LArElectrodeID corresponding to a given LArHVLineID.
LArHVCablingSimTool(const std::string &type, const std::string &name, const IInterface *parent)
Helper to read HV ID mapping data from a file or conditions.