ATLAS Offline Software
Toggle main menu visibility
Loading...
Searching...
No Matches
Tracking
TrkDetDescr
TrkDetDescrTPCnv
TrkDetDescrTPCnv
TrkGeometry
MaterialStepCollectionCnv_p1.h
Go to the documentation of this file.
1
/*
2
Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
3
*/
4
6
// MaterialStepCollectionCnv_p1.h, (c) ATLAS Detector software
8
9
#ifndef MATERIAKSTEPCOLLECTION_CNV_P1_TRK_H
10
#define MATERIAKSTEPCOLLECTION_CNV_P1_TRK_H
11
12
#include "
AthenaPoolCnvSvc/T_AthenaPoolTPConverter.h
"
13
14
#include "
TrkGeometry/MaterialStepCollection.h
"
15
#include "
TrkDetDescrTPCnv/TrkGeometry/MaterialStepCollection_p1.h
"
16
#include "
TrkDetDescrTPCnv/TrkGeometry/MaterialStepCnv_p1.h
"
17
#include "
TrkDetDescrTPCnv/TrkGeometry/ElementTableCnv_p1.h
"
18
19
20
class
MsgStream;
21
22
class
MaterialStepCollectionCnv_p1
:
public
T_AthenaPoolTPCnvBase
< Trk::MaterialStepCollection, Trk::MaterialStepCollection_p1 >
23
{
24
public
:
25
27
MaterialStepCollectionCnv_p1
()
28
{}
29
31
virtual
void
persToTrans
(
const
Trk::MaterialStepCollection_p1
* persVect,
Trk::MaterialStepCollection
* transVect, MsgStream &log) {
32
transVect->
clear
();
33
transVect->
reserve
( persVect->size() );
34
// convert vector entries one by one
35
Trk::MaterialStepCollection_p1::const_iterator it = persVect->begin();
36
Trk::MaterialStepCollection_p1::const_iterator iEnd = persVect->end();
37
for
( ; it != iEnd; ++it ) {
38
const
Trk::MaterialStep_p1
* ms = &(*it);
39
transVect->
push_back
(
m_materialStepCnv
.createTransient(ms, log ) );
40
}
41
}
42
44
virtual
void
transToPers
(
const
Trk::MaterialStepCollection
* transVect,
Trk::MaterialStepCollection_p1
* persVect, MsgStream &log) {
45
persVect->clear();
46
persVect->resize( transVect->
size
() );
47
// convert vector entries one by one
48
unsigned
int
i=0;
49
Trk::MaterialStepCollection::const_iterator
it = transVect->
begin
();
50
Trk::MaterialStepCollection::const_iterator
iEnd = transVect->
end
();
51
for
( ; it != iEnd; ++it ) {
52
m_materialStepCnv
.transToPers(*it, &(*persVect)[i++], log ) ;
53
}
54
}
55
56
private
:
57
MaterialStepCnv_p1
m_materialStepCnv
;
58
};
59
60
#endif
// MATERIAKSTEPCOLLECTION_CNV_P1_TRK_H
ElementTableCnv_p1.h
MaterialStepCnv_p1.h
MaterialStepCollection.h
MaterialStepCollection_p1.h
T_AthenaPoolTPConverter.h
T_AthenaPoolTPCnvBase
TPConverterBase< TRANS, PERS > T_AthenaPoolTPCnvBase
Definition
T_AthenaPoolTPConverter.h:41
DataVector< Trk::MaterialStep >::const_iterator
DataModel_detail::const_iterator< DataVector > const_iterator
Definition
DataVector.h:838
DataVector::reserve
void reserve(size_type n)
Attempt to preallocate enough memory for a specified number of elements.
DataVector::push_back
value_type push_back(value_type pElem)
Add an element to the end of the collection.
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.
DataVector::clear
void clear()
Erase all the elements in the collection.
MaterialStepCnv_p1
Definition
MaterialStepCnv_p1.h:20
MaterialStepCollectionCnv_p1::transToPers
virtual void transToPers(const Trk::MaterialStepCollection *transVect, Trk::MaterialStepCollection_p1 *persVect, MsgStream &log)
transient to persistent
Definition
MaterialStepCollectionCnv_p1.h:44
MaterialStepCollectionCnv_p1::persToTrans
virtual void persToTrans(const Trk::MaterialStepCollection_p1 *persVect, Trk::MaterialStepCollection *transVect, MsgStream &log)
persistent to transient
Definition
MaterialStepCollectionCnv_p1.h:31
MaterialStepCollectionCnv_p1::m_materialStepCnv
MaterialStepCnv_p1 m_materialStepCnv
Definition
MaterialStepCollectionCnv_p1.h:57
MaterialStepCollectionCnv_p1::MaterialStepCollectionCnv_p1
MaterialStepCollectionCnv_p1()
Standard constructor.
Definition
MaterialStepCollectionCnv_p1.h:27
Trk::MaterialStepCollection_p1
Definition
MaterialStepCollection_p1.h:18
Trk::MaterialStep_p1
the persistent object is simply a std::vector<float> where
Definition
MaterialStep_p1.h:36
Trk::MaterialStepCollection
DataVector< Trk::MaterialStep > MaterialStepCollection
Definition
MaterialStepCollection.h:17
private
#define private
Definition
testRead.cxx:27
Generated on
for ATLAS Offline Software by
1.17.0