ATLAS Offline Software
Toggle main menu visibility
Loading...
Searching...
No Matches
InnerDetector
InDetEventCnv
InDetEventAthenaPool
src
SCT_ClusterContainerCnv.cxx
Go to the documentation of this file.
1
/*
2
Copyright (C) 2002-2024 CERN for the benefit of the ATLAS collaboration
3
*/
4
5
#include "
SCT_ClusterContainerCnv.h
"
6
7
#include "
MsgUtil.h
"
8
9
#include "
InDetIdentifier/SCT_ID.h
"
10
#include "
StoreGate/StoreGateSvc.h
"
11
12
#include <iostream>
13
#include <memory>
14
15
SCT_ClusterContainerCnv::SCT_ClusterContainerCnv
(ISvcLocator* svcloc)
16
:
SCT_ClusterContainerCnvBase
(svcloc,
"SCT_ClusterContainerCnv"
),
17
m_converter_p0
()
18
{}
19
20
21
StatusCode
SCT_ClusterContainerCnv::initialize
() {
22
ATH_MSG_INFO
(
"SCT_ClusterContainerCnv::initialize()"
);
23
24
ATH_CHECK
(
SCT_ClusterContainerCnvBase::initialize
() );
25
26
// Get the SCT helper from the detector store
27
const
SCT_ID
* idhelper(
nullptr
);
28
ATH_CHECK
(
detStore
()->retrieve(idhelper,
"SCT_ID"
) );
29
30
ATH_CHECK
(
m_converter_p0
.initialize(
msg
()) );
31
32
ATH_MSG_DEBUG
(
"Converter initialized"
);
33
34
return
StatusCode::SUCCESS;
35
}
36
37
38
InDet::SCT_ClusterContainer*
SCT_ClusterContainerCnv::createTransient
(
const
Token
* token) {
39
// MsgStream log(msgSvc(), "SCT_ClusterContainerCnv" );
40
static
const
pool::Guid
p0_guid(
"A180F372-0D52-49C3-8AA0-0939CB0B8179"
);
// before t/p split
41
static
const
pool::Guid
p1_guid(
"657F6546-F5CD-4166-9567-16AD9C96D286"
);
// with SCT_Cluster_tlp1
42
static
const
pool::Guid
p2_guid(
"ECE7D831-0F31-4E6F-A6BE-2ADDE90083BA"
);
// with SCT_Cluster_p2
43
static
const
pool::Guid
p3_guid(
"623F5836-369F-4A94-9DD4-DAD728E93C13"
);
// with SCT_Cluster_p3
44
45
//ATH_MSG_DEBUG("createTransient(const Token* token): main converter");
46
InDet::SCT_ClusterContainer* p_collection(
nullptr
);
47
if
(
compareClassGuid
(token, p3_guid) ) {
48
//ATH_MSG_DEBUG("createTransient(const Token* token): T/P version 3 detected");
49
std::unique_ptr< SCT_ClusterContainer_PERS > p_coll(
poolReadObject< SCT_ClusterContainer_PERS >
(token) );
50
p_collection =
m_TPConverter_p3
.createTransient( p_coll.get(),
msg
() );
51
52
}
else
if
(
compareClassGuid
(token, p1_guid) ) {
53
//ATH_MSG_DEBUG("createTransient(const Token* token): T/P version 1 detected");
54
std::unique_ptr< InDet::SCT_ClusterContainer_tlp1 > p_coll(
poolReadObject< InDet::SCT_ClusterContainer_tlp1 >
(token) );
55
p_collection =
m_TPConverter
.createTransient( p_coll.get(),
msg
() );
56
57
}
else
if
(
compareClassGuid
(token, p2_guid) ) {
58
//ATH_MSG_DEBUG("createTransient(const Token* token): T/P version 2 detected");
59
std::unique_ptr< InDet::SCT_ClusterContainer_p2 > p_coll(
poolReadObject< InDet::SCT_ClusterContainer_p2 >
(token) );
60
p_collection =
m_TPConverter_p2
.createTransient( p_coll.get(),
msg
() );
61
62
}
else
if
(
compareClassGuid
(token, p0_guid) ) {
63
//ATH_MSG_DEBUG("createTransient(const Token* token): Old input file");
64
std::unique_ptr< SCT_ClusterContainer_p0 > col_vect(
poolReadObject< SCT_ClusterContainer_p0 >
(token) );
65
p_collection =
m_converter_p0
.createTransient( col_vect.get(),
msg
() );
66
67
}
else
{
68
throw
std::runtime_error(
"Unsupported persistent version of SCT_ClusterContainer"
);
69
70
}
71
return
p_collection;
72
}
73
74
75
SCT_ClusterContainer_PERS
*
SCT_ClusterContainerCnv::createPersistent
(InDet::SCT_ClusterContainer* transCont) {
76
SCT_ClusterContainer_PERS
* sctdc_p=
m_TPConverter_p3
.createPersistent( transCont,
msg
() );
77
return
sctdc_p;
78
}
ATH_CHECK
#define ATH_CHECK
Evaluate an expression and check for errors.
Definition
AthCheckMacros.h:40
ATH_MSG_INFO
#define ATH_MSG_INFO(x)
Definition
AthMsgStreamMacros.h:31
ATH_MSG_DEBUG
#define ATH_MSG_DEBUG(x)
Definition
AthMsgStreamMacros.h:29
MsgUtil.h
SCT_ClusterContainerCnv.h
SCT_ClusterContainerCnvBase
T_AthenaPoolCustomCnv< InDet::SCT_ClusterContainer, SCT_ClusterContainer_PERS > SCT_ClusterContainerCnvBase
Definition
SCT_ClusterContainerCnv.h:21
SCT_ClusterContainer_PERS
InDet::SCT_ClusterContainer_p3 SCT_ClusterContainer_PERS
Definition
SCT_ClusterContainerCnv.h:20
SCT_ID.h
This is an Identifier helper class for the SCT subdetector.
StoreGateSvc.h
T_AthenaPoolCustomCnv< InDet::SCT_ClusterContainer, SCT_ClusterContainer_PERS >::msg
MsgStream & msg() const
Definition
AthMessaging.h:167
T_AthenaPoolCustomCnv< InDet::SCT_ClusterContainer, SCT_ClusterContainer_PERS >::detStore
const ServiceHandle< StoreGateSvc > & detStore() const
Definition
AthenaPoolConverter.h:68
SCT_ClusterContainerCnv::createTransient
virtual InDet::SCT_ClusterContainer * createTransient(const Token *token) override
Definition
SCT_ClusterContainerCnv.cxx:38
SCT_ClusterContainerCnv::createPersistent
virtual SCT_ClusterContainer_PERS * createPersistent(InDet::SCT_ClusterContainer *transCont) override
Definition
SCT_ClusterContainerCnv.cxx:75
SCT_ClusterContainerCnv::m_TPConverter
SCT_ClusterContainerCnv_tlp1 m_TPConverter
Definition
SCT_ClusterContainerCnv.h:34
SCT_ClusterContainerCnv::m_TPConverter_p2
SCT_ClusterContainerCnv_p2 m_TPConverter_p2
Definition
SCT_ClusterContainerCnv.h:36
SCT_ClusterContainerCnv::m_TPConverter_p3
SCT_ClusterContainerCnv_p3 m_TPConverter_p3
Definition
SCT_ClusterContainerCnv.h:35
SCT_ClusterContainerCnv::initialize
virtual StatusCode initialize() override
Gaudi Service Interface method implementations:
Definition
SCT_ClusterContainerCnv.cxx:21
SCT_ClusterContainerCnv::m_converter_p0
SCT_ClusterContainerCnv_p0 m_converter_p0
Definition
SCT_ClusterContainerCnv.h:33
SCT_ClusterContainerCnv::SCT_ClusterContainerCnv
SCT_ClusterContainerCnv(ISvcLocator *svcloc)
Definition
SCT_ClusterContainerCnv.cxx:15
SCT_ID
This is an Identifier helper class for the SCT subdetector.
Definition
SCT_ID.h:68
T_AthenaPoolCustomCnv< InDet::SCT_ClusterContainer, SCT_ClusterContainer_PERS >::compareClassGuid
virtual bool compareClassGuid(const Token *token, const Guid &clid) const
T_AthenaPoolCustomCnv< InDet::SCT_ClusterContainer, SCT_ClusterContainer_PERS >::initialize
virtual StatusCode initialize()
T_AthenaPoolCustomCnv< InDet::SCT_ClusterContainer, SCT_ClusterContainer_PERS >::poolReadObject
P * poolReadObject(const Token *token)
Token
This class provides a token that identifies in a unique way objects on the persistent storage.
Definition
Token.h:22
pool::Guid
::Guid Guid
Definition
T_AthenaPoolCustCnv.h:19
Generated on
for ATLAS Offline Software by
1.17.0