ATLAS Offline Software
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 
13 
18 
19 
20 class MsgStream;
21 
22 class MaterialStepCollectionCnv_p1 : public T_AthenaPoolTPCnvBase< Trk::MaterialStepCollection, Trk::MaterialStepCollection_p1 >
23 {
24  public:
25 
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);
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;
51  for( ; it != iEnd; ++it ) {
52  m_materialStepCnv.transToPers(*it, &(*persVect)[i++], log ) ;
53  }
54  }
55 
56  private :
58 };
59 
60 #endif // MATERIAKSTEPCOLLECTION_CNV_P1_TRK_H
DataVector::reserve
void reserve(size_type n)
Attempt to preallocate enough memory for a specified number of elements.
Trk::MaterialStep_p1
Definition: MaterialStep_p1.h:36
MaterialStepCnv_p1.h
DataModel_detail::const_iterator
Const iterator class for DataVector/DataList.
Definition: DVLIterator.h:82
MaterialStepCollectionCnv_p1::transToPers
virtual void transToPers(const Trk::MaterialStepCollection *transVect, Trk::MaterialStepCollection_p1 *persVect, MsgStream &log)
transient to persistent
Definition: MaterialStepCollectionCnv_p1.h:44
TPPolyCnvBase::createTransient
virtual TRANS * createTransient(const PERS *persObj, MsgStream &log)
Create transient representation of a persistent object.
skel.it
it
Definition: skel.GENtoEVGEN.py:396
TPConverterBase
Definition: TPConverter.h:738
MaterialStepCollection.h
MaterialStepCollectionCnv_p1::m_materialStepCnv
MaterialStepCnv_p1 m_materialStepCnv
Definition: MaterialStepCollectionCnv_p1.h:57
MaterialStepCnv_p1
Definition: MaterialStepCnv_p1.h:20
python.SystemOfUnits.ms
int ms
Definition: SystemOfUnits.py:132
MaterialStepCollectionCnv_p1::persToTrans
virtual void persToTrans(const Trk::MaterialStepCollection_p1 *persVect, Trk::MaterialStepCollection *transVect, MsgStream &log)
persistent to transient
Definition: MaterialStepCollectionCnv_p1.h:31
lumiFormat.i
int i
Definition: lumiFormat.py:85
MaterialStepCollection_p1.h
T_AthenaPoolTPConverter.h
Trk::MaterialStepCollection_p1
Definition: MaterialStepCollection_p1.h:18
DataVector
Derived DataVector<T>.
Definition: DataVector.h:581
DataVector::clear
void clear()
Erase all the elements in the collection.
MaterialStepCnv_p1::transToPers
virtual void transToPers(const Trk::MaterialStep *transObj, Trk::MaterialStep_p1 *persObj, MsgStream &log)
Definition: MaterialStepCnv_p1.cxx:39
ElementTableCnv_p1.h
private
#define private
Definition: DetDescrConditionsDict_dict_fixes.cxx:13
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.
python.CaloCondTools.log
log
Definition: CaloCondTools.py:20
MaterialStepCollectionCnv_p1
Definition: MaterialStepCollectionCnv_p1.h:23
MaterialStepCollectionCnv_p1::MaterialStepCollectionCnv_p1
MaterialStepCollectionCnv_p1()
Standard constructor.
Definition: MaterialStepCollectionCnv_p1.h:27
DataVector::size
size_type size() const noexcept
Returns the number of elements in the collection.
DataVector::begin
const_iterator begin() const noexcept
Return a const_iterator pointing at the beginning of the collection.