diff --git a/Event/EventAthenaPool/src/EventStreamInfoCnv.cxx b/Event/EventAthenaPool/src/EventStreamInfoCnv.cxx index d2db891d1d90d827881be627208995a050cc988d..b5301ed08b75b87478104963c18a72438684b9b4 100755 --- a/Event/EventAthenaPool/src/EventStreamInfoCnv.cxx +++ b/Event/EventAthenaPool/src/EventStreamInfoCnv.cxx @@ -8,47 +8,3 @@ * $Id: EventStreamInfoCnv.cxx,v 1.3 2009-03-18 17:48:03 gemmeren Exp $ **/ -#include "EventStreamInfoCnv.h" -#include "EventTPCnv/EventStreamInfo_p1.h" -#include "EventTPCnv/EventStreamInfo_p2.h" -#include "EventTPCnv/EventStreamInfo_p3.h" -#include "EventTPCnv/EventStreamInfoCnv_p1.h" -#include "EventTPCnv/EventStreamInfoCnv_p2.h" -#include "EventTPCnv/EventStreamInfoCnv_p3.h" -#include "EventTPCnv/EventInfoCnv_p1.h" - -//______________________________________________________________________________ -EventStreamInfo_PERS* EventStreamInfoCnv::createPersistent(EventStreamInfo* transObj) { - MsgStream log(msgSvc(), "EventStreamInfoConverter"); - EventStreamInfoCnv_p3 tPconverter_p3; - EventStreamInfo_PERS *persObj = tPconverter_p3.createPersistent(transObj, log); - log << MSG::DEBUG << "Success" << endmsg; - return(persObj); -} -//______________________________________________________________________________ -EventStreamInfo* EventStreamInfoCnv::createTransient() { - static const pool::Guid p3_guid("11DF1B8C-0DEE-4687-80D7-E74B520ACBB4"); - static const pool::Guid p2_guid("9AD4889D-C8EB-4F3B-9920-D37FF092CAB6"); - static const pool::Guid p1_guid("9998C282-403B-4EA5-A795-C8C9BA9909C3"); - if (compareClassGuid(p3_guid)) { - // using unique_ptr ensures deletion of the persistent object - std::unique_ptr<EventStreamInfo_p3> esi_p3(poolReadObject<EventStreamInfo_p3>()); - MsgStream log(msgSvc(), "EventStreamInfoConverter"); - EventStreamInfoCnv_p3 tPconverter_p3; - return(tPconverter_p3.createTransient(esi_p3.get(), log)); - } else if (compareClassGuid(p2_guid)) { - // using unique_ptr ensures deletion of the persistent object - std::unique_ptr<EventStreamInfo_p2> esi_p2(poolReadObject<EventStreamInfo_p2>()); - MsgStream log(msgSvc(), "EventStreamInfoConverter"); - EventStreamInfoCnv_p2 tPconverter_p2; - return(tPconverter_p2.createTransient(esi_p2.get(), log)); - } else if (compareClassGuid(p1_guid)) { - // using unique_ptr ensures deletion of the persistent object - std::unique_ptr<EventStreamInfo_p1> esi_p1(poolReadObject<EventStreamInfo_p1>()); - MsgStream log(msgSvc(), "EventStreamInfoConverter"); - EventStreamInfoCnv_p1 tPconverter_p1; - return(tPconverter_p1.createTransient(esi_p1.get(), log)); - } - EventStreamInfo* esi = poolReadObject<EventStreamInfo>(); - return(esi); -} diff --git a/Event/EventAthenaPool/src/EventStreamInfoCnv.h b/Event/EventAthenaPool/src/EventStreamInfoCnv.h index 4bbdf192c5c8e0c813ab23572e625422abc0a684..e8eb422005b424c0da0dc31ee8d91eef982ccb1c 100644 --- a/Event/EventAthenaPool/src/EventStreamInfoCnv.h +++ b/Event/EventAthenaPool/src/EventStreamInfoCnv.h @@ -1,5 +1,5 @@ /* - Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration + Copyright (C) 2002-2021 CERN for the benefit of the ATLAS collaboration */ #ifndef EVENTSTREAMINFOCNV_H @@ -11,28 +11,20 @@ * $Id: EventStreamInfoCnv.h,v 1.3 2009-03-18 17:48:04 gemmeren Exp $ **/ -#include "AthenaPoolCnvSvc/T_AthenaPoolCustomCnv.h" -#include "EventInfo/EventStreamInfo.h" -#include "EventTPCnv/EventStreamInfo_p3.h" - -/// the latest persistent representation type of EventStreamInfo -typedef EventStreamInfo_p3 EventStreamInfo_PERS; -typedef T_AthenaPoolCustomCnv<EventStreamInfo, EventStreamInfo_PERS> EventStreamInfoCnvBase; -/** @class EventStreamInfoCnv - * @brief This class provides a converter for the EventStreamInfo class. - **/ -class EventStreamInfoCnv : public EventStreamInfoCnvBase { +#include "AthenaPoolCnvSvc/T_AthenaPoolTPCnvCnv.h" +#include "EventInfo/EventStreamInfo.h" +#include "EventTPCnv/EventStreamInfoCnv_p1.h" +#include "EventTPCnv/EventStreamInfoCnv_p2.h" +#include "EventTPCnv/EventStreamInfoCnv_p3.h" -friend class CnvFactory<EventStreamInfoCnv>; -protected: -public: - EventStreamInfoCnv(ISvcLocator* svcloc) : EventStreamInfoCnvBase(svcloc) {} -protected: +typedef T_AthenaPoolTPCnvCnv<EventStreamInfo, + EventStreamInfoCnv_p3, + EventStreamInfoCnv_p2, + EventStreamInfoCnv_p1, + T_TPCnvNull<EventStreamInfo> > + EventStreamInfoCnv; - virtual EventStreamInfo_PERS* createPersistent(EventStreamInfo* transObj); - virtual EventStreamInfo* createTransient(); -}; #endif diff --git a/Event/EventAthenaPool/src/MergedEventInfoCnv.cxx b/Event/EventAthenaPool/src/MergedEventInfoCnv.cxx index 3bfdc89587f80868930c0921b645f87a24a8460a..0b7f6a82b168166008c0e997e6a5c117649a82d4 100755 --- a/Event/EventAthenaPool/src/MergedEventInfoCnv.cxx +++ b/Event/EventAthenaPool/src/MergedEventInfoCnv.cxx @@ -8,39 +8,3 @@ * @author Marcin.Nowak@cern.ch */ -#include "MergedEventInfoCnv.h" - -MergedEventInfo_PERS* MergedEventInfoCnv::createPersistent(MergedEventInfo* transObj) { - MsgStream log(msgSvc(), "MergedEventInfoConverter" ); - static const MergedEventInfoCnv_p2 TPconv; - MergedEventInfo_PERS *persObj = TPconv.createPersistentConst( transObj, log ); - //log << MSG::DEBUG << "Success" << endmsg; - return persObj; -} - -MergedEventInfo* MergedEventInfoCnv::createTransient() { - static const pool::Guid p2_guid("5B0C1A92-6836-4B3C-9EE6-5E69792A28B5"); - static const pool::Guid p1_guid("9540DED6-51E8-48A3-8F86-05CB1D9CC812"); - static const pool::Guid p0_guid("FA93B80D-82C7-4096-8A04-62885A679A6F"); - if( compareClassGuid(p2_guid) ) { - std::unique_ptr< MergedEventInfo_p2 > col_vect( poolReadObject< MergedEventInfo_p2 >() ); - MsgStream log(msgSvc(), "MergedEventInfoConverter" ); - //log << MSG::DEBUG << "Reading MergedEventInfo_p2" << endmsg; - static const MergedEventInfoCnv_p2 TPconverter; - return TPconverter.createTransientConst( col_vect.get(), log ); - } else - if( compareClassGuid(p1_guid) ) { - std::unique_ptr< MergedEventInfo_p1 > col_vect( poolReadObject< MergedEventInfo_p1 >() ); - MsgStream log(msgSvc(), "MergedEventInfoConverter" ); - //log << MSG::DEBUG << "Reading MergedEventInfo_p1" << endmsg; - static const MergedEventInfoCnv_p1 TPconverter; - return TPconverter.createTransientConst( col_vect.get(), log ); - } - else if( compareClassGuid(p0_guid) ) { - // regular object from before TP separation, just return it - //MsgStream log(msgSvc(), "MergedEventInfoConverter" ); - //log << MSG::DEBUG << "Reading MergedEventInfo (original)" << endmsg; - return poolReadObject< MergedEventInfo >(); - } - throw std::runtime_error("Unsupported persistent version of MergedEventInfo"); -} diff --git a/Event/EventAthenaPool/src/MergedEventInfoCnv.h b/Event/EventAthenaPool/src/MergedEventInfoCnv.h index b3c7dfe89fe96f8fa31e0133598b424cd81a2286..dbb67e50b063fb3a590fb8c6a95734f51ea1d3ce 100644 --- a/Event/EventAthenaPool/src/MergedEventInfoCnv.h +++ b/Event/EventAthenaPool/src/MergedEventInfoCnv.h @@ -19,20 +19,12 @@ #include "EventTPCnv/MergedEventInfo_p2.h" #include "EventTPCnv/MergedEventInfoCnv_p2.h" -// the latest persistent representation type of MergedEventInfo -typedef MergedEventInfo_p2 MergedEventInfo_PERS; - -typedef T_AthenaPoolCustomCnv<MergedEventInfo, MergedEventInfo_PERS > MergedEventInfoCnvBase; - -class MergedEventInfoCnv : public MergedEventInfoCnvBase { -friend class CnvFactory<MergedEventInfoCnv >; -protected: -public: - MergedEventInfoCnv (ISvcLocator* svcloc) : MergedEventInfoCnvBase(svcloc) {} -protected: - virtual MergedEventInfo_PERS* createPersistent (MergedEventInfo* transObj); - virtual MergedEventInfo* createTransient (); -}; +typedef T_AthenaPoolTPCnvCnv<MergedEventInfo, + MergedEventInfoCnv_p2, + MergedEventInfoCnv_p1, + T_TPCnvNull<MergedEventInfo> > + MergedEventInfoCnv; + #endif diff --git a/Event/EventAthenaPool/src/PileUpEventInfoCnv.cxx b/Event/EventAthenaPool/src/PileUpEventInfoCnv.cxx index 07a678a7be633207c9e3f8b19ed3ea90332477e7..805e5aa48782b25a9bce410949543439fcf7b7b0 100755 --- a/Event/EventAthenaPool/src/PileUpEventInfoCnv.cxx +++ b/Event/EventAthenaPool/src/PileUpEventInfoCnv.cxx @@ -8,70 +8,3 @@ * @author Marcin.Nowak@cern.ch */ -#include "PileUpEventInfoCnv.h" - - -PileUpEventInfo_PERS* PileUpEventInfoCnv::createPersistent(PileUpEventInfo* transObj) { - MsgStream log(msgSvc(), "PileUpEventInfoConverter" ); - static const PileUpEventInfoCnv_p5 TPconverter; - PileUpEventInfo_PERS *persObj = TPconverter.createPersistentConst( transObj, log ); - //log << MSG::DEBUG << "Success" << endmsg; - return persObj; -} - -PileUpEventInfo* PileUpEventInfoCnv::createTransient() { - static const pool::Guid p5_guid("F53A1735-F61A-4CA4-B25F-DB0E277E2DDC"); - static const pool::Guid p4_guid("7D72CE05-E814-4A70-B3B2-B54B05069103"); - static const pool::Guid p3_guid("32A54198-BCDF-0AB5-DC0B-542CAE9866C2"); - static const pool::Guid p2_guid("C2A54FC3-759C-4F01-AF7E-668D9198E10F"); - static const pool::Guid p1_guid("1A399605-8E31-4150-B766-2049FD689485"); - static const pool::Guid p0_guid("6A58157B-6B6E-430F-A72A-EAAA4BDC4AE2"); - if( compareClassGuid(p5_guid) ) { - // using unique_ptr ensures deletion of the persistent object - std::unique_ptr< PileUpEventInfo_p5 > col_vect( poolReadObject< PileUpEventInfo_p5 >() ); - MsgStream log(msgSvc(), "PileUpEventInfoConverter" ); - //log << MSG::DEBUG << "Reading PileUpEventInfo_p5" << endmsg; - static const PileUpEventInfoCnv_p5 TPconverter; - return TPconverter.createTransientConst( col_vect.get(), log ); - } - else if( compareClassGuid(p4_guid) ) { - // using unique_ptr ensures deletion of the persistent object - std::unique_ptr< PileUpEventInfo_p4 > col_vect( poolReadObject< PileUpEventInfo_p4 >() ); - MsgStream log(msgSvc(), "PileUpEventInfoConverter" ); - //log << MSG::DEBUG << "Reading PileUpEventInfo_p4" << endmsg; - static const PileUpEventInfoCnv_p4 TPconverter; - return TPconverter.createTransientConst( col_vect.get(), log ); - } - if( compareClassGuid(p3_guid) ) { - // using unique_ptr ensures deletion of the persistent object - std::unique_ptr< PileUpEventInfo_p3 > col_vect( poolReadObject< PileUpEventInfo_p3 >() ); - MsgStream log(msgSvc(), "PileUpEventInfoConverter" ); - //log << MSG::DEBUG << "Reading PileUpEventInfo_p3" << endmsg; - static const PileUpEventInfoCnv_p3 TPconverter; - return TPconverter.createTransientConst( col_vect.get(), log ); - } - else if( compareClassGuid(p2_guid) ) { - // using unique_ptr ensures deletion of the persistent object - std::unique_ptr< PileUpEventInfo_p2 > col_vect( poolReadObject< PileUpEventInfo_p2 >() ); - MsgStream log(msgSvc(), "PileUpEventInfoConverter" ); - //log << MSG::DEBUG << "Reading PileUpEventInfo_p2" << endmsg; - static const PileUpEventInfoCnv_p2 TPconverter; - return TPconverter.createTransientConst( col_vect.get(), log ); - } - else if( compareClassGuid(p1_guid) ) { - // using unique_ptr ensures deletion of the persistent object - std::unique_ptr< PileUpEventInfo_p1 > col_vect( poolReadObject< PileUpEventInfo_p1 >() ); - MsgStream log(msgSvc(), "PileUpEventInfoConverter" ); - //log << MSG::DEBUG << "Reading PileUpEventInfo_p1" << endmsg; - static const PileUpEventInfoCnv_p1 TPconverter; - return TPconverter.createTransientConst( col_vect.get(), log ); - } - else if( compareClassGuid(p0_guid) ) { - // regular object from before TP separation, just return it - - //MsgStream log(msgSvc(), "PileUpEventInfoConverter" ); - //log << MSG::DEBUG << "Reading PileUpEventInfo (original)" << endmsg; - return poolReadObject< PileUpEventInfo >(); - } - throw std::runtime_error("Unsupported persistent version of PileUpEventInfo"); -} diff --git a/Event/EventAthenaPool/src/PileUpEventInfoCnv.h b/Event/EventAthenaPool/src/PileUpEventInfoCnv.h index dd2266d69b66da3761f6c366a1336304a0bf4b04..f9fd00c8d6129d49e1490413cf820423269c1b91 100644 --- a/Event/EventAthenaPool/src/PileUpEventInfoCnv.h +++ b/Event/EventAthenaPool/src/PileUpEventInfoCnv.h @@ -1,5 +1,5 @@ /* - Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration + Copyright (C) 2002-2021 CERN for the benefit of the ATLAS collaboration */ /** @@ -27,20 +27,14 @@ #include "EventTPCnv/PileUpEventInfo_p5.h" #include "EventTPCnv/PileUpEventInfoCnv_p5.h" -// the latest persistent representation type of PileUpEventInfo -typedef PileUpEventInfo_p5 PileUpEventInfo_PERS; +typedef T_AthenaPoolTPCnvCnv<PileUpEventInfo, + PileUpEventInfoCnv_p5, + PileUpEventInfoCnv_p4, + PileUpEventInfoCnv_p3, + PileUpEventInfoCnv_p2, + PileUpEventInfoCnv_p1, + T_TPCnvNull<PileUpEventInfo> > + PileUpEventInfoCnv; -typedef T_AthenaPoolCustomCnv<PileUpEventInfo, PileUpEventInfo_PERS > PileUpEventInfoCnvBase; - -class PileUpEventInfoCnv : public PileUpEventInfoCnvBase { -friend class CnvFactory<PileUpEventInfoCnv >; -protected: -public: - PileUpEventInfoCnv (ISvcLocator* svcloc) : PileUpEventInfoCnvBase(svcloc) {} -protected: - virtual PileUpEventInfo_PERS* createPersistent (PileUpEventInfo* transObj); - virtual PileUpEventInfo* createTransient (); -}; #endif -