ATLAS Offline Software
Loading...
Searching...
No Matches
LArHitContainerCnv.cxx
Go to the documentation of this file.
1/*
2 Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration
3*/
4
9
11 MsgStream mlog(msgSvc(), "LArHitContainerConverter" );
12 LArHitContainerCnv_p2 converter;
13 LArHitContainer_PERS *persObj = converter.createPersistent( transCont, mlog );
14 return persObj;
15}
16
17
19 MsgStream mlog(msgSvc(), "LArHitContainerConverter" );
20 LArHitContainerCnv_p1 converter_p1;
21 LArHitContainerCnv_p2 converter_p2;
22
23 LArHitContainer *trans_cont(0);
24
25 static const pool::Guid p2_guid("1F1DE705-E0CE-4F0E-941A-C405CB2CD137");
26 static const pool::Guid p1_guid("ED1ECB80-B38C-46DE-94BF-22F9379796DB");
27 static const pool::Guid p0_guid("32703AED-CAA5-45ED-B804-8556900CA6B5");
28
29 if( this->compareClassGuid(p2_guid)) {
30 std::unique_ptr< LArHitContainer_p2 > col_vect( this->poolReadObject< LArHitContainer_p2 >() );
31 trans_cont = converter_p2.createTransient( col_vect.get(), mlog );
32 }
33 else if( this->compareClassGuid(p1_guid)) {
34 std::unique_ptr< LArHitContainer_p1 > col_vect( this->poolReadObject< LArHitContainer_p1 >() );
35 trans_cont = converter_p1.createTransient( col_vect.get(), mlog );
36 }
37 else if( this->compareClassGuid(p0_guid)) {
38 // old version from before TP separation, just return it
39 trans_cont = this->poolReadObject<LArHitContainer>();
40 } else {
41 throw std::runtime_error("Unsupported persistent version of Data container");
42 }
43 return trans_cont;
44}
LArHitContainer_p2 LArHitContainer_PERS
T_AthenaHitsVectorCnv< LArHitContainer, LArHitContainer_p1, LArHitCnv_p1 > LArHitContainerCnv_p1
LArHitContainer_PERS * createPersistent(LArHitContainer *transCont)
LArHitContainer * createTransient()
Hit collection.
virtual PERS * createPersistent(const TRANS *transObj, MsgStream &log)
Create persistent representation of a transient object.
virtual TRANS * createTransient(const PERS *persObj, MsgStream &log)
Create transient representation of a persistent object.