ATLAS Offline Software
Toggle main menu visibility
Loading...
Searching...
No Matches
MuonSpectrometer
MuonCnv
MuonEventAthenaPool
src
MdtPrepDataContainerCnv.cxx
Go to the documentation of this file.
1
/*
2
Copyright (C) 2002-2025 CERN for the benefit of the ATLAS collaboration
3
*/
4
5
#include "
MdtPrepDataContainerCnv.h
"
6
7
// Gaudi
8
#include "GaudiKernel/StatusCode.h"
9
#include "GaudiKernel/MsgStream.h"
10
11
// Athena
12
#include "
StoreGate/StoreGateSvc.h
"
13
14
// Id includes
15
#include "
MuonIdHelpers/MdtIdHelper.h
"
16
#include "
MuonPrepRawData/MdtPrepDataContainer.h
"
17
#include "
MuonReadoutGeometry/MdtReadoutElement.h
"
18
19
20
21
MdtPrepDataContainerCnv::MdtPrepDataContainerCnv
(ISvcLocator* svcloc) :
22
MdtPrepDataContainerCnvBase
(svcloc)
23
{
24
}
25
26
MdtPrepDataContainerCnv::~MdtPrepDataContainerCnv
() =
default
;
27
28
StatusCode
MdtPrepDataContainerCnv::initialize
() {
29
// Call base clase initialize
30
if
( !
MdtPrepDataContainerCnvBase::initialize
().isSuccess() )
31
return
StatusCode::FAILURE;
32
33
// msgSvc()->setOutputLevel( "MdtPrepDataContainerCnv", MSG::DEBUG );
34
35
// Get the messaging service, print where you are
36
MsgStream log(msgSvc(),
"MdtPrepDataContainerCnv"
);
37
log << MSG::INFO <<
"MdtPrepDataContainerCnv::initialize()"
<<
endmsg
;
38
return
StatusCode::SUCCESS;
39
}
40
41
MdtPrepDataContainer_PERS
*
MdtPrepDataContainerCnv::createPersistent
(
Muon::MdtPrepDataContainer
* transCont) {
42
MsgStream log(msgSvc(),
"MdtPrepDataContainerCnv"
);
43
if
(log.level() <= MSG::DEBUG) log<<MSG::DEBUG<<
"createPersistent(): main converter"
<<
endmsg
;
44
MdtPrepDataContainer_PERS
*pixdc_p=
m_converter_p2
.createPersistent( transCont, log );
45
return
pixdc_p;
46
}
47
48
Muon::MdtPrepDataContainer
*
MdtPrepDataContainerCnv::createTransient
(
const
Token
* token) {
49
MsgStream log(msgSvc(),
"MdtPrepDataContainerCnv"
);
50
static
const
pool::Guid
p1_guid(
"7E3F92F5-FAFF-45C3-A8F5-386B3CD56A7B"
);
// with MdtPrepDataContainerCnv_tlp1
51
static
const
pool::Guid
p2_guid(
"BBC02355-570A-4C28-81A6-65F23779509E"
);
// with MdtPrepDataContainerCnv_p2
52
if
(log.level() <= MSG::DEBUG) log<<MSG::DEBUG<<
"createTransient(const Token* token): main converter"
<<
endmsg
;
53
Muon::MdtPrepDataContainer
* p_collection(
nullptr
);
54
if
(
compareClassGuid
(token, p2_guid) ) {
55
if
(log.level() <= MSG::DEBUG) log<<MSG::DEBUG<<
"createTransient(const Token* token): T/P version 2 detected"
<<
endmsg
;
56
std::unique_ptr< MdtPrepDataContainer_PERS > col_vect(
poolReadObject< MdtPrepDataContainer_PERS >
(token) );
57
if
(log.level() <= MSG::DEBUG) log << MSG::DEBUG <<
"Delegate TP converter "
<<
endmsg
;
58
p_collection =
m_converter_p2
.createTransient( col_vect.get(), log );
59
}
else
if
(
compareClassGuid
(token, p1_guid) ) {
60
if
(log.level() <= MSG::DEBUG) log<<MSG::DEBUG<<
"createTransient(const Token* token): T/P version 1 detected"
<<
endmsg
;
61
poolReadObject< MdtPrepDataContainer_PERS >
(
m_converter_tlp1
, token );
62
p_collection =
m_converter_tlp1
.createTransient( log );
63
}
64
else
{
65
throw
std::runtime_error(
"Unsupported persistent version of MdtPrepDataContainer"
);
66
}
67
return
p_collection;
68
}
endmsg
#define endmsg
Definition
AnalysisConfig_Ntuple.cxx:54
MdtIdHelper.h
MdtPrepDataContainerCnv.h
MdtPrepDataContainer_PERS
Muon::MdtPrepDataContainer_p2 MdtPrepDataContainer_PERS
Definition
MdtPrepDataContainerCnv.h:18
MdtPrepDataContainerCnvBase
T_AthenaPoolCustomCnv< Muon::MdtPrepDataContainer, MdtPrepDataContainer_PERS > MdtPrepDataContainerCnvBase
Definition
MdtPrepDataContainerCnv.h:19
MdtPrepDataContainer.h
MdtReadoutElement.h
StoreGateSvc.h
MdtPrepDataContainerCnv::createPersistent
virtual MdtPrepDataContainer_PERS * createPersistent(Muon::MdtPrepDataContainer *transCont)
Definition
MdtPrepDataContainerCnv.cxx:41
MdtPrepDataContainerCnv::createTransient
virtual Muon::MdtPrepDataContainer * createTransient(const Token *token)
Definition
MdtPrepDataContainerCnv.cxx:48
MdtPrepDataContainerCnv::m_converter_tlp1
MdtPrepDataContainerCnv_tlp1 m_converter_tlp1
'Old style' top level convertor
Definition
MdtPrepDataContainerCnv.h:43
MdtPrepDataContainerCnv::MdtPrepDataContainerCnv
MdtPrepDataContainerCnv(ISvcLocator *svcloc)
Definition
MdtPrepDataContainerCnv.cxx:21
MdtPrepDataContainerCnv::~MdtPrepDataContainerCnv
virtual ~MdtPrepDataContainerCnv()
MdtPrepDataContainerCnv::m_converter_p2
Muon::MdtPrepDataContainerCnv_p2 m_converter_p2
New, flattened convertor.
Definition
MdtPrepDataContainerCnv.h:44
MdtPrepDataContainerCnv::initialize
virtual StatusCode initialize()
Gaudi Service Interface method implementations:
Definition
MdtPrepDataContainerCnv.cxx:28
T_AthenaPoolCustomCnv< Muon::MdtPrepDataContainer, MdtPrepDataContainer_PERS >::compareClassGuid
virtual bool compareClassGuid(const Token *token, const Guid &clid) const
T_AthenaPoolCustomCnv< Muon::MdtPrepDataContainer, MdtPrepDataContainer_PERS >::initialize
virtual StatusCode initialize()
T_AthenaPoolCustomCnv< Muon::MdtPrepDataContainer, MdtPrepDataContainer_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
Muon::MdtPrepDataContainer
MuonPrepDataContainerT< MdtPrepData > MdtPrepDataContainer
Definition
MuonPrepDataContainer.h:94
pool::Guid
::Guid Guid
Definition
T_AthenaPoolCustCnv.h:19
Generated on
for ATLAS Offline Software by
1.17.0