ATLAS Offline Software
InnerDetector
InDetEventCnv
InDetEventAthenaPool
src
SCT_RDO_ContainerCnv_p0.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 "
SCT_RDO_ContainerCnv_p0.h
"
6
7
8
9
#include "
InDetIdentifier/SCT_ID.h
"
10
#include "
InDetRawData/SCT_RDO_Container.h
"
11
#include "
InDetRawData/SCT_RDO_Collection.h
"
12
13
//================================================================
14
SCT_RDO_Container
*
SCT_RDO_ContainerCnv_p0::createTransient
(
const
SCT_RDO_Container_p0
* persObj, MsgStream&
log
) {
15
std::unique_ptr<SCT_RDO_Container> trans(std::make_unique<SCT_RDO_Container>(
m_sctId
->
wafer_hash_max
()));
16
17
SCT_RDO_Container_p0::const_iterator
it
= persObj->
begin
();
18
SCT_RDO_Container_p0::const_iterator
last = persObj->
end
();
19
for
(;
it
!= last; ++
it
) {
20
21
// Old persistent format used collection templated on the specific raw data type
22
const
InDetRawDataCollection<SCT1_RawData>
* rdoCollOld = *
it
;
23
24
if
(rdoCollOld==
nullptr
) {
25
throw
std::runtime_error(
"Got nullptr of collection reading old format SCT_RDO_Container"
);
26
}
27
28
// Ugly cast... The new format does not need it in its converters.
29
const
InDetRawDataCollection<SCT_RDORawData>
* rdoColl =
reinterpret_cast<
const
InDetRawDataCollection<SCT_RDORawData>
*
>
(rdoCollOld);
30
31
// Add to the container
32
if
(trans->
addCollection
( rdoColl, rdoColl->
identifyHash
() ).isFailure()) {
33
log
<<
MSG::FATAL
<<
"[p0] SCT RDOs could not be added to the container!"
<<
endmsg
;
34
throw
std::runtime_error(
"SCT_RDO_ContainerCnv_p0::createTransient(): SCT RDOs could not be added to the container!"
);
35
}
36
}
37
38
return
trans.release();
39
}
40
41
//================================================================
DataModel_detail::const_iterator
Const iterator class for DataVector/DataList.
Definition:
DVLIterator.h:82
SCT_ID.h
This is an Identifier helper class for the SCT subdetector. This class is a factory for creating comp...
SCT_RDO_ContainerCnv_p0.h
python.Constants.FATAL
int FATAL
Definition:
Control/AthenaCommon/python/Constants.py:19
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:297
skel.it
it
Definition:
skel.GENtoEVGEN.py:396
InDetRawDataContainer
Definition:
InDetRawDataContainer.h:27
InDetRawDataCollection::identifyHash
virtual IdentifierHash identifyHash() const override final
SCT_RDO_Container.h
endmsg
#define endmsg
Definition:
AnalysisConfig_Ntuple.cxx:63
InDetRawDataCollection
Definition:
InDetRawDataCollection.h:31
DataVector
Derived DataVector<T>.
Definition:
DataVector.h:794
SCT_ID::wafer_hash_max
size_type wafer_hash_max(void) const
Definition:
SCT_ID.cxx:645
SCT_RDO_Collection.h
DataVector::end
const_iterator end() const noexcept
Return a const_iterator pointing past the end of the collection.
SCT_RDO_ContainerCnv_p0::m_sctId
const SCT_ID * m_sctId
Definition:
SCT_RDO_ContainerCnv_p0.h:20
SCT_RDO_ContainerCnv_p0::createTransient
virtual SCT_RDO_Container * createTransient(const SCT_RDO_Container_p0 *persObj, MsgStream &log)
Definition:
SCT_RDO_ContainerCnv_p0.cxx:14
python.CaloCondTools.log
log
Definition:
CaloCondTools.py:20
DataVector::begin
const_iterator begin() const noexcept
Return a const_iterator pointing at the beginning of the collection.
Generated on Sun Dec 22 2024 21:17:46 for ATLAS Offline Software by
1.8.18