ATLAS Offline Software
Toggle main menu visibility
Loading...
Searching...
No Matches
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
//================================================================
endmsg
#define endmsg
Definition
AnalysisConfig_Ntuple.cxx:54
SCT_ID.h
This is an Identifier helper class for the SCT subdetector.
SCT_RDO_Collection.h
SCT_RDO_ContainerCnv_p0.h
SCT_RDO_Container_p0
DataVector< InDetRawDataCollection< SCT1_RawData > > SCT_RDO_Container_p0
Definition
SCT_RDO_ContainerCnv_p0.h:16
SCT_RDO_Container.h
SCT_RDO_Container
InDetRawDataContainer< InDetRawDataCollection< SCT_RDORawData > > SCT_RDO_Container
Definition
SCT_RDO_Container.h:23
DataVector< InDetRawDataCollection< SCT1_RawData > >::const_iterator
DataModel_detail::const_iterator< DataVector > const_iterator
Definition
DataVector.h:838
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.
InDetRawDataCollection
Definition
InDetRawDataCollection.h:31
InDetRawDataCollection::identifyHash
virtual IdentifierHash identifyHash() const override final
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
Generated on
for ATLAS Offline Software by
1.17.0