ATLAS Offline Software
Toggle main menu visibility
Loading...
Searching...
No Matches
MuonSpectrometer
MuonCnv
MuonEventAthenaPool
src
MMPrepDataContainerCnv.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 "
MMPrepDataContainerCnv.h
"
6
7
#include "GaudiKernel/StatusCode.h"
8
#include "GaudiKernel/MsgStream.h"
9
#include "
StoreGate/StoreGateSvc.h
"
10
#include "
MuonPrepRawData/MMPrepDataContainer.h
"
11
12
MMPrepDataContainerCnv::MMPrepDataContainerCnv
(ISvcLocator* svcloc) :
13
MMPrepDataContainerCnvBase
(svcloc)
14
{
15
}
16
17
MMPrepDataContainerCnv::~MMPrepDataContainerCnv
() =
default
;
18
19
StatusCode
MMPrepDataContainerCnv::initialize
() {
20
// Call base clase initialize
21
if
( !
MMPrepDataContainerCnvBase::initialize
().isSuccess() )
22
return
StatusCode::FAILURE;
23
24
// Get the messaging service, print where you are
25
MsgStream log(msgSvc(),
"MMPrepDataContainerCnv"
);
26
if
(log.level() <= MSG::INFO) log << MSG::INFO <<
"MMPrepDataContainerCnv::initialize()"
<<
endmsg
;
27
28
return
StatusCode::SUCCESS;
29
}
30
31
MMPrepDataContainer_PERS
*
MMPrepDataContainerCnv::createPersistent
(
Muon::MMPrepDataContainer
* transCont) {
32
MsgStream log(msgSvc(),
"MMPrepDataContainerCnv"
);
33
if
(log.level() <= MSG::DEBUG) log<<MSG::DEBUG<<
"createPersistent(): main converter"
<<
endmsg
;
34
MMPrepDataContainer_PERS
*pers=
m_converter_p2
.createPersistent( transCont, log );
35
// COMPRESS MMPrepDataContainer_PERS *pers= m_converter_p1.createPersistent( transCont, log );
36
return
pers;
37
}
38
39
Muon::MMPrepDataContainer
*
MMPrepDataContainerCnv::createTransient
(
const
Token
* token) {
40
MsgStream log(msgSvc(),
"MMPrepDataContainerCnv"
);
41
static
const
Guid
p1_guid(
"5E5C97E2-8D7C-11E2-9FCB-001517648C14"
);
42
static
const
Guid
p2_guid(
"86B42223-304D-4AFA-8E94-A49B23AC8865"
);
43
if
(log.level() <= MSG::DEBUG) log<<MSG::DEBUG<<
"createTransient(const Token* token): main converter"
<<
endmsg
;
44
Muon::MMPrepDataContainer
* p_collection(
nullptr
);
45
if
(
compareClassGuid
(token, p1_guid) ) {
46
if
(log.level() <= MSG::DEBUG) log<<MSG::DEBUG<<
"createTransient(const Token* token): T/P version 1 detected"
<<
endmsg
;
47
std::unique_ptr< Muon::MMPrepDataContainer_p1 > p_coll(
poolReadObject< Muon::MMPrepDataContainer_p1 >
(token) );
48
p_collection =
m_converter_p1
.createTransient( p_coll.get(), log );
49
}
else
if
(
compareClassGuid
(token, p2_guid)) {
50
if
(log.level() <= MSG::DEBUG) log<<MSG::DEBUG<<
"createTransient(const Token* token): T/P version 2 detected"
<<
endmsg
;
51
std::unique_ptr< Muon::MMPrepDataContainer_p2 > p_coll(
poolReadObject< Muon::MMPrepDataContainer_p2 >
(token) );
52
p_collection =
m_converter_p2
.createTransient( p_coll.get(), log );
53
54
}
else
{
55
throw
std::runtime_error(
"Unsupported persistent version of MMPrepDataContainer."
);
56
57
}
58
return
p_collection;
59
}
endmsg
#define endmsg
Definition
AnalysisConfig_Ntuple.cxx:54
MMPrepDataContainerCnv.h
MMPrepDataContainer_PERS
Muon::MMPrepDataContainer_p2 MMPrepDataContainer_PERS
Definition
MMPrepDataContainerCnv.h:18
MMPrepDataContainerCnvBase
T_AthenaPoolCustomCnv< Muon::MMPrepDataContainer, MMPrepDataContainer_PERS > MMPrepDataContainerCnvBase
Definition
MMPrepDataContainerCnv.h:19
MMPrepDataContainer.h
StoreGateSvc.h
Guid
This class provides a encapsulation of a GUID/UUID/CLSID/IID data structure (128 bit number).
Definition
Guid.h:25
MMPrepDataContainerCnv::m_converter_p1
Muon::MMPrepDataContainerCnv_p1 m_converter_p1
Definition
MMPrepDataContainerCnv.h:41
MMPrepDataContainerCnv::MMPrepDataContainerCnv
MMPrepDataContainerCnv(ISvcLocator *svcloc)
Definition
MMPrepDataContainerCnv.cxx:12
MMPrepDataContainerCnv::~MMPrepDataContainerCnv
virtual ~MMPrepDataContainerCnv()
MMPrepDataContainerCnv::createPersistent
virtual MMPrepDataContainer_PERS * createPersistent(Muon::MMPrepDataContainer *transCont)
Definition
MMPrepDataContainerCnv.cxx:31
MMPrepDataContainerCnv::createTransient
virtual Muon::MMPrepDataContainer * createTransient(const Token *token)
Definition
MMPrepDataContainerCnv.cxx:39
MMPrepDataContainerCnv::initialize
virtual StatusCode initialize()
Gaudi Service Interface method implementations:
Definition
MMPrepDataContainerCnv.cxx:19
MMPrepDataContainerCnv::m_converter_p2
Muon::MMPrepDataContainerCnv_p2 m_converter_p2
Definition
MMPrepDataContainerCnv.h:42
T_AthenaPoolCustomCnv< Muon::MMPrepDataContainer, MMPrepDataContainer_PERS >::compareClassGuid
virtual bool compareClassGuid(const Token *token, const Guid &clid) const
T_AthenaPoolCustomCnv< Muon::MMPrepDataContainer, MMPrepDataContainer_PERS >::initialize
virtual StatusCode initialize()
T_AthenaPoolCustomCnv< Muon::MMPrepDataContainer, MMPrepDataContainer_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::MMPrepDataContainer
MuonPrepDataContainerT< MMPrepData > MMPrepDataContainer
Definition
MuonPrepDataContainer.h:99
Generated on
for ATLAS Offline Software by
1.17.0