ATLAS Offline Software
TrigElectronContainerCnv.cxx
Go to the documentation of this file.
1 /*
2  Copyright (C) 2002-2022 CERN for the benefit of the ATLAS collaboration
3 */
4 
7 
8 //create persistent
10 {
11  MsgStream mlog(msgSvc(), "TrigElectronContainerConverter" );
12  mlog << MSG::DEBUG << "TrigElectronContainerCnv::createPersistent" << endmsg;
13 
15 
16  return persObj;
17 }
18 
19 //create transient
21 {
22  MsgStream mlog(msgSvc(), "TrigElectronContainerConverter" );
23  mlog << MSG::DEBUG << "TrigElectronContainerCnv::createTransient" << endmsg;
24 
25  static const pool::Guid p3_guid("F2E0066A-3BC5-44F2-A18C-57C63481988D");
26  static const pool::Guid tlp2_guid("2EDB14B9-0B61-4014-90C2-20AEB7AAFEBE");
27  static const pool::Guid tlp1_guid("8831D2A9-F4B6-40BE-97C1-4BD7F9468267");
28  static const pool::Guid p0_guid2("2F97E0FB-7C93-4616-B322-1A01BF65D331");
29  static const pool::Guid p0_guid1("EA6EA1A5-16FC-4DBF-896E-D933B25E65E0");
30 
31  if( compareClassGuid( p3_guid ) ){
32  std::unique_ptr< TrigElectronContainer_p3 > col_vect( poolReadObject< TrigElectronContainer_p3 >() );
33  // std::cout << "Reading IMFC p3" << std::endl;
34  return m_converter.createTransient( col_vect.get(), mlog ) ;
35 
36  } else if ( compareClassGuid(tlp2_guid) ) {
37 
38  std::unique_ptr< TrigElectronContainer_tlp2 > col_vect( poolReadObject< TrigElectronContainer_tlp2 >() );
39  return m_converter_tlp2.createTransient( col_vect.get(), mlog );
40 
41  } else if ( compareClassGuid(tlp1_guid) ) {
42 
43  std::unique_ptr< TrigElectronContainer_tlp1 > col_vect( poolReadObject< TrigElectronContainer_tlp1 >() );
44  return m_converter_tlp1.createTransient( col_vect.get(), mlog );
45 
46  } else if ( compareClassGuid(p0_guid1) || compareClassGuid(p0_guid2) ) {
47 
48  // old version from before TP separation, just return it
49  return poolReadObject<TrigElectronContainer>();
50 
51  } else {
52 
53  throw std::runtime_error("Unsupported persistent version of Data container");
54 
55  }
56 
57 }
TPPolyCnvBase::createTransient
virtual TRANS * createTransient(const PERS *persObj, MsgStream &log)
Create transient representation of a persistent object.
TrigElectronContainerCnv::createTransient
virtual TrigElectronContainer * createTransient()
Definition: TrigElectronContainerCnv.cxx:20
TrigElectronContainerCnv::m_converter_tlp1
TrigElectronContainerCnv_tlp1 m_converter_tlp1
Definition: TrigElectronContainerCnv.h:34
TPAbstractPolyCnvBase::createPersistent
virtual PERS * createPersistent(const TRANS *transObj, MsgStream &log)
Create persistent representation of a transient object.
pool::Guid
::Guid Guid
Definition: T_AthenaPoolCustCnv.h:19
TopLevelTPConverter::createTransient
TRANS * createTransient(MsgStream &log)
Create transient representation of the persistent object known to this converter.
Definition: TopLevelTPConverter.h:62
python.InDetPriVxFinderConfig.mlog
mlog
Definition: InDetPriVxFinderConfig.py:134
StdJOSetup.msgSvc
msgSvc
Provide convenience handles for various services.
Definition: StdJOSetup.py:36
endmsg
#define endmsg
Definition: AnalysisConfig_Ntuple.cxx:63
TrigElectronContainer_p3.h
TrigElectronContainerCnv::createPersistent
virtual TrigElectronContainer_PERS * createPersistent(TrigElectronContainer *transCont)
Definition: TrigElectronContainerCnv.cxx:9
TrigElectronContainerCnv::m_converter_tlp2
TrigElectronContainerCnv_tlp2 m_converter_tlp2
Definition: TrigElectronContainerCnv.h:35
DEBUG
#define DEBUG
Definition: page_access.h:11
TrigElectronContainerCnv::m_converter
TrigElectronContainerCnv_p3 m_converter
Definition: TrigElectronContainerCnv.h:36
T_AthenaPoolCustCnv::compareClassGuid
virtual bool compareClassGuid(const Guid &clid) const
Compare POOL class GUID with the one of the object being read.
TrigElectronContainer_p3
Definition: TrigElectronContainer_p3.h:10
TrigElectronContainer
File: TrigElectronContainer.h.
Definition: Trigger/TrigEvent/TrigParticle/TrigParticle/TrigElectronContainer.h:32
TrigElectronContainerCnv.h