ATLAS Offline Software
TgcRdoContainerCnv.h
Go to the documentation of this file.
1 /*
2  Copyright (C) 2002-2022 CERN for the benefit of the ATLAS collaboration
3 */
4 
5 #ifndef MUONEVENTATHENAPOOL_TGCRDOCONTAINERCNV_H
6 #define MUONEVENTATHENAPOOL_TGCRDOCONTAINERCNV_H
7 
8 /*
9  custom POOL TP converter for TGC RDO
10  @author Marcin Nowak
11  CERN, February 2006
12 */
13 
14 
15 #include "MuonRdoContainerTPCnv.h"
16 #include "TgcRdoContainerCnv_p1.h"
17 #include "TgcRdoContainerCnv_p2.h"
18 #include "TgcRdoContainerCnv_p3.h"
19 #include "TgcRdoContainerCnv_p4.h"
25 
26 
29 
30 
31 template < >
32 inline
35 {
36  MsgStream log(msgSvc(), "TgcRdoContainerCnv" );
37  log << MSG::DEBUG << " **** Entered createTransient() "
38  << endmsg;
39 
40  // the use of auto pointers ensures that the persistent object is deleted
41  // using the correct persistent type pointer
42 
43  TgcRdoContainer *trans_cont = 0;
44  static const pool::Guid p4_guid("176667f0-DEC8-42A4-94AF-B4750829671A");
45  static const pool::Guid p3_guid("E7D45D90-CB92-4A7D-B5FE-2791CE34FFEE");
46  static const pool::Guid p2_guid("3DA250DA-321C-4DD3-996A-BB0E67A6034D");
47  static const pool::Guid p1_guid("BF9D17EA-AC87-4243-9126-8FC86DDCDAA3");
48  static const pool::Guid p0_guid("FBF8D72D-A6B9-4689-8E02-BB0F435BF2F7");
49 
50  if( compareClassGuid(p4_guid) ) {
51  std::unique_ptr< TgcRdoContainer_p4 > col_vect( this->poolReadObject<TgcRdoContainer_p4>() );
52  trans_cont = m_TPconverter.createTransient( col_vect.get(), log );
53  }
54  else if( compareClassGuid(p3_guid) ) {
55  std::unique_ptr< TgcRdoContainer_p3 > col_vect( this->poolReadObject<TgcRdoContainer_p3>() );
57  trans_cont = cnv.createTransient( col_vect.get(), log );
58  }
59  else if( compareClassGuid(p2_guid) ) {
60  std::unique_ptr< TgcRdoContainer_p2 > col_vect( this->poolReadObject<TgcRdoContainer_p2>() );
62  trans_cont = cnv.createTransient( col_vect.get(), log );
63  }
64  else if( compareClassGuid(p1_guid) ) {
65  std::unique_ptr< TgcRdoContainer_p1 > col_vect( this->poolReadObject<TgcRdoContainer_p1>() );
67  trans_cont = cnv.createTransient( col_vect.get(), log );
68  }
69  else if(compareClassGuid(p0_guid) ) {
70  // old version from before TP separation
71  std::unique_ptr< COLL_vector > col_vect( this->poolReadObject< COLL_vector >() );
72  trans_cont = createTransientFrom_p0( col_vect.get(), log );
73  }
74  else {
75  throw std::runtime_error("Unsupported persistent version of TGC RDO container");
76  }
77  return trans_cont;
78 }
79 
80 
81 #endif
82 
83 
TgcRdoContainerCnv
MuonRdoContainerTPCnv< TgcRdoContainer, TgcRdoContainer_p4, TgcRdoContainerCnv_p4 > TgcRdoContainerCnv
Definition: TgcRdoContainerCnv.h:28
TPPolyCnvBase::createTransient
virtual TRANS * createTransient(const PERS *persObj, MsgStream &log)
Create transient representation of a persistent object.
TgcRdoContainer_p4.h
TgcRdoContainer_p2.h
TgcRdoContainer_p3.h
TPCnvIDCont
Definition: TPConverter.h:1335
MuonRdoContainerTPCnv
Definition: MuonRdoContainerTPCnv.h:25
pool::Guid
::Guid Guid
Definition: T_AthenaPoolCustCnv.h:19
StdJOSetup.msgSvc
msgSvc
Provide convenience handles for various services.
Definition: StdJOSetup.py:36
TgcRdoContainer
Definition: TgcRdoContainer.h:25
endmsg
#define endmsg
Definition: AnalysisConfig_Ntuple.cxx:63
TgcRdoContainerCnv_p1.h
TgcRdoContainer_p1.h
TgcRdoContainer.h
MuonRdoContainerTPCnv.h
TgcRdoContainerCnv_p2.h
MuonRdoContainerTPCnv::createTransientFrom_p0
virtual T * createTransientFrom_p0(COLL_vector *persObj, MsgStream &log)
MuonRdoContainerTPCnv::createTransient
virtual T * createTransient()
Definition: CscRawDataContainerCnv.h:25
TgcRdoContainerCnv_p4.h
DEBUG
#define DEBUG
Definition: page_access.h:11
python.CaloCondTools.log
log
Definition: CaloCondTools.py:20
MuonRdoContainerTPCnv::m_TPconverter
CONV m_TPconverter
convertor
Definition: MuonRdoContainerTPCnv.h:45
TgcRdoContainerCnv_p3.h
T_AthenaPoolCustCnv< T, P >::compareClassGuid
virtual bool compareClassGuid(const Guid &clid) const
Compare POOL class GUID with the one of the object being read.