ATLAS Offline Software
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 )
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 //========================================================================================
52 const 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 }
LArG4FSStartPointFilter.part
part
Definition: LArG4FSStartPointFilter.py:21
python.PyKernel.retrieve
def retrieve(aClass, aKey=None)
Definition: PyKernel.py:110
LArElectrodeID
Helper for the Liquid Argon Calorimeter cell at the electrode level.
Definition: LArElectrodeID.h:101
AthCommonDataStore< AthCommonMsg< AlgTool > >::declareProperty
Gaudi::Details::PropertyBase & declareProperty(Gaudi::Property< T > &t)
Definition: AthCommonDataStore.h:145
LArHVCablingSimTool::m_hvline_electrode_map
std::map< HWIdentifier, std::vector< HWIdentifier > > m_hvline_electrode_map
Definition: LArHVCablingSimTool.h:52
LArHVCablingSimTool::m_hvlineHelper
const LArHVLineID * m_hvlineHelper
Definition: LArHVCablingSimTool.h:51
ATH_MSG_VERBOSE
#define ATH_MSG_VERBOSE(x)
Definition: AthMsgStreamMacros.h:28
LArHVLineID.h
HWIdentifier
Definition: HWIdentifier.h:13
AthenaAttributeList.h
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
LArHVIdMappingReader
Helper to read HV ID mapping data from a file or conditions.
Definition: LArHVIdMappingReader.h:33
AthCommonDataStore< AthCommonMsg< AlgTool > >::detStore
const ServiceHandle< StoreGateSvc > & detStore() const
The standard StoreGateSvc/DetectorStore Returns (kind of) a pointer to the StoreGateSvc.
Definition: AthCommonDataStore.h:95
LArHVCablingSimTool::LArHVCablingSimTool
LArHVCablingSimTool(const std::string &type, const std::string &name, const IInterface *parent)
Definition: LArHVCablingSimTool.cxx:13
LArHVIdMappingReader.h
Helper to read HV ID mapping data from a file or conditions.
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
test_pyathena.parent
parent
Definition: test_pyathena.py:15
ATH_CHECK
#define ATH_CHECK
Definition: AthCheckMacros.h:40
AthenaAttributeList
An AttributeList represents a logical row of attributes in a metadata table. The name and type of eac...
Definition: PersistentDataModel/PersistentDataModel/AthenaAttributeList.h:45
LArHVCablingSimTool::m_mappingFolder
std::string m_mappingFolder
Definition: LArHVCablingSimTool.h:49
name
std::string name
Definition: Control/AthContainers/Root/debug.cxx:228
ATH_MSG_WARNING
#define ATH_MSG_WARNING(x)
Definition: AthMsgStreamMacros.h:32
python.CaloScaleNoiseConfig.type
type
Definition: CaloScaleNoiseConfig.py:78
LArHVCablingSimTool.h
LArElectrodeID.h
collisions.reader
reader
read the goodrunslist xml file(s)
Definition: collisions.py:22
AthAlgTool
Definition: AthAlgTool.h:26
LArHVCablingSimTool::initialize
virtual StatusCode initialize() override
Definition: LArHVCablingSimTool.cxx:25