diff --git a/Tracking/TrkEventCnv/TrkEventAthenaPool/src/TrackCollectionCnv.cxx b/Tracking/TrkEventCnv/TrkEventAthenaPool/src/TrackCollectionCnv.cxx index cd68ef765d0bb938893c1495570805e1d0514d91..682272c4f2448687f3c3beab3ad7c73eb3f527eb 100755 --- a/Tracking/TrkEventCnv/TrkEventAthenaPool/src/TrackCollectionCnv.cxx +++ b/Tracking/TrkEventCnv/TrkEventAthenaPool/src/TrackCollectionCnv.cxx @@ -74,7 +74,8 @@ void TrackCollectionCnv::initializeOldExtConverters() -TrackCollection_PERS * TrackCollectionCnv::createPersistent( TrackCollection *transCont) +TrackCollection_PERS * TrackCollectionCnv::createPersistentWithKey( TrackCollection *transCont, + const std::string& key) { std::string logname = "TrackCollectionCnv"; if (const DataObject* dObj = getDataObject()) { @@ -83,52 +84,52 @@ TrackCollection_PERS * TrackCollectionCnv::createPersistent( TrackCollection *tr MsgStream log (m_msgSvc, logname ); - return m_TPConverter.createPersistent( transCont, log ); + return m_TPConverter.createPersistentWithKey ( transCont, key, log ); } //----------------------------------------------------------------------------- // Create transient collection //----------------------------------------------------------------------------- -TrackCollection *TrackCollectionCnv::createTransient() +TrackCollection *TrackCollectionCnv::createTransientWithKey(const std::string& key) { m_log.setLevel( m_msgSvc->outputLevel() ); - static pool::Guid p6_guid( "3228B252-2C5D-11E8-B170-0800271C02BC" ); - static pool::Guid p5_guid( "436E4996-9D6E-11E3-AD2A-6C3BE51AB9F1" ); - static pool::Guid p4_guid( "3BEB819F-6ED2-48F6-9F95-E65E1759E781" ); - static pool::Guid p3_guid( "A1E9FDCB-2F4A-4AC8-BF4E-2D70B9C70F8A" ); - static pool::Guid p2_guid( "2D8B19DC-DB2E-4F56-BB94-D7C4544D501A" ); - static pool::Guid p1_guid( "ECB12567-B999-4908-B0C6-C43CF9F9A987" ); - static pool::Guid p0_guid( "70ECEBFC-BE00-46C2-8B35-4CC12D18DE39" ); + static const pool::Guid p6_guid( "3228B252-2C5D-11E8-B170-0800271C02BC" ); + static const pool::Guid p5_guid( "436E4996-9D6E-11E3-AD2A-6C3BE51AB9F1" ); + static const pool::Guid p4_guid( "3BEB819F-6ED2-48F6-9F95-E65E1759E781" ); + static const pool::Guid p3_guid( "A1E9FDCB-2F4A-4AC8-BF4E-2D70B9C70F8A" ); + static const pool::Guid p2_guid( "2D8B19DC-DB2E-4F56-BB94-D7C4544D501A" ); + static const pool::Guid p1_guid( "ECB12567-B999-4908-B0C6-C43CF9F9A987" ); + static const pool::Guid p0_guid( "70ECEBFC-BE00-46C2-8B35-4CC12D18DE39" ); TrackCollection *p_collection = 0; if( compareClassGuid( p6_guid )){ poolReadObject< TrackCollection_PERS >( m_TPConverter ); - p_collection = m_TPConverter.createTransient( m_log ); + p_collection = m_TPConverter.createTransientWithKey( key, m_log ); } else if( compareClassGuid( p5_guid )){ initializeOldExtConverters(); poolReadObject< Trk::TrackCollection_tlp5 >( m_TPConverter_tlp5); - p_collection = m_TPConverter_tlp5.createTransient( m_log ); + p_collection = m_TPConverter_tlp5.createTransientWithKey( key, m_log ); } else if( compareClassGuid( p4_guid )){ initializeOldExtConverters(); poolReadObject< Trk::TrackCollection_tlp4 >( m_TPConverter_tlp4); - p_collection = m_TPConverter_tlp4.createTransient( m_log ); + p_collection = m_TPConverter_tlp4.createTransientWithKey( key, m_log ); } else if( compareClassGuid( p3_guid )){ initializeOldExtConverters(); poolReadObject< Trk::TrackCollection_tlp3 >( m_TPConverter_tlp3); - p_collection = m_TPConverter_tlp3.createTransient( m_log ); + p_collection = m_TPConverter_tlp3.createTransientWithKey( key, m_log ); } else if( compareClassGuid( p2_guid ) ) { initializeOldExtConverters(); poolReadObject< Trk::TrackCollection_tlp2 >( m_TPConverter_tlp2 ); - p_collection = m_TPConverter_tlp2.createTransient( m_log ); + p_collection = m_TPConverter_tlp2.createTransientWithKey( key, m_log ); } else if( compareClassGuid( p1_guid ) ) { initializeOldExtConverters(); poolReadObject< Trk::TrackCollection_tlp1 >( m_TPConverter_tlp1 ); - p_collection = m_TPConverter_tlp1.createTransient( m_log ); + p_collection = m_TPConverter_tlp1.createTransientWithKey( key, m_log ); } else if( compareClassGuid( p0_guid ) ) { p_collection = poolReadObject< TrackCollection >(); diff --git a/Tracking/TrkEventCnv/TrkEventAthenaPool/src/TrackCollectionCnv.h b/Tracking/TrkEventCnv/TrkEventAthenaPool/src/TrackCollectionCnv.h index c31f155c8e16bebe96058a64998bbe8b296174e7..c0cdfa844f256669d3b7402dbff9af05c9d76390 100755 --- a/Tracking/TrkEventCnv/TrkEventAthenaPool/src/TrackCollectionCnv.h +++ b/Tracking/TrkEventCnv/TrkEventAthenaPool/src/TrackCollectionCnv.h @@ -35,7 +35,7 @@ typedef Trk::TrackCollection_tlp6 TrackCollection_PERS; -typedef T_AthenaPoolCustomCnv<TrackCollection, TrackCollection_PERS> TrackCollectionCnvBase; +typedef T_AthenaPoolCustomCnvWithKey<TrackCollection, TrackCollection_PERS> TrackCollectionCnvBase; //----------------------------------------------------------------------------- // Converter for TrackCollection object @@ -52,8 +52,9 @@ public: protected: virtual StatusCode initialize() override; - virtual TrackCollection_PERS *createPersistent( TrackCollection *transCont) override; - virtual TrackCollection *createTransient() override; + virtual TrackCollection_PERS *createPersistentWithKey( TrackCollection *transCont, + const std::string& key) override; + virtual TrackCollection *createTransientWithKey (const std::string& key) override; virtual AthenaPoolTopLevelTPCnvBase* getTopLevelTPCnv() override { return & m_TPConverter; } diff --git a/Tracking/TrkEventCnv/TrkEventTPCnv/TrkEventTPCnv/TrkTrack/TrackCollectionCnv_p1.h b/Tracking/TrkEventCnv/TrkEventTPCnv/TrkEventTPCnv/TrkTrack/TrackCollectionCnv_p1.h index b23dccd006011e3b3bec220e22c54673b6505f2d..85d2a3fb2743efa2d5831bd7e2aa0799160efe3d 100644 --- a/Tracking/TrkEventCnv/TrkEventTPCnv/TrkEventTPCnv/TrkTrack/TrackCollectionCnv_p1.h +++ b/Tracking/TrkEventCnv/TrkEventTPCnv/TrkEventTPCnv/TrkTrack/TrackCollectionCnv_p1.h @@ -1,5 +1,5 @@ /* - Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration + Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration */ #ifndef TRACK_COLLECTION_CNV_P1_TRK_H @@ -22,7 +22,7 @@ class MsgStream; class TrackCollectionCnv_p1 - : public T_AthenaPoolTPPtrVectorCnv< TrackCollection, Trk::TrackCollection_p1, TrackCnv_p1 > + : public T_AthenaPoolTPThinnedPtrVectorCnv< TrackCollection, Trk::TrackCollection_p1, TrackCnv_p1 > { public: TrackCollectionCnv_p1() {} diff --git a/Tracking/TrkEventCnv/TrkEventTPCnv/TrkEventTPCnv/TrkTrack/TrackCollectionCnv_p2.h b/Tracking/TrkEventCnv/TrkEventTPCnv/TrkEventTPCnv/TrkTrack/TrackCollectionCnv_p2.h index 1100036bb3d041ae0fe1dcfe563aee836cf48114..8abccda9088549c73e1a2e3a300f397cf33f1fe3 100644 --- a/Tracking/TrkEventCnv/TrkEventTPCnv/TrkEventTPCnv/TrkTrack/TrackCollectionCnv_p2.h +++ b/Tracking/TrkEventCnv/TrkEventTPCnv/TrkEventTPCnv/TrkTrack/TrackCollectionCnv_p2.h @@ -1,5 +1,5 @@ /* - Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration + Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration */ #ifndef TRACK_COLLECTION_CNV_P2_TRK_H @@ -22,7 +22,7 @@ class MsgStream; class TrackCollectionCnv_p2 - : public T_AthenaPoolTPPtrVectorCnv< TrackCollection, Trk::TrackCollection_p1, TrackCnv_p2 > + : public T_AthenaPoolTPThinnedPtrVectorCnv< TrackCollection, Trk::TrackCollection_p1, TrackCnv_p2 > { public: TrackCollectionCnv_p2() {} diff --git a/Tracking/TrkEventCnv/TrkEventTPCnv/TrkEventTPCnv/TrkTrack/TrackCollectionCnv_p3.h b/Tracking/TrkEventCnv/TrkEventTPCnv/TrkEventTPCnv/TrkTrack/TrackCollectionCnv_p3.h index d9735235395c6c7031f89c726a87584d2bca5586..974a49ecabbb99b16bad64684dc45bf2b4b0e0a9 100644 --- a/Tracking/TrkEventCnv/TrkEventTPCnv/TrkEventTPCnv/TrkTrack/TrackCollectionCnv_p3.h +++ b/Tracking/TrkEventCnv/TrkEventTPCnv/TrkEventTPCnv/TrkTrack/TrackCollectionCnv_p3.h @@ -1,5 +1,5 @@ /* - Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration + Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration */ #ifndef TRACK_COLLECTION_CNV_P3_TRK_H @@ -21,7 +21,7 @@ class MsgStream; class TrackCollectionCnv_p3 - : public T_AthenaPoolTPPtrVectorCnv< TrackCollection, Trk::TrackCollection_p1, TrackCnv_p3 > + : public T_AthenaPoolTPThinnedPtrVectorCnv< TrackCollection, Trk::TrackCollection_p1, TrackCnv_p3 > { public: TrackCollectionCnv_p3() {} diff --git a/Tracking/TrkEventCnv/TrkEventTPCnv/TrkEventTPCnv/TrkTrack/TrackCollectionCnv_p4.h b/Tracking/TrkEventCnv/TrkEventTPCnv/TrkEventTPCnv/TrkTrack/TrackCollectionCnv_p4.h index d9aa7c53eeef58d4d85e857548e401ba8fc387be..5c166b81caf74158b83037d12333fad40ce51007 100644 --- a/Tracking/TrkEventCnv/TrkEventTPCnv/TrkEventTPCnv/TrkTrack/TrackCollectionCnv_p4.h +++ b/Tracking/TrkEventCnv/TrkEventTPCnv/TrkEventTPCnv/TrkTrack/TrackCollectionCnv_p4.h @@ -1,5 +1,5 @@ /* - Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration + Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration */ #ifndef TRACK_COLLECTION_CNV_P4_TRK_H @@ -21,7 +21,7 @@ class MsgStream; class TrackCollectionCnv_p4 - : public T_AthenaPoolTPPtrVectorCnv< TrackCollection, Trk::TrackCollection_p1, TrackCnv_p4 > + : public T_AthenaPoolTPThinnedPtrVectorCnv< TrackCollection, Trk::TrackCollection_p1, TrackCnv_p4 > { public: TrackCollectionCnv_p4() {} diff --git a/Tracking/TrkEventCnv/TrkEventTopLevelCnv/TrkEventTopLevelCnv/TrackCollectionCnv_tlp6.h b/Tracking/TrkEventCnv/TrkEventTopLevelCnv/TrkEventTopLevelCnv/TrackCollectionCnv_tlp6.h index 3d0527fe45fc82cbb9ee65dd40faa7c00e3e8d5d..6f2ab56d82569a5f40efe697887eeefc20ea7790 100644 --- a/Tracking/TrkEventCnv/TrkEventTopLevelCnv/TrkEventTopLevelCnv/TrackCollectionCnv_tlp6.h +++ b/Tracking/TrkEventCnv/TrkEventTopLevelCnv/TrkEventTopLevelCnv/TrackCollectionCnv_tlp6.h @@ -1,5 +1,5 @@ /* - Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration + Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration */ #ifndef TRACK_COLLECTION_CNV_TLP6_TRK_H @@ -45,8 +45,10 @@ class TrackCollectionCnv_tlp6 : public BaseTrackCollectionCnv TrackCollectionCnv_tlp6(); - virtual void setPStorage( PERS *storage ); - virtual PERS* createPersistent(const TRANS* transObj, MsgStream &log); + virtual void setPStorage( PERS *storage ) override; + virtual PERS* createPersistentWithKey(const TRANS* transObj, + const std::string& key, + MsgStream &log) override; // all TP converters for types used in the Track package protected: diff --git a/Tracking/TrkEventCnv/TrkEventTopLevelCnv/src/TrackCollectionCnv_tlp6.cxx b/Tracking/TrkEventCnv/TrkEventTopLevelCnv/src/TrackCollectionCnv_tlp6.cxx index fb33709bf03e0eae891bae6fc413e68546b8c5d9..59f87fbbfa0862737b127295b4d6129410ba5a59 100644 --- a/Tracking/TrkEventCnv/TrkEventTopLevelCnv/src/TrackCollectionCnv_tlp6.cxx +++ b/Tracking/TrkEventCnv/TrkEventTopLevelCnv/src/TrackCollectionCnv_tlp6.cxx @@ -1,5 +1,5 @@ /* - Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration + Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration */ #include "TrkEventTopLevelCnv/TrackCollectionCnv_tlp6.h" @@ -93,16 +93,19 @@ void TrackCollectionCnv_tlp6::setPStorage( PERS *storage ) m_localParametersCnv. setPStorage( &storage->m_localParameters ); // when reading (createTrans) these will be non-null if extension is present - // when writing, they will be null at first end set afterwards in createPersisten() + // when writing, they will be null at first end set afterwards in createPersistentWithKey() if( storage->m_inDetTrackExt ) m_inDetTrackCnv .setPStorage( storage->m_inDetTrackExt ); if( storage->m_muonMeasurementsExt ) m_muonMeasurementsCnv.setPStorage( storage->m_muonMeasurementsExt ); if( storage->m_muonCaloEnergiesExt ) m_muonCaloEnergiesCnv.setPStorage( storage->m_muonCaloEnergiesExt ); } -BaseTrackCollectionCnv::PERS* TrackCollectionCnv_tlp6::createPersistent(const TRANS* transObj, MsgStream &log) +BaseTrackCollectionCnv::PERS* +TrackCollectionCnv_tlp6::createPersistentWithKey(const TRANS* transObj, + const std::string& key, + MsgStream &log) { - PERS *pers = BaseTrackCollectionCnv::createPersistent(transObj, log); + PERS *pers = BaseTrackCollectionCnv::createPersistentWithKey(transObj, key, log); // get extending objects (nullptr if there was no extending data types) pers->m_muonMeasurementsExt = m_muonMeasurementsCnv.releaseTLPersObject();