ATLAS Offline Software
Toggle main menu visibility
Loading...
Searching...
No Matches
InnerDetector
InDetEventCnv
InDetEventAthenaPool
src
PixelClusterContainerCnv.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 "
StoreGate/StoreGateSvc.h
"
6
#include "
PixelClusterContainerCnv.h
"
7
#include "
InDetIdentifier/PixelID.h
"
8
9
#include <memory>
10
11
#include <iostream>
12
13
PixelClusterContainerCnv::PixelClusterContainerCnv
(ISvcLocator* svcloc)
14
:
PixelClusterContainerCnvBase
(svcloc,
"PixelClusterContainerCnv"
),
15
m_converter_p0
()
16
{}
17
18
19
StatusCode
PixelClusterContainerCnv::initialize
() {
20
ATH_MSG_INFO
(
"PixelClusterContainerCnv::initialize()"
);
21
22
ATH_CHECK
(
PixelClusterContainerCnvBase::initialize
() );
23
24
// Get the pixel helper from the detector store
25
const
PixelID
* idhelper(
nullptr
);
26
ATH_CHECK
(
detStore
()->retrieve(idhelper,
"PixelID"
) );
27
28
ATH_CHECK
(
m_converter_p0
.initialize(
msg
()) );
29
30
ATH_MSG_DEBUG
(
"Converter initialized"
);
31
32
return
StatusCode::SUCCESS;
33
}
34
35
36
InDet::PixelClusterContainer*
PixelClusterContainerCnv::createTransient
(
const
Token
* token) {
37
static
const
Guid
p0_guid(
"37B00A31-EA80-45DF-9A3F-2721EC0F0DA6"
);
// before t/p split
38
static
const
Guid
p1_guid(
"9DB54746-8C4E-4A56-8B4C-0E5D42905218"
);
// with PixelCluster_tlp1
39
static
const
Guid
p2_guid(
"DE48E26B-9E03-4EAD-86B9-351AD88D060E"
);
// with pixelCluster_p2
40
static
const
Guid
p3_guid(
"7BF0F163-B227-434C-86A6-16130E005E6C"
);
// with pixelCluster_p3
41
ATH_MSG_DEBUG
(
"createTransient(const Token* token): main converter"
);
42
InDet::PixelClusterContainer* p_collection(
nullptr
);
43
if
(
compareClassGuid
(token, p3_guid) ) {
44
ATH_MSG_DEBUG
(
"createTransient(const Token* token): T/P version 3 detected"
);
45
std::unique_ptr< InDet::PixelClusterContainer_p3 > p_coll(
poolReadObject< InDet::PixelClusterContainer_p3 >
(token) );
46
p_collection =
m_converter_p3
.createTransient( p_coll.get(),
msg
() );
47
}
else
if
(
compareClassGuid
(token, p2_guid) ) {
48
ATH_MSG_DEBUG
(
"createTransient(const Token* token): T/P version 2 detected"
);
49
std::unique_ptr< InDet::PixelClusterContainer_p2 > p_coll(
poolReadObject< InDet::PixelClusterContainer_p2 >
(token) );
50
p_collection =
m_converter_p2
.createTransient( p_coll.get(),
msg
() );
51
}
else
if
(
compareClassGuid
(token, p1_guid) ) {
52
ATH_MSG_DEBUG
(
"createTransient(const Token* token): T/P version 1 detected"
);
53
std::unique_ptr< InDet::PixelClusterContainer_tlp1 > p_coll(
poolReadObject< InDet::PixelClusterContainer_tlp1 >
(token) );
54
p_collection =
m_TPConverter
.createTransient( p_coll.get(),
msg
() );
55
}
56
//----------------------------------------------------------------
57
else
if
(
compareClassGuid
(token, p0_guid) ) {
58
ATH_MSG_DEBUG
(
"createTransient(const Token* token): Old input file"
);
59
60
std::unique_ptr< PixelClusterContainer_p0 > col_vect(
poolReadObject< PixelClusterContainer_p0 >
(token) );
61
p_collection =
m_converter_p0
.createTransient( col_vect.get(),
msg
() );
62
}
63
else
{
64
throw
std::runtime_error(
"Unsupported persistent version of PixelClusterContainer"
);
65
66
}
67
return
p_collection;
68
}
69
70
71
PixelClusterContainer_PERS
*
PixelClusterContainerCnv::createPersistent
(InDet::PixelClusterContainer* transCont) {
72
PixelClusterContainer_PERS
*pixdc_p=
m_converter_p3
.createPersistent( transCont,
msg
() );
73
return
pixdc_p;
74
}
75
76
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
PixelClusterContainerCnv.h
PixelClusterContainerCnvBase
T_AthenaPoolCustomCnv< InDet::PixelClusterContainer, PixelClusterContainer_PERS > PixelClusterContainerCnvBase
Definition
PixelClusterContainerCnv.h:21
PixelClusterContainer_PERS
InDet::PixelClusterContainer_p3 PixelClusterContainer_PERS
Definition
PixelClusterContainerCnv.h:20
PixelID.h
This is an Identifier helper class for the Pixel subdetector.
StoreGateSvc.h
T_AthenaPoolCustomCnv< InDet::PixelClusterContainer, PixelClusterContainer_PERS >::msg
MsgStream & msg() const
Definition
AthMessaging.h:167
T_AthenaPoolCustomCnv< InDet::PixelClusterContainer, PixelClusterContainer_PERS >::detStore
const ServiceHandle< StoreGateSvc > & detStore() const
Definition
AthenaPoolConverter.h:68
Guid
This class provides a encapsulation of a GUID/UUID/CLSID/IID data structure (128 bit number).
Definition
Guid.h:25
PixelClusterContainerCnv::createPersistent
virtual PixelClusterContainer_PERS * createPersistent(InDet::PixelClusterContainer *transCont) override
Definition
PixelClusterContainerCnv.cxx:71
PixelClusterContainerCnv::m_converter_p2
PixelClusterContainerCnv_p2 m_converter_p2
Definition
PixelClusterContainerCnv.h:34
PixelClusterContainerCnv::createTransient
virtual InDet::PixelClusterContainer * createTransient(const Token *token) override
Definition
PixelClusterContainerCnv.cxx:36
PixelClusterContainerCnv::initialize
virtual StatusCode initialize() override
Gaudi Service Interface method implementations:
Definition
PixelClusterContainerCnv.cxx:19
PixelClusterContainerCnv::m_converter_p3
PixelClusterContainerCnv_p3 m_converter_p3
Definition
PixelClusterContainerCnv.h:35
PixelClusterContainerCnv::m_converter_p0
PixelClusterContainerCnv_p0 m_converter_p0
Definition
PixelClusterContainerCnv.h:33
PixelClusterContainerCnv::m_TPConverter
PixelClusterContainerCnv_tlp1 m_TPConverter
Definition
PixelClusterContainerCnv.h:36
PixelClusterContainerCnv::PixelClusterContainerCnv
PixelClusterContainerCnv(ISvcLocator *svcloc)
Definition
PixelClusterContainerCnv.cxx:13
PixelID
This is an Identifier helper class for the Pixel subdetector.
Definition
PixelID.h:69
T_AthenaPoolCustomCnv< InDet::PixelClusterContainer, PixelClusterContainer_PERS >::compareClassGuid
virtual bool compareClassGuid(const Token *token, const Guid &clid) const
T_AthenaPoolCustomCnv< InDet::PixelClusterContainer, PixelClusterContainer_PERS >::initialize
virtual StatusCode initialize()
T_AthenaPoolCustomCnv< InDet::PixelClusterContainer, PixelClusterContainer_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
Generated on
for ATLAS Offline Software by
1.17.0