ATLAS Offline Software
Loading...
Searching...
No Matches
CscPrepDataContainerCnv.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
15// #include "MuonIdHelpers/CscIdHelper.h"
18
19
24
26
28 // Call base clase initialize
30 return StatusCode::FAILURE;
31
32 // msgSvc()->setOutputLevel( "CscPrepDataContainerCnv", MSG::DEBUG );
33
34 // Get the messaging service, print where you are
35 MsgStream log(msgSvc(), "CscPrepDataContainerCnv");
36 if (log.level() <= MSG::INFO) log << MSG::INFO << "CscPrepDataContainerCnv::initialize()" << endmsg;
37
38 return StatusCode::SUCCESS;
39}
40
42 MsgStream log(msgSvc(), "CscPrepDataContainerCnv" );
43 if (log.level() <= MSG::DEBUG) log<<MSG::DEBUG<<"createPersistent(): main converter"<<endmsg;
44 CscPrepDataContainer_PERS *pers= m_TPConverter.createPersistent( transCont, log );
45 // COMPRESS CscPrepDataContainer_PERS *pers= m_converter_p2.createPersistent( transCont, log );
46 return pers;
47}
48
50 MsgStream log(msgSvc(), "CscPrepDataContainerCnv" );
51 static const pool::Guid p0_guid("C48250B1-7575-DFA1-1313-01AAAF759AEA"); // before t/p split
52 static const pool::Guid p1_guid("B941657D-1ABF-4A88-B23C-6C4212CD04B3"); // with CscPrepData_tlp1
53 static const pool::Guid p2_guid("BF5DA875-6D5B-4DCA-9CD8-E0ABC4FD92F5"); // with CscPrepDataContainer_p2
54 if (log.level() <= MSG::DEBUG) log<<MSG::DEBUG<<"createTransient(): main converter"<<endmsg;
55 Muon::CscPrepDataContainer* p_collection(nullptr);
56 if( compareClassGuid(p2_guid) ) {
57 if (log.level() <= MSG::DEBUG) log<<MSG::DEBUG<<"createTransient(): T/P version 2 detected"<<endmsg;
58 std::unique_ptr< Muon::CscPrepDataContainer_p2 > p_coll( poolReadObject< Muon::CscPrepDataContainer_p2 >() );
59 p_collection = m_converter_p2.createTransient( p_coll.get(), log );
60 } else if( compareClassGuid(p1_guid) ) {
61 CscPrepDataContainerCnv_tlp1 tpConvertor_p1;
62 std::unique_ptr< Muon::CscPrepDataContainer_tlp1 > col_vect( poolReadObject< Muon::CscPrepDataContainer_tlp1 >() );
63 p_collection = m_TPConverter.createTransient( col_vect.get(), log );
64 if (log.level() <= MSG::DEBUG) log<<MSG::DEBUG<<"createTransient(): T/P version 1 detected"<<endmsg;
65 }
66 //----------------------------------------------------------------
67 else if( compareClassGuid(p0_guid) ) {
68 if (log.level() <= MSG::DEBUG) log<<MSG::DEBUG<<"createTransient(): Old input file"<<std::endl;
69 throw std::runtime_error("Not currently supporting reading non TP-split PRDs");
70 //std::unique_ptr< CscPrepDataContainer_p0 > col_vect( poolReadObject< CscPrepDataContainer_p0 >() );
71 //p_collection = m_converter_p0.createTransient( col_vect.get(), log );
72 }
73 else {
74 throw std::runtime_error("Unsupported persistent version of CscPrepDataContainer");
75
76 }
77 return p_collection;
78}
#define endmsg
Muon::CscPrepDataContainer_tlp1 CscPrepDataContainer_PERS
T_AthenaPoolCustomCnv< Muon::CscPrepDataContainer, CscPrepDataContainer_PERS > CscPrepDataContainerCnvBase
Muon::CscPrepDataContainerCnv_p2 m_converter_p2
virtual CscPrepDataContainer_PERS * createPersistent(Muon::CscPrepDataContainer *transCont)
virtual Muon::CscPrepDataContainer * createTransient()
virtual ~CscPrepDataContainerCnv()
virtual StatusCode initialize()
Gaudi Service Interface method implementations:
CscPrepDataContainerCnv_tlp1 m_TPConverter
CscPrepDataContainerCnv(ISvcLocator *svcloc)
MuonPrepDataContainerT< CscPrepData > CscPrepDataContainer