ATLAS Offline Software
Loading...
Searching...
No Matches
TRTUncompressedHitCollectionCnv.cxx
Go to the documentation of this file.
1/*
2 Copyright (C) 2002-2024 CERN for the benefit of the ATLAS collaboration
3*/
4
13
14
16 MsgStream mlog(msgSvc(), "TRT_HitCollectionConverter" );
18 TRT_HitCollection_PERS *persObj = converter.createPersistent( transCont, mlog );
19 return persObj;
20}
21
22
24 MsgStream mlog(msgSvc(), "TRT_HitCollectionConverter" );
25 TRT_HitCollectionCnv_p1 converter_p1;
26 TRT_HitCollectionCnv_p2 converter_p2;
27 TRT_HitCollectionCnv_p3 converter_p3;
28 TRT_HitCollectionCnv_p4 converter_p4;
29 TRT_HitCollectionCnv_p5 converter_p5;
30 static const pool::Guid p1_guid("6688E934-157E-421A-B6D1-A35FC8BD651C");
31 static const pool::Guid p2_guid("473FF621-3466-4D87-9469-4780A6A77023");
32 static const pool::Guid p3_guid("FB5F5BFC-43E5-44E1-B79C-C330C1480E2E");
33 static const pool::Guid p4_guid("73BECF03-4C45-491E-A973-A1C4402AD018");
34 static const pool::Guid p5_guid("018E1E3D-8B69-7BDF-B1E9-D5D09F3CF750");
35 static const pool::Guid old_guid("35722E01-C4E3-420E-8A7E-E375C5E7989D");
36
37
38 TRTUncompressedHitCollection *trans_cont(nullptr);
39 if( this->compareClassGuid(p4_guid)) {
40 std::unique_ptr< TRT_HitCollection_p4 > col_vect( this->poolReadObject< TRT_HitCollection_p4 >() );
41 trans_cont = converter_p4.createTransient( col_vect.get(), mlog );
42 }
43 else if( this->compareClassGuid(p1_guid)) {
44 std::unique_ptr< TRT_HitCollection_p1 > col_vect( this->poolReadObject< TRT_HitCollection_p1 >() );
45 trans_cont = converter_p1.createTransient( col_vect.get(), mlog );
46 }
47 else if( this->compareClassGuid(p2_guid)) {
48 std::unique_ptr< TRT_HitCollection_p2 > col_vect( this->poolReadObject< TRT_HitCollection_p2 >() );
49 trans_cont = converter_p2.createTransient( col_vect.get(), mlog );
50 }
51 else if( this->compareClassGuid(p3_guid)) {
52 std::unique_ptr< TRT_HitCollection_p3 > col_vect( this->poolReadObject< TRT_HitCollection_p3 >() );
53 trans_cont = converter_p3.createTransient( col_vect.get(), mlog );
54 }
55 else if( this->compareClassGuid(p5_guid)) {
56 std::unique_ptr< TRT_HitCollection_p5 > col_vect( this->poolReadObject< TRT_HitCollection_p5 >() );
57 trans_cont = converter_p5.createTransient( col_vect.get(), mlog );
58 }
59 else if( this->compareClassGuid(old_guid)) {
60 // old version from before TP separation - convert to new transient format
62 size_t size = oldColl->size();
63 trans_cont=new TRTUncompressedHitCollection("DefaultCollectionName",size);
64 //do the copy
65 for (TRTUncompressedHit* hit : *oldColl) {
66 trans_cont->push_back(*hit);
67 }
68 delete oldColl;
69 } else {
70 throw std::runtime_error("Unsupported persistent version of Data container");
71 }
72 return trans_cont;
73}
TRT_HitCollectionCnv_p4 TRT_HitCollectionCnv_PERS
TRT_HitCollection_p4 TRT_HitCollection_PERS
AtlasHitsVector< TRTUncompressedHit > TRTUncompressedHitCollection
T_AtlasHitsVectorCnv< TRTUncompressedHitCollection, TRT_HitCollection_p1, TRT_HitCnv_p1 > TRT_HitCollectionCnv_p1
size_type size() const
void push_back(const T &t)
virtual PERS * createPersistent(const TRANS *transObj, MsgStream &log)
Create persistent representation of a transient object.
virtual TRANS * createTransient(const PERS *persObj, MsgStream &log)
TRT_HitCollection_PERS * createPersistent(TRTUncompressedHitCollection *transCont)
TRTUncompressedHitCollection * createTransient()
virtual TRTUncompressedHitCollection * createTransient(const TRT_HitCollection_p2 *persObj, MsgStream &log)
virtual TRTUncompressedHitCollection * createTransient(const TRT_HitCollection_p3 *persObj, MsgStream &log)
virtual TRTUncompressedHitCollection * createTransient(const TRT_HitCollection_p4 *persObj, MsgStream &log)
virtual TRTUncompressedHitCollection * createTransient(const TRT_HitCollection_p5 *persObj, MsgStream &log)