ATLAS Offline Software
LayerMaterialMapCnv.cxx
Go to the documentation of this file.
1 /*
2  Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration
3 */
4 
6 // LayerMaterialMapCnv.cxx, (c) ATLAS Detector software
8 
9 #include "LayerMaterialMapCnv.h"
10 #include "GaudiKernel/IToolSvc.h"
11 
12 //-----------------------------------------------------------------------------
13 // Constructor
14 //-----------------------------------------------------------------------------
17  m_msgSvc( msgSvc() )
18 {
19 }
20 
21 //-----------------------------------------------------------------------------
22 // Initializer
23 //-----------------------------------------------------------------------------
25 {
27  MsgStream log (m_msgSvc, "ElementTableCnv");
28  if( sc.isFailure() ) {
29  log << MSG::FATAL << "Could not initialize cnv base" << endmsg;
30  return sc;
31  }
32  //-------------------------------------------------------------------------
33  // Set up the message stream
34  //-------------------------------------------------------------------------
35  log << MSG::INFO << "LayerMaterialMapCnv::initialize()" << endmsg;
36 
37  return StatusCode::SUCCESS;
38 }
39 
40 
43  const std::string& key)
44 {
45  MsgStream log (m_msgSvc, "LayerMaterialMapCnv: " + key);
46  return m_TPConverter_tlp1.createPersistent( transCont, log );
47 }
48 
49 
50 //-----------------------------------------------------------------------------
51 // Create transient collection
52 //-----------------------------------------------------------------------------
55 {
56  static const pool::Guid tlp1_guid( "3DA92DBD-DA78-43A2-BFDF-9E19E2BF1E8A" );
57 
58  Trk::LayerMaterialMap *p_collection = nullptr;
59 
60  MsgStream log (m_msgSvc, "LayerMaterialMapCnv: " + key);
61 
62  if( compareClassGuid( tlp1_guid ) ) {
63  poolReadObject< Trk::LayerMaterialMap_tlp1 >( m_TPConverter_tlp1 );
64  p_collection = m_TPConverter_tlp1.createTransient( log );
65  }
66  return p_collection;
67 }
python.Constants.FATAL
int FATAL
Definition: Control/AthenaCommon/python/Constants.py:19
LayerMaterialMapCnv::m_TPConverter_tlp1
LayerMaterialMapCnv_tlp1 m_TPConverter_tlp1
Definition: LayerMaterialMapCnv.h:46
LayerMaterialMapCnv::createPersistentWithKey
virtual LayerMaterialMap_PERS * createPersistentWithKey(Trk::LayerMaterialMap *transCont, const std::string &key) override
Definition: LayerMaterialMapCnv.cxx:42
LayerMaterialMapCnv::LayerMaterialMapCnv
LayerMaterialMapCnv(ISvcLocator *svcloc)
Definition: LayerMaterialMapCnv.cxx:15
Trk::LayerMaterialMap
Definition: LayerMaterialMap.h:32
AthenaPoolTestRead.sc
sc
Definition: AthenaPoolTestRead.py:27
T_AthenaPoolCustomCnvWithKey
This templated class extends T_AthenaPoolCustCnv to provide management of the persistent objects crea...
Definition: T_AthenaPoolCustomCnv.h:35
pool::Guid
::Guid Guid
Definition: T_AthenaPoolCustCnv.h:19
TopLevelTPConverter::createTransient
TRANS * createTransient(MsgStream &log)
Create transient representation of the persistent object known to this converter.
Definition: TopLevelTPConverter.h:62
StdJOSetup.msgSvc
msgSvc
Provide convenience handles for various services.
Definition: StdJOSetup.py:36
Trk::LayerMaterialMap_tlp1
Definition: LayerMaterialMap_tlp1.h:28
LayerMaterialMapCnv::createTransientWithKey
virtual Trk::LayerMaterialMap * createTransientWithKey(const std::string &key) override
method to be implemented by the developer.
Definition: LayerMaterialMapCnv.cxx:54
endmsg
#define endmsg
Definition: AnalysisConfig_Ntuple.cxx:63
EL::StatusCode
::StatusCode StatusCode
StatusCode definition for legacy code.
Definition: PhysicsAnalysis/D3PDTools/EventLoop/EventLoop/StatusCode.h:22
LayerMaterialMapCnv::initialize
virtual StatusCode initialize() override
Gaudi Service Interface method implementations:
Definition: LayerMaterialMapCnv.cxx:24
LayerMaterialMapCnv::m_msgSvc
IMessageSvc * m_msgSvc
Definition: LayerMaterialMapCnv.h:45
python.CaloCondTools.log
log
Definition: CaloCondTools.py:20
LayerMaterialMapCnv.h
TopLevelTPConverter::createPersistent
virtual TL_PERS * createPersistent(const TRANS *transObj, MsgStream &log)
Create persistent representation of transObj.
Definition: TopLevelTPConverter.h:110
T_AthenaPoolCustCnv::compareClassGuid
virtual bool compareClassGuid(const Guid &clid) const
Compare POOL class GUID with the one of the object being read.
T_AthenaPoolCustCnv::initialize
virtual StatusCode initialize()
Gaudi Service Interface method implementations:
mapkey::key
key
Definition: TElectronEfficiencyCorrectionTool.cxx:37