ATLAS Offline Software
Toggle main menu visibility
Loading...
Searching...
No Matches
MuonSpectrometer
MuonCnv
MuonEventAthenaPool
src
sTgcPrepDataContainerCnv.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 "
sTgcPrepDataContainerCnv.h
"
6
7
#include "GaudiKernel/StatusCode.h"
8
#include "GaudiKernel/MsgStream.h"
9
#include "
StoreGate/StoreGateSvc.h
"
10
#include "
MuonPrepRawData/sTgcPrepDataContainer.h
"
11
12
sTgcPrepDataContainerCnv::sTgcPrepDataContainerCnv
(ISvcLocator* svcloc) :
13
sTgcPrepDataContainerCnvBase
(svcloc)
14
{
15
}
16
17
sTgcPrepDataContainerCnv::~sTgcPrepDataContainerCnv
() =
default
;
18
19
StatusCode
sTgcPrepDataContainerCnv::initialize
() {
20
// Call base clase initialize
21
if
( !
sTgcPrepDataContainerCnvBase::initialize
().isSuccess() )
22
return
StatusCode::FAILURE;
23
24
// Get the messaging service, print where you are
25
MsgStream log(msgSvc(),
"sTgcPrepDataContainerCnv"
);
26
if
(log.level() <= MSG::INFO) log << MSG::INFO <<
"sTgcPrepDataContainerCnv::initialize()"
<<
endmsg
;
27
28
return
StatusCode::SUCCESS;
29
}
30
31
sTgcPrepDataContainer_PERS
*
sTgcPrepDataContainerCnv::createPersistent
(
Muon::sTgcPrepDataContainer
* transCont) {
32
MsgStream log(msgSvc(),
"sTgcPrepDataContainerCnv"
);
33
if
(log.level() <= MSG::DEBUG) log<<MSG::DEBUG<<
"createPersistent(): main converter"
<<
endmsg
;
34
sTgcPrepDataContainer_PERS
*pers=
m_converter_p3
.createPersistent( transCont, log );
35
return
pers;
36
}
37
38
Muon::sTgcPrepDataContainer
*
sTgcPrepDataContainerCnv::createTransient
(
const
Token
* token) {
39
MsgStream log(msgSvc(),
"sTgcPrepDataContainerCnv"
);
40
static
const
Guid
p1_guid(
"7AB87DDE-8D7C-11E2-AA7C-001517648C14"
);
41
static
const
Guid
p2_guid(
"9E1B8028-D22C-4E02-BA82-D0EC79DB4F6C"
);
42
static
const
Guid
p3_guid(
"F06F048C-878D-11EE-AFB6-5811229BAA38"
);
43
44
if
(log.level() <= MSG::DEBUG) log<<MSG::DEBUG<<
"createTransient(const Token* token): main converter"
<<
endmsg
;
45
Muon::sTgcPrepDataContainer
* p_collection(
nullptr
);
46
if
(
compareClassGuid
(token, p3_guid) ) {
47
if
(log.level() <= MSG::DEBUG) log<<MSG::DEBUG<<
"createTransient(const Token* token): T/P version 3 detected"
<<
endmsg
;
48
std::unique_ptr< Muon::sTgcPrepDataContainer_p3 > p_coll(
poolReadObject< Muon::sTgcPrepDataContainer_p3 >
(token) );
49
p_collection =
m_converter_p3
.createTransient( p_coll.get(), log );
50
}
else
if
(
compareClassGuid
(token, p2_guid) ) {
51
if
(log.level() <= MSG::DEBUG) log<<MSG::DEBUG<<
"createTransient(const Token* token): T/P version 2 detected"
<<
endmsg
;
52
std::unique_ptr< Muon::sTgcPrepDataContainer_p2 > p_coll(
poolReadObject< Muon::sTgcPrepDataContainer_p2 >
(token) );
53
p_collection =
m_converter_p2
.createTransient( p_coll.get(), log );
54
}
else
if
(
compareClassGuid
(token, p1_guid) ) {
55
if
(log.level() <= MSG::DEBUG) log<<MSG::DEBUG<<
"createTransient(const Token* token): T/P version 1 detected"
<<
endmsg
;
56
std::unique_ptr< Muon::sTgcPrepDataContainer_p1 > p_coll(
poolReadObject< Muon::sTgcPrepDataContainer_p1 >
(token) );
57
p_collection =
m_converter_p1
.createTransient( p_coll.get(), log );
58
}
else
{
59
throw
std::runtime_error(
"Unsupported persistent version of sTgcPrepDataContainer"
);
60
}
61
return
p_collection;
62
}
endmsg
#define endmsg
Definition
AnalysisConfig_Ntuple.cxx:54
StoreGateSvc.h
Guid
This class provides a encapsulation of a GUID/UUID/CLSID/IID data structure (128 bit number).
Definition
Guid.h:25
T_AthenaPoolCustomCnv< Muon::sTgcPrepDataContainer, sTgcPrepDataContainer_PERS >::compareClassGuid
virtual bool compareClassGuid(const Token *token, const Guid &clid) const
T_AthenaPoolCustomCnv< Muon::sTgcPrepDataContainer, sTgcPrepDataContainer_PERS >::initialize
virtual StatusCode initialize()
T_AthenaPoolCustomCnv< Muon::sTgcPrepDataContainer, sTgcPrepDataContainer_PERS >::poolReadObject
P * poolReadObject(const Token *token)
Token
This class provides a token that identifies in a unique way objects on the persistent storage.
Definition
Token.h:22
sTgcPrepDataContainerCnv::m_converter_p2
Muon::sTgcPrepDataContainerCnv_p2 m_converter_p2
Definition
sTgcPrepDataContainerCnv.h:41
sTgcPrepDataContainerCnv::m_converter_p3
Muon::sTgcPrepDataContainerCnv_p3 m_converter_p3
Definition
sTgcPrepDataContainerCnv.h:42
sTgcPrepDataContainerCnv::~sTgcPrepDataContainerCnv
virtual ~sTgcPrepDataContainerCnv()
sTgcPrepDataContainerCnv::createPersistent
virtual sTgcPrepDataContainer_PERS * createPersistent(Muon::sTgcPrepDataContainer *transCont)
Definition
sTgcPrepDataContainerCnv.cxx:31
sTgcPrepDataContainerCnv::createTransient
virtual Muon::sTgcPrepDataContainer * createTransient(const Token *token)
Definition
sTgcPrepDataContainerCnv.cxx:38
sTgcPrepDataContainerCnv::m_converter_p1
Muon::sTgcPrepDataContainerCnv_p1 m_converter_p1
Definition
sTgcPrepDataContainerCnv.h:40
sTgcPrepDataContainerCnv::sTgcPrepDataContainerCnv
sTgcPrepDataContainerCnv(ISvcLocator *svcloc)
Definition
sTgcPrepDataContainerCnv.cxx:12
sTgcPrepDataContainerCnv::initialize
virtual StatusCode initialize()
Gaudi Service Interface method implementations:
Definition
sTgcPrepDataContainerCnv.cxx:19
Muon::sTgcPrepDataContainer
MuonPrepDataContainerT< sTgcPrepData > sTgcPrepDataContainer
Definition
MuonPrepDataContainer.h:100
sTgcPrepDataContainerCnv.h
sTgcPrepDataContainerCnvBase
T_AthenaPoolCustomCnv< Muon::sTgcPrepDataContainer, sTgcPrepDataContainer_PERS > sTgcPrepDataContainerCnvBase
Definition
sTgcPrepDataContainerCnv.h:18
sTgcPrepDataContainer_PERS
Muon::sTgcPrepDataContainer_p3 sTgcPrepDataContainer_PERS
Definition
sTgcPrepDataContainerCnv.h:17
sTgcPrepDataContainer.h
Generated on
for ATLAS Offline Software by
1.17.0