ATLAS Offline Software
LArCalorimeter
LArCnv
LArSimEventAthenaPool
src
LArHitContainerCnv.cxx
Go to the documentation of this file.
1
/*
2
Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration
3
*/
4
5
#include "
LArSimEventTPCnv/LArHitContainerCnv_p1.h
"
6
#include "
LArSimEventTPCnv/LArHitContainerCnv_p2.h
"
7
#include "
LArHitContainerCnv.h
"
8
#include "
LArSimEventTPCnv/LArHit_p1.h
"
9
10
LArHitContainer_PERS
*
LArHitContainerCnv::createPersistent
(
LArHitContainer
* transCont) {
11
MsgStream
mlog
(
msgSvc
(),
"LArHitContainerConverter"
);
12
LArHitContainerCnv_p2
converter;
13
LArHitContainer_PERS
*persObj = converter.
createPersistent
( transCont,
mlog
);
14
return
persObj;
15
}
16
17
18
LArHitContainer
*
LArHitContainerCnv::createTransient
() {
19
MsgStream
mlog
(
msgSvc
(),
"LArHitContainerConverter"
);
20
LArHitContainerCnv_p1
converter_p1;
21
LArHitContainerCnv_p2
converter_p2;
22
23
LArHitContainer
*trans_cont(0);
24
25
static
const
pool::Guid
p2_guid(
"1F1DE705-E0CE-4F0E-941A-C405CB2CD137"
);
26
static
const
pool::Guid
p1_guid(
"ED1ECB80-B38C-46DE-94BF-22F9379796DB"
);
27
static
const
pool::Guid
p0_guid(
"32703AED-CAA5-45ED-B804-8556900CA6B5"
);
28
29
if
( this->
compareClassGuid
(p2_guid)) {
30
std::unique_ptr< LArHitContainer_p2 > col_vect( this->poolReadObject< LArHitContainer_p2 >() );
31
trans_cont = converter_p2.
createTransient
( col_vect.get(),
mlog
);
32
}
33
else
if
( this->
compareClassGuid
(p1_guid)) {
34
std::unique_ptr< LArHitContainer_p1 > col_vect( this->poolReadObject< LArHitContainer_p1 >() );
35
trans_cont = converter_p1.
createTransient
( col_vect.get(),
mlog
);
36
}
37
else
if
( this->
compareClassGuid
(p0_guid)) {
38
// old version from before TP separation, just return it
39
trans_cont = this->poolReadObject<LArHitContainer>();
40
}
else
{
41
throw
std::runtime_error(
"Unsupported persistent version of Data container"
);
42
}
43
return
trans_cont;
44
}
LArHitContainerCnv_p1.h
TPPolyCnvBase::createTransient
virtual TRANS * createTransient(const PERS *persObj, MsgStream &log)
Create transient representation of a persistent object.
LArHitContainer
Hit collection.
Definition:
LArHitContainer.h:26
LArHitContainerCnv::createTransient
LArHitContainer * createTransient()
Definition:
LArHitContainerCnv.cxx:18
TPAbstractPolyCnvBase::createPersistent
virtual PERS * createPersistent(const TRANS *transObj, MsgStream &log)
Create persistent representation of a transient object.
pool::Guid
::Guid Guid
Definition:
T_AthenaPoolCustCnv.h:19
python.InDetPriVxFinderConfig.mlog
mlog
Definition:
InDetPriVxFinderConfig.py:139
StdJOSetup.msgSvc
msgSvc
Provide convenience handles for various services.
Definition:
StdJOSetup.py:36
LArHitContainerCnv.h
LArHitContainer_p2
Persistent represenation of a LArHitContainer,.
Definition:
LArHitContainer_p2.h:16
T_AthenaHitsVectorCnv
Definition:
TPConverter.h:1216
LArHitContainerCnv::createPersistent
LArHitContainer_PERS * createPersistent(LArHitContainer *transCont)
Definition:
LArHitContainerCnv.cxx:10
T_AthenaPoolCustCnv< LArHitContainer, LArHitContainer_PERS >::compareClassGuid
virtual bool compareClassGuid(const Guid &clid) const
Compare POOL class GUID with the one of the object being read.
LArHit_p1.h
LArHitContainerCnv_p2
Definition:
LArHitContainerCnv_p2.h:16
LArHitContainerCnv_p2.h
Generated on Wed Jan 8 2025 21:12:49 for ATLAS Offline Software by
1.8.18