ATLAS Offline Software
Toggle main menu visibility
Loading...
Searching...
No Matches
TileCalorimeter
TileSvc
TileEventAthenaPool
src
TileRawChannelContainerCnv.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/TileRawChannelContainerCnv_p1.h
"
6
#include "
TileRawChannelContainerCnv.h
"
7
// Gaudi
8
#include "GaudiKernel/MsgStream.h"
9
10
TileRawChannelContainer_PERS
*
TileRawChannelContainerCnv::createPersistent
(
TileRawChannelContainer
* transCont) {
11
MsgStream mlog(msgSvc(),
"TileRawChannelContainerConverter"
);
12
TileRawChannelContainerCnv_p1
converter;
13
TileRawChannelContainer_PERS
*persObj = converter.
createPersistent
( transCont, mlog );
14
return
persObj;
15
}
16
17
TileRawChannelContainer
*
TileRawChannelContainerCnv::createTransient
(
const
Token
* token) {
18
MsgStream mlog(msgSvc(),
"TileRawChannelContainerConverter"
);
19
TileRawChannelContainerCnv_p1
converter_p1;
20
21
TileRawChannelContainer
*trans_cont(0);
22
23
static
const
pool::Guid
p1_guid(
"BF727F06-9F94-4989-9C1F-9E59023988EA"
);
24
static
const
pool::Guid
p0_guid(
"E18095F6-01D9-4E8B-AD51-A8628F92E7FF"
);
25
26
if
( this->
compareClassGuid
(token, p1_guid)) {
27
std::unique_ptr< TileRawChannelContainer_p1 > cont( this->
poolReadObject< TileRawChannelContainer_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
TileRawChannelCollectionVec
* rdoV = this->
poolReadObject<TileRawChannelCollectionVec>
(token);
33
bool
lDebug = (mlog.level()<=MSG::DEBUG);
34
35
if
(lDebug)
36
mlog << MSG::DEBUG <<
"Read IDC, size "
<< rdoV->
size
() <<
endmsg
;
37
38
// fixing bug with units in 13.0.20 - should be removed once all RDO files produced with 13.0.20 disappear
39
if
(rdoV->
m_type
== 104) {
40
if
(lDebug)
41
mlog << MSG::DEBUG <<
"fixing units bug in 13.0.20 RDO data: if (type=104) type=4;"
<<
endmsg
;
42
rdoV->
m_type
= (
TileFragHash::TYPE
)4;
43
}
44
45
int
hashType = rdoV->
m_type
& 0xF;
46
int
type
= (rdoV->
m_type
>> 4) & 0xF;
47
int
unit
= (rdoV->
m_type
>> 8) & 0xF;
48
uint32_t bsflags = rdoV->
m_type
& 0xFFFFF000;
49
50
if
(lDebug)
51
mlog << MSG::DEBUG << MSG::hex <<
"m_type="
<< rdoV->
m_type
52
<<
" "
<< bsflags <<
" "
<<
unit
<<
" "
<<
type
<<
" "
<< hashType << MSG::dec <<
endmsg
;
53
54
// create the Tile IdentifiableContainer to contain the rdo collections
55
trans_cont =
new
TileRawChannelContainer
(
false
,hashType,
unit
,
SG::OWN_ELEMENTS
);
56
if
(
type
!= 0) trans_cont->
set_type
((
TileFragHash::TYPE
)
type
);
57
trans_cont->
set_bsflags
(bsflags);
58
59
TileRawChannelCollectionVec::iterator
it = rdoV->
begin
();
60
TileRawChannelCollectionVec::iterator
last = rdoV->
end
();
61
62
for
(; it != last; ++it) {
63
64
TileRawChannelCollection
* rdoColl = *it;
65
rdoColl->
setOwnership
(
SG::OWN_ELEMENTS
);
66
67
// register the rdo collection in StoreGate
68
TileRawChannelCollection::ID
id_coll = rdoColl->
identify
();
69
StatusCode
sc
= trans_cont->
addCollection
(rdoColl,trans_cont->
hashFunc
()(id_coll));
70
if
(
sc
.isFailure()) {
71
mlog << MSG::ERROR <<
"Can't add collection "
<< id_coll <<
" to container"
<<
endmsg
;
72
}
73
}
74
delete
rdoV;
75
}
else
{
76
throw
std::runtime_error(
"Unsupported persistent version of Data container"
);
77
}
78
return
trans_cont;
79
}
unit
const PlainObject unit() const
This is a plugin that makes Eigen look like CLHEP & defines some convenience methods.
Definition
AmgMatrixBasePlugin.h:21
endmsg
#define endmsg
Definition
AnalysisConfig_Ntuple.cxx:61
sc
static Double_t sc
Definition
LArPhysWaveHECTool.cxx:37
TileRawChannelContainerCnv.h
TileRawChannelContainer_PERS
TileRawChannelContainer_p1 TileRawChannelContainer_PERS
Definition
TileRawChannelContainerCnv.h:12
TileRawChannelContainerCnv_p1.h
TileRawChannelContainerCnv_p1
T_TilePoolContainerCnv< TileRawChannelContainer, TileRawChannelContainer_p1, TileRawChannelCnv_p1 > TileRawChannelContainerCnv_p1
Definition
TileRawChannelContainerCnv_p1.h:27
TileRawChannelContainer
Athena::TPCnvVers::Old Athena::TPCnvVers::Old Athena::TPCnvVers::Current Athena::TPCnvVers::Old Athena::TPCnvVers::Current TileRawChannelContainer
Definition
TileTPCnv.cxx:127
DataVector< TileRawChannelCollection >::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< TileRawChannelContainer, TileRawChannelContainer_PERS >::compareClassGuid
virtual bool compareClassGuid(const Token *token, const Guid &clid) const
T_AthenaPoolCustomCnv< TileRawChannelContainer, TileRawChannelContainer_PERS >::poolReadObject
P * poolReadObject(const Token *token)
TileFragHash::TYPE
TYPE
initialize
Definition
TileFragHash.h:33
TileRawChannelCollectionVec
Definition
TileRawChannelContainer.h:35
TileRawChannelCollection
Definition
TileRawChannelCollection.h:12
TileRawChannelCollection::ID
MyBase::ID ID
Definition
TileRawChannelCollection.h:17
TileRawChannelContainerCnv::createTransient
TileRawChannelContainer * createTransient(const Token *token)
Definition
TileRawChannelContainerCnv.cxx:17
TileRawChannelContainerCnv::createPersistent
TileRawChannelContainer_PERS * createPersistent(TileRawChannelContainer *transCont)
Definition
TileRawChannelContainerCnv.cxx:10
TileRawChannelContainer
Definition
TileRawChannelContainer.h:13
TileRawDataCollectionVec::m_type
TileFragHash::TYPE m_type
Definition
TileRawDataContainer.h:100
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
TileRawDataContainer::set_bsflags
void set_bsflags(uint32_t bsflags)
Definition
TileRawDataContainer.h:65
TileRawDataContainer::set_type
void set_type(TYPE type)
Definition
TileRawDataContainer.h:63
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
type
Generated on
for ATLAS Offline Software by
1.17.0