Skip to content
Snippets Groups Projects
Commit ec004e55 authored by Edward Moyse's avatar Edward Moyse
Browse files

Merge branch 'removeConverters.xAODBTaggingAthenaPool-20191013' into 'master'

xAODBTaggingAthenaPool: Remove unneeded custom pool converters.

See merge request atlas/athena!27174
parents 88abdc94 c0ea7ab3
No related branches found
No related tags found
No related merge requests found
Showing
with 80 additions and 586 deletions
/*
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: xAODBTaggingAuxContainerCnv.cxx 566967 2013-10-24 13:24:31Z krasznaa $
......@@ -15,48 +15,25 @@
#include "xAODTracking/TrackParticleContainer.h"
#include "AthContainers/tools/copyThinned.h"
#include "AthenaKernel/IThinningSvc.h"
xAODBTagVertexAuxContainerCnv::xAODBTagVertexAuxContainerCnv( ISvcLocator* svcLoc )
: xAODBTagVertexAuxContainerCnvBase( svcLoc ) {
#define LOAD_DICTIONARY( name ) do { TClass* cl = TClass::GetClass( name ); \
if( ( ! cl ) || ( ! cl->IsLoaded() ) ) { ATH_MSG_ERROR( "Couldn't load dictionary for type: " << name ); } } while(0)
}
xAOD::BTagVertexAuxContainer*
xAODBTagVertexAuxContainerCnv::
createPersistent( xAOD::BTagVertexAuxContainer* trans ) {
static const char* trackParticleType =
"std::vector<std::vector<ElementLink<DataVector<xAOD::TrackParticle_v1> > > >";
static bool dictLoaded = false;
if( ! dictLoaded ) {
TClass* cl = TClass::GetClass( trackParticleType );
if( ( ! cl ) || ( ! cl->IsLoaded() ) ) {
ATH_MSG_ERROR( "Couldn't load the dictionary for \""
<< trackParticleType << "\"" );
} else {
dictLoaded = true;
}
}
createPersistentWithKey( xAOD::BTagVertexAuxContainer* trans,
const std::string& key)
{
// ??? Still needed?
std::once_flag flag;
std::call_once (flag,
[this] {
LOAD_DICTIONARY( "std::vector<std::vector<ElementLink<DataVector<xAOD::TrackParticle_v1> > > >" );
});
// Create a copy of the container:
return SG::copyThinned (*trans, IThinningSvc::instance());
return xAODBTagVertexAuxContainerCnvBase::createPersistentWithKey (trans, key);
}
xAOD::BTagVertexAuxContainer* xAODBTagVertexAuxContainerCnv::createTransient() {
// The known ID(s) for this container:
const pool::Guid v1_guid( "09CD44BA-0F40-4FDB-BB30-2F4226FF3E18" );
// Check which version of the container we're reading:
if( compareClassGuid( v1_guid ) ) {
// It's the latest version, read it directly:
return poolReadObject< xAOD::BTagVertexAuxContainer >();
}
// If we didn't recognise the ID:
throw std::runtime_error( "Unsupported version of "
"xAOD::BTagVertexAuxContainer 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: xAODBTaggingAuxContainerCnv.h 566967 2013-10-24 13:24:31Z krasznaa $
......@@ -9,14 +9,13 @@
#define XAODBTAGGINGATHENAPOOL_XAODBTAGVERTEXAUXCONTAINERCNV_H
// Gaudi/Athena include(s):
#include "AthenaPoolCnvSvc/T_AthenaPoolCustomCnv.h"
#include "AthenaPoolCnvSvc/T_AthenaPoolAuxContainerCnv.h"
// EDM include(s):
#include "xAODBTagging/BTagVertexAuxContainer.h"
/// Base class for the converter
typedef T_AthenaPoolCustomCnv< xAOD::BTagVertexAuxContainer,
xAOD::BTagVertexAuxContainer >
typedef T_AthenaPoolAuxContainerCnv< xAOD::BTagVertexAuxContainer >
xAODBTagVertexAuxContainerCnvBase;
/**
......@@ -34,19 +33,17 @@ typedef T_AthenaPoolCustomCnv< xAOD::BTagVertexAuxContainer,
* $Date: 2013-10-24 15:24:31 +0200 (Thu, 24 Oct 2013) $
*/
class xAODBTagVertexAuxContainerCnv :
public xAODBTagVertexAuxContainerCnvBase {
public xAODBTagVertexAuxContainerCnvBase
{
public:
/// Converter constructor
xAODBTagVertexAuxContainerCnv( ISvcLocator* svcLoc );
using xAODBTagVertexAuxContainerCnvBase::xAODBTagVertexAuxContainerCnvBase;
protected:
/// Function preparing the container to be written out
virtual xAOD::BTagVertexAuxContainer*
createPersistent( xAOD::BTagVertexAuxContainer* trans );
/// Function reading in the object from the input file
virtual xAOD::BTagVertexAuxContainer* createTransient();
createPersistentWithKey( xAOD::BTagVertexAuxContainer* trans,
const std::string& key ) override;
}; // class xAODBTaggingAuxContainerCnv
#endif // XAODBTAGGINGATHENAPOOL_XAODBTAGGINGAUXCONTAINERCNV_H
/*
Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
*/
// $Id: xAODBTagVertexContainerCnv.cxx 581167 2014-02-03 10:45:56Z $
// System include(s):
#include <exception>
// Local include(s):
#include "xAODBTagVertexContainerCnv.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
xAODBTagVertexContainerCnv::xAODBTagVertexContainerCnv( ISvcLocator* svcLoc )
: xAODBTagVertexContainerCnvBase( 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 xAODBTagVertexContainerCnv::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::BTagVertexContainer: " << m_key );
// Let the base class do its thing now:
return AthenaPoolConverter::createObj( pAddr, pObj );
}
xAOD::BTagVertexContainer*
xAODBTagVertexContainerCnv::createPersistent( xAOD::BTagVertexContainer* trans ) {
// Create a view copy of the container:
xAOD::BTagVertexContainer* result =
new xAOD::BTagVertexContainer( trans->begin(), trans->end(),
SG::VIEW_ELEMENTS );
// Prepare the objects to be written out:
xAOD::BTagVertexContainer::iterator itr = result->begin();
xAOD::BTagVertexContainer::iterator end = result->end();
for( ; itr != end; ++itr ) {
toPersistent( *itr );
}
// Return the new container:
return result;
}
xAOD::BTagVertexContainer* xAODBTagVertexContainerCnv::createTransient() {
// The known ID(s) for this container:
const pool::Guid v1_guid( "E225A9EC-9782-43F7-B7BF-1B215187C11C" );
// Check if we're reading the most up to date type:
if( compareClassGuid( v1_guid ) ) {
xAOD::BTagVertexContainer* c = poolReadObject< xAOD::BTagVertexContainer >();
setStoreLink( c, m_key );
return c;
}
// If we didn't recognise the ID, let's complain:
throw std::runtime_error( "Unsupported version of "
"xAOD::BTagVertexContainer found" );
return 0;
}
void xAODBTagVertexContainerCnv::toPersistent( xAOD::BTagVertex* BTagVertex ) const {
// Tell the object to prepare all its smart pointers for persistification:
BTagVertex->toPersistent();
return;
}
// Dear emacs, this is -*- c++ -*-
/*
Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
*/
// $Id: xAODJetContainerCnv.h 581167 2014-02-03 10:45:56Z krasznaa $
#ifndef XAODBTAGGINGATHENAPOOL_XAODBTAGVERTEXCONTAINERCNV_H
#define XAODBTAGGINGATHENAPOOL_XAODBTAGVERTEXCONTAINERCNV_H
// System include(s):
#include <string>
// Gaudi/Athena include(s):
#include "AthenaPoolCnvSvc/T_AthenaPoolCustomCnv.h"
// EDM include(s):
#include "xAODBTagging/BTagVertexContainer.h"
/// Type definition for the converter's base
typedef T_AthenaPoolCustomCnv< xAOD::BTagVertexContainer,
xAOD::BTagVertexContainer >
xAODBTagVertexContainerCnvBase;
/**
* @short POOL converter for the xAOD::BTaggingContainer class
*
* Simple converter class making the xAOD::BTaggingContainer
* class known to POOL.
*
* @author Attila Krasznahorkay <Attila.Krasznahorkay@cern.ch>
*
* $Revision: 581167 $
* $Date: 2014-02-03 11:45:56 +0100 (Mon, 03 Feb 2014) $
*/
class xAODBTagVertexContainerCnv : public xAODBTagVertexContainerCnvBase {
// Declare the factory as our friend:
friend class CnvFactory< xAODBTagVertexContainerCnv >;
public:
/// Converter constructor
xAODBTagVertexContainerCnv( 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::BTagVertexContainer* createPersistent( xAOD::BTagVertexContainer* trans );
/// Function reading in the persistent object
virtual xAOD::BTagVertexContainer* createTransient();
private:
/// Function preparing a vertex object for persistence
void toPersistent( xAOD::BTagVertex* BTagVertex ) const;
/// StoreGate key of the container just being created
std::string m_key;
}; // class xAODBTaggingContainerCnv
#endif // XAODBTAGGINGATHENAPOOL_XAODBTAGGINGCONTAINERCNV_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: xAODBTaggingAuxContainerCnv.cxx 566967 2013-10-24 13:24:31Z krasznaa $
......@@ -15,49 +15,24 @@
#include "xAODTracking/TrackParticleContainer.h"
#include "AthContainers/tools/copyThinned.h"
#include "AthenaKernel/IThinningSvc.h"
xAODBTaggingAuxContainerCnv::xAODBTaggingAuxContainerCnv( ISvcLocator* svcLoc )
: xAODBTaggingAuxContainerCnvBase( svcLoc ) {
}
#define LOAD_DICTIONARY( name ) do { TClass* cl = TClass::GetClass( name ); \
if( ( ! cl ) || ( ! cl->IsLoaded() ) ) { ATH_MSG_ERROR( "Couldn't load dictionary for type: " << name ); } } while(0)
xAOD::BTaggingAuxContainer*
xAODBTaggingAuxContainerCnv::
createPersistent( xAOD::BTaggingAuxContainer* trans ) {
// Make sure that the dictionary for the Athena-only dynamic variable
// is loaded:
static const char* trackParticleType =
"std::vector<std::vector<ElementLink<DataVector<xAOD::TrackParticle_v1> > > >";
static bool dictLoaded = false;
if( ! dictLoaded ) {
TClass* cl = TClass::GetClass( trackParticleType );
if( ( ! cl ) || ( ! cl->IsLoaded() ) ) {
ATH_MSG_ERROR( "Couldn't load the dictionary for \""
<< trackParticleType << "\"" );
} else {
dictLoaded = true;
}
}
createPersistentWithKey( xAOD::BTaggingAuxContainer* trans,
const std::string& key)
{
// ??? Still needed?
std::once_flag flag;
std::call_once (flag,
[this] {
LOAD_DICTIONARY( "std::vector<std::vector<ElementLink<DataVector<xAOD::TrackParticle_v1> > > >" );
});
// Create a copy of the container:
return SG::copyThinned (*trans, IThinningSvc::instance());
}
xAOD::BTaggingAuxContainer* xAODBTaggingAuxContainerCnv::createTransient() {
// The known ID(s) for this container:
const pool::Guid v1_guid( "5E1973D2-D860-4BB1-B8EF-C9AD8E6C66A2" );
// Check which version of the container we're reading:
if( compareClassGuid( v1_guid ) ) {
// It's the latest version, read it directly:
return poolReadObject< xAOD::BTaggingAuxContainer >();
}
// If we didn't recognise the ID:
throw std::runtime_error( "Unsupported version of "
"xAOD::BTaggingAuxContainer found" );
return 0;
return xAODBTaggingAuxContainerCnvBase::createPersistentWithKey (trans, key);
}
// 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: xAODBTaggingAuxContainerCnv.h 566967 2013-10-24 13:24:31Z krasznaa $
......@@ -9,14 +9,13 @@
#define XAODBTAGGINGATHENAPOOL_XAODBTAGGINGAUXCONTAINERCNV_H
// Gaudi/Athena include(s):
#include "AthenaPoolCnvSvc/T_AthenaPoolCustomCnv.h"
#include "AthenaPoolCnvSvc/T_AthenaPoolAuxContainerCnv.h"
// EDM include(s):
#include "xAODBTagging/BTaggingAuxContainer.h"
/// Base class for the converter
typedef T_AthenaPoolCustomCnv< xAOD::BTaggingAuxContainer,
xAOD::BTaggingAuxContainer >
typedef T_AthenaPoolAuxContainerCnv< xAOD::BTaggingAuxContainer >
xAODBTaggingAuxContainerCnvBase;
/**
......@@ -34,19 +33,17 @@ typedef T_AthenaPoolCustomCnv< xAOD::BTaggingAuxContainer,
* $Date: 2013-10-24 15:24:31 +0200 (Thu, 24 Oct 2013) $
*/
class xAODBTaggingAuxContainerCnv :
public xAODBTaggingAuxContainerCnvBase {
public xAODBTaggingAuxContainerCnvBase
{
public:
/// Converter constructor
xAODBTaggingAuxContainerCnv( ISvcLocator* svcLoc );
using xAODBTaggingAuxContainerCnvBase::xAODBTaggingAuxContainerCnvBase;
protected:
/// Function preparing the container to be written out
virtual xAOD::BTaggingAuxContainer*
createPersistent( xAOD::BTaggingAuxContainer* trans );
/// Function reading in the object from the input file
virtual xAOD::BTaggingAuxContainer* createTransient();
createPersistentWithKey( xAOD::BTaggingAuxContainer* trans,
const std::string& key ) override;
}; // class xAODBTaggingAuxContainerCnv
#endif // XAODBTAGGINGATHENAPOOL_XAODBTAGGINGAUXCONTAINERCNV_H
/*
Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
*/
// $Id: xAODBTaggingContainerCnv.cxx 581167 2014-02-03 10:45:56Z krasznaa $
// System include(s):
#include <exception>
// Local include(s):
#include "xAODBTaggingContainerCnv.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
xAODBTaggingContainerCnv::xAODBTaggingContainerCnv( ISvcLocator* svcLoc )
: xAODBTaggingContainerCnvBase( 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 xAODBTaggingContainerCnv::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::BTaggingContainer: " << m_key );
// Let the base class do its thing now:
return AthenaPoolConverter::createObj( pAddr, pObj );
}
xAOD::BTaggingContainer*
xAODBTaggingContainerCnv::createPersistent( xAOD::BTaggingContainer* trans ) {
// Create a view copy of the container:
xAOD::BTaggingContainer* result =
new xAOD::BTaggingContainer( trans->begin(), trans->end(),
SG::VIEW_ELEMENTS );
// Prepare the objects to be written out:
xAOD::BTaggingContainer::iterator itr = result->begin();
xAOD::BTaggingContainer::iterator end = result->end();
for( ; itr != end; ++itr ) {
toPersistent( *itr );
}
// Return the new container:
return result;
}
xAOD::BTaggingContainer* xAODBTaggingContainerCnv::createTransient() {
// The known ID(s) for this container:
const pool::Guid v1_guid( "5D19F171-E07E-4F65-BC1F-FC4F4099E9F1" );
// Check if we're reading the most up to date type:
if( compareClassGuid( v1_guid ) ) {
xAOD::BTaggingContainer* c = poolReadObject< xAOD::BTaggingContainer >();
setStoreLink( c, m_key );
return c;
}
// If we didn't recognise the ID, let's complain:
throw std::runtime_error( "Unsupported version of "
"xAOD::BTaggingContainer found" );
return 0;
}
void xAODBTaggingContainerCnv::toPersistent( xAOD::BTagging* BTagging ) const {
// Tell the object to prepare all its smart pointers for persistification:
BTagging->toPersistent();
return;
}
// Dear emacs, this is -*- c++ -*-
/*
Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
*/
// $Id: xAODJetContainerCnv.h 581167 2014-02-03 10:45:56Z krasznaa $
#ifndef XAODBTAGGINGATHENAPOOL_XAODBTAGGINGCONTAINERCNV_H
#define XAODBTAGGINGATHENAPOOL_XAODBTAGGINGCONTAINERCNV_H
// System include(s):
#include <string>
// Gaudi/Athena include(s):
#include "AthenaPoolCnvSvc/T_AthenaPoolCustomCnv.h"
// EDM include(s):
#include "xAODBTagging/BTaggingContainer.h"
/// Type definition for the converter's base
typedef T_AthenaPoolCustomCnv< xAOD::BTaggingContainer,
xAOD::BTaggingContainer >
xAODBTaggingContainerCnvBase;
/**
* @short POOL converter for the xAOD::BTaggingContainer class
*
* Simple converter class making the xAOD::BTaggingContainer
* class known to POOL.
*
* @author Attila Krasznahorkay <Attila.Krasznahorkay@cern.ch>
*
* $Revision: 581167 $
* $Date: 2014-02-03 11:45:56 +0100 (Mon, 03 Feb 2014) $
*/
class xAODBTaggingContainerCnv : public xAODBTaggingContainerCnvBase {
// Declare the factory as our friend:
friend class CnvFactory< xAODBTaggingContainerCnv >;
public:
/// Converter constructor
xAODBTaggingContainerCnv( 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::BTaggingContainer* createPersistent( xAOD::BTaggingContainer* trans );
/// Function reading in the persistent object
virtual xAOD::BTaggingContainer* createTransient();
private:
/// Function preparing a vertex object for persistence
void toPersistent( xAOD::BTagging* BTagging ) const;
/// StoreGate key of the container just being created
std::string m_key;
}; // class xAODBTaggingContainerCnv
#endif // XAODBTAGGINGATHENAPOOL_XAODBTAGGINGCONTAINERCNV_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: xAODBTaggingTrigAuxContainerCnv.cxx 705820 2015-11-04 14:54:05Z krasznaa $
......@@ -11,7 +11,6 @@
#include <TClass.h>
// Gaudi/Athena include(s):
#include "AthenaKernel/IThinningSvc.h"
#include "AthContainers/tools/copyThinned.h"
// EDM include(s):
......@@ -21,64 +20,23 @@
#include "xAODBTaggingTrigAuxContainerCnv.h"
#include "xAODBTaggingTrigAuxContainerOfflineCnv_v1.h"
xAODBTaggingTrigAuxContainerCnv::
xAODBTaggingTrigAuxContainerCnv( ISvcLocator* svcLoc )
: xAODBTaggingTrigAuxContainerCnvBase( svcLoc ) {
}
#define LOAD_DICTIONARY( name ) do { TClass* cl = TClass::GetClass( name ); \
if( ( ! cl ) || ( ! cl->IsLoaded() ) ) { ATH_MSG_ERROR( "Couldn't load dictionary for type: " << name ); } } while(0)
xAOD::BTaggingTrigAuxContainer*
xAODBTaggingTrigAuxContainerCnv::
createPersistent( xAOD::BTaggingTrigAuxContainer* trans ) {
// Make sure that the dictionary for the Athena-only dynamic variable
// is loaded:
static const char* trackParticleType =
"std::vector<std::vector<ElementLink<DataVector<xAOD::TrackParticle_v1> > > >";
static bool dictLoaded = false;
if( ! dictLoaded ) {
TClass* cl = TClass::GetClass( trackParticleType );
if( ( ! cl ) || ( ! cl->IsLoaded() ) ) {
ATH_MSG_ERROR( "Couldn't load the dictionary for \""
<< trackParticleType << "\"" );
} else {
dictLoaded = true;
}
}
createPersistentWithKey( xAOD::BTaggingTrigAuxContainer* trans,
const std::string& key )
{
// ??? Still needed?
std::once_flag flag;
std::call_once (flag,
[this] {
LOAD_DICTIONARY( "std::vector<std::vector<ElementLink<DataVector<xAOD::TrackParticle_v1> > > >" );
});
// Create a copy of the container:
return SG::copyThinned (*trans, IThinningSvc::instance());
}
xAOD::BTaggingTrigAuxContainer*
xAODBTaggingTrigAuxContainerCnv::createTransient() {
// The known ID(s) for this container:
const pool::Guid v1_guid( "1B738105-2F3E-4DCB-9DAE-DA3A4964486E" );
const pool::Guid
v1_offline_guid( "5E1973D2-D860-4BB1-B8EF-C9AD8E6C66A2" );
// Check which version of the container we're reading:
if( compareClassGuid( v1_guid ) ) {
// It's the latest version, read it directly:
return poolReadObject< xAOD::BTaggingTrigAuxContainer >();
} else if( compareClassGuid( v1_offline_guid ) ) {
// The converter:
static xAODBTaggingTrigAuxContainerOfflineCnv_v1 converter;
// Read in the offline v1 version:
std::unique_ptr< xAOD::BTaggingAuxContainer_v1 >
old( poolReadObject< xAOD::BTaggingAuxContainer_v1 >() );
// Return the converter object:
return converter.createTransient( old.get(), msg() );
}
// If we didn't recognise the ID:
throw std::runtime_error( "Unsupported version of "
"xAOD::BTaggingTrigAuxContainer found" );
return 0;
return xAODBTaggingTrigAuxContainerCnvBase::createPersistentWithKey (trans, key);
}
// 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: xAODBTaggingTrigAuxContainerCnv.h 705820 2015-11-04 14:54:05Z krasznaa $
......@@ -9,14 +9,15 @@
#define XAODBTAGGINGATHENAPOOL_XAODBTAGGINGTRIGAUXCONTAINERCNV_H
// Gaudi/Athena include(s):
#include "AthenaPoolCnvSvc/T_AthenaPoolCustomCnv.h"
#include "AthenaPoolCnvSvc/T_AthenaPoolAuxContainerCnv.h"
// EDM include(s):
#include "xAODBTagging/BTaggingTrigAuxContainer.h"
#include "xAODBTaggingTrigAuxContainerOfflineCnv_v1.h"
/// Base class for the converter
typedef T_AthenaPoolCustomCnv< xAOD::BTaggingTrigAuxContainer,
xAOD::BTaggingTrigAuxContainer >
typedef T_AthenaPoolAuxContainerCnv< xAOD::BTaggingTrigAuxContainer,
xAODBTaggingTrigAuxContainerOfflineCnv_v1 >
xAODBTaggingTrigAuxContainerCnvBase;
/**
......@@ -34,23 +35,17 @@ typedef T_AthenaPoolCustomCnv< xAOD::BTaggingTrigAuxContainer,
* $Date: 2015-11-04 15:54:05 +0100 (Wed, 04 Nov 2015) $
*/
class xAODBTaggingTrigAuxContainerCnv :
public xAODBTaggingTrigAuxContainerCnvBase {
// Declare the factory as our friend:
friend class CnvFactory< xAODBTaggingTrigAuxContainerCnv >;
protected:
/// Converter constructor
public xAODBTaggingTrigAuxContainerCnvBase
{
public:
xAODBTaggingTrigAuxContainerCnv( ISvcLocator* svcLoc );
protected:
using xAODBTaggingTrigAuxContainerCnvBase::xAODBTaggingTrigAuxContainerCnvBase;
/// Function preparing the container to be written out
virtual xAOD::BTaggingTrigAuxContainer*
createPersistent( xAOD::BTaggingTrigAuxContainer* trans );
/// Function reading in the object from the input file
virtual xAOD::BTaggingTrigAuxContainer* createTransient();
createPersistentWithKey( xAOD::BTaggingTrigAuxContainer* trans,
const std::string& key) override;
}; // class xAODBTaggingTrigAuxContainerCnv
#endif // XAODBTAGGINGATHENAPOOL_XAODBTAGGINGTRIGAUXCONTAINERCNV_H
/*
Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
*/
// $Id: xAODBTaggingTrigAuxContainerOfflineCnv_v1.cxx 705820 2015-11-04 14:54:05Z krasznaa $
// System include(s):
#include <stdexcept>
// Gaudi/Athena include(s):
#include "GaudiKernel/MsgStream.h"
// Core EDM include(s):
#include "AthContainers/tools/copyAuxStoreThinned.h"
// Local include(s):
#include "xAODBTaggingTrigAuxContainerOfflineCnv_v1.h"
/// Convenience macro for setting the level of output messages
#define MSGLVL MSG::DEBUG
/// Another convenience macro for printing messages in the converter
#define ATH_MSG( MSG ) \
do { \
if( log.level() <= MSGLVL ) { \
log << MSGLVL << MSG << endmsg; \
} \
} while( 0 )
xAODBTaggingTrigAuxContainerOfflineCnv_v1::
xAODBTaggingTrigAuxContainerOfflineCnv_v1()
: T_AthenaPoolTPCnvBase< xAOD::BTaggingTrigAuxContainer,
xAOD::BTaggingAuxContainer_v1 >() {
}
void xAODBTaggingTrigAuxContainerOfflineCnv_v1::
persToTrans( const xAOD::BTaggingAuxContainer_v1* oldObj,
xAOD::BTaggingTrigAuxContainer* newObj,
MsgStream& log ) {
// Greet the user:
ATH_MSG( "Converting xAOD::BTaggingAuxContainer_v1 to "
"xAOD::BTaggingTrigAuxContainer..." );
// Clear the transient object:
newObj->resize( 0 );
// Copy the payload of the v1 object into the latest one by misusing
// the thinning code a bit...
SG::copyAuxStoreThinned( *oldObj, *newObj, 0 );
// Print what happened:
ATH_MSG( "Converting xAOD::BTaggingAuxContainer_v1 to "
"xAOD::BTaggingTrigAuxContainer [OK]" );
return;
}
/// This function should never be called, as we are not supposed to convert
/// object before writing.
///
void xAODBTaggingTrigAuxContainerOfflineCnv_v1::
transToPers( const xAOD::BTaggingTrigAuxContainer*,
xAOD::BTaggingAuxContainer_v1*,
MsgStream& log ) {
log << MSG::ERROR
<< "Somebody called xAODBTaggingTrigAuxContainerOfflineCnv_v1::"
<< "transToPers" << endmsg;
throw std::runtime_error( "Somebody called "
"xAODBTaggingTrigAuxContainerOfflineCnv_v1::"
"transToPers" );
return;
}
// 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: xAODBTaggingTrigAuxContainerOfflineCnv_v1.h 705820 2015-11-04 14:54:05Z krasznaa $
......@@ -9,7 +9,7 @@
#define XAODBTAGGINGATHENAPOOL_XAODBTAGGINGTRIGAUXCONTAINEROFFLINECNV_V1_H
// Gaudi/Athena include(s):
#include "AthenaPoolCnvSvc/T_AthenaPoolTPConverter.h"
#include "AthenaPoolCnvSvc/T_AuxContainerCopyTPCnv.h"
// EDM include(s):
#include "xAODBTagging/versions/BTaggingAuxContainer_v1.h"
......@@ -23,28 +23,9 @@
/// objects into the trigger ones automatically, to be able to read old
/// RAW files correctly.
///
/// @author Attila Krasznahorkay <Attila.Krasznahorkay@cern.ch>
///
/// $Revision: 705820 $
/// $Date: 2015-11-04 15:54:05 +0100 (Wed, 04 Nov 2015) $
///
class xAODBTaggingTrigAuxContainerOfflineCnv_v1 :
public T_AthenaPoolTPCnvBase< xAOD::BTaggingTrigAuxContainer,
xAOD::BTaggingAuxContainer_v1 > {
public:
/// Default constructor
xAODBTaggingTrigAuxContainerOfflineCnv_v1();
/// Function converting from the old type to the current one
virtual void persToTrans( const xAOD::BTaggingAuxContainer_v1* oldObj,
xAOD::BTaggingTrigAuxContainer* newObj,
MsgStream& log );
/// Dummy function inherited from the base class
virtual void transToPers( const xAOD::BTaggingTrigAuxContainer*,
xAOD::BTaggingAuxContainer_v1*,
MsgStream& log );
typedef T_AuxContainerCopyTPCnv< xAOD::BTaggingTrigAuxContainer,
xAOD::BTaggingAuxContainer_v1 >
xAODBTaggingTrigAuxContainerOfflineCnv_v1;
}; // class xAODBTaggingTrigAuxContainerOfflineCnv_v1
#endif // XAODBTAGGINGATHENAPOOL_XAODBTAGGINGTRIGAUXCONTAINEROFFLINECNV_V1_H
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment