ATLAS Offline Software
Toggle main menu visibility
Loading...
Searching...
No Matches
TileCalorimeter
TileSvc
TileEventAthenaPool
src
TileBeamElemContainerCnv.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 "
TileTPCnv/TileBeamElemContainerCnv_p1.h
"
6
#include "
TileBeamElemContainerCnv.h
"
7
// Gaudi
8
#include "GaudiKernel/MsgStream.h"
9
10
TileBeamElemContainer_PERS
*
TileBeamElemContainerCnv::createPersistent
(
TileBeamElemContainer
* transCont) {
11
MsgStream mlog(msgSvc(),
"TileBeamElemContainerConverter"
);
12
TileBeamElemContainerCnv_p1
converter;
13
TileBeamElemContainer_PERS
*persObj = converter.
createPersistent
( transCont, mlog );
14
return
persObj;
15
}
16
17
TileBeamElemContainer
*
TileBeamElemContainerCnv::createTransient
(
const
Token
* token) {
18
MsgStream mlog(msgSvc(),
"TileBeamElemContainerConverter"
);
19
TileBeamElemContainerCnv_p1
converter_p1;
20
21
TileBeamElemContainer
*trans_cont(0);
22
23
static
const
pool::Guid
p1_guid(
"CF8DE6AB-8E15-4B5F-881B-39B736EAB4E0"
);
24
static
const
pool::Guid
p0_guid(
"7FCE8F30-B59E-41E6-9A66-0DCD6134552E"
);
25
26
if
( this->
compareClassGuid
(token, p1_guid)) {
27
std::unique_ptr< TileBeamElemContainer_p1 > cont( this->
poolReadObject< TileBeamElemContainer_p1 >
(token) );
28
trans_cont = converter_p1.
createTransient
( cont.get(), mlog );
29
}
30
else
if
( this->
compareClassGuid
(token, p0_guid)) {
31
// old version from before TP separation
32
TileBeamElemCollectionVec
* rdoV = this->
poolReadObject<TileBeamElemCollectionVec>
(token);
33
34
if
(mlog.level()<=MSG::DEBUG)
35
mlog << MSG::DEBUG <<
"Read IDC, size "
<< rdoV->
size
() <<
endmsg
;
36
37
// TileFragHash::TYPE type = rdoV->m_type;
38
39
// create the Tile IdentifiableContainer to contain the rdo collections
40
trans_cont =
new
TileBeamElemContainer
(
false
,
SG::OWN_ELEMENTS
);
41
42
TileBeamElemCollectionVec::iterator
it = rdoV->
begin
();
43
TileBeamElemCollectionVec::iterator
last = rdoV->
end
();
44
45
for
(; it != last; ++it) {
46
47
TileBeamElemCollection
* rdoColl = *it;
48
rdoColl->
setOwnership
(
SG::OWN_ELEMENTS
);
49
50
// register the rdo collection in StoreGate
51
TileBeamElemCollection::ID
id_coll = rdoColl->
identify
();
52
StatusCode
sc
= trans_cont->
addCollection
(rdoColl,trans_cont->
hashFunc
()(id_coll));
53
if
(
sc
.isFailure()) {
54
mlog << MSG::ERROR <<
"Can't add collection "
<< id_coll <<
" to container "
<<
endmsg
;
55
}
56
}
57
delete
rdoV;
58
}
else
{
59
throw
std::runtime_error(
"Unsupported persistent version of Data container"
);
60
}
61
return
trans_cont;
62
}
63
endmsg
#define endmsg
Definition
AnalysisConfig_Ntuple.cxx:54
sc
static Double_t sc
Definition
LArPhysWaveHECTool.cxx:37
TileBeamElemContainerCnv.h
TileBeamElemContainer_PERS
TileBeamElemContainer_p1 TileBeamElemContainer_PERS
Definition
TileBeamElemContainerCnv.h:12
TileBeamElemContainerCnv_p1.h
TileBeamElemContainerCnv_p1
T_TilePoolContainerCnv< TileBeamElemContainer, TileBeamElemContainer_p1, TileBeamElemCnv_p1 > TileBeamElemContainerCnv_p1
Definition
TileBeamElemContainerCnv_p1.h:27
DataVector< TileBeamElemCollection >::iterator
DataModel_detail::iterator< DataVector > iterator
Definition
DataVector.h:842
DataVector::end
const_iterator end() const noexcept
Return a const_iterator pointing past the end of the collection.
DataVector::begin
const_iterator begin() const noexcept
Return a const_iterator pointing at the beginning of the collection.
DataVector::size
size_type size() const noexcept
Returns the number of elements in the collection.
IdentifiableContainerMT::addCollection
virtual StatusCode addCollection(const T *coll, IdentifierHash hashId) override final
insert collection into container with id hash if IDC should not take ownership of collection,...
Definition
IdentifiableContainerMT.h:306
TPAbstractPolyCnvBase< TRANS, TRANS, PERS >::createPersistent
virtual PERS * createPersistent(const TRANS *transObj, MsgStream &log)
TPPolyCnvBase< TRANS, TRANS, PERS >::createTransient
virtual TRANS * createTransient(const PERS *persObj, MsgStream &log)
T_AthenaPoolCustomCnv< TileBeamElemContainer, TileBeamElemContainer_PERS >::compareClassGuid
virtual bool compareClassGuid(const Token *token, const Guid &clid) const
T_AthenaPoolCustomCnv< TileBeamElemContainer, TileBeamElemContainer_PERS >::poolReadObject
P * poolReadObject(const Token *token)
TileBeamElemCollectionVec
Definition
TileBeamElemContainer.h:34
TileBeamElemCollection
Definition
TileBeamElemCollection.h:12
TileBeamElemCollection::ID
MyBase::ID ID
Definition
TileBeamElemCollection.h:17
TileBeamElemContainerCnv::createPersistent
TileBeamElemContainer_PERS * createPersistent(TileBeamElemContainer *transCont)
Definition
TileBeamElemContainerCnv.cxx:10
TileBeamElemContainerCnv::createTransient
TileBeamElemContainer * createTransient(const Token *token)
Definition
TileBeamElemContainerCnv.cxx:17
TileBeamElemContainer
Definition
TileBeamElemContainer.h:13
TileRawDataCollection::setOwnership
void setOwnership(SG::OwnershipPolicy ownPolicy)
Definition
TileRawDataCollection.h:110
TileRawDataCollection::identify
ID identify() const
Definition
TileRawDataCollection.h:71
TileRawDataContainer::hashFunc
const TileFragHash & hashFunc() const
Definition
TileRawDataContainer.h:66
Token
This class provides a token that identifies in a unique way objects on the persistent storage.
Definition
Token.h:22
SG::OWN_ELEMENTS
@ OWN_ELEMENTS
this data object owns its elements
Definition
OwnershipPolicy.h:17
pool::Guid
::Guid Guid
Definition
T_AthenaPoolCustCnv.h:19
Generated on
for ATLAS Offline Software by
1.17.0