ATLAS Offline Software
Toggle main menu visibility
Loading...
Searching...
No Matches
Tracking
TrkEventCnv
TrkEventTPCnv
TrkEventTPCnv
TrkSegment
SegmentCollectionCnv_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
5
#ifndef SEGMENT_COLLECTION_CNV_P1_H
6
#define SEGMENT_COLLECTION_CNV_P1_H
7
8
//-----------------------------------------------------------------------------
9
//
10
// file: SegmentCollectionCnv_p1.h
11
//
12
//-----------------------------------------------------------------------------
13
14
#include "
AthenaPoolCnvSvc/T_AthenaPoolTPConverter.h
"
15
16
#include "
TrkSegment/SegmentCollection.h
"
17
#include "
TrkEventTPCnv/TrkSegment/SegmentCollection_p1.h
"
18
#include "
TrkMeasurementBase/MeasurementBase.h
"
19
#include "
TrkSegment/Segment.h
"
20
21
class
MsgStream;
22
23
class
SegmentCollectionCnv_p1
24
:
public
T_AthenaPoolTPCnvBase
< Trk::SegmentCollection, Trk::SegmentCollection_p1 >
25
{
26
public
:
27
SegmentCollectionCnv_p1
() {}
28
29
// remark: the usual templated needed to be overwritten in this case because
30
// 1) SegmentCollection is DV< Segments >
31
// 2) but Segment and TrkSegment have their T/P entry point at MeasurementBase which
32
// is their highers abstract base class
33
virtual
void
transToPers
(
const
Trk::SegmentCollection
* transVect,
Trk::SegmentCollection_p1
* persVect, MsgStream &log) {
34
persVect->clear();
35
persVect->reserve( transVect->
size
() );
36
// convert vector entries one by one
37
for
(
Trk::SegmentCollection::const_iterator
it = transVect->
begin
();
38
it != transVect->
end
(); ++it ) {
39
persVect->push_back(
toPersistent
( (
ITPConverterFor<Trk::MeasurementBase>
**)0, *it, log ) );
40
}
41
}
42
43
44
virtual
void
persToTrans
(
const
Trk::SegmentCollection_p1
* persVect,
Trk::SegmentCollection
* transVect, MsgStream &log)
45
{
46
transVect->
clear
();
47
transVect->
reserve
( persVect->size() );
48
// convert vector entries one by one
49
for
( Trk::SegmentCollection_p1::const_iterator it = persVect->begin();
50
it != persVect->end(); ++it )
51
{
52
transVect->
push_back
(
dynamic_cast<
Trk::Segment
*
>
(
createTransFromPStore
( (
ITPConverterFor<Trk::MeasurementBase>
**)0, *it, log ) ) );
53
}
54
}
55
56
};
57
58
59
#endif
MeasurementBase.h
SegmentCollection.h
SegmentCollection_p1.h
T_AthenaPoolTPConverter.h
T_AthenaPoolTPCnvBase
TPConverterBase< TRANS, PERS > T_AthenaPoolTPCnvBase
Definition
T_AthenaPoolTPConverter.h:41
Segment.h
DataVector< Trk::Segment >::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.
ITPConverterFor
Common base class for all TP converters, specialized for a given transient type.
Definition
TPConverter.h:37
TPPolyCnvBase< TRANS, TRANS, PERS >::createTransFromPStore
CNV::Trans_t * createTransFromPStore(CNV **cnv, const TPObjRef &ref, MsgStream &log) const
Definition
TPConverter.h:172
TPPolyCnvBase< TRANS, TRANS, PERS >::toPersistent
TPObjRef toPersistent(CNV **cnv, const typename CNV::TransBase_t *transObj, MsgStream &log) const
Definition
TPConverter.h:119
SegmentCollectionCnv_p1::persToTrans
virtual void persToTrans(const Trk::SegmentCollection_p1 *persVect, Trk::SegmentCollection *transVect, MsgStream &log)
Definition
SegmentCollectionCnv_p1.h:44
SegmentCollectionCnv_p1::transToPers
virtual void transToPers(const Trk::SegmentCollection *transVect, Trk::SegmentCollection_p1 *persVect, MsgStream &log)
Definition
SegmentCollectionCnv_p1.h:33
SegmentCollectionCnv_p1::SegmentCollectionCnv_p1
SegmentCollectionCnv_p1()
Definition
SegmentCollectionCnv_p1.h:27
Trk::SegmentCollection_p1
Definition
SegmentCollection_p1.h:21
Trk::Segment
Base class for all TrackSegment implementations, extends the common MeasurementBase.
Definition
Tracking/TrkEvent/TrkSegment/TrkSegment/Segment.h:56
Trk::SegmentCollection
DataVector< Trk::Segment > SegmentCollection
Definition
SegmentCollection.h:13
Generated on
for ATLAS Offline Software by
1.17.0