Skip to content
Snippets Groups Projects
Commit b1d2ab5c authored by Walter Lampl's avatar Walter Lampl
Browse files

Merge branch 'removeConverters.xAODTrackingAthenaPool-20190922' into 'master'

xAODTrackingAthenaPool: Remove unneeded custom pool converters.

See merge request atlas/athena!26734
parents 5a3c7eab bd4675e3
Branches
No related tags found
No related merge requests found
Showing
with 62 additions and 729 deletions
/*
Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
*/
// $Id: xAODNeutralParticleAuxContainerCnv.cxx 635798 2014-12-12 22:08:04Z ssnyder $
// System include(s):
#include <exception>
// Local include(s):
#include "xAODNeutralParticleAuxContainerCnv.h"
#include "AthContainers/tools/copyThinned.h"
#include "AthenaKernel/IThinningSvc.h"
xAODNeutralParticleAuxContainerCnv::
xAODNeutralParticleAuxContainerCnv( ISvcLocator* svcLoc )
: xAODNeutralParticleAuxContainerCnvBase( svcLoc ) {
}
xAOD::NeutralParticleAuxContainer*
xAODNeutralParticleAuxContainerCnv::
createPersistent( xAOD::NeutralParticleAuxContainer* trans ) {
// Create a copy of the container:
return SG::copyThinned (*trans, IThinningSvc::instance());
}
xAOD::NeutralParticleAuxContainer*
xAODNeutralParticleAuxContainerCnv::createTransient() {
// The known ID(s) for this container:
static const pool::Guid v1_guid( "006862BC-5CEB-11E3-9FB4-02163E00A92F" );
// Check which version of the container we're reading:
if( compareClassGuid( v1_guid ) ) {
// It's the latest version, read it directly:
return poolReadObject< xAOD::NeutralParticleAuxContainer >();
}
// If we didn't recognise the ID:
throw std::runtime_error( "Unsupported version of "
"xAOD::NeutralParticleAuxContainer found" );
return 0;
}
/*
Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
*/
#ifndef XAODTRACKINGATHENAPOOL_XAODNEUTRALPARTICLEAUXCONTAINERCNV_H
#define XAODTRACKINGATHENAPOOL_XAODNEUTRALPARTICLEAUXCONTAINERCNV_H
// Gaudi/Athena include(s):
#include "AthenaPoolCnvSvc/T_AthenaPoolCustomCnv.h"
// EDM include(s):
#include "xAODTracking/NeutralParticleAuxContainer.h"
/// Base class for the converter
typedef T_AthenaPoolCustomCnv< xAOD::NeutralParticleAuxContainer,
xAOD::NeutralParticleAuxContainer >
xAODNeutralParticleAuxContainerCnvBase;
/**
* @short POOL converter for the xAOD::NeutralParticleAuxContainer class
*
* This is the converter doing the actual schema evolution
* of the package... The converter for xAOD::TrackParticleContainer
* doesn't do much, as the "interface classes" don't contain
* too much/any payload. Most of the payload is in the auxiliary
* containers like this one.
*
* @author Edward Moyse <Edward.Moyse@cern.ch>
*/
class xAODNeutralParticleAuxContainerCnv :
public xAODNeutralParticleAuxContainerCnvBase {
public:
/// Converter constructor
xAODNeutralParticleAuxContainerCnv( ISvcLocator* svcLoc );
protected:
/// Function preparing the container to be written out
virtual xAOD::NeutralParticleAuxContainer*
createPersistent( xAOD::NeutralParticleAuxContainer* trans );
/// Function reading in the object from the input file
virtual xAOD::NeutralParticleAuxContainer* createTransient();
}; // class xAODNeutralParticleAuxContainerCnv
#endif
/*
Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
*/
// System include(s):
#include <exception>
// Local include(s):
#include "xAODNeutralParticleContainerCnv.h"
namespace {
/// Helper function setting up the container's link to its auxiliary store
void setStoreLink( SG::AuxVectorBase* cont, const std::string& key ) {
// The link to set up:
DataLink< SG::IConstAuxStore > link( key + "Aux." );
// Give it to the container:
cont->setStore( link );
return;
}
} // private namespace
xAODNeutralParticleContainerCnv::xAODNeutralParticleContainerCnv( ISvcLocator* svcLoc )
: xAODNeutralParticleContainerCnvBase( svcLoc ) {
}
xAOD::NeutralParticleContainer*
xAODNeutralParticleContainerCnv::
createPersistent( xAOD::NeutralParticleContainer* trans ) {
// Create a view copy of the container:
xAOD::NeutralParticleContainer* result =
new xAOD::NeutralParticleContainer( trans->begin(), trans->end(),
SG::VIEW_ELEMENTS );
// Prepare the objects to be written out:
xAOD::NeutralParticleContainer::iterator itr = result->begin();
xAOD::NeutralParticleContainer::iterator end = result->end();
for( ; itr != end; ++itr ) {
toPersistent( *itr );
}
// Return the new container:
return result;
}
/**
* This function needs to be re-implemented in order to figure out the StoreGate
* key of the container that's being created. After that's done, it lets the
* base class do its normal task.
*/
StatusCode xAODNeutralParticleContainerCnv::createObj( IOpaqueAddress* pAddr,
DataObject*& pObj ) {
// Get the key of the container that we'll be creating:
m_key = *( pAddr->par() + 1 );
ATH_MSG_VERBOSE( "Key of xAOD::NeutralParticleContainer: " << m_key );
// Let the base class do its thing now:
return AthenaPoolConverter::createObj( pAddr, pObj );
}
xAOD::NeutralParticleContainer* xAODNeutralParticleContainerCnv::createTransient() {
// The known ID(s) for this container:
static pool::Guid v1_guid( "12869D6A-5CEB-11E3-B64A-02163E00A92F" );
// Check if we're reading the most up to date type:
if( compareClassGuid( v1_guid ) ) {
xAOD::NeutralParticleContainer* c = poolReadObject< xAOD::NeutralParticleContainer >();
setStoreLink( c, m_key );
return c;
}
// If we didn't recognise the ID, let's complain:
throw std::runtime_error( "Unsupported version of "
"xAOD::NeutralParticleContainer found" );
return 0;
}
void xAODNeutralParticleContainerCnv::
toPersistent( xAOD::NeutralParticle* /*np*/ ) const {
return;
}
/*
Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
*/
#ifndef XAODTRACKINGATHENAPOOL_XAODNEUTRALPARTICLECONTAINERCNV_H
#define XAODTRACKINGATHENAPOOL_XAODNEUTRALPARTICLECONTAINERCNV_H
// Gaudi/Athena include(s):
#include "AthenaPoolCnvSvc/T_AthenaPoolCustomCnv.h"
// EDM include(s):
#include "xAODTracking/NeutralParticleContainer.h"
/// Type definition for the converter's base
typedef T_AthenaPoolCustomCnv< xAOD::NeutralParticleContainer,
xAOD::NeutralParticleContainer >
xAODNeutralParticleContainerCnvBase;
/**
* @short POOL converter for the xAOD::NeutralParticleContainer class
*
* Simple converter class making the xAOD::NeutralParticleContainer
* class known to POOL.
*
* @author Edward Moyse <Edward.Moyse@cern.ch>
* @author Attila Krasznahorkay <Attila.Krasznahorkay@cern.ch>
*
*/
class xAODNeutralParticleContainerCnv : public xAODNeutralParticleContainerCnvBase {
// Declare the factory as our friend:
friend class CnvFactory< xAODNeutralParticleContainerCnv >;
public:
/// Converter constructor
xAODNeutralParticleContainerCnv( ISvcLocator* svcLoc );
/// Re-implemented function in order to get access to the SG key
virtual StatusCode createObj( IOpaqueAddress* pAddr, DataObject*& pObj );
/// Function preparing the container to be written out
virtual xAOD::NeutralParticleContainer* createPersistent( xAOD::NeutralParticleContainer* trans );
/// Function reading in the persistent object
virtual xAOD::NeutralParticleContainer* createTransient();
private:
/// Function preparing a vertex object for persistence
void toPersistent( xAOD::NeutralParticle* np ) const;
/// StoreGate key of the container just being created
std::string m_key;
}; // class xAODNeutralParticleContainerCnv
#endif
/*
Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
*/
// System include(s):
#include <exception>
// Local include(s):
#include "xAODSCTRDOAuxContainerCnv.h"
#include "AthContainers/tools/copyThinned.h"
#include "AthenaKernel/IThinningSvc.h"
xAODSCTRDOAuxContainerCnv::xAODSCTRDOAuxContainerCnv( ISvcLocator* svcLoc )
: xAODSCTRDOAuxContainerCnvBase( svcLoc )
{ }
xAOD::SCTRawHitValidationAuxContainer*
xAODSCTRDOAuxContainerCnv::createPersistent( xAOD::SCTRawHitValidationAuxContainer* trans )
{
// Create a thinned copy of the container:
return SG::copyThinned (*trans, IThinningSvc::instance());
}
xAOD::SCTRawHitValidationAuxContainer* xAODSCTRDOAuxContainerCnv::createTransient() {
// The known ID(s) for this container:
static const pool::Guid v1_guid( "BC5A8B61-9429-4704-B8C7-50B2FB676775" );
// Check which version of the container we're reading:
if( compareClassGuid( v1_guid ) ) {
// It's the latest version, read it directly:
return poolReadObject< xAOD::SCTRawHitValidationAuxContainer >();
}
// If we didn't recognise the ID:
throw std::runtime_error( "Unsupported version of xAOD::SCTRawHitValidationAuxContainer found." );
}
/*
Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
*/
#ifndef XAODTRACKINGATHENAPOOL_XAODSCTRDOAUXCONTAINERCNV_H
#define XAODTRACKINGATHENAPOOL_XAODSCTRDOAUXCONTAINERCNV_H
// Gaudi/Athena include(s):
#include "AthenaPoolCnvSvc/T_AthenaPoolCustomCnv.h"
// EDM include(s):
#include "xAODTracking/SCTRawHitValidationAuxContainer.h"
/// Base class for the converter
typedef T_AthenaPoolCustomCnv< xAOD::SCTRawHitValidationAuxContainer,
xAOD::SCTRawHitValidationAuxContainer >
xAODSCTRDOAuxContainerCnvBase;
/**
* POOL converter for the xAOD::SCTRawHitValidationAuxContainer class
*/
class xAODSCTRDOAuxContainerCnv : public xAODSCTRDOAuxContainerCnvBase {
// Declare the factory as our friend:
friend class CnvFactory< xAODSCTRDOAuxContainerCnv >;
protected:
/// Converter constructor
xAODSCTRDOAuxContainerCnv( ISvcLocator* svcLoc );
/// Function preparing the container to be written out
virtual xAOD::SCTRawHitValidationAuxContainer* createPersistent( xAOD::SCTRawHitValidationAuxContainer* trans ) override;
/// Function reading in the object from the input file
virtual xAOD::SCTRawHitValidationAuxContainer* createTransient() override;
}; // class xAODSCTRDOAuxContainerCnv
#endif
/*
Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
*/
// System include(s):
#include <exception>
// Local include(s):
#include "xAODSCTRDOContainerCnv.h"
xAODSCTRDOContainerCnv::xAODSCTRDOContainerCnv( ISvcLocator* svcLoc )
: xAODSCTRDOContainerCnvBase( svcLoc )
{ }
/**
* This function needs to be re-implemented in order to figure out the StoreGate
* key of the container that's being created. After that's done, it lets the
* base class do its normal task.
*/
StatusCode xAODSCTRDOContainerCnv::createObj(IOpaqueAddress* pAddr,
DataObject*& pObj )
{
// Get the key of the container that we'll be creating:
m_key = *( pAddr->par() + 1 );
ATH_MSG_VERBOSE( "Key of xAOD::SCTRawHitValidationContainer: " << m_key );
// Let the base class do its thing now:
return AthenaPoolConverter::createObj( pAddr, pObj );
}
xAOD::SCTRawHitValidationContainer*
xAODSCTRDOContainerCnv::createPersistent( xAOD::SCTRawHitValidationContainer* trans )
{
// Create a view copy of the container:
return new xAOD::SCTRawHitValidationContainer( trans->begin(), trans->end(), SG::VIEW_ELEMENTS );
}
xAOD::SCTRawHitValidationContainer* xAODSCTRDOContainerCnv::createTransient() {
// The known ID(s) for this container:
const pool::Guid v1_guid( "BC8CE35A-5785-4F97-82B6-1E4A21A8C28F" );
// Check if we're reading the most up to date type:
if( compareClassGuid( v1_guid ) ) {
xAOD::SCTRawHitValidationContainer* c = poolReadObject< xAOD::SCTRawHitValidationContainer >();
c->setStore(DataLink<SG::IConstAuxStore>(m_key + "Aux."));
return c;
}
// If we didn't recognise the ID, let's complain:
throw std::runtime_error( "Unsupported version of xAOD::SCTRawHitValidationContainer found" );
}
/*
Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
*/
#ifndef XAODTRACKINGATHENAPOOL_XAODSCTRDOCONTAINERCNV_H
#define XAODTRACKINGATHENAPOOL_XAODSCTRDOCONTAINERCNV_H
// Gaudi/Athena include(s):
#include "AthenaPoolCnvSvc/T_AthenaPoolCustomCnv.h"
// EDM include(s):
#include "xAODTracking/SCTRawHitValidationContainer.h"
/// Type definition for the converter's base
typedef T_AthenaPoolCustomCnv< xAOD::SCTRawHitValidationContainer,
xAOD::SCTRawHitValidationContainer >
xAODSCTRDOContainerCnvBase;
/**
* @short POOL converter for the xAOD::SCTRawHitValidationContainer class
*
* Simple converter class making the xAOD::SCTRawHitValidationContainer
* class known to POOL.
*
* @author Edward Moyse <Edward.Moyse@cern.ch>
* @author Attila Krasznahorkay <Attila.Krasznahorkay@cern.ch>
*
*/
class xAODSCTRDOContainerCnv : public xAODSCTRDOContainerCnvBase {
// Declare the factory as our friend:
friend class CnvFactory< xAODSCTRDOContainerCnv >;
public:
/// Converter constructor
xAODSCTRDOContainerCnv( ISvcLocator* svcLoc );
/// Re-implemented function in order to get access to the SG key
virtual StatusCode createObj( IOpaqueAddress* pAddr, DataObject*& pObj ) override;
/// Function preparing the container to be written out
virtual xAOD::SCTRawHitValidationContainer* createPersistent( xAOD::SCTRawHitValidationContainer* trans ) override;
/// Function reading in the persistent object
virtual xAOD::SCTRawHitValidationContainer* createTransient() override;
protected:
/// StoreGate key of the container just being created
std::string m_key;
}; // class xAODSCTRDOContainerCnv
#endif
/*
Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
*/
// $Id: xAODTrackMeasurementValidationAuxContainerCnv.cxx 581533 2014-02-05 09:28:36Z krasznaa $
// System include(s):
#include <exception>
// Local include(s):
#include "xAODTrackMeasurementValidationAuxContainerCnv.h"
#include "AthContainers/tools/copyThinned.h"
#include "AthenaKernel/IThinningSvc.h"
xAODTrackMeasurementValidationAuxContainerCnv::
xAODTrackMeasurementValidationAuxContainerCnv( ISvcLocator* svcLoc )
: xAODTrackMeasurementValidationAuxContainerCnvBase( svcLoc ) {
}
xAOD::TrackMeasurementValidationAuxContainer*
xAODTrackMeasurementValidationAuxContainerCnv::
createPersistent( xAOD::TrackMeasurementValidationAuxContainer* trans ) {
// Create a copy of the container:
return SG::copyThinned (*trans, IThinningSvc::instance());
}
xAOD::TrackMeasurementValidationAuxContainer*
xAODTrackMeasurementValidationAuxContainerCnv::createTransient() {
// The known ID(s) for this container:
static const pool::Guid v1_guid( "61B62A1A-4C51-43A2-9623-1B9E910A81E8" );
// Check which version of the container we're reading:
if( compareClassGuid( v1_guid ) ) {
// It's the latest version, read it directly:
return poolReadObject< xAOD::TrackMeasurementValidationAuxContainer >();
}
// If we didn't recognise the ID:
throw std::runtime_error( "Unsupported version of "
"xAOD::TrackMeasurementValidationAuxContainer found" );
return 0;
}
/*
Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
*/
#ifndef XAODTRACKINGATHENAPOOL_XAODPREPRAWDATAAUXCONTAINERCNV_H
#define XAODTRACKINGATHENAPOOL_XAODPREPRAWDATAAUXCONTAINERCNV_H
// Gaudi/Athena include(s):
#include "AthenaPoolCnvSvc/T_AthenaPoolCustomCnv.h"
// EDM include(s):
#include "xAODTracking/TrackMeasurementValidationAuxContainer.h"
/// Base class for the converter
typedef T_AthenaPoolCustomCnv< xAOD::TrackMeasurementValidationAuxContainer,
xAOD::TrackMeasurementValidationAuxContainer >
xAODTrackMeasurementValidationAuxContainerCnvBase;
/**
* @short POOL converter for the xAOD::TrackMeasurementValidationAuxContainer class
*
* This is the converter doing the actual schema evolution
* of the package... The converter for xAOD::TrackParticleContainer
* doesn't do much, as the "interface classes" don't contain
* too much/any payload. Most of the payload is in the auxiliary
* containers like this one.
*
* @author Edward Moyse <Edward.Moyse@cern.ch>
*/
class xAODTrackMeasurementValidationAuxContainerCnv :
public xAODTrackMeasurementValidationAuxContainerCnvBase {
public:
/// Converter constructor
xAODTrackMeasurementValidationAuxContainerCnv( ISvcLocator* svcLoc );
protected:
/// Function preparing the container to be written out
virtual xAOD::TrackMeasurementValidationAuxContainer*
createPersistent( xAOD::TrackMeasurementValidationAuxContainer* trans );
/// Function reading in the object from the input file
virtual xAOD::TrackMeasurementValidationAuxContainer* createTransient();
}; // class xAODTrackMeasurementValidationAuxContainerCnv
#endif
/*
Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
*/
// System include(s):
#include <exception>
// Local include(s):
#include "xAODTrackMeasurementValidationContainerCnv.h"
namespace {
/// Helper function setting up the container's link to its auxiliary store
void setStoreLink( SG::AuxVectorBase* cont, const std::string& key ) {
// The link to set up:
DataLink< SG::IConstAuxStore > link( key + "Aux." );
// Give it to the container:
cont->setStore( link );
return;
}
} // private namespace
xAODTrackMeasurementValidationContainerCnv::xAODTrackMeasurementValidationContainerCnv( ISvcLocator* svcLoc )
: xAODTrackMeasurementValidationContainerCnvBase( svcLoc ) {
}
xAOD::TrackMeasurementValidationContainer*
xAODTrackMeasurementValidationContainerCnv::
createPersistent( xAOD::TrackMeasurementValidationContainer* trans ) {
// Create a view copy of the container:
xAOD::TrackMeasurementValidationContainer* result =
new xAOD::TrackMeasurementValidationContainer( trans->begin(), trans->end(),
SG::VIEW_ELEMENTS );
// Return the new container:
return result;
}
/**
* This function needs to be re-implemented in order to figure out the StoreGate
* key of the container that's being created. After that's done, it lets the
* base class do its normal task.
*/
StatusCode xAODTrackMeasurementValidationContainerCnv::createObj( IOpaqueAddress* pAddr,
DataObject*& pObj ) {
// Get the key of the container that we'll be creating:
m_key = *( pAddr->par() + 1 );
ATH_MSG_VERBOSE( "Key of xAOD::TrackMeasurementValidationContainer: " << m_key );
// Let the base class do its thing now:
return AthenaPoolConverter::createObj( pAddr, pObj );
}
xAOD::TrackMeasurementValidationContainer* xAODTrackMeasurementValidationContainerCnv::createTransient() {
// The known ID(s) for this container:
static pool::Guid v1_guid( "868F1FD8-AFE7-4B40-B12E-73716C37A6B0" );
// Check if we're reading the most up to date type:
if( compareClassGuid( v1_guid ) ) {
xAOD::TrackMeasurementValidationContainer* c = poolReadObject< xAOD::TrackMeasurementValidationContainer >();
setStoreLink( c, m_key );
return c;
}
// If we didn't recognise the ID, let's complain:
throw std::runtime_error( "Unsupported version of "
"xAOD::TrackMeasurementValidationContainer found" );
return 0;
}
/*
Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
*/
#ifndef XAODTRACKINGATHENAPOOL_XAODPREPRAWDATACONTAINERCNV_H
#define XAODTRACKINGATHENAPOOL_XAODPREPRAWDATACONTAINERCNV_H
// Gaudi/Athena include(s):
#include "AthenaPoolCnvSvc/T_AthenaPoolCustomCnv.h"
// EDM include(s):
#include "xAODTracking/TrackMeasurementValidationContainer.h"
/// Type definition for the converter's base
typedef T_AthenaPoolCustomCnv< xAOD::TrackMeasurementValidationContainer,
xAOD::TrackMeasurementValidationContainer >
xAODTrackMeasurementValidationContainerCnvBase;
/**
* @short POOL converter for the xAOD::TrackMeasurementValidationContainer class
*
* Simple converter class making the xAOD::TrackMeasurementValidationContainer
* class known to POOL.
*
* @author Edward Moyse <Edward.Moyse@cern.ch>
* @author Attila Krasznahorkay <Attila.Krasznahorkay@cern.ch>
*
*/
class xAODTrackMeasurementValidationContainerCnv : public xAODTrackMeasurementValidationContainerCnvBase {
// Declare the factory as our friend:
friend class CnvFactory< xAODTrackMeasurementValidationContainerCnv >;
public:
/// Converter constructor
xAODTrackMeasurementValidationContainerCnv( ISvcLocator* svcLoc );
/// Re-implemented function in order to get access to the SG key
virtual StatusCode createObj( IOpaqueAddress* pAddr, DataObject*& pObj );
/// Function preparing the container to be written out
virtual xAOD::TrackMeasurementValidationContainer* createPersistent( xAOD::TrackMeasurementValidationContainer* trans );
/// Function reading in the persistent object
virtual xAOD::TrackMeasurementValidationContainer* createTransient();
private:
/// Function preparing a vertex object for persistence
void toPersistent( xAOD::TrackMeasurementValidation* np ) const;
/// StoreGate key of the container just being created
std::string m_key;
}; // class xAODTrackMeasurementValidationContainerCnv
#endif
/*
Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration
*/
// $Id: xAODTrackParticleAuxContainerCnv.cxx 791368 2017-01-05 08:55:07Z krasznaa $
......@@ -47,27 +47,26 @@ StatusCode xAODTrackParticleAuxContainerCnv::initialize() {
xAOD::TrackParticleAuxContainer*
xAODTrackParticleAuxContainerCnv::
createPersistent( xAOD::TrackParticleAuxContainer* trans ) {
createPersistentWithKey( xAOD::TrackParticleAuxContainer* trans,
const std::string& key ) {
// Load the necessary ROOT class(es):
static bool dictLoaded = false;
if( ! dictLoaded ) {
static const char* NAME =
"std::vector<ElementLink<DataVector<Trk::Track> > >";
if( ! TClass::GetClass( NAME ) ) {
ATH_MSG_ERROR( "Couldn't load dictionary for type: " << NAME );
}
dictLoaded = true;
static const char* NAME =
"std::vector<ElementLink<DataVector<Trk::Track> > >";
static const TClass* cls = TClass::GetClass( NAME );
if( ! cls ) {
ATH_MSG_ERROR( "Couldn't load dictionary for type: " << NAME );
}
// Create a copy of the container:
std::unique_ptr< xAOD::TrackParticleAuxContainer > result(
SG::copyThinned( *trans, IThinningSvc::instance() ) );
// This makes a copy of the container, with any thinning applied.
std::unique_ptr< xAOD::TrackParticleAuxContainer > result
( xAODTrackParticleAuxContainerCnvBase::createPersistentWithKey (trans, key) );
// Create a helper object for the float compression:
xAOD::TrackParticleContainer helper;
for( size_t i = 0; i < result->size(); ++i ) {
helper.push_back( new xAOD::TrackParticle() );
helper.push_back( std::make_unique<xAOD::TrackParticle>() );
}
helper.setStore( result.get() );
......@@ -85,48 +84,3 @@ createPersistent( xAOD::TrackParticleAuxContainer* trans ) {
return result.release();
}
xAOD::TrackParticleAuxContainer*
xAODTrackParticleAuxContainerCnv::createTransient() {
// The known ID(s) for this container:
static const pool::Guid v1_guid( "C3B01EA0-CA87-4C96-967F-E0F9A75BD370" );
static const pool::Guid v2_guid( "53031BE5-2156-41E8-B70C-41A1C0572FC5" );
static const pool::Guid v3_guid( "F41DF744-242D-11E6-B472-02163E010CEC" );
static const pool::Guid v4_guid( "403CEB6E-2A3D-11E8-B048-080027F5CBDA" );
// Check which version of the container we're reading:
if ( compareClassGuid( v4_guid ) ){
// It's the latest version, read it directly:
return poolReadObject< xAOD::TrackParticleAuxContainer >();
} else if ( compareClassGuid( v3_guid ) ){
// Read in the v3 version:
static xAODTrackParticleAuxContainerCnv_v3 converter;
std::unique_ptr< xAOD::TrackParticleAuxContainer_v3 >
old( poolReadObject< xAOD::TrackParticleAuxContainer_v3 >() );
return converter.createTransient( old.get(), msg() );
} else if ( compareClassGuid( v2_guid ) ){
// Read in the v2 version:
static xAODTrackParticleAuxContainerCnv_v2 converter;
std::unique_ptr< xAOD::TrackParticleAuxContainer_v2 >
old( poolReadObject< xAOD::TrackParticleAuxContainer_v2 >() );
return converter.createTransient( old.get(), msg() );
} else if( compareClassGuid( v1_guid ) ) {
// The v1 converter:
static xAODTrackParticleAuxContainerCnv_v1 converter;
// Read in the v1 version:
std::unique_ptr< xAOD::TrackParticleAuxContainer_v1 >
old( poolReadObject< xAOD::TrackParticleAuxContainer_v1 >() );
// Return the converted object:
return converter.createTransient( old.get(), msg() );
}
// If we didn't recognise the ID:
throw std::runtime_error( "Unsupported version of "
"xAOD::TrackParticleAuxContainer found" );
return 0;
}
// Dear emacs, this is -*- c++ -*-
/*
Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration
*/
// $Id: xAODTrackParticleAuxContainerCnv.h 789663 2016-12-14 14:48:57Z krasznaa $
......@@ -9,18 +9,25 @@
#define XAODTRACKINGATHENAPOOL_XAODTRACKPARTICLEAUXCONTAINERCNV_H
// Gaudi/Athena include(s):
#include "AthenaPoolCnvSvc/T_AthenaPoolCustomCnv.h"
#include "AthenaPoolCnvSvc/T_AthenaPoolAuxContainerCnv.h"
#include "GaudiKernel/ToolHandle.h"
// EDM include(s):
#include "xAODTracking/TrackParticleAuxContainer.h"
#include "xAODTrackingCnv/ITrackParticleCompressorTool.h"
#include "xAODTrackParticleAuxContainerCnv_v1.h"
#include "xAODTrackParticleAuxContainerCnv_v2.h"
#include "xAODTrackParticleAuxContainerCnv_v3.h"
/// Base class for the converter
typedef T_AthenaPoolCustomCnv< xAOD::TrackParticleAuxContainer,
xAOD::TrackParticleAuxContainer >
typedef T_AthenaPoolAuxContainerCnv<xAOD::TrackParticleAuxContainer,
xAODTrackParticleAuxContainerCnv_v3,
xAODTrackParticleAuxContainerCnv_v2,
xAODTrackParticleAuxContainerCnv_v1>
xAODTrackParticleAuxContainerCnvBase;
/**
* @short POOL converter for the xAOD::TrackParticleAuxContainer class
*
......@@ -33,7 +40,8 @@ typedef T_AthenaPoolCustomCnv< xAOD::TrackParticleAuxContainer,
* @author Edward Moyse <Edward.Moyse@cern.ch>
*/
class xAODTrackParticleAuxContainerCnv :
public xAODTrackParticleAuxContainerCnvBase {
public xAODTrackParticleAuxContainerCnvBase
{
public:
/// Converter constructor
......@@ -50,9 +58,8 @@ private:
protected:
/// Function preparing the container to be written out
virtual xAOD::TrackParticleAuxContainer*
createPersistent( xAOD::TrackParticleAuxContainer* trans ) override;
/// Function reading in the object from the input file
virtual xAOD::TrackParticleAuxContainer* createTransient() override;
createPersistentWithKey( xAOD::TrackParticleAuxContainer* trans,
const std::string& key ) override;
private:
/// Compressor tool for the track particles
......
/*
Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration
*/
// $Id$
......@@ -30,14 +30,13 @@ do { \
} while( 0 )
xAODTrackParticleAuxContainerCnv_v1::xAODTrackParticleAuxContainerCnv_v1()
: T_AthenaPoolTPCnvBase< xAOD::TrackParticleAuxContainer, xAOD::TrackParticleAuxContainer_v1 >()
{
}
void xAODTrackParticleAuxContainerCnv_v1::
persToTrans( const xAOD::TrackParticleAuxContainer_v1* oldObj,
xAOD::TrackParticleAuxContainer* newObj,
MsgStream& log ) {
MsgStream& log ) const {
// Greet the user:
ATH_MSG( "Converting xAOD::TrackParticleAuxContainer_v1 to current version..." );
......@@ -133,7 +132,7 @@ persToTrans( const xAOD::TrackParticleAuxContainer_v1* oldObj,
///
void xAODTrackParticleAuxContainerCnv_v1::transToPers( const xAOD::TrackParticleAuxContainer*,
xAOD::TrackParticleAuxContainer_v1*,
MsgStream& log ) {
MsgStream& log ) const {
log << MSG::ERROR
<< "Somebody called xAODTrackParticleAuxContainerCnv_v1::transToPers"
......
// Dear emacs, this is -*- c++ -*-
/*
Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration
*/
// $Id$
......@@ -27,21 +27,25 @@
/// $Date$
///
class xAODTrackParticleAuxContainerCnv_v1 :
public T_AthenaPoolTPCnvBase< xAOD::TrackParticleAuxContainer, xAOD::TrackParticleAuxContainer_v1 >
public T_AthenaPoolTPCnvConstBase< xAOD::TrackParticleAuxContainer, xAOD::TrackParticleAuxContainer_v1 >
{
public:
using base_class::persToTrans;
using base_class::transToPers;
/// Default constructor
xAODTrackParticleAuxContainerCnv_v1();
/// Function converting from the old type to the current one
virtual void persToTrans( const xAOD::TrackParticleAuxContainer_v1* oldObj,
xAOD::TrackParticleAuxContainer* newObj,
MsgStream& log );
MsgStream& log ) const override;
/// Dummy function inherited from the base class
virtual void transToPers( const xAOD::TrackParticleAuxContainer*,
xAOD::TrackParticleAuxContainer_v1*,
MsgStream& log );
MsgStream& log ) const override;
}; // class xAODTrackParticleAuxContainerCnv_v1
#endif // XAODTRACKINGATHENAPOOL_XAODTRACKPARTICLEAUXCONTAINERCNV_V1_H
\ No newline at end of file
#endif // XAODTRACKINGATHENAPOOL_XAODTRACKPARTICLEAUXCONTAINERCNV_V1_H
/*
Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration
*/
// $Id$
......@@ -30,14 +30,13 @@ do { \
} while( 0 )
xAODTrackParticleAuxContainerCnv_v2::xAODTrackParticleAuxContainerCnv_v2()
: T_AthenaPoolTPCnvBase< xAOD::TrackParticleAuxContainer, xAOD::TrackParticleAuxContainer_v2 >()
{
}
void xAODTrackParticleAuxContainerCnv_v2::
persToTrans( const xAOD::TrackParticleAuxContainer_v2* oldObj,
xAOD::TrackParticleAuxContainer* newObj,
MsgStream& log ) {
MsgStream& log ) const {
// Greet the user:
ATH_MSG( "Converting xAOD::TrackParticleAuxContainer_v2 to current version..." );
......@@ -64,7 +63,7 @@ persToTrans( const xAOD::TrackParticleAuxContainer_v2* oldObj,
///
void xAODTrackParticleAuxContainerCnv_v2::transToPers( const xAOD::TrackParticleAuxContainer*,
xAOD::TrackParticleAuxContainer_v2*,
MsgStream& log ) {
MsgStream& log ) const {
log << MSG::ERROR
<< "Somebody called xAODTrackParticleAuxContainerCnv_v2::transToPers"
......
// Dear emacs, this is -*- c++ -*-
/*
Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration
*/
// $Id$
......@@ -27,20 +27,24 @@
/// $Date$
///
class xAODTrackParticleAuxContainerCnv_v2 :
public T_AthenaPoolTPCnvBase< xAOD::TrackParticleAuxContainer, xAOD::TrackParticleAuxContainer_v2 >
public T_AthenaPoolTPCnvConstBase< xAOD::TrackParticleAuxContainer, xAOD::TrackParticleAuxContainer_v2 >
{
public:
using base_class::persToTrans;
using base_class::transToPers;
/// Default constructor
xAODTrackParticleAuxContainerCnv_v2();
/// Function converting from the old type to the current one
virtual void persToTrans( const xAOD::TrackParticleAuxContainer_v2* oldObj,
xAOD::TrackParticleAuxContainer* newObj,
MsgStream& log );
MsgStream& log ) const override;
/// Dummy function inherited from the base class
virtual void transToPers( const xAOD::TrackParticleAuxContainer*,
xAOD::TrackParticleAuxContainer_v2*,
MsgStream& log );
MsgStream& log ) const override;
}; // class xAODTrackParticleAuxContainerCnv_v2
......
/*
Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration
*/
// $Id$
......@@ -30,14 +30,13 @@ do { \
} while( 0 )
xAODTrackParticleAuxContainerCnv_v3::xAODTrackParticleAuxContainerCnv_v3()
: T_AthenaPoolTPCnvBase< xAOD::TrackParticleAuxContainer, xAOD::TrackParticleAuxContainer_v3 >()
{
}
void xAODTrackParticleAuxContainerCnv_v3::
persToTrans( const xAOD::TrackParticleAuxContainer_v3* oldObj,
xAOD::TrackParticleAuxContainer* newObj,
MsgStream& log ) {
MsgStream& log ) const {
// Greet the user:
ATH_MSG( "Converting xAOD::TrackParticleAuxContainer_v3 to current version..." );
......@@ -64,7 +63,7 @@ persToTrans( const xAOD::TrackParticleAuxContainer_v3* oldObj,
///
void xAODTrackParticleAuxContainerCnv_v3::transToPers( const xAOD::TrackParticleAuxContainer*,
xAOD::TrackParticleAuxContainer_v3*,
MsgStream& log ) {
MsgStream& log ) const {
log << MSG::ERROR
<< "Somebody called xAODTrackParticleAuxContainerCnv_v3::transToPers"
......
// Dear emacs, this is -*- c++ -*-
/*
Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration
*/
// $Id$
......@@ -27,20 +27,24 @@
/// $Date$
///
class xAODTrackParticleAuxContainerCnv_v3 :
public T_AthenaPoolTPCnvBase< xAOD::TrackParticleAuxContainer, xAOD::TrackParticleAuxContainer_v3 >
public T_AthenaPoolTPCnvConstBase< xAOD::TrackParticleAuxContainer, xAOD::TrackParticleAuxContainer_v3 >
{
public:
using base_class::persToTrans;
using base_class::transToPers;
/// Default constructor
xAODTrackParticleAuxContainerCnv_v3();
/// Function converting from the old type to the current one
virtual void persToTrans( const xAOD::TrackParticleAuxContainer_v3* oldObj,
xAOD::TrackParticleAuxContainer* newObj,
MsgStream& log );
MsgStream& log ) const override;
/// Dummy function inherited from the base class
virtual void transToPers( const xAOD::TrackParticleAuxContainer*,
xAOD::TrackParticleAuxContainer_v3*,
MsgStream& log );
MsgStream& log ) const override;
}; // class xAODTrackParticleAuxContainerCnv_v3
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment