ATLAS Offline Software
Toggle main menu visibility
Loading...
Searching...
No Matches
LArCalorimeter
LArCnv
LArAthenaPool
src
LArRawChannelContainerCnv.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 "
LArRawChannelContainerCnv.h
"
6
7
#include "GaudiKernel/StatusCode.h"
8
#include "GaudiKernel/MsgStream.h"
9
#include "
StoreGate/StoreGateSvc.h
"
10
#include "
LArTPCnv/LArRawChannelContainerCnv_p1.h
"
11
12
// LArRawChannelContainerCnv, used for T/P separation
13
// real work is done in LArRawChannelContainerCnv_p2 for reading new data or
14
// below for reading old data
15
// author R.Seuster <seuster@cern.ch>
16
17
template
<>
18
LArRawChannelContainer_PERSISTENT
*
19
LArRawChannelContainerCnv::createPersistent
(
LArRawChannelContainer
* transCont)
20
{
21
MsgStream log(msgSvc(),
"LArRawChannelContainerConverter"
);
22
LArRawChannelContainerCnv_p4
converter;
23
LArRawChannelContainer_p4
*persObj = converter.
createPersistent
( transCont, log );
24
return
persObj;
25
}
26
27
template
<>
28
LArRawChannelContainer
*
29
LArRawChannelContainerCnv::createTransient
(
const
Token
* token)
30
{
31
MsgStream log(msgSvc(),
"LArRawChannelContainerConverter"
);
32
LArRawChannelContainer
*trans_cont = NULL;
33
34
// GUID for new and old persistent classes
35
static
const
pool::Guid
guid_p4(
"E3B70B7A-0D69-429A-AD43-B68941E879FB"
);
36
static
const
pool::Guid
guid_p3(
"95401B94-3D69-49BD-B901-C7B71940D746"
);
37
static
const
pool::Guid
guid_p2(
"AD521521-4043-472B-BF8B-FDFDC1870FD9"
);
38
static
const
pool::Guid
guid_p1(
"1569AF5C-5F27-4C02-A87B-47FF192F1605"
);
39
static
const
pool::Guid
guid_p0(
"9D624DCE-B943-4515-B33A-6F6928F8EB90"
);
40
// even newer representation of LArRawChannelContainer
41
if
(
compareClassGuid
(token, guid_p4) ) {
42
LArRawChannelContainerCnv_p4
converter;
43
std::unique_ptr<LArRawChannelContainer_p4> col_vect(
poolReadObject<LArRawChannelContainer_p4>
(token) );
44
trans_cont = converter.
createTransient
( col_vect.get(), log );
45
}
46
else
if
(
compareClassGuid
(token, guid_p3) ) {
47
LArRawChannelContainerCnv_p3
converter;
48
std::unique_ptr<LArRawChannelContainer_p3> col_vect(
poolReadObject<LArRawChannelContainer_p3>
(token) );
49
trans_cont = converter.
createTransient
( col_vect.get(), log );
50
}
51
// new representation of LArRawChannelContainer
52
else
if
(
compareClassGuid
(token, guid_p2) ) {
53
LArRawChannelContainerCnv_p2
converter;
54
std::unique_ptr<LArRawChannelContainer_p2> col_vect(
poolReadObject<LArRawChannelContainer_p2>
(token) );
55
trans_cont = converter.
createTransient
( col_vect.get(), log );
56
57
}
58
// previous representation of LArRawChannelContainer
59
else
if
(
compareClassGuid
(token, guid_p1) )
60
{
61
LArRawChannelContainerCnv_p1
converter;
62
std::unique_ptr<LArRawChannelContainer_p1> col_vect(
poolReadObject<LArRawChannelContainer_p1>
(token) );
63
trans_cont = converter.
createTransient
( col_vect.get(), log );
64
}
65
// old representation of LArRawChannelContainer
66
else
if
(
compareClassGuid
(token, guid_p0) )
67
{
68
log << MSG::ERROR <<
"Reading of version 0 of LArRawChannelContainer not supported any more"
<<
endmsg
;
69
70
}
71
else
{
72
// log << MSG::ERROR << "failed trying to read : " << m_token << endmsg;
73
throw
std::runtime_error(
"Unsupported persistent version of LArRawChannel container"
);
74
}
75
return
trans_cont;
76
}
endmsg
#define endmsg
Definition
AnalysisConfig_Ntuple.cxx:54
LArRawChannelContainerCnv.h
LArRawChannelContainer_PERSISTENT
LArRawChannelContainer_p4 LArRawChannelContainer_PERSISTENT
Definition
LArRawChannelContainerCnv.h:25
LArRawChannelContainerCnv_p1.h
StoreGateSvc.h
LArRawChannelContainerCnv_p1
Definition
LArRawChannelContainerCnv_p1.h:22
LArRawChannelContainerCnv_p2
Definition
LArRawChannelContainerCnv_p2.h:21
LArRawChannelContainerCnv_p3
Definition
LArRawChannelContainerCnv_p3.h:17
LArRawChannelContainerCnv_p4
Definition
LArRawChannelContainerCnv_p4.h:18
LArRawChannelContainer_p4
Persistent LArRawChannelContainer, version p3.
Definition
LArRawChannelContainer_p4.h:20
LArRawChannelContainer
Container for LArRawChannel (IDC using LArRawChannelCollection).
Definition
LArRawChannelContainer.h:26
LArRawEventContainerCnv< LArRawChannelContainer, LArRawChannelContainer_p4, LArRawChannelContainerCnv_p4 >::createPersistent
virtual LArRawChannelContainer_p4 * createPersistent(LArRawChannelContainer *transCont)
Definition
LArRawChannelContainerCnv.cxx:19
LArRawEventContainerCnv< LArRawChannelContainer, LArRawChannelContainer_p4, LArRawChannelContainerCnv_p4 >::createTransient
virtual LArRawChannelContainer * createTransient(const Token *token)
Definition
LArRawChannelContainerCnv.cxx:29
TPAbstractPolyCnvBase::createPersistent
virtual PERS * createPersistent(const TRANS *transObj, MsgStream &log)
Create persistent representation of a transient object.
TPPolyCnvBase::createTransient
virtual TRANS * createTransient(const PERS *persObj, MsgStream &log)
Create transient representation of a persistent object.
T_AthenaPoolCustomCnv< T, P >::compareClassGuid
virtual bool compareClassGuid(const Token *token, const Guid &clid) const
LArRawEventContainerCnv< LArRawChannelContainer, LArRawChannelContainer_p4, LArRawChannelContainerCnv_p4 >::poolReadObject
LArRawChannelContainer_p4 * 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
pool::Guid
::Guid Guid
Definition
T_AthenaPoolCustCnv.h:19
Generated on
for ATLAS Offline Software by
1.17.0