ATLAS Offline Software
Loading...
Searching...
No Matches
TileHitVectorCnv.cxx
Go to the documentation of this file.
1/*
2 Copyright (C) 2002-2022 CERN for the benefit of the ATLAS collaboration
3*/
4
6#include "TileHitVectorCnv.h"
8
9
11 MsgStream mlog(msgSvc(), "TileHitVectorConverter" );
12 TileHitVectorCnv_p1 converter;
13 TileHitVector_PERS *persObj = converter.createPersistent( transCont, mlog );
14 return persObj;
15}
16
17
19
20 MsgStream mlog(msgSvc(), "TileHitVectorConverter" );
21 TileHitVectorCnv_p1 converter_p1;
22
23 TileHitVector* trans_cont(0);
24
25 static const pool::Guid p1_guid("65AD597A-BF97-46EE-B9E3-203B35218EA7");
26 static const pool::Guid p0_guid("EA2209D1-C339-453D-AEAD-21C026F0735E");
27
28 if( this->compareClassGuid(p1_guid)) {
29
30 std::unique_ptr< TileHitVector_p1 > col_vect( this->poolReadObject< TileHitVector_p1 >() );
31 trans_cont = converter_p1.createTransient( col_vect.get(), mlog );
32
33 } else if( this->compareClassGuid(p0_guid)) {
34
35 // old version from before TP separation
37 size_t size = oldVec->size();
38 trans_cont = new TileHitVector();
39 trans_cont->reserve(size);
40 // copy all hits to new vector
41
42 for (TileHit* hit : *oldVec) {
43 trans_cont->push_back(*hit);
44 }
45
46 delete oldVec;
47
48 } else {
49 throw std::runtime_error("Unsupported persistent version of Data container");
50 }
51
52 return trans_cont;
53}
TileHitVector_p1 TileHitVector_PERS
AtlasHitsVector< TileHit > TileHitVector
AthenaHitsVector< TileHit > TileOldHitVector
size_type size() const
void push_back(const T &t)
void reserve(size_type n)
virtual PERS * createPersistent(const TRANS *transObj, MsgStream &log)
virtual bool compareClassGuid(const Guid &clid) const
virtual TileHitVector * createTransient(const TileHitVector_p1 *persObj, MsgStream &log)
Create transient representation of a persistent object.
TileHitVector * createTransient()
TileHitVector_PERS * createPersistent(TileHitVector *transCont)