ATLAS Offline Software
Loading...
Searching...
No Matches
CscRawDataContainerCnv.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#include <TString.h> // for Form
7
10 if (sc!=StatusCode::SUCCESS) return sc;
11 std::cout << "CscRawDataContainerCnv::initialize" << std::endl;
12 // pass the IMuonIdHelperSvc to the CscRawDataCnv (needed for p2/p3 to translate between geometrical and positional hashes)
13 SmartIF<Muon::IMuonIdHelperSvc> idHelp = serviceLocator()->service<Muon::IMuonIdHelperSvc>( "MuonIdHelperSvc" );
14 if (!idHelp.isValid()) throw std::runtime_error(Form("File: %s, Line: %d\nCscRawDataContainerCnv::initialize() - No valid MuonIdHelperSvc present (needed for channel hash conversion)", __FILE__, __LINE__));
15 this->m_TPconverter.m_elementCnv.m_elementCnv.setMuonIdHelperSvc(idHelp.get());
16 // ^ ^ ^
17 // | | |
18 // TPCnvIDCont TPCnvVector CscRawDataCnv_p4
19
20 // do the same for p1-p3
21 m_converter_p1.m_elementCnv.m_elementCnv.setMuonIdHelperSvc(idHelp.get());
22 m_converter_p2.m_elementCnv.m_elementCnv.setMuonIdHelperSvc(idHelp.get());
23 m_converter_p3.m_elementCnv.m_elementCnv.setMuonIdHelperSvc(idHelp.get());
24 return StatusCode::SUCCESS;
25}
26
28{
29 MsgStream log(msgSvc(), "CscRawDataContainerCnv" );
30 if (log.level() <= MSG::DEBUG) log << MSG::DEBUG << " **** Entered createTransient() "<< endmsg;
31
32 // the use of auto pointers ensures that the persistent object is deleted
33 // using the correct persistent type pointer
34
35 CscRawDataContainer * trans_cont = nullptr;
36
37 static const pool::Guid p4_guid("F94905BF-D474-4453-B9D0-80ECB7BA4041");
38 static const pool::Guid p3_guid("A77330FB-BD12-4E50-829C-DADFBF556119");
39 static const pool::Guid p2_guid("19221A0D-4167-4A1C-BE2A-EE335D7C9D5F");
40 static const pool::Guid p1_guid("3586FE6B-0504-4E78-BD9F-AF839C50F931");
41 static const pool::Guid p0_guid("D7600810-31BC-4344-A3C6-9C59F47E5551");
42
43 if( compareClassGuid(p4_guid) ) {
44 // from this version onwards, the CSC identifier hashes are actually the position of the identifiers in the vector of identifiers
45 // thus, no conversion inside CscRawDataCnv_p... is needed anymore
46 std::unique_ptr< CscRawDataContainer_p4 > col_vect( poolReadObject< CscRawDataContainer_p4 >() );
47 trans_cont = m_TPconverter.createTransient( col_vect.get(), log );
48 } else if( compareClassGuid(p3_guid) ) {
49 std::unique_ptr< CscRawDataContainer_p3 > col_vect( poolReadObject< CscRawDataContainer_p3 >() );
50 trans_cont = m_converter_p3.createTransient( col_vect.get(), log );
51 } else if( compareClassGuid(p2_guid) ) {
52 std::unique_ptr< CscRawDataContainer_p2 > col_vect( poolReadObject< CscRawDataContainer_p2 >() );
53 trans_cont = m_converter_p2.createTransient( col_vect.get(), log );
54 } else if( compareClassGuid(p1_guid) ) {
55 std::unique_ptr< CscRawDataContainer_p1 > col_vect( poolReadObject< CscRawDataContainer_p1 >() );
56 trans_cont = m_converter_p1.createTransient( col_vect.get(), log );
57 }
58 else if( compareClassGuid(p0_guid) ) {
59 // old version from before TP separation
60 std::unique_ptr< COLL_vector > col_vect( this->poolReadObject< COLL_vector >() );
61 trans_cont = createTransientFrom_p0( col_vect.get(), log );
62 }
63 else {
64 throw std::runtime_error("Unsupported persistent version of CSC RDO container");
65 }
66 return trans_cont;
67}
#define endmsg
static Double_t sc
CscRawDataContainerCnv_p2 m_converter_p2
CscRawDataContainerCnv_p3 m_converter_p3
virtual CscRawDataContainer * createTransient()
virtual StatusCode initialize()
Gaudi Service Interface method implementations:
CscRawDataContainerCnv_p1 m_converter_p1
This container provides access to collections of CSC RDOs and a mechanism for recording them.
virtual CscRawDataContainer * createTransientFrom_p0(COLL_vector *persObj, MsgStream &log)
Interface for Helper service that creates muon Identifiers and can be used to print Identifiers.