ATLAS Offline Software
Toggle main menu visibility
Loading...
Searching...
No Matches
Event
xAOD
xAODCaloEventAthenaPool
src
xAODCaloClusterAuxContainerCnv.cxx
Go to the documentation of this file.
1
/*
2
Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration
3
*/
4
5
// $Id: xAODCaloClusterAuxContainerCnv.cxx 773852 2016-09-19 14:08:20Z krasznaa $
6
7
// System include(s):
8
#include <exception>
9
#include <memory>
10
11
// Infrastucture include(s):
12
13
// EDM include(s):
14
#include "
xAODCaloEvent/versions/CaloClusterAuxContainer_v1.h
"
15
#include "
xAODCaloEvent/CaloClusterContainer.h
"
16
17
// Local include(s):
18
#include "
xAODCaloClusterAuxContainerCnv.h
"
19
#include "
xAODCaloClusterAuxContainerCnv_v1.h
"
20
#include "
AthContainers/tools/copyThinned.h
"
21
22
xAODCaloClusterAuxContainerCnv::
23
xAODCaloClusterAuxContainerCnv
( ISvcLocator* svcLoc )
24
:
xAODCaloClusterAuxContainerCnvBase
( svcLoc )
25
#ifndef XAOD_ANALYSIS
26
,
m_compressor
(
"xAODClusterCompressor"
,
"xAODCaloClusterAuxContainerCnv"
)
27
#endif
28
,
m_doCompression
( false )
29
{
30
31
#ifndef XAOD_ANALYSIS
32
if
(
m_compressor
.retrieve().isSuccess() ) {
33
m_doCompression = true;
34
ATH_MSG_INFO(
"Retrieved compression tool"
);
35
}
else
{
36
m_doCompression = false;
37
ATH_MSG_WARNING(
"Failed to retrieve compression tool. "
38
"Will store uncompressed cluster"
);
39
}
40
#endif
41
42
}
43
44
xAOD::CaloClusterAuxContainer
*
45
xAODCaloClusterAuxContainerCnv::
46
createPersistentWithKey
(
xAOD::CaloClusterAuxContainer
* trans,
47
const
std::string& key) {
48
49
std::unique_ptr<xAOD::CaloClusterAuxContainer> result
50
{
xAODCaloClusterAuxContainerCnvBase::createPersistentWithKey
(trans, key) };
51
52
#ifndef XAOD_ANALYSIS
53
// Compress it if possible:
54
if
(
m_doCompression
) {
55
xAOD::CaloClusterContainer
helper;
56
for
(
size_t
i = 0; i < result->size(); ++i ) {
57
helper.push_back(
new
xAOD::CaloCluster
() );
58
}
59
helper.setStore( result.get() );
60
m_compressor
->compress( &helper );
61
}
62
#endif
63
64
// Return the object to be written:
65
return
result.release();
66
}
67
CaloClusterAuxContainer_v1.h
CaloClusterContainer.h
T_AthenaPoolAuxContainerCnv< xAOD::CaloClusterAuxContainer, xAODCaloClusterAuxContainerCnv_v1 >::createPersistentWithKey
virtual xAOD::CaloClusterAuxContainer * createPersistentWithKey(xAOD::CaloClusterAuxContainer *trans, const std::string &key) override
xAODCaloClusterAuxContainerCnv::m_compressor
ServiceHandle< IxAODClusterCompressor > m_compressor
Service compressing the cluster for storage on disk.
Definition
xAODCaloClusterAuxContainerCnv.h:58
xAODCaloClusterAuxContainerCnv::xAODCaloClusterAuxContainerCnv
xAODCaloClusterAuxContainerCnv(ISvcLocator *svcLoc)
Converter constructor.
Definition
xAODCaloClusterAuxContainerCnv.cxx:23
xAODCaloClusterAuxContainerCnv::createPersistentWithKey
virtual xAOD::CaloClusterAuxContainer * createPersistentWithKey(xAOD::CaloClusterAuxContainer *trans, const std::string &key)
Function preparing the container to be written out.
Definition
xAODCaloClusterAuxContainerCnv.cxx:46
xAODCaloClusterAuxContainerCnv::m_doCompression
bool m_doCompression
Flag set to false if the retrieval of the compression service failed.
Definition
xAODCaloClusterAuxContainerCnv.h:62
copyThinned.h
Helper to copy an object while applying thinning.
xAOD::CaloCluster
CaloCluster_v1 CaloCluster
Define the latest version of the calorimeter cluster class.
Definition
Event/xAOD/xAODCaloEvent/xAODCaloEvent/CaloCluster.h:19
xAOD::CaloClusterContainer
CaloClusterContainer_v1 CaloClusterContainer
Define the latest version of the calorimeter cluster container.
Definition
Event/xAOD/xAODCaloEvent/xAODCaloEvent/CaloClusterContainer.h:17
xAOD::CaloClusterAuxContainer
CaloClusterAuxContainer_v2 CaloClusterAuxContainer
Define the latest version of the calorimeter cluster auxiliary container.
Definition
CaloClusterAuxContainer.h:16
xAODCaloClusterAuxContainerCnv.h
xAODCaloClusterAuxContainerCnvBase
T_AthenaPoolAuxContainerCnv< xAOD::CaloClusterAuxContainer, xAODCaloClusterAuxContainerCnv_v1 > xAODCaloClusterAuxContainerCnvBase
Base class for the converter.
Definition
xAODCaloClusterAuxContainerCnv.h:25
xAODCaloClusterAuxContainerCnv_v1.h
Generated on
for ATLAS Offline Software by
1.17.0