ATLAS Offline Software
Loading...
Searching...
No Matches
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
13
18#include "HitManagement/AthenaHitsVector.h" //for back-compatibility
19
20
25
27
29 MsgStream log(msgSvc(), "MMSimHitCollectionCnv" );
30 ATH_MSG_DEBUG("createPersistent(): main converter");
31 MMSimHitCollection_PERS *pixdc_p= m_TPConverter_p2.createPersistent( transCont, log );
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}
#define ATH_MSG_DEBUG(x)
T_AthenaPoolCustomCnv< MMSimHitCollection, MMSimHitCollection_PERS > MMSimHitCollectionCnvBase
Muon::MMSimHitCollection_p2 MMSimHitCollection_PERS
AtlasHitsVector< MMSimHit > MMSimHitCollection
MMSimHitCollectionCnv_p2 m_TPConverter_p2
virtual MMSimHitCollection * createTransient()
virtual ~MMSimHitCollectionCnv()
MMSimHitCollectionCnv_p3 m_TPConverter_p3
MMSimHitCollectionCnv_p1 m_TPConverter_p1
virtual MMSimHitCollection_PERS * createPersistent(MMSimHitCollection *transCont)
MMSimHitCollectionCnv(ISvcLocator *svcloc)