ATLAS Offline Software
TrackParticleContainerCnv.cxx
Go to the documentation of this file.
1 /*
2  Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration
3 */
4 
5 //-----------------------------------------------------------------------------
6 //
7 // file: TrackParticleContainerCnv.cxx
8 // author: Andreas Wildauer
9 //
10 //-----------------------------------------------------------------------------
13 #include <iostream>
14 //-----------------------------------------------------------------------------
15 // Constructor
16 //-----------------------------------------------------------------------------
17 
20  m_msgSvc( msgSvc() )
21  {}
22 
23 //-----------------------------------------------------------------------------
24 // Initializer
25 //-----------------------------------------------------------------------------
27 {
29  return StatusCode::SUCCESS;
30 }//end of initialize method
31 
34 {
36 
37  return tpBaseCont;
38 }//end of create persistent method
39 
41 {
42  std::string logname = "TrackParticleContainerCnv";
43  const DataObject* dObj = getDataObject();
44  if (dObj) {
45  logname += dObj->name();
46  }
47  MsgStream log (m_msgSvc, logname);
48  static const pool::Guid p3_guid( "8C84D957-1899-4C98-A49D-D6AC0F85C5EC" );
49  static const pool::Guid p2_guid( "170211F9-C4E1-4173-B0FB-71322899C8B9" );
50  static const pool::Guid p1_guid( "4A8CEB2C-0833-4C83-8514-A69928DE4672" );
51  static const pool::Guid p0_guid( "35BE1E01-658C-438A-AC86-F951006ECC6B" );
52 
53  Rec::TrackParticleContainer *p_collection = 0;
54  if( compareClassGuid( p3_guid ) ) {
55  // std::cout<<"TrackParticleContainerCnv::createTransient p3_guid"<<std::endl;
56 
57  poolReadObject< Rec::TrackParticleContainer_tlp3 >(m_TPConverter_tlp3);
58  p_collection = m_TPConverter_tlp3.createTransient(log);
59  }
60  else if( compareClassGuid( p2_guid ) ) {
61  // std::cout<<"TrackParticleContainerCnv::createTransient p2_guid"<<std::endl;
62 
63  poolReadObject< Rec::TrackParticleContainer_tlp2 >(m_TPConverter_tlp2);
64  p_collection = m_TPConverter_tlp2.createTransient(log);
65  }
66  else if( compareClassGuid( p1_guid ) ) {
67  poolReadObject< Rec::TrackParticleContainer_tlp1 >(m_TPConverter_tlp1);
68  p_collection = m_TPConverter_tlp1.createTransient(log);
69  }
70  else if( compareClassGuid( p0_guid ) ) {
71  p_collection = poolReadObject< Rec::TrackParticleContainer >();
72  }
73  else {
74  throw std::runtime_error( "Unsupported persistent version of Rec::TrackParticleContainer" );
75  }
76 
77  return p_collection;
78 
79 }//end of create transient method
80 
81 
TrackParticleContainerCnv::m_TPConverter_tlp2
TrackParticleContainerCnv_tlp2 m_TPConverter_tlp2
Definition: TrackParticleContainerCnv.h:58
AthCheckMacros.h
TrackParticleContainerCnv::m_TPConverter_tlp3
TrackParticleContainerCnv_tlp3 m_TPConverter_tlp3
Definition: TrackParticleContainerCnv.h:59
TrackParticleContainerCnv::TrackParticleContainerCnv
TrackParticleContainerCnv(ISvcLocator *svcloc)
Definition: TrackParticleContainerCnv.cxx:18
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
StdJOSetup.msgSvc
msgSvc
Provide convenience handles for various services.
Definition: StdJOSetup.py:36
T_AthenaPoolCustomCnv
Compatibility for old converter classes that don't get passed the key.
Definition: T_AthenaPoolCustomCnv.h:132
TrackParticleContainerCnv::createTransient
virtual Rec::TrackParticleContainer * createTransient() override
Definition: TrackParticleContainerCnv.cxx:40
EL::StatusCode
::StatusCode StatusCode
StatusCode definition for legacy code.
Definition: PhysicsAnalysis/D3PDTools/EventLoop/EventLoop/StatusCode.h:22
TrackParticleContainerCnv::createPersistent
virtual TrackParticleContainer_PERS * createPersistent(Rec::TrackParticleContainer *transCont) override
Definition: TrackParticleContainerCnv.cxx:33
ATH_CHECK
#define ATH_CHECK
Definition: AthCheckMacros.h:40
AthMessaging::msg
MsgStream & msg() const
The standard message stream.
Definition: AthMessaging.h:164
Rec::TrackParticleContainer
Definition: Reconstruction/Particle/Particle/TrackParticleContainer.h:33
python.CaloCondTools.log
log
Definition: CaloCondTools.py:20
TrackParticleContainerCnv::initialize
virtual StatusCode initialize() override
Gaudi Service Interface method implementations:
Definition: TrackParticleContainerCnv.cxx:26
Rec::TrackParticleContainer_tlp3
Definition: TrackParticleContainer_tlp3.h:36
AthenaPoolConverter::getDataObject
virtual const DataObject * getDataObject() const
Definition: AthenaPoolConverter.cxx:267
TrackParticleContainerCnv::m_TPConverter_tlp1
TrackParticleContainerCnv_tlp1 m_TPConverter_tlp1
Definition: TrackParticleContainerCnv.h:57
TopLevelTPConverter::createPersistent
virtual TL_PERS * createPersistent(const TRANS *transObj, MsgStream &log)
Create persistent representation of transObj.
Definition: TopLevelTPConverter.h:110
T_AthenaPoolCustCnv::compareClassGuid
virtual bool compareClassGuid(const Guid &clid) const
Compare POOL class GUID with the one of the object being read.
TrackParticleContainerCnv::m_msgSvc
IMessageSvc * m_msgSvc
Definition: TrackParticleContainerCnv.h:56
T_AthenaPoolCustCnv::initialize
virtual StatusCode initialize()
Gaudi Service Interface method implementations:
TrackParticleContainerCnv.h
MakeSliceSet.logname
logname
Definition: MakeSliceSet.py:34