ATLAS Offline Software
Toggle main menu visibility
Loading...
Searching...
No Matches
MuonSpectrometer
MuonCnv
MuonEventAthenaPool
src
TgcPrepDataContainerCnv.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 "
TgcPrepDataContainerCnv.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/TgcIdHelper.h
"
16
#include "
MuonPrepRawData/TgcPrepDataContainer.h
"
17
#include "
MuonReadoutGeometry/TgcReadoutElement.h
"
18
19
TgcPrepDataContainerCnv::TgcPrepDataContainerCnv
(ISvcLocator* svcloc) :
20
TgcPrepDataContainerCnvBase
(svcloc)
21
{
22
}
23
24
TgcPrepDataContainerCnv::~TgcPrepDataContainerCnv
() =
default
;
25
26
StatusCode
TgcPrepDataContainerCnv::initialize
() {
27
// Call base clase initialize
28
if
( !
TgcPrepDataContainerCnvBase::initialize
().isSuccess() )
29
return
StatusCode::FAILURE;
30
31
// msgSvc()->setOutputLevel( "TgcPrepDataContainerCnv", MSG::DEBUG );
32
33
// Get the messaging service, print where you are
34
MsgStream log(msgSvc(),
"TgcPrepDataContainerCnv"
);
35
if
(log.level() <= MSG::INFO) log << MSG::INFO <<
"TgcPrepDataContainerCnv::initialize()"
<<
endmsg
;
36
37
return
StatusCode::SUCCESS;
38
}
39
40
TgcPrepDataContainer_PERS
*
TgcPrepDataContainerCnv::createPersistent
(
Muon::TgcPrepDataContainer
* transCont) {
41
MsgStream log(msgSvc(),
"TgcPrepDataContainerCnv"
);
42
if
(log.level() <= MSG::DEBUG) log<<MSG::DEBUG<<
"createPersistent(): main converter"
<<
endmsg
;
43
TgcPrepDataContainer_PERS
*pers=
m_converter_p3
.createPersistent( transCont, log );
44
return
pers;
45
}
46
47
Muon::TgcPrepDataContainer
*
TgcPrepDataContainerCnv::createTransient
(
const
Token
* token) {
48
MsgStream log(msgSvc(),
"TgcPrepDataContainerCnv"
);
49
static
const
Guid
p0_guid(
"04E7158E-416B-8E31-D370-616631B8617E"
);
// before t/p split
50
static
const
Guid
p1_guid(
"8C563637-620B-43A0-9A5D-E0BC09496745"
);
// with TgcPrepData_tlp1
51
static
const
Guid
p2_guid(
"EBB4DCEC-CE23-4A30-BEF7-F3150E4060CB"
);
// with TgcPrepDataContainerCnv_p2
52
static
const
Guid
p3_guid(
"215726D6-15F4-41D2-B808-1B9E9FD84166"
);
// with TgcPrepDataContainerCnv_p3
53
54
55
if
(log.level() <= MSG::DEBUG) log<<MSG::DEBUG<<
"createTransient(const Token* token): main converter"
<<
endmsg
;
56
Muon::TgcPrepDataContainer
* 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::TgcPrepDataContainer_p3 > p_coll(
poolReadObject< Muon::TgcPrepDataContainer_p3 >
(token) );
60
p_collection =
m_converter_p3
.createTransient( p_coll.get(), log );
61
}
else
if
(
compareClassGuid
(token, p2_guid) ) {
62
if
(log.level() <= MSG::DEBUG) log<<MSG::DEBUG<<
"createTransient(const Token* token): T/P version 2 detected"
<<
endmsg
;
63
std::unique_ptr< Muon::TgcPrepDataContainer_p2 > p_coll(
poolReadObject< Muon::TgcPrepDataContainer_p2 >
(token) );
64
p_collection =
m_converter_p2
.createTransient( p_coll.get(), log );
65
}
else
if
(
compareClassGuid
(token, p1_guid) ) {
66
TgcPrepDataContainerCnv_tlp1
tpConvertor_p1;
67
std::unique_ptr< Muon::TgcPrepDataContainer_tlp1 > col_vect(
poolReadObject< Muon::TgcPrepDataContainer_tlp1 >
(token) );
68
p_collection =
m_TPConverter
.createTransient( col_vect.get(), log );
69
if
(log.level() <= MSG::DEBUG) log<<MSG::DEBUG<<
"createTransient(const Token* token): T/P version 1 detected"
<<
endmsg
;
70
}
71
//----------------------------------------------------------------
72
else
if
(
compareClassGuid
(token, p0_guid) ) {
73
if
(log.level() <= MSG::DEBUG) log<<MSG::DEBUG<<
"createTransient(const Token* token): Old input file"
<<std::endl;
74
throw
std::runtime_error(
"Not currently supporting reading non TP-split PRDs"
);
75
//std::unique_ptr< TgcPrepDataContainer_p0 > col_vect( poolReadObject< TgcPrepDataContainer_p0 >(token) );
76
//p_collection = m_converter_p0.createTransient( col_vect.get(), log );
77
}
78
else
{
79
throw
std::runtime_error(
"Unsupported persistent version of TgcPrepDataContainer"
);
80
81
}
82
return
p_collection;
83
}
endmsg
#define endmsg
Definition
AnalysisConfig_Ntuple.cxx:54
TgcReadoutElement.h
StoreGateSvc.h
TgcIdHelper.h
TgcPrepDataContainerCnv.h
TgcPrepDataContainer_PERS
Muon::TgcPrepDataContainer_p3 TgcPrepDataContainer_PERS
Definition
TgcPrepDataContainerCnv.h:20
TgcPrepDataContainerCnvBase
T_AthenaPoolCustomCnv< Muon::TgcPrepDataContainer, TgcPrepDataContainer_PERS > TgcPrepDataContainerCnvBase
Definition
TgcPrepDataContainerCnv.h:21
TgcPrepDataContainer.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::TgcPrepDataContainer, TgcPrepDataContainer_PERS >::compareClassGuid
virtual bool compareClassGuid(const Token *token, const Guid &clid) const
T_AthenaPoolCustomCnv< Muon::TgcPrepDataContainer, TgcPrepDataContainer_PERS >::initialize
virtual StatusCode initialize()
T_AthenaPoolCustomCnv< Muon::TgcPrepDataContainer, TgcPrepDataContainer_PERS >::poolReadObject
P * poolReadObject(const Token *token)
TgcPrepDataContainerCnv_tlp1
Definition
TgcPrepDataContainerCnv_tlp1.h:23
TgcPrepDataContainerCnv::m_TPConverter
TgcPrepDataContainerCnv_tlp1 m_TPConverter
Definition
TgcPrepDataContainerCnv.h:48
TgcPrepDataContainerCnv::TgcPrepDataContainerCnv
TgcPrepDataContainerCnv(ISvcLocator *svcloc)
Definition
TgcPrepDataContainerCnv.cxx:19
TgcPrepDataContainerCnv::createPersistent
virtual TgcPrepDataContainer_PERS * createPersistent(Muon::TgcPrepDataContainer *transCont)
Definition
TgcPrepDataContainerCnv.cxx:40
TgcPrepDataContainerCnv::initialize
virtual StatusCode initialize()
Gaudi Service Interface method implementations:
Definition
TgcPrepDataContainerCnv.cxx:26
TgcPrepDataContainerCnv::m_converter_p2
Muon::TgcPrepDataContainerCnv_p2 m_converter_p2
Definition
TgcPrepDataContainerCnv.h:47
TgcPrepDataContainerCnv::createTransient
virtual Muon::TgcPrepDataContainer * createTransient(const Token *token)
Definition
TgcPrepDataContainerCnv.cxx:47
TgcPrepDataContainerCnv::m_converter_p3
Muon::TgcPrepDataContainerCnv_p3 m_converter_p3
Definition
TgcPrepDataContainerCnv.h:46
TgcPrepDataContainerCnv::~TgcPrepDataContainerCnv
virtual ~TgcPrepDataContainerCnv()
Token
This class provides a token that identifies in a unique way objects on the persistent storage.
Definition
Token.h:22
Muon::TgcPrepDataContainer
MuonPrepDataContainerT< TgcPrepData > TgcPrepDataContainer
Definition
MuonPrepDataContainer.h:96
Generated on
for ATLAS Offline Software by
1.17.0