diff --git a/Reconstruction/Jet/JetEventAthenaPool/src/JetCollectionCnv.cxx b/Reconstruction/Jet/JetEventAthenaPool/src/JetCollectionCnv.cxx index ab676fc54f8c9706affe6ae264bbd340452273af..83e4d5762b35876f7cf78dfed0c063c748ae52cc 100755 --- a/Reconstruction/Jet/JetEventAthenaPool/src/JetCollectionCnv.cxx +++ b/Reconstruction/Jet/JetEventAthenaPool/src/JetCollectionCnv.cxx @@ -18,17 +18,6 @@ #include "GaudiKernel/MsgStream.h" -/////////////////////////////////////////////////////////////////// -/// Public methods: -/////////////////////////////////////////////////////////////////// - -/////////////////////////////////////////////////////////////////// -/// Const methods: -/////////////////////////////////////////////////////////////////// - -/////////////////////////////////////////////////////////////////// -// Protected methods: -/////////////////////////////////////////////////////////////////// /// Hook ourselves into the infrastructure. JetCollectionCnv::JetCollectionCnv(ISvcLocator *svcLocator) diff --git a/Reconstruction/Jet/JetEventAthenaPool/src/JetKeyDescriptorCnv.cxx b/Reconstruction/Jet/JetEventAthenaPool/src/JetKeyDescriptorCnv.cxx index 18f54f8b2ecac915a0a24f67aadd045c8dffe4bc..5c8cdba561c049e9d33c3289664f6d9fd878dc1b 100644 --- a/Reconstruction/Jet/JetEventAthenaPool/src/JetKeyDescriptorCnv.cxx +++ b/Reconstruction/Jet/JetEventAthenaPool/src/JetKeyDescriptorCnv.cxx @@ -1,35 +1,6 @@ /* - 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 "JetKeyDescriptorCnv.h" -#include "JetEventTPCnv/JetKeyDescriptor_p1.h" -#include "JetEventTPCnv/JetKeyDescriptorCnv_p1.h" - -JetKeyDescriptor_PERS* JetKeyDescriptorCnv::createPersistent(JetKeyDescriptor* transObj) -{ - MsgStream report( msgSvc(), "JetKeyDescriptorConverter" ); - report << MSG::DEBUG << "Writing JetKeyDescriptor_p1" << endmsg; - JetKeyDescriptorCnv_p1 TPconverter; - JetKeyDescriptor_PERS *persObj = TPconverter.createPersistent( transObj, report ); - - // will be deleted shortly - // RS RS RS transObj->m_instance = 0; - return persObj; -} - -JetKeyDescriptor* JetKeyDescriptorCnv::createTransient() -{ - static pool::Guid p1_guid("9F364413-5313-485F-9DBC-8DD8E8CA4AC4"); - if( compareClassGuid(p1_guid) ) - { - JetKeyDescriptorCnv_p1 TPconverter; - // using unique_ptr ensures deletion of the persistent object - std::unique_ptr<JetKeyDescriptor_p1> jet_keydescr( poolReadObject< JetKeyDescriptor_p1 >() ); - MsgStream report( msgSvc(), "JetKeyDescriptorCnv" ); - report << MSG::DEBUG << "Reading JetKeyDescriptor_p1" << endmsg; - return TPconverter.createTransient( jet_keydescr.get(), report ); - } - throw std::runtime_error("Unsupported persistent version of JetKeyDescriptor"); -} +// Reconstruction/Jet/JetEventAthenaPool/src/JetKeyDescriptorCnv.cxx +// Dummy source so that the build system knows that this is a custom converter. diff --git a/Reconstruction/Jet/JetEventAthenaPool/src/JetKeyDescriptorCnv.h b/Reconstruction/Jet/JetEventAthenaPool/src/JetKeyDescriptorCnv.h index 247518938a9ebaafb55f352fa94854ec07694b5d..4f4127bc2b108a380ada8e5b7005425de81321e6 100644 --- a/Reconstruction/Jet/JetEventAthenaPool/src/JetKeyDescriptorCnv.h +++ b/Reconstruction/Jet/JetEventAthenaPool/src/JetKeyDescriptorCnv.h @@ -1,33 +1,22 @@ /* - 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 JETEVENT_JETKEYDESCRIPTORCNV_H #define JETEVENT_JETKEYDESCRIPTORCNV_H -#include "AthenaPoolCnvSvc/T_AthenaPoolCustomCnv.h" +#include "AthenaPoolCnvSvc/T_AthenaPoolTPCnvCnv.h" #include <string> #include <vector> #include "JetEvent/JetKeyDescriptor.h" -#include "JetEventTPCnv/JetKeyDescriptor_p1.h" +#include "JetEventTPCnv/JetKeyDescriptorCnv_p1.h" // the latest persistent representation type of JetKeyDescriptor_p1 -typedef JetKeyDescriptor_p1 JetKeyDescriptor_PERS; -typedef T_AthenaPoolCustomCnv<JetKeyDescriptor, JetKeyDescriptor_PERS> JetKeyDescriptorCnvBase; +typedef T_AthenaPoolTPCnvCnv<JetKeyDescriptor, + JetKeyDescriptorCnv_p1> + JetKeyDescriptorCnv; -class JetKeyDescriptorCnv : public JetKeyDescriptorCnvBase -{ - friend class CnvFactory<JetKeyDescriptorCnv>; - - protected: - -public: - JetKeyDescriptorCnv (ISvcLocator* svcloc) : JetKeyDescriptorCnvBase(svcloc) {}; -protected: - virtual JetKeyDescriptor_PERS* createPersistent (JetKeyDescriptor* transObj); - virtual JetKeyDescriptor* createTransient (); -}; #endif diff --git a/Reconstruction/Jet/JetEventAthenaPool/src/JetMomentMapCnv.cxx b/Reconstruction/Jet/JetEventAthenaPool/src/JetMomentMapCnv.cxx index 309b057364679e2b2143e121cc34ff9e5c79a8cd..7df618525054000c5467367b064632226753adf6 100644 --- a/Reconstruction/Jet/JetEventAthenaPool/src/JetMomentMapCnv.cxx +++ b/Reconstruction/Jet/JetEventAthenaPool/src/JetMomentMapCnv.cxx @@ -1,46 +1,6 @@ /* - 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 "JetMomentMapCnv.h" -#include "JetEventTPCnv/JetMomentMapCnv_p6.h" -#include "JetEventTPCnv/JetMomentMapCnv_p1.h" - - -JetMomentMap_PERS* JetMomentMapCnv::createPersistent(JetMomentMap* transObj) -{ - MsgStream report( msgSvc(), "JetMomentMapConverter" ); - report << MSG::DEBUG << "Writing JetMomentMap_p6" << endmsg; - JetMomentMapCnv_p6 TPconverter; - JetMomentMap_PERS *persObj = TPconverter.createPersistent( transObj, report ); - - // will be deleted shortly - // RS RS RS transObj->m_instance = 0; - return persObj; -} - -JetMomentMap* JetMomentMapCnv::createTransient() -{ - static pool::Guid p1_guid("12E5A61A-6C0B-42EF-9E1D-DF33129500F4"); - static pool::Guid p6_guid("7E53BA8F-B022-4DA7-9D8E-334262C4CE6F"); - if( compareClassGuid(p1_guid) ) - { - JetMomentMapCnv_p1 TPconverter; - // using unique_ptr ensures deletion of the persistent object - std::unique_ptr<JetMomentMap_p1> jet_momentdescr( poolReadObject< JetMomentMap_p1 >() ); - MsgStream report( msgSvc(), "JetMomentMapCnv" ); - report << MSG::DEBUG << "Reading JetMomentMap_p6" << endmsg; - return TPconverter.createTransient( jet_momentdescr.get(), report ); - }else if( compareClassGuid(p6_guid) ) - { - JetMomentMapCnv_p6 TPconverter; - // using unique_ptr ensures deletion of the persistent object - std::unique_ptr<JetMomentMap_p6> jet_momentdescr( poolReadObject< JetMomentMap_p6 >() ); - MsgStream report( msgSvc(), "JetMomentMapCnv" ); - report << MSG::DEBUG << "Reading JetMomentMap_p6" << endmsg; - return TPconverter.createTransient( jet_momentdescr.get(), report ); - } - - throw std::runtime_error("Unsupported persistent version of JetMomentMap"); -} +// Reconstruction/Jet/JetEventAthenaPool/src/JetMomentMapCnv.cxx +// Dummy source so that the build system knows that this is a custom converter. diff --git a/Reconstruction/Jet/JetEventAthenaPool/src/JetMomentMapCnv.h b/Reconstruction/Jet/JetEventAthenaPool/src/JetMomentMapCnv.h index 088cf963009e2e49647d9483e91c746fc06ff44f..ea3d92a2aa8b8f6d7310f593b51da34427e97700 100644 --- a/Reconstruction/Jet/JetEventAthenaPool/src/JetMomentMapCnv.h +++ b/Reconstruction/Jet/JetEventAthenaPool/src/JetMomentMapCnv.h @@ -1,36 +1,25 @@ /* - 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 JETEVENTATHENAPOOL_JETMOMENTMAPCNV_H #define JETEVENTATHENAPOOL_JETMOMENTMAPCNV_H -#include "AthenaPoolCnvSvc/T_AthenaPoolCustomCnv.h" +#include "AthenaPoolCnvSvc/T_AthenaPoolTPCnvCnv.h" -#include "JetEventTPCnv/JetMomentMap_p6.h" +#include "JetEventTPCnv/JetMomentMapCnv_p1.h" +#include "JetEventTPCnv/JetMomentMapCnv_p6.h" #include "JetEvent/JetMomentMap.h" #include <string> #include <vector> -// the latest persistent representation type of JetMomentMap_p1 -typedef JetMomentMap_p6 JetMomentMap_PERS; -typedef T_AthenaPoolCustomCnv<JetMomentMap, JetMomentMap_PERS> JetMomentMapCnvBase; - -class JetMomentMapCnv : public JetMomentMapCnvBase -{ - friend class CnvFactory<JetMomentMapCnv>; - - protected: - -public: - JetMomentMapCnv (ISvcLocator* svcloc) : JetMomentMapCnvBase(svcloc) {}; -protected: - virtual JetMomentMap_PERS* createPersistent (JetMomentMap* transObj); - virtual JetMomentMap* createTransient (); - -}; +typedef T_AthenaPoolTPCnvCnv<JetMomentMap, + JetMomentMapCnv_p6, + JetMomentMapCnv_p1> + JetMomentMapCnv; + #endif diff --git a/Reconstruction/Jet/JetEventAthenaPool/src/JetSamplingCollectionCnv.cxx b/Reconstruction/Jet/JetEventAthenaPool/src/JetSamplingCollectionCnv.cxx index a1f4ef5a4f08080580e36a6a9693e1d5e85297b5..ba54cddbc25279240ec9f3d018a19d02e001a8a9 100644 --- a/Reconstruction/Jet/JetEventAthenaPool/src/JetSamplingCollectionCnv.cxx +++ b/Reconstruction/Jet/JetEventAthenaPool/src/JetSamplingCollectionCnv.cxx @@ -1,81 +1,6 @@ -///////////////////////// -*- 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 */ -// JetSamplingCollectionCnv.cxx -// Implementation file for class JetSamplingCollectionCnv -// Author: S.Binet<binet@cern.ch> -// Modified: Belen.Salvachua@cern.ch Dc 2008 Add JetSampling_p2 -/////////////////////////////////////////////////////////////////// - -// STL includes - -// Framework includes -#include "GaudiKernel/MsgStream.h" - -// JetEventTPCnv includes -#include "JetEventTPCnv/JetSamplingCollectionCnv_p1.h" -#include "JetEventTPCnv/JetSamplingCollectionCnv_p2.h" - -// RecAthenaPool includes -#include "JetSamplingCollectionCnv.h" - -/////////////////////////////////////////////////////////////////// -/// Public methods: -/////////////////////////////////////////////////////////////////// - -/////////////////////////////////////////////////////////////////// -/// Const methods: -/////////////////////////////////////////////////////////////////// - -/////////////////////////////////////////////////////////////////// -// Protected methods: -/////////////////////////////////////////////////////////////////// - - -JetSamplingCollection_PERS* -JetSamplingCollectionCnv::createPersistent( JetSamplingCollection* transCont ) -{ - MsgStream msg( msgSvc(), "JetSamplingCollectionCnv" ); - - JetSamplingCollectionCnv_p2 cnv; - JetSamplingCollection_PERS *persObj = cnv.createPersistent( transCont, msg ); - - msg << MSG::DEBUG << "::createPersistent [Success]" << endmsg; - return persObj; -} - -JetSamplingCollection* JetSamplingCollectionCnv::createTransient() -{ - MsgStream msg( msgSvc(), "JetSamplingCollectionCnv" ); - - JetSamplingCollection *transObj = 0; - - static pool::Guid tr_guid("EA7497BA-7AAA-43A2-8735-EB071FCA5276"); - static pool::Guid p1_guid("E6C1B2E1-A7E7-4997-8A32-8F641BC4D741"); - static pool::Guid p2_guid("FB2AAFA3-90D4-4838-8889-900ACC4C2578"); - - if ( compareClassGuid(tr_guid) ) { - // regular object from before the T/P separation - return poolReadObject<JetSamplingCollection>(); - - } else if ( compareClassGuid(p2_guid) ) { - // using unique_ptr ensures deletion of the persistent object - std::unique_ptr<JetSamplingCollection_p2> persObj( poolReadObject<JetSamplingCollection_p2>() ); - JetSamplingCollectionCnv_p2 cnv; - transObj = cnv.createTransient( persObj.get(), msg ); - - } else if ( compareClassGuid(p1_guid) ) { - // using unique_ptr ensures deletion of the persistent object - std::unique_ptr<JetSamplingCollection_p1> persObj( poolReadObject<JetSamplingCollection_p1>() ); - JetSamplingCollectionCnv_p1 cnv; - transObj = cnv.createTransient( persObj.get(), msg ); - - } else { - throw std::runtime_error("Unsupported persistent version of JetSamplingCollection"); - } - - return transObj; -} +// Reconstruction/Jet/JetEventAthenaPool/src/JetSamplingCollectionCnv.cxx +// Dummy source so that the build system knows that this is a custom converter. diff --git a/Reconstruction/Jet/JetEventAthenaPool/src/JetSamplingCollectionCnv.h b/Reconstruction/Jet/JetEventAthenaPool/src/JetSamplingCollectionCnv.h index eacd0482290839530462a8884500cb6c530d1e3f..1a6db5c4cb7a3751a55356b69fca9c52f814c1f9 100644 --- a/Reconstruction/Jet/JetEventAthenaPool/src/JetSamplingCollectionCnv.h +++ b/Reconstruction/Jet/JetEventAthenaPool/src/JetSamplingCollectionCnv.h @@ -1,7 +1,7 @@ ///////////////////////// -*- 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 */ // JetSamplingCollectionCnv.h @@ -15,61 +15,23 @@ // STL includes // AthenaPoolCnvSvc includes -#include "AthenaPoolCnvSvc/T_AthenaPoolCustomCnv.h" +#include "AthenaPoolCnvSvc/T_AthenaPoolTPCnvCnv.h" // JetEventTPCnv includes #include "JetEventTPCnv/JetSamplingCollection_p1.h" #include "JetEventTPCnv/JetSamplingCollection_p2.h" +#include "JetEventTPCnv/JetSamplingCollectionCnv_p1.h" +#include "JetEventTPCnv/JetSamplingCollectionCnv_p2.h" // JetEvent includes #include "JetEvent/JetSamplingCollection.h" -// Forward declaration +typedef T_AthenaPoolTPCnvCnv< JetSamplingCollection, + JetSamplingCollectionCnv_p2, + JetSamplingCollectionCnv_p1, + T_TPCnvNull<JetSamplingCollection> > + JetSamplingCollectionCnv; -// the latest persistent representation type of DataCollection: -typedef JetSamplingCollection_p2 JetSamplingCollection_PERS; - -class JetSamplingCollectionCnv: public T_AthenaPoolCustomCnv< - JetSamplingCollection, - JetSamplingCollection_PERS - > - -{ - - // make the factory for this converter our friend - friend class CnvFactory<JetSamplingCollectionCnv>; - - /////////////////////////////////////////////////////////////////// - // Protected methods: - /////////////////////////////////////////////////////////////////// - protected: - - /** Create the converter from the service locator - */ -public: - JetSamplingCollectionCnv(ISvcLocator* svcloc); -protected: - - /** Build the persistent representation from the transient one. - */ - virtual JetSamplingCollection_PERS* - createPersistent( JetSamplingCollection* transCont ); - - /** Build the transient representation from a persistent one - */ - virtual JetSamplingCollection* createTransient(); - -}; - -/////////////////////////////////////////////////////////////////// -/// Inline methods: -/////////////////////////////////////////////////////////////////// - -inline -JetSamplingCollectionCnv::JetSamplingCollectionCnv( ISvcLocator* svcLocator ) : - T_AthenaPoolCustomCnv<JetSamplingCollection, - JetSamplingCollection_PERS>(svcLocator) -{} #endif //> RECATHENAPOOL_JETSAMPLINGCOLLECTIONCNV_H