ATLAS Offline Software
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 
17 template<>
20 {
21  MsgStream log(msgSvc(), "LArRawChannelContainerConverter" );
23  LArRawChannelContainer_p4 *persObj = converter.createPersistent( transCont, log );
24  return persObj;
25 }
26 
27 template<>
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 }
LArRawChannelContainerCnv_p3
Definition: LArRawChannelContainerCnv_p3.h:17
LArRawChannelContainerCnv_p1
Definition: LArRawChannelContainerCnv_p1.h:22
TPPolyCnvBase::createTransient
virtual TRANS * createTransient(const PERS *persObj, MsgStream &log)
Create transient representation of a persistent object.
LArRawEventContainerCnv::createPersistent
virtual P * createPersistent(T *transCont)
TPAbstractPolyCnvBase::createPersistent
virtual PERS * createPersistent(const TRANS *transObj, MsgStream &log)
Create persistent representation of a transient object.
pool::Guid
::Guid Guid
Definition: T_AthenaPoolCustCnv.h:19
LArRawChannelContainerCnv.h
StdJOSetup.msgSvc
msgSvc
Provide convenience handles for various services.
Definition: StdJOSetup.py:36
endmsg
#define endmsg
Definition: AnalysisConfig_Ntuple.cxx:63
LArRawChannelContainer_p4
Persistent LArRawChannelContainer, version p3.
Definition: LArRawChannelContainer_p4.h:20
LArRawEventContainerCnv::createTransient
virtual T * createTransient()
Definition: LArRawChannelContainerCnv.cxx:29
LArRawChannelContainerCnv_p1.h
python.CaloCondTools.log
log
Definition: CaloCondTools.py:20
T_AthenaPoolCustCnv< T, P >::compareClassGuid
virtual bool compareClassGuid(const Guid &clid) const
Compare POOL class GUID with the one of the object being read.
LArRawChannelContainerCnv_p4
Definition: LArRawChannelContainerCnv_p4.h:18
LArRawChannelContainerCnv_p2
Definition: LArRawChannelContainerCnv_p2.h:21
StoreGateSvc.h
LArRawChannelContainer
Container for LArRawChannel (IDC using LArRawChannelCollection)
Definition: LArRawChannelContainer.h:26