ATLAS Offline Software
LUCID_SimHitCollectionCnv.cxx
Go to the documentation of this file.
1 /*
2  Copyright (C) 2002-2024 CERN for the benefit of the ATLAS collaboration
3 */
4 
12 
13 
15  MsgStream mlog(msgSvc(), "LUCID_SimHitCollectionCnv");
16  mlog << MSG::DEBUG << "In LUCID_SimHitCollectionCnv::createPersistent " << endmsg;
18  LUCID_SimHitCollection_PERS* persObj = converter.createPersistent(transCont, mlog);
19  return persObj;
20 }
21 
22 
24  MsgStream mlog(msgSvc(), "LUCID_SimHitCollectionCnv");
25  mlog << MSG::DEBUG << "In LUCID_SimHitCollectionCnv::createTransient " << endmsg;
26  LUCID_SimHitCollectionCnv_p1 converter_p1;
27  LUCID_SimHitCollectionCnv_p2 converter_p2;
28  LUCID_SimHitCollectionCnv_p3 converter_p3;
29  static const pool::Guid p3_guid ("018E3850-0AAE-776B-9BDE-69C14B881C19");
30  static const pool::Guid p2_guid ("149F1834-1D98-4F35-A1B3-C9AA083D6838");
31  static const pool::Guid p1_guid ("9ACC906C-74CA-4F77-AC16-2A503358C2D1");
32  static const pool::Guid old_guid("7BCDF079-FD96-4B18-B1E7-FA5EDDB026F2");
33 
34  LUCID_SimHitCollection* trans_cont{};
35  if (this->compareClassGuid(p3_guid)) {
36  std::unique_ptr< LUCID_SimHitCollection_p3 > col_vect( this->poolReadObject< LUCID_SimHitCollection_p3 >());
37  trans_cont = converter_p3.createTransient(col_vect.get(), mlog);
38  }
39  else if (this->compareClassGuid(p2_guid)) {
40  std::unique_ptr< LUCID_SimHitCollection_p2 > col_vect( this->poolReadObject< LUCID_SimHitCollection_p2 >());
41  trans_cont = converter_p2.createTransient(col_vect.get(), mlog);
42  }
43  else if(this->compareClassGuid(p1_guid)) {
44  std::unique_ptr< LUCID_SimHitCollection_p1 > col_vect( this->poolReadObject< LUCID_SimHitCollection_p1 >());
45  trans_cont = converter_p1.createTransient(col_vect.get(), mlog);
46  }
47  else if(this->compareClassGuid(old_guid)) {
48  trans_cont = this->poolReadObject<LUCID_SimHitCollection>();
49  }
50  else {
51  mlog << MSG::ERROR << "BAD GUID: " << m_i_poolToken->toString() << endmsg;
52  throw std::runtime_error("Unsupported persistent version of Data container");
53  }
54  return trans_cont;
55 }
LUCID_SimHitCollectionCnv::createPersistent
virtual LUCID_SimHitCollection_PERS * createPersistent(LUCID_SimHitCollection *transCont)
Definition: LUCID_SimHitCollectionCnv.cxx:14
TPPolyCnvBase::createTransient
virtual TRANS * createTransient(const PERS *persObj, MsgStream &log)
Create transient representation of a persistent object.
AtlasHitsVector
Definition: AtlasHitsVector.h:33
TPAbstractPolyCnvBase::createPersistent
virtual PERS * createPersistent(const TRANS *transObj, MsgStream &log)
Create persistent representation of a transient object.
LUCID_SimHitCollectionCnv_p3.h
pool::Guid
::Guid Guid
Definition: T_AthenaPoolCustCnv.h:19
AthenaPoolConverter::m_i_poolToken
const Token * m_i_poolToken
Definition: AthenaPoolConverter.h:130
python.InDetPriVxFinderConfig.mlog
mlog
Definition: InDetPriVxFinderConfig.py:139
StdJOSetup.msgSvc
msgSvc
Provide convenience handles for various services.
Definition: StdJOSetup.py:36
LUCID_SimHit_p1.h
endmsg
#define endmsg
Definition: AnalysisConfig_Ntuple.cxx:63
LUCID_SimHit_p3.h
LUCID_SimHit_p2.h
T_AtlasHitsVectorCnv
Definition: TPConverter.h:1234
LUCID_SimHitCollectionCnv_p2.h
LUCID_SimHitCollection_p2
Definition: LUCID_SimHitCollection_p2.h:13
LUCID_SimHitCollectionCnv_p1.h
Token::toString
virtual const std::string toString() const
Retrieve the string representation of the token.
Definition: Token.cxx:114
LUCID_SimHitCollectionCnv::createTransient
virtual LUCID_SimHitCollection * createTransient()
Definition: LUCID_SimHitCollectionCnv.cxx:23
LUCID_SimHitCollectionCnv.h
DEBUG
#define DEBUG
Definition: page_access.h:11
T_AthenaPoolCustCnv::compareClassGuid
virtual bool compareClassGuid(const Guid &clid) const
Compare POOL class GUID with the one of the object being read.