ATLAS Offline Software
MMSimHitCollectionCnv.cxx
Go to the documentation of this file.
1 /*
2  Copyright (C) 2002-2024 CERN for the benefit of the ATLAS collaboration
3 */
4 
6 
7 // Gaudi
8 #include "GaudiKernel/StatusCode.h"
9 #include "GaudiKernel/MsgStream.h"
10 
11 // Athena
12 #include "StoreGate/StoreGateSvc.h"
13 
18 #include "HitManagement/AthenaHitsVector.h" //for back-compatibility
19 
20 
23 {
24 }
25 
27 
29  MsgStream log(msgSvc(), "MMSimHitCollectionCnv" );
30  ATH_MSG_DEBUG("createPersistent(): main converter");
32  return pixdc_p;
33 }
34 
36  MsgStream log(msgSvc(), "MMSimHitCollectionCnv" );
37  static const pool::Guid p1_guid("ac0b677c-fe08-11e8-b174-02163e018187");
38  static const pool::Guid p2_guid("b9bdd436-fe08-11e8-a40f-02163e018187");
39  static const pool::Guid p3_guid("018E2DAC-18EB-7EAA-A141-F0FD2A6E1E06");
40  ATH_MSG_DEBUG("createTransient(): main converter");
41  MMSimHitCollection* p_collection(nullptr);
42  if( compareClassGuid(p3_guid) ) {
43  ATH_MSG_DEBUG("createTransient(): T/P version 3 detected");
44  std::unique_ptr< Muon::MMSimHitCollection_p3 > col_vect( this->poolReadObject< Muon::MMSimHitCollection_p3 >() );
45  p_collection = m_TPConverter_p3.createTransient( col_vect.get(), log );
46  } else if( compareClassGuid(p2_guid) ) {
47  ATH_MSG_DEBUG("createTransient(): T/P version 2 detected");
48  std::unique_ptr< Muon::MMSimHitCollection_p2 > col_vect( this->poolReadObject< Muon::MMSimHitCollection_p2 >() );
49  p_collection = m_TPConverter_p2.createTransient( col_vect.get(), log );
50  } else if( compareClassGuid(p1_guid) ) {
51  ATH_MSG_DEBUG("createTransient(): T/P version 1 detected");
52  std::unique_ptr< Muon::MMSimHitCollection_p1 > col_vect( this->poolReadObject< Muon::MMSimHitCollection_p1 >() );
53  p_collection = m_TPConverter_p1.createTransient( col_vect.get(), log );
54  }
55  //----------------------------------------------------------------
56  else {
57  throw std::runtime_error("Unsupported persistent version of MMSimHitCollection");
58 
59  }
60  return p_collection;
61 }
MMSimHitCollectionCnv::m_TPConverter_p3
MMSimHitCollectionCnv_p3 m_TPConverter_p3
Definition: MMSimHitCollectionCnv.h:39
AthenaHitsVector.h
MMSimHitCollectionCnv.h
AtlasHitsVector
Definition: AtlasHitsVector.h:33
Muon::MMSimHitCollection_p2
Definition: MMSimHitCollection_p2.h:13
TPAbstractPolyCnvBase::createPersistent
virtual PERS * createPersistent(const TRANS *transObj, MsgStream &log)
Create persistent representation of a transient object.
MMSimHitCollectionCnv::~MMSimHitCollectionCnv
virtual ~MMSimHitCollectionCnv()
MMSimHitCollectionCnv::createPersistent
virtual MMSimHitCollection_PERS * createPersistent(MMSimHitCollection *transCont)
Definition: MMSimHitCollectionCnv.cxx:28
MMSimHitCollectionCnv::createTransient
virtual MMSimHitCollection * createTransient()
Definition: MMSimHitCollectionCnv.cxx:35
pool::Guid
::Guid Guid
Definition: T_AthenaPoolCustCnv.h:19
MMSimHitCollectionCnv_p3::createTransient
virtual MMSimHitCollection * createTransient(const Muon::MMSimHitCollection_p3 *persObj, MsgStream &log)
Definition: MMSimHitCollectionCnv_p3.cxx:63
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
ATH_MSG_DEBUG
#define ATH_MSG_DEBUG(x)
Definition: AthMsgStreamMacros.h:29
MMSimHitCollectionCnv::m_TPConverter_p1
MMSimHitCollectionCnv_p1 m_TPConverter_p1
Definition: MMSimHitCollectionCnv.h:37
MMSimHitCollectionCnv_p2::createTransient
virtual MMSimHitCollection * createTransient(const Muon::MMSimHitCollection_p2 *persObj, MsgStream &log)
Definition: MMSimHitCollectionCnv_p2.cxx:63
MMSimHitCollectionCnv_p1::createTransient
virtual MMSimHitCollection * createTransient(const Muon::MMSimHitCollection_p1 *persObj, MsgStream &log)
Definition: MMSimHitCollectionCnv_p1.cxx:63
MMSimHitCollection_p2.h
MMSimHitCollection_p1.h
MMSimHitCollection.h
MMSimHitCollection_p3.h
MMSimHitCollectionCnv::m_TPConverter_p2
MMSimHitCollectionCnv_p2 m_TPConverter_p2
Definition: MMSimHitCollectionCnv.h:38
python.CaloCondTools.log
log
Definition: CaloCondTools.py:20
T_AthenaPoolCustCnv::compareClassGuid
virtual bool compareClassGuid(const Guid &clid) const
Compare POOL class GUID with the one of the object being read.
MMSimHitCollectionCnv::MMSimHitCollectionCnv
MMSimHitCollectionCnv(ISvcLocator *svcloc)
Definition: MMSimHitCollectionCnv.cxx:21
StoreGateSvc.h