ATLAS Offline Software
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):
16 
17 // Local include(s):
21 
23 xAODCaloClusterAuxContainerCnv( ISvcLocator* 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 
47  const std::string& key) {
48 
49  std::unique_ptr<xAOD::CaloClusterAuxContainer> result
51 
52 #ifndef XAOD_ANALYSIS
53  // Compress it if possible:
54  if( m_doCompression ) {
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 
xAODCaloClusterAuxContainerCnv::m_doCompression
bool m_doCompression
Flag set to false if the retrieval of the compression service failed.
Definition: xAODCaloClusterAuxContainerCnv.h:62
get_generator_info.result
result
Definition: get_generator_info.py:21
ATH_MSG_INFO
#define ATH_MSG_INFO(x)
Definition: AthMsgStreamMacros.h:31
xAODCaloClusterAuxContainerCnv::m_compressor
ServiceHandle< IxAODClusterCompressor > m_compressor
Service compressing the cluster for storage on disk.
Definition: xAODCaloClusterAuxContainerCnv.h:58
T_AthenaPoolAuxContainerCnv
Athena pool converter for aux store classes.
Definition: T_AthenaPoolAuxContainerCnv.h:39
runBeamSpotCalibration.helper
helper
Definition: runBeamSpotCalibration.py:112
CaloClusterAuxContainer_v1.h
xAOD::CaloCluster_v1
Description of a calorimeter cluster.
Definition: CaloCluster_v1.h:59
lumiFormat.i
int i
Definition: lumiFormat.py:92
xAODCaloClusterAuxContainerCnv_v1.h
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
DataVector
Derived DataVector<T>.
Definition: DataVector.h:581
xAODCaloClusterAuxContainerCnv::xAODCaloClusterAuxContainerCnv
xAODCaloClusterAuxContainerCnv(ISvcLocator *svcLoc)
Converter constructor.
Definition: xAODCaloClusterAuxContainerCnv.cxx:23
xAOD::CaloClusterAuxContainer_v2
Auxiliary container for calorimeter cluster containers.
Definition: CaloClusterAuxContainer_v2.h:30
T_AthenaPoolAuxContainerCnv::createPersistentWithKey
virtual AUXSTORE * createPersistentWithKey(AUXSTORE *trans, const std::string &key) override
Convert a transient object to persistent form.
xAODCaloClusterAuxContainerCnv.h
ATH_MSG_WARNING
#define ATH_MSG_WARNING(x)
Definition: AthMsgStreamMacros.h:32
CaloClusterContainer.h
copyThinned.h
Helper to copy an object while applying thinning.
mapkey::key
key
Definition: TElectronEfficiencyCorrectionTool.cxx:37