ATLAS Offline Software
Loading...
Searching...
No Matches
RpcPrepDataContainerCnv.cxx
Go to the documentation of this file.
1/*
2 Copyright (C) 2002-2022 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
14// Id includes
18
19
20
24
26
28 // Call base clase initialize
30 return StatusCode::FAILURE;
31
32 // msgSvc()->setOutputLevel( "RpcPrepDataContainerCnv", MSG::DEBUG );
33
34 // Get the messaging service, print where you are
35 MsgStream log(msgSvc(), "RpcPrepDataContainerCnv");
36 log << MSG::INFO << "RpcPrepDataContainerCnv::initialize()" << endmsg;
37
38 return StatusCode::SUCCESS;
39}
40
42 MsgStream log(msgSvc(), "RpcPrepDataContainerCnv" );
43 if (log.level() <= MSG::DEBUG) log<<MSG::DEBUG<<"createPersistent(): main converter"<<endmsg;
44 RpcPrepDataContainer_PERS *pers= m_converter_p3.createPersistent( transCont, log );
45 return pers;
46}
47
49 MsgStream log(msgSvc(), "RpcPrepDataContainerCnv" );
50 static const pool::Guid p0_guid("CCD4055C-2A39-CAFF-3F82-5A9116ADAFCB"); // before t/p split
51 static const pool::Guid p1_guid("F29233F8-F488-4D6D-97F9-4BCA1976BD9F"); // with RpcPrepData_tlp1
52 // static const pool::Guid p2_guid("F29233F8-F488-4D6D-97F9-4BCA1976BD9F"); // with RpcPrepData_tlp2
53 static const pool::Guid p3_guid("65496D1F-E660-42A9-84C9-2002D39B87CB"); // with RpcPrepDataContainer_p3
54
55 if (log.level() <= MSG::DEBUG) log<<MSG::DEBUG<<"createTransient(): main converter"<<endmsg;
56 Muon::RpcPrepDataContainer* p_collection(nullptr);
57 if( compareClassGuid(p3_guid) ) {
58 if (log.level() <= MSG::DEBUG) log<<MSG::DEBUG<<"createTransient(): T/P version 3 detected"<<endmsg;
59 std::unique_ptr< Muon::RpcPrepDataContainer_p3 > p_coll( poolReadObject< Muon::RpcPrepDataContainer_p3 >() );
60 p_collection = m_converter_p3.createTransient( p_coll.get(), log );
61 } else if( compareClassGuid(p1_guid) ) {
62 RpcPrepDataContainerCnv_tlp1 tpConvertor_p1;
63 std::unique_ptr< Muon::RpcPrepDataContainer_tlp1 > col_vect( poolReadObject< Muon::RpcPrepDataContainer_tlp1 >() );
64 p_collection = m_TPConverter.createTransient( col_vect.get(), log );
65 if (log.level() <= MSG::DEBUG) log<<MSG::DEBUG<<"createTransient(): T/P version 1 detected"<<endmsg;
66 }
67 //----------------------------------------------------------------
68 else if( compareClassGuid(p0_guid) ) {
69 if (log.level() <= MSG::DEBUG) log<<MSG::DEBUG<<"createTransient(): Old input file"<<std::endl;
70 throw std::runtime_error("Not supporting reading non TP-split PRDs");
71 }
72 else {
73 throw std::runtime_error("Unsupported persistent version of RpcPrepDataContainer");
74
75 }
76 return p_collection;
77}
#define endmsg
T_AthenaPoolCustomCnv< Muon::RpcPrepDataContainer, RpcPrepDataContainer_PERS > RpcPrepDataContainerCnvBase
Muon::RpcPrepDataContainer_p3 RpcPrepDataContainer_PERS
virtual StatusCode initialize()
Gaudi Service Interface method implementations:
RpcPrepDataContainerCnv_tlp1 m_TPConverter
Muon::RpcPrepDataContainerCnv_p3 m_converter_p3
virtual ~RpcPrepDataContainerCnv()
virtual Muon::RpcPrepDataContainer * createTransient()
virtual RpcPrepDataContainer_PERS * createPersistent(Muon::RpcPrepDataContainer *transCont)
RpcPrepDataContainerCnv(ISvcLocator *svcloc)
MuonPrepDataContainerT< RpcPrepData > RpcPrepDataContainer