ATLAS Offline Software
Toggle main menu visibility
Loading...
Searching...
No Matches
MuonSpectrometer
MuonCnv
MuonEventAthenaPool
src
RpcPrepDataContainerCnv.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 "
RpcPrepDataContainerCnv.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/RpcIdHelper.h
"
16
#include "
MuonPrepRawData/RpcPrepDataContainer.h
"
17
#include "
MuonReadoutGeometry/RpcReadoutElement.h
"
18
19
20
21
RpcPrepDataContainerCnv::RpcPrepDataContainerCnv
(ISvcLocator* svcloc) :
22
RpcPrepDataContainerCnvBase
(svcloc)
23
{}
24
25
RpcPrepDataContainerCnv::~RpcPrepDataContainerCnv
() =
default
;
26
27
StatusCode
RpcPrepDataContainerCnv::initialize
() {
28
// Call base clase initialize
29
if
( !
RpcPrepDataContainerCnvBase::initialize
().isSuccess() )
30
return
StatusCode::FAILURE;
31
32
// msgSvc()->setOutputLevel( "RpcPrepDataContainerCnv", MSG::DEBUG );
33
34
// Get the messaging service, print where you are
35
MsgStream log(msgSvc(),
"RpcPrepDataContainerCnv"
);
36
log << MSG::INFO <<
"RpcPrepDataContainerCnv::initialize()"
<<
endmsg
;
37
38
return
StatusCode::SUCCESS;
39
}
40
41
RpcPrepDataContainer_PERS
*
RpcPrepDataContainerCnv::createPersistent
(
Muon::RpcPrepDataContainer
* transCont) {
42
MsgStream log(msgSvc(),
"RpcPrepDataContainerCnv"
);
43
if
(log.level() <= MSG::DEBUG) log<<MSG::DEBUG<<
"createPersistent(): main converter"
<<
endmsg
;
44
RpcPrepDataContainer_PERS
*pers=
m_converter_p3
.createPersistent( transCont, log );
45
return
pers;
46
}
47
48
Muon::RpcPrepDataContainer
*
RpcPrepDataContainerCnv::createTransient
(
const
Token
* token) {
49
MsgStream log(msgSvc(),
"RpcPrepDataContainerCnv"
);
50
static
const
Guid
p0_guid(
"CCD4055C-2A39-CAFF-3F82-5A9116ADAFCB"
);
// before t/p split
51
static
const
Guid
p1_guid(
"F29233F8-F488-4D6D-97F9-4BCA1976BD9F"
);
// with RpcPrepData_tlp1
52
// static const Guid p2_guid("F29233F8-F488-4D6D-97F9-4BCA1976BD9F"); // with RpcPrepData_tlp2
53
static
const
Guid
p3_guid(
"65496D1F-E660-42A9-84C9-2002D39B87CB"
);
// with RpcPrepDataContainer_p3
54
55
if
(log.level() <= MSG::DEBUG) log<<MSG::DEBUG<<
"createTransient(const Token* token): main converter"
<<
endmsg
;
56
Muon::RpcPrepDataContainer
* p_collection(
nullptr
);
57
if
(
compareClassGuid
(token, p3_guid) ) {
58
if
(log.level() <= MSG::DEBUG) log<<MSG::DEBUG<<
"createTransient(const Token* token): T/P version 3 detected"
<<
endmsg
;
59
std::unique_ptr< Muon::RpcPrepDataContainer_p3 > p_coll(
poolReadObject< Muon::RpcPrepDataContainer_p3 >
(token) );
60
p_collection =
m_converter_p3
.createTransient( p_coll.get(), log );
61
}
else
if
(
compareClassGuid
(token, p1_guid) ) {
62
RpcPrepDataContainerCnv_tlp1
tpConvertor_p1;
63
std::unique_ptr< Muon::RpcPrepDataContainer_tlp1 > col_vect(
poolReadObject< Muon::RpcPrepDataContainer_tlp1 >
(token) );
64
p_collection =
m_TPConverter
.createTransient( col_vect.get(), log );
65
if
(log.level() <= MSG::DEBUG) log<<MSG::DEBUG<<
"createTransient(const Token* token): T/P version 1 detected"
<<
endmsg
;
66
}
67
//----------------------------------------------------------------
68
else
if
(
compareClassGuid
(token, p0_guid) ) {
69
if
(log.level() <= MSG::DEBUG) log<<MSG::DEBUG<<
"createTransient(const Token* token): Old input file"
<<std::endl;
70
throw
std::runtime_error(
"Not supporting reading non TP-split PRDs"
);
71
}
72
else
{
73
throw
std::runtime_error(
"Unsupported persistent version of RpcPrepDataContainer"
);
74
75
}
76
return
p_collection;
77
}
endmsg
#define endmsg
Definition
AnalysisConfig_Ntuple.cxx:54
RpcReadoutElement.h
RpcIdHelper.h
RpcPrepDataContainerCnv.h
RpcPrepDataContainerCnvBase
T_AthenaPoolCustomCnv< Muon::RpcPrepDataContainer, RpcPrepDataContainer_PERS > RpcPrepDataContainerCnvBase
Definition
RpcPrepDataContainerCnv.h:19
RpcPrepDataContainer_PERS
Muon::RpcPrepDataContainer_p3 RpcPrepDataContainer_PERS
Definition
RpcPrepDataContainerCnv.h:18
RpcPrepDataContainer.h
StoreGateSvc.h
Guid
This class provides a encapsulation of a GUID/UUID/CLSID/IID data structure (128 bit number).
Definition
Guid.h:25
RpcPrepDataContainerCnv_tlp1
Definition
RpcPrepDataContainerCnv_tlp1.h:23
RpcPrepDataContainerCnv::initialize
virtual StatusCode initialize()
Gaudi Service Interface method implementations:
Definition
RpcPrepDataContainerCnv.cxx:27
RpcPrepDataContainerCnv::m_TPConverter
RpcPrepDataContainerCnv_tlp1 m_TPConverter
Definition
RpcPrepDataContainerCnv.h:45
RpcPrepDataContainerCnv::m_converter_p3
Muon::RpcPrepDataContainerCnv_p3 m_converter_p3
Definition
RpcPrepDataContainerCnv.h:46
RpcPrepDataContainerCnv::~RpcPrepDataContainerCnv
virtual ~RpcPrepDataContainerCnv()
RpcPrepDataContainerCnv::createTransient
virtual Muon::RpcPrepDataContainer * createTransient(const Token *token)
Definition
RpcPrepDataContainerCnv.cxx:48
RpcPrepDataContainerCnv::createPersistent
virtual RpcPrepDataContainer_PERS * createPersistent(Muon::RpcPrepDataContainer *transCont)
Definition
RpcPrepDataContainerCnv.cxx:41
RpcPrepDataContainerCnv::RpcPrepDataContainerCnv
RpcPrepDataContainerCnv(ISvcLocator *svcloc)
Definition
RpcPrepDataContainerCnv.cxx:21
T_AthenaPoolCustomCnv< Muon::RpcPrepDataContainer, RpcPrepDataContainer_PERS >::compareClassGuid
virtual bool compareClassGuid(const Token *token, const Guid &clid) const
T_AthenaPoolCustomCnv< Muon::RpcPrepDataContainer, RpcPrepDataContainer_PERS >::initialize
virtual StatusCode initialize()
T_AthenaPoolCustomCnv< Muon::RpcPrepDataContainer, RpcPrepDataContainer_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::RpcPrepDataContainer
MuonPrepDataContainerT< RpcPrepData > RpcPrepDataContainer
Definition
MuonPrepDataContainer.h:95
Generated on
for ATLAS Offline Software by
1.17.0