ATLAS Offline Software
Loading...
Searching...
No Matches
TgcPrepDataContainerCnv.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
23
25
27 // Call base clase initialize
29 return StatusCode::FAILURE;
30
31// msgSvc()->setOutputLevel( "TgcPrepDataContainerCnv", MSG::DEBUG );
32
33 // Get the messaging service, print where you are
34 MsgStream log(msgSvc(), "TgcPrepDataContainerCnv");
35 if (log.level() <= MSG::INFO) log << MSG::INFO << "TgcPrepDataContainerCnv::initialize()" << endmsg;
36
37 return StatusCode::SUCCESS;
38}
39
41 MsgStream log(msgSvc(), "TgcPrepDataContainerCnv" );
42 if (log.level() <= MSG::DEBUG) log<<MSG::DEBUG<<"createPersistent(): main converter"<<endmsg;
43 TgcPrepDataContainer_PERS *pers= m_converter_p3.createPersistent( transCont, log );
44 return pers;
45}
46
48 MsgStream log(msgSvc(), "TgcPrepDataContainerCnv" );
49 static const pool::Guid p0_guid("04E7158E-416B-8E31-D370-616631B8617E"); // before t/p split
50 static const pool::Guid p1_guid("8C563637-620B-43A0-9A5D-E0BC09496745"); // with TgcPrepData_tlp1
51 static const pool::Guid p2_guid("EBB4DCEC-CE23-4A30-BEF7-F3150E4060CB"); // with TgcPrepDataContainerCnv_p2
52 static const pool::Guid p3_guid("215726D6-15F4-41D2-B808-1B9E9FD84166"); // with TgcPrepDataContainerCnv_p3
53
54
55 if (log.level() <= MSG::DEBUG) log<<MSG::DEBUG<<"createTransient(): main converter"<<endmsg;
56 Muon::TgcPrepDataContainer* 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::TgcPrepDataContainer_p3 > p_coll( poolReadObject< Muon::TgcPrepDataContainer_p3 >() );
60 p_collection = m_converter_p3.createTransient( p_coll.get(), log );
61 } else if( compareClassGuid(p2_guid) ) {
62 if (log.level() <= MSG::DEBUG) log<<MSG::DEBUG<<"createTransient(): T/P version 2 detected"<<endmsg;
63 std::unique_ptr< Muon::TgcPrepDataContainer_p2 > p_coll( poolReadObject< Muon::TgcPrepDataContainer_p2 >() );
64 p_collection = m_converter_p2.createTransient( p_coll.get(), log );
65 } else if( compareClassGuid(p1_guid) ) {
66 TgcPrepDataContainerCnv_tlp1 tpConvertor_p1;
67 std::unique_ptr< Muon::TgcPrepDataContainer_tlp1 > col_vect( poolReadObject< Muon::TgcPrepDataContainer_tlp1 >() );
68 p_collection = m_TPConverter.createTransient( col_vect.get(), log );
69 if (log.level() <= MSG::DEBUG) log<<MSG::DEBUG<<"createTransient(): T/P version 1 detected"<<endmsg;
70 }
71 //----------------------------------------------------------------
72 else if( compareClassGuid(p0_guid) ) {
73 if (log.level() <= MSG::DEBUG) log<<MSG::DEBUG<<"createTransient(): Old input file"<<std::endl;
74 throw std::runtime_error("Not currently supporting reading non TP-split PRDs");
75 //std::unique_ptr< TgcPrepDataContainer_p0 > col_vect( poolReadObject< TgcPrepDataContainer_p0 >() );
76 //p_collection = m_converter_p0.createTransient( col_vect.get(), log );
77 }
78 else {
79 throw std::runtime_error("Unsupported persistent version of TgcPrepDataContainer");
80
81 }
82 return p_collection;
83}
#define endmsg
Muon::TgcPrepDataContainer_p3 TgcPrepDataContainer_PERS
T_AthenaPoolCustomCnv< Muon::TgcPrepDataContainer, TgcPrepDataContainer_PERS > TgcPrepDataContainerCnvBase
TgcPrepDataContainerCnv_tlp1 m_TPConverter
TgcPrepDataContainerCnv(ISvcLocator *svcloc)
virtual Muon::TgcPrepDataContainer * createTransient()
virtual TgcPrepDataContainer_PERS * createPersistent(Muon::TgcPrepDataContainer *transCont)
virtual StatusCode initialize()
Gaudi Service Interface method implementations:
Muon::TgcPrepDataContainerCnv_p2 m_converter_p2
Muon::TgcPrepDataContainerCnv_p3 m_converter_p3
virtual ~TgcPrepDataContainerCnv()
MuonPrepDataContainerT< TgcPrepData > TgcPrepDataContainer