diff --git a/Reconstruction/RecTPCnv/RecTPCnv/MuonCnvARA_p1.h b/Reconstruction/RecTPCnv/RecTPCnv/MuonCnvARA_p1.h index 3f75280b9be1abadd7e57e449d1e05c434f32ce6..397f96b3adfde530c7138c0763fa0b0515df053c 100644 --- a/Reconstruction/RecTPCnv/RecTPCnv/MuonCnvARA_p1.h +++ b/Reconstruction/RecTPCnv/RecTPCnv/MuonCnvARA_p1.h @@ -21,9 +21,6 @@ // RecTPCnv includes #include "RecTPCnv/Muon_p1.h" -#include "AthAllocators/ArenaHandle.h" -#include "AthAllocators/ArenaHeapAllocator.h" - #include "muonEvent/CaloEnergy.h" @@ -61,9 +58,6 @@ class MuonCnvARA_p1 : public T_AthenaPoolTPCnvBase<Analysis::Muon, Muon_p1> /////////////////////////////////////////////////////////////////// // Protected method: /////////////////////////////////////////////////////////////////// -private: - - SG::ArenaHandle<CaloEnergy, SG::ArenaHeapAllocator> m_handle; }; /////////////////////////////////////////////////////////////////// diff --git a/Reconstruction/RecTPCnv/RecTPCnv/RecTPCnvDict.h b/Reconstruction/RecTPCnv/RecTPCnv/RecTPCnvDict.h index 7aabe976911ea737def70ca20892cfa162633e0a..4d65b1db75edf815af8942bf7905b25f5f9575d5 100644 --- a/Reconstruction/RecTPCnv/RecTPCnv/RecTPCnvDict.h +++ b/Reconstruction/RecTPCnv/RecTPCnv/RecTPCnvDict.h @@ -58,11 +58,15 @@ #include "RecTPCnv/MuonSpShower_p1.h" #include "RecTPCnv/MuonSpShowerContainer_p1.h" -#include "RecEvent/RecoTimingObj.h" -#include "RecTPCnv/RecoTimingObj_p1.h" - extern "C" { void caloenergy_cnv_p2_register_streamer(); } +class CaloEnergyCnv_p2_register_streamer +{ +public: + static + void reg() { caloenergy_cnv_p2_register_streamer(); } +}; + #endif //RECTPCNV_RECTPCNVCNVDICT_H diff --git a/Reconstruction/RecTPCnv/RecTPCnv/RecoTimingObjCnv_p1.h b/Reconstruction/RecTPCnv/RecTPCnv/RecoTimingObjCnv_p1.h deleted file mode 100644 index aa5b739b3cd12dcb20ff7c4c917da2926805ff83..0000000000000000000000000000000000000000 --- a/Reconstruction/RecTPCnv/RecTPCnv/RecoTimingObjCnv_p1.h +++ /dev/null @@ -1,28 +0,0 @@ -/* - Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration -*/ - -#ifndef RECTPCNV_RECOTIMINGOBJCNV_P1_H -#define RECTPCNV_RECOTIMINGOBJCNV_P1_H - -#include "AthenaPoolCnvSvc/T_AthenaPoolTPConverter.h" -#include "RecTPCnv/RecoTimingObj_p1.h" -#include "RecEvent/RecoTimingObj.h" - -class MsgStream; - -class RecoTimingObjCnv_p1 : public T_AthenaPoolTPCnvBase<RecoTimingObj, RecoTimingObj_p1> -{ - public: - RecoTimingObjCnv_p1() {}; - virtual void persToTrans( const RecoTimingObj_p1 *persObj, - RecoTimingObj *transObj, - MsgStream &msg ); - - virtual void transToPers( const RecoTimingObj *transObj, - RecoTimingObj_p1 *persObj, - MsgStream &msg ); -}; - - -#endif diff --git a/Reconstruction/RecTPCnv/RecTPCnv/RecoTimingObj_p1.h b/Reconstruction/RecTPCnv/RecTPCnv/RecoTimingObj_p1.h deleted file mode 100644 index 7ad31f298f57de308df2a3322366aeb29cbd6e07..0000000000000000000000000000000000000000 --- a/Reconstruction/RecTPCnv/RecTPCnv/RecoTimingObj_p1.h +++ /dev/null @@ -1,31 +0,0 @@ -/* - Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration -*/ - -#ifndef RECTPCNV_RECOTIMINGOBJ_P1_H -#define RECTPCNV_RECOTIMINGOBJ_P1_H - -#include <vector> - -// forward declarations -class RecoTimingObjCnv_p1; - -class RecoTimingObj_p1 -{ - friend class RecoTimingObjCnv_p1; - - public: - - /** default constructor */ - RecoTimingObj_p1() : m_isTimings(true) {}; - - /** destructor */ - ~RecoTimingObj_p1() {}; - - // protected: - - std::vector<float> timings; - - bool m_isTimings; -}; -#endif diff --git a/Reconstruction/RecTPCnv/RecTPCnv/selection.xml b/Reconstruction/RecTPCnv/RecTPCnv/selection.xml index 0ef12ab3cb7929f973e20536f0efe673a2146820..9ca2dd099704ce306c51435139ac3888470eaae4 100644 --- a/Reconstruction/RecTPCnv/RecTPCnv/selection.xml +++ b/Reconstruction/RecTPCnv/RecTPCnv/selection.xml @@ -51,8 +51,6 @@ <field name="m_ownshowers" transient="true"/> </class> - <class name="RecoTimingObj_p1" id="4A28542C-DD7F-441A-9866-37A74ED49850" /> - - <function name="caloenergy_cnv_p2_register_streamer" /> + <class name="CaloEnergyCnv_p2_register_streamer"/> </lcgdict> diff --git a/Reconstruction/RecTPCnv/cmt/requirements b/Reconstruction/RecTPCnv/cmt/requirements index 2389bf993b23e3be83fad41d44254a37fed421fc..b7eb7dd8cff4d39d6d4e5dd9650d6d2f18d64fc2 100644 --- a/Reconstruction/RecTPCnv/cmt/requirements +++ b/Reconstruction/RecTPCnv/cmt/requirements @@ -11,7 +11,6 @@ use CLIDSvc CLIDSvc-* Control # use AthenaPoolUtilities AthenaPoolUtilities-* Database/AthenaPOOL use AthenaPoolCnvSvc AthenaPoolCnvSvc-* Database/AthenaPOOL -use AthAllocators AthAllocators-* Control use DataModelAthenaPool DataModelAthenaPool-* Control use EventCommonTPCnv EventCommonTPCnv-* Event @@ -23,12 +22,12 @@ use MissingETEvent MissingETEvent-* Reconstruction use ParticleEventTPCnv ParticleEventTPCnv-* PhysicsAnalysis/AnalysisCommon use TrkEventTPCnv TrkEventTPCnv-* Tracking/TrkEventCnv -use RecEvent RecEvent-* Reconstruction # use AtlasCLHEP AtlasCLHEP-* External private -use AthenaKernel AthenaKernel-* Control use AtlasReflex AtlasReflex-* External +use AthenaKernel AthenaKernel-* Control +use AthAllocators AthAllocators-* Control use RootConversions RootConversions-* Database/AthenaPOOL end_private diff --git a/Reconstruction/RecTPCnv/src/MuonCnvARA_p1.cxx b/Reconstruction/RecTPCnv/src/MuonCnvARA_p1.cxx index 486c1f8d211b0a5a1cb061d060c8057e1665036a..12b17e6eb0134fb894ace7dc7184d3d0035d0223 100644 --- a/Reconstruction/RecTPCnv/src/MuonCnvARA_p1.cxx +++ b/Reconstruction/RecTPCnv/src/MuonCnvARA_p1.cxx @@ -34,6 +34,9 @@ #include "RecTPCnv/DepositInCaloCnv_p1.h" #include "RecTPCnv/MuonCnvARA_p1.h" +#include "AthAllocators/ArenaHandle.h" +#include "AthAllocators/ArenaHeapAllocator.h" + typedef ElementLinkCnv_p1<ElementLink<Rec::TrackParticleContainer> > TrackLinkCnv_t; typedef ElementLinkCnv_p1<ElementLink<CaloClusterContainer> > ClusterLinkCnv_t; @@ -142,8 +145,8 @@ void MuonCnvARA_p1::persToTrans( const Muon_p1* pers, unsigned short tag = static_cast<unsigned short>(pers->m_caloEnergyLoss.m_fsrCandidateEnergy); float fsrEnergy = pers->m_caloEnergyLoss.m_fsrCandidateEnergy; - // xxx - CaloEnergy * caloEnergy = new (m_handle.allocate()) CaloEnergy(deltaE, sigma, sigmaM, sigmaP, elossT, caloLR, tag) ; + SG::ArenaHandle<CaloEnergy, SG::ArenaHeapAllocator> handle; + CaloEnergy * caloEnergy = new (handle.allocate()) CaloEnergy(deltaE, sigma, sigmaM, sigmaP, elossT, caloLR, tag) ; caloEnergy->set_fsrCandidateEnergy ( fsrEnergy ); std::vector<DepositInCalo> deposits; deposits.reserve( pers->m_caloEnergyLoss.m_deposits.size() ); diff --git a/Reconstruction/RecTPCnv/src/RecTPCnv.cxx b/Reconstruction/RecTPCnv/src/RecTPCnv.cxx index ecf0878a0b93704818548c054dcbdfb17e1e201a..39a4fb938fb0233b03b4f98ee34d43b64c6619fa 100644 --- a/Reconstruction/RecTPCnv/src/RecTPCnv.cxx +++ b/Reconstruction/RecTPCnv/src/RecTPCnv.cxx @@ -30,8 +30,6 @@ #include "RecTPCnv/MuonCaloEnergyContainerCnv_p1.h" #include "RecTPCnv/MuonSpShowerContainerCnv_p1.h" -#include "RecTPCnv/RecoTimingObjCnv_p1.h" - // DECLARE_TPCNV_FACTORY(MuonContainerCnvARA_p1, // Analysis::MuonContainer, // MuonContainer_p1, @@ -134,7 +132,3 @@ DECLARE_TPCNV_FACTORY(MuonSpShowerContainerCnv_p1, MuonSpShowerContainer_p1, Athena::TPCnvVers::Current) -DECLARE_TPCNV_FACTORY(RecoTimingObjCnv_p1, - RecoTimingObj, - RecoTimingObj_p1, - Athena::TPCnvVers::Current) diff --git a/Reconstruction/RecTPCnv/src/RecoTimingObjCnv_p1.cxx b/Reconstruction/RecTPCnv/src/RecoTimingObjCnv_p1.cxx deleted file mode 100644 index 002a144f708a661de0aabdc9b924d7fd34d52394..0000000000000000000000000000000000000000 --- a/Reconstruction/RecTPCnv/src/RecoTimingObjCnv_p1.cxx +++ /dev/null @@ -1,145 +0,0 @@ -/* - Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration -*/ - - -#include "RecTPCnv/RecoTimingObjCnv_p1.h" - -#include <malloc.h> - -#include <sys/time.h> -#include <sys/resource.h> - -void RecoTimingObjCnv_p1::persToTrans( const RecoTimingObj_p1* pers, - RecoTimingObj* trans, - MsgStream& msg ) -{ - if (msg.level() <= MSG::DEBUG) - msg << MSG::DEBUG << "Loading RecoTimingObj from persistent state.[start]" << endreq; - trans->m_readFromFile=true; - trans->m_isTimings=pers->m_isTimings; - - trans->clear(); - trans->reserve(pers->timings.size()); - for( unsigned int i(0); i<pers->timings.size(); ++i ) - trans->push_back( pers->timings[i] ); - if (msg.level() <= MSG::DEBUG) - msg << MSG::DEBUG << "Loading RecoTimingObj from persistent state.[end]" << endreq; - return; -} - -void RecoTimingObjCnv_p1::transToPers( const RecoTimingObj* trans, - RecoTimingObj_p1* pers, - MsgStream& msg ) -{ - if (msg.level() <= MSG::DEBUG) - msg << MSG::DEBUG << "Creating persistent state of RecoTimingObj.[start]" << endreq; - if ( trans->m_readFromFile ) - pers->timings.reserve(trans->size()); - else - { - if ( trans->m_isTimings ) - pers->timings.reserve(trans->size()+1); - else - pers->timings.reserve(trans->size()+2); - } - pers->m_isTimings=trans->m_isTimings; - - for( unsigned int i(0); i<trans->size(); ++i ) - { - pers->timings.push_back( (*trans)[i] ); - if (msg.level() <= MSG::DEBUG) - msg << MSG::DEBUG << "Creating persistent state of RecoTimingObj.[" << i << "] : " << (*trans)[i] << endreq; - } - if ( ! trans->m_readFromFile && trans->size() > 0 ) - { - float fv(0); - float f0(0); - float f1(0); - uintptr_t mem(0); - - if ( trans->size() > 0 ) - f0=(*trans)[0]; - if ( ! trans->m_isTimings ) - if ( trans->size() > 1 ) - f1=(*trans)[1]; - - if ( pers->m_isTimings ) - { - struct rusage r; - getrusage(RUSAGE_SELF, &r); - fv=float(r.ru_utime.tv_sec+r.ru_stime.tv_sec) + float(r.ru_utime.tv_usec+r.ru_stime.tv_usec)/1000000; - } - else - { - int a(0); - FILE *proc = fopen("/proc/self/statm","r"); - if (proc) { - fscanf(proc, "%d", &a); - fclose(proc); - } - fv=float(a); - - char buffer[2048] = {0}; - int out_pipe[2]; - int saved_stderr = dup (STDERR_FILENO); - pipe (out_pipe); - dup2 (out_pipe[1], STDERR_FILENO); - close (out_pipe[1]); - malloc_stats (); - int n = read (out_pipe[0], buffer, 2047); - // Make coverity happy... - if (n < 0) n = 0; - if (n >= 2048) n = 2047; - buffer[n] = 0; - // close (STDERR_FILENO); - if (saved_stderr >= 0) { - dup2 (saved_stderr, STDERR_FILENO); - close (saved_stderr); - } - close (out_pipe[0]); - - // ATH_MSG_INFO("ROLF " << buffer); - unsigned int start(0); - while ( start < strlen(buffer) ) - { - int pos(0); - uintptr_t memtmp(0); - //int ret; - if ( trans->m_usetcmalloc ) - { -#if __WORDSIZE == 64 - sscanf(&buffer[start], "MALLOC: %lu Bytes in use by application%n", &memtmp, &pos); -#else - sscanf(&buffer[start], "MALLOC: %u Bytes in use by application%n", &memtmp, &pos); -#endif - if ( pos ) - mem=memtmp; - } - else - { -#if __WORDSIZE == 64 - sscanf(&buffer[start], "in use bytes = %lu%n", &memtmp, &pos); -#else - sscanf(&buffer[start], "in use bytes = %u%n", &memtmp, &pos); -#endif - if ( pos ) - mem=memtmp; - } - // ATH_MSG_INFO("ROLF rr " << start << " " << ret << " " << memtmp << " " << mem << " len: " << strlen(buffer) << " pos : " << pos ); - while (buffer[start] != '\n' && start<strlen(buffer)) - start += 1; - start += 1; - } - } - pers->timings.push_back( fv - f0 ); - if ( ! pers->m_isTimings ) - pers->timings.push_back( float(mem)/1024 - f1 ); - - if (msg.level() <= MSG::DEBUG) - msg << MSG::DEBUG << "Creating persistent state of RecoTimingObj.[end] : " << fv - f0 << endreq; - } - if (msg.level() <= MSG::DEBUG) - msg << MSG::DEBUG << "Creating persistent state of RecoTimingObj.[end]" << endreq; - return; -} diff --git a/Reconstruction/RecTPCnv/src/RecoTimingObj_p1.cxx b/Reconstruction/RecTPCnv/src/RecoTimingObj_p1.cxx deleted file mode 100644 index bae7362365f5d8ece89cb08f51ca5fc2a89cc1ee..0000000000000000000000000000000000000000 --- a/Reconstruction/RecTPCnv/src/RecoTimingObj_p1.cxx +++ /dev/null @@ -1,5 +0,0 @@ -/* - Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration -*/ - -#include "RecTPCnv/RecoTimingObj_p1.h"