ATLAS Offline Software
CscStripPrepDataContainerCnv.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 
14  // Must create DataVector that does NOT own elements
15  m_storeGate(nullptr)
16 {
17 }
18 
20 
22  // Call base clase initialize
24  return StatusCode::FAILURE;
25 
26  // Get the messaging service, print where you are
27  MsgStream log(msgSvc(), "CscStripPrepDataContainerCnv");
28  log << MSG::INFO << "CscStripPrepDataContainerCnv::initialize()" << endmsg;
29 
30  // get StoreGate service
31  StatusCode sc = service("StoreGateSvc", m_storeGate);
32  if (sc.isFailure()) {
33  log << MSG::FATAL << "StoreGate service not found !" << endmsg;
34  return StatusCode::FAILURE;
35  }
36 
37  // get DetectorStore service
39  sc = service("DetectorStore", detStore);
40  if (sc.isFailure()) {
41  log << MSG::FATAL << "DetectorStore service not found !" << endmsg;
42  return StatusCode::FAILURE;
43  } else {
44  log << MSG::DEBUG << "Found DetectorStore." << endmsg;
45  }
46 
47  if (log.level() <= MSG::DEBUG) log << MSG::DEBUG << "Converter initialized." << endmsg;
48 
49  return StatusCode::SUCCESS;
50 }
51 
53  MsgStream log(msgSvc(), "CscStripPrepDataContainerCnv" );
54  log<<MSG::DEBUG<<"createPersistent(): main converter"<<endmsg;
56  return pixdc_p;
57 }
58 
60  MsgStream log(msgSvc(), "CscStripPrepDataContainerCnv" );
61  static const pool::Guid p0_guid("A41C9D99-F977-43B5-8DFC-819F057A9136"); // before t/p split
62  static const pool::Guid p1_guid("6075244C-C6BB-4E24-B711-E7E4ED0F7462"); // with CscStripPrepData_tlp1
63  if (log.level() <= MSG::DEBUG) log<<MSG::DEBUG<<"createTransient(): main converter"<<endmsg;
64  Muon::CscStripPrepDataContainer* p_collection(nullptr);
65  if( compareClassGuid(p1_guid) ) {
66  log<<MSG::DEBUG<<"createTransient(): T/P version 1 detected"<<endmsg;
67  std::unique_ptr< CscStripPrepDataContainer_PERS > p_coll( poolReadObject< CscStripPrepDataContainer_PERS >() );
68  p_collection = m_TPConverter.createTransient( p_coll.get(), log );
69  }
70  //----------------------------------------------------------------
71  else if( compareClassGuid(p0_guid) ) {
72  if (log.level() <= MSG::DEBUG) log<<MSG::DEBUG<<"createTransient(): Old input file"<<std::endl;
73  throw std::runtime_error("Not currently supporting reading non TP-split PRDs");
74  }
75  else {
76  throw std::runtime_error("Unsupported persistent version of CscStripPrepDataContainer");
77 
78  }
79  return p_collection;
80 }
Muon::MuonPrepDataContainer
Template for Muon PRD containers (which are basically collections of MuonPrepDataCollections).
Definition: MuonPrepDataContainer.h:42
CscStripPrepDataContainerCnv::m_TPConverter
CscStripPrepDataContainerCnv_tlp1 m_TPConverter
Definition: CscStripPrepDataContainerCnv.h:46
CscStripPrepDataContainer.h
python.Constants.FATAL
int FATAL
Definition: Control/AthenaCommon/python/Constants.py:19
CscStripPrepDataContainerCnv::m_storeGate
StoreGateSvc * m_storeGate
Definition: CscStripPrepDataContainerCnv.h:42
CscStripPrepDataContainerCnv::CscStripPrepDataContainerCnv
CscStripPrepDataContainerCnv(ISvcLocator *svcloc)
Definition: CscStripPrepDataContainerCnv.cxx:12
AthenaPoolTestRead.sc
sc
Definition: AthenaPoolTestRead.py:27
pool::Guid
::Guid Guid
Definition: T_AthenaPoolCustCnv.h:19
StoreGateSvc
The Athena Transient Store API.
Definition: StoreGateSvc.h:128
TopLevelTPConverter::createTransient
TRANS * createTransient(MsgStream &log)
Create transient representation of the persistent object known to this converter.
Definition: TopLevelTPConverter.h:62
StdJOSetup.msgSvc
msgSvc
Provide convenience handles for various services.
Definition: StdJOSetup.py:36
T_AthenaPoolCustomCnv
Compatibility for old converter classes that don't get passed the key.
Definition: T_AthenaPoolCustomCnv.h:132
endmsg
#define endmsg
Definition: AnalysisConfig_Ntuple.cxx:63
EL::StatusCode
::StatusCode StatusCode
StatusCode definition for legacy code.
Definition: PhysicsAnalysis/D3PDTools/EventLoop/EventLoop/StatusCode.h:22
CscStripPrepDataContainerCnv::~CscStripPrepDataContainerCnv
virtual ~CscStripPrepDataContainerCnv()
CscStripPrepDataContainerCnv.h
python.PyKernel.detStore
detStore
Definition: PyKernel.py:41
CscStripPrepDataContainerCnv::createPersistent
virtual CscStripPrepDataContainer_PERS * createPersistent(Muon::CscStripPrepDataContainer *transCont)
Definition: CscStripPrepDataContainerCnv.cxx:52
CscStripPrepDataContainerCnv::initialize
virtual StatusCode initialize()
Gaudi Service Interface method implementations:
Definition: CscStripPrepDataContainerCnv.cxx:21
DEBUG
#define DEBUG
Definition: page_access.h:11
python.CaloCondTools.log
log
Definition: CaloCondTools.py:20
Muon::CscStripPrepDataContainer_tlp1
Definition: CscStripPrepDataContainer_tlp1.h:24
CscStripPrepDataContainerCnv::createTransient
virtual Muon::CscStripPrepDataContainer * createTransient()
Definition: CscStripPrepDataContainerCnv.cxx:59
TopLevelTPConverter::createPersistent
virtual TL_PERS * createPersistent(const TRANS *transObj, MsgStream &log)
Create persistent representation of transObj.
Definition: TopLevelTPConverter.h:110
T_AthenaPoolCustCnv::compareClassGuid
virtual bool compareClassGuid(const Guid &clid) const
Compare POOL class GUID with the one of the object being read.
T_AthenaPoolCustCnv::initialize
virtual StatusCode initialize()
Gaudi Service Interface method implementations:
StoreGateSvc.h