ATLAS Offline Software
Loading...
Searching...
No Matches
LArRawChannelContainerCnv.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#include "GaudiKernel/StatusCode.h"
8#include "GaudiKernel/MsgStream.h"
11
12// LArRawChannelContainerCnv, used for T/P separation
13// real work is done in LArRawChannelContainerCnv_p2 for reading new data or
14// below for reading old data
15// author R.Seuster <seuster@cern.ch>
16
17template<>
20{
21 MsgStream log(msgSvc(), "LArRawChannelContainerConverter" );
23 LArRawChannelContainer_p4 *persObj = converter.createPersistent( transCont, log );
24 return persObj;
25}
26
27template<>
30{
31 MsgStream log(msgSvc(), "LArRawChannelContainerConverter" );
32 LArRawChannelContainer *trans_cont = NULL;
33
34 // GUID for new and old persistent classes
35 static const pool::Guid guid_p4("E3B70B7A-0D69-429A-AD43-B68941E879FB");
36 static const pool::Guid guid_p3("95401B94-3D69-49BD-B901-C7B71940D746");
37 static const pool::Guid guid_p2("AD521521-4043-472B-BF8B-FDFDC1870FD9");
38 static const pool::Guid guid_p1("1569AF5C-5F27-4C02-A87B-47FF192F1605");
39 static const pool::Guid guid_p0("9D624DCE-B943-4515-B33A-6F6928F8EB90");
40 // even newer representation of LArRawChannelContainer
41 if( compareClassGuid(guid_p4) ) {
43 std::unique_ptr<LArRawChannelContainer_p4> col_vect( poolReadObject<LArRawChannelContainer_p4>() );
44 trans_cont = converter.createTransient( col_vect.get(), log );
45 }
46 else if( compareClassGuid(guid_p3) ) {
48 std::unique_ptr<LArRawChannelContainer_p3> col_vect( poolReadObject<LArRawChannelContainer_p3>() );
49 trans_cont = converter.createTransient( col_vect.get(), log );
50 }
51 // new representation of LArRawChannelContainer
52 else if( compareClassGuid(guid_p2) ) {
54 std::unique_ptr<LArRawChannelContainer_p2> col_vect( poolReadObject<LArRawChannelContainer_p2>() );
55 trans_cont = converter.createTransient( col_vect.get(), log );
56
57 }
58 // previous representation of LArRawChannelContainer
59 else if( compareClassGuid(guid_p1) )
60 {
62 std::unique_ptr<LArRawChannelContainer_p1> col_vect( poolReadObject<LArRawChannelContainer_p1>() );
63 trans_cont = converter.createTransient( col_vect.get(), log );
64 }
65 // old representation of LArRawChannelContainer
66 else if( compareClassGuid(guid_p0) )
67 {
68 log << MSG::ERROR << "Reading of version 0 of LArRawChannelContainer not supported any more" << endmsg;
69
70 }
71 else {
72// log << MSG::ERROR << "failed trying to read : " << m_token << endmsg;
73 throw std::runtime_error("Unsupported persistent version of LArRawChannel container");
74 }
75 return trans_cont;
76}
#define endmsg
LArRawChannelContainer_p4 LArRawChannelContainer_PERSISTENT
Persistent LArRawChannelContainer, version p3.
Container for LArRawChannel (IDC using LArRawChannelCollection)
virtual PERS * createPersistent(const TRANS *transObj, MsgStream &log)
Create persistent representation of a transient object.
virtual TRANS * createTransient(const PERS *persObj, MsgStream &log)
Create transient representation of a persistent object.
virtual bool compareClassGuid(const Guid &clid) const