ATLAS Offline Software
Toggle main menu visibility
Loading...
Searching...
No Matches
InnerDetector
InDetEventCnv
InDetEventAthenaPool
src
PixelRDO_ContainerCnv_p0.cxx
Go to the documentation of this file.
1
/*
2
Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
3
*/
4
5
#include "
PixelRDO_ContainerCnv_p0.h
"
6
7
#include "
InDetRawData/PixelRDO_Container.h
"
8
#include "
InDetRawData/PixelRDO_Collection.h
"
9
#include "
InDetIdentifier/PixelID.h
"
10
11
#include "
MsgUtil.h
"
12
13
#include <string>
14
#include <iostream>
15
#include <sstream>
16
17
18
//================================================================
19
PixelRDO_Container
*
PixelRDO_ContainerCnv_p0::createTransient
(
const
PixelRDO_Container_p0
* persObj, MsgStream& log) {
20
std::unique_ptr<PixelRDO_Container> trans(std::make_unique<PixelRDO_Container>(
m_pixId
->wafer_hash_max()));
21
22
MSG_DEBUG
(log,
"Read RDO vector, size "
<< persObj->
size
());
23
24
PixelRDO_Container_p0::const_iterator
it = persObj->
begin
();
25
PixelRDO_Container_p0::const_iterator
last = persObj->
end
();
26
for
(; it != last; ++it) {
27
28
// Old persistent format used collection templated on the specific raw data type
29
const
InDetRawDataCollection<Pixel1RawData>
* rdoCollOld = *it;
30
31
if
(!rdoCollOld) {
32
throw
std::runtime_error(
"Got NULL collection reading old format PixelRDO_Container"
);
33
}
34
35
// Ugly cast... The new format does not need it in its converters.
36
const
InDetRawDataCollection<PixelRDORawData>
* rdoColl =
reinterpret_cast<
const
InDetRawDataCollection<PixelRDORawData>
*
>
(rdoCollOld);
37
38
// Add to the container
39
if
(trans->addCollection( rdoColl, rdoColl->
identifyHash
() ).isFailure()) {
40
log << MSG::FATAL <<
"[p0] Pixel RDOs could not be added to the container!"
<<
endmsg
;
41
throw
std::runtime_error(
"PixelRDO_ContainerCnv_p0::createTransient(): Pixel RDOs could not be added to the container!"
);
42
}
43
}
44
45
return
(trans.release());
46
}
47
48
//================================================================
49
50
endmsg
#define endmsg
Definition
AnalysisConfig_Ntuple.cxx:54
MsgUtil.h
MSG_DEBUG
#define MSG_DEBUG(log, x)
Definition
MsgUtil.h:16
PixelID.h
This is an Identifier helper class for the Pixel subdetector.
PixelRDO_Collection.h
PixelRDO_ContainerCnv_p0.h
PixelRDO_Container_p0
DataVector< InDetRawDataCollection< Pixel1RawData > > PixelRDO_Container_p0
Definition
PixelRDO_ContainerCnv_p0.h:16
PixelRDO_Container.h
PixelRDO_Container
InDetRawDataContainer< InDetRawDataCollection< PixelRDORawData > > PixelRDO_Container
Definition
PixelRDO_Container.h:25
DataVector< InDetRawDataCollection< Pixel1RawData > >::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.
DataVector::size
size_type size() const noexcept
Returns the number of elements in the collection.
InDetRawDataCollection
Definition
InDetRawDataCollection.h:31
InDetRawDataCollection::identifyHash
virtual IdentifierHash identifyHash() const override final
PixelRDO_ContainerCnv_p0::createTransient
virtual PixelRDO_Container * createTransient(const PixelRDO_Container_p0 *persObj, MsgStream &log)
Definition
PixelRDO_ContainerCnv_p0.cxx:19
PixelRDO_ContainerCnv_p0::m_pixId
const PixelID * m_pixId
Definition
PixelRDO_ContainerCnv_p0.h:20
Generated on
for ATLAS Offline Software by
1.17.0