From c50bd4c02a92e4ebdbe8ab9aedcd0e16b0d6af14 Mon Sep 17 00:00:00 2001 From: Atlas-Software Librarian <Atlas-Software.Librarian@cern.ch> Date: Fri, 8 Apr 2016 17:17:05 +0200 Subject: [PATCH] 'CMakeLists.txt' (InDetSimData-03-00-09) * Tagging InDetSimData-03-00-09 * InDetSimData/InDetSimData.h, src/InDetSimData.cxx: Add move assignment. Add ctor taking vector by move. * InDetSimData/InDetSimDataDict.h: Naming convention fix. --- .../InDetRawEvent/InDetSimData/CMakeLists.txt | 32 +++++++++++++++++++ .../InDetSimData/InDetSimData/InDetSimData.h | 12 ++----- .../InDetSimData/InDetSimDataDict.h | 2 +- .../InDetSimData/src/InDetSimData.cxx | 27 ++++++++++------ 4 files changed, 52 insertions(+), 21 deletions(-) create mode 100644 InnerDetector/InDetRawEvent/InDetSimData/CMakeLists.txt diff --git a/InnerDetector/InDetRawEvent/InDetSimData/CMakeLists.txt b/InnerDetector/InDetRawEvent/InDetSimData/CMakeLists.txt new file mode 100644 index 00000000000..af0635263f4 --- /dev/null +++ b/InnerDetector/InDetRawEvent/InDetSimData/CMakeLists.txt @@ -0,0 +1,32 @@ +################################################################################ +# Package: InDetSimData +################################################################################ + +# Declare the package name: +atlas_subdir( InDetSimData ) + +# Declare the package's dependencies: +atlas_depends_on_subdirs( PUBLIC + Control/CLIDSvc + Control/SGTools + DetectorDescription/Identifier + Generators/GeneratorObjects ) + +# External dependencies: +find_package( ROOT COMPONENTS Core Tree MathCore Hist RIO pthread ) + +# Component(s) in the package: +atlas_add_library( InDetSimData + src/InDetSimData.cxx + src/InDetSimDataCollection.cxx + PUBLIC_HEADERS InDetSimData + PRIVATE_INCLUDE_DIRS ${ROOT_INCLUDE_DIRS} + LINK_LIBRARIES SGTools Identifier GeneratorObjects + PRIVATE_LINK_LIBRARIES ${ROOT_LIBRARIES} ) + +atlas_add_dictionary( InDetSimDataDict + InDetSimData/InDetSimDataDict.h + InDetSimData/selection.xml + INCLUDE_DIRS ${ROOT_INCLUDE_DIRS} + LINK_LIBRARIES ${ROOT_LIBRARIES} SGTools Identifier GeneratorObjects InDetSimData ) + diff --git a/InnerDetector/InDetRawEvent/InDetSimData/InDetSimData/InDetSimData.h b/InnerDetector/InDetRawEvent/InDetSimData/InDetSimData/InDetSimData.h index c9b2e7d19cd..f53a25d95b2 100755 --- a/InnerDetector/InDetRawEvent/InDetSimData/InDetSimData/InDetSimData.h +++ b/InnerDetector/InDetRawEvent/InDetSimData/InDetSimData/InDetSimData.h @@ -31,17 +31,10 @@ #ifndef INDETSIMDATA_InDetSimData_H # define INDETSIMDATA_InDetSimData_H -//<<<<<< INCLUDES >>>>>> //#include "InDetSimData/PixelSimHelper.h" #include <utility> #include <vector> #include "GeneratorObjects/HepMcParticleLink.h" -//<<<<<< PUBLIC DEFINES >>>>>> -//<<<<<< PUBLIC CONSTANTS >>>>>> -//<<<<<< PUBLIC TYPES >>>>>> -//<<<<<< PUBLIC VARIABLES >>>>>> -//<<<<<< PUBLIC FUNCTIONS >>>>>> -//<<<<<< CLASS DECLARATIONS >>>>>> class PixelSimHelper; @@ -56,8 +49,10 @@ public: // energy (charge) which its hits contribute to the current RDO. InDetSimData(); InDetSimData (const std::vector< Deposit >& deposits, int simDataWord = 0); + InDetSimData (std::vector< Deposit >&& deposits, int simDataWord = 0); InDetSimData (const InDetSimData& other); InDetSimData &operator=(const InDetSimData& other); + InDetSimData &operator=(InDetSimData&& other); virtual ~InDetSimData(); int word() const; // Get the packed simdata word void deposits(std::vector<Deposit>& deposits) const; // Get the Deposits @@ -70,9 +65,6 @@ private: std::vector<Deposit> m_deposits; }; -//<<<<<< INLINE PUBLIC FUNCTIONS >>>>>> -//<<<<<< INLINE MEMBER FUNCTIONS >>>>>> - inline int InDetSimData::word() const { return m_word & 0x1fffffff; diff --git a/InnerDetector/InDetRawEvent/InDetSimData/InDetSimData/InDetSimDataDict.h b/InnerDetector/InDetRawEvent/InDetSimData/InDetSimData/InDetSimDataDict.h index 044f5d72019..c00ba983fbf 100755 --- a/InnerDetector/InDetRawEvent/InDetSimData/InDetSimData/InDetSimDataDict.h +++ b/InnerDetector/InDetRawEvent/InDetSimData/InDetSimData/InDetSimDataDict.h @@ -9,7 +9,7 @@ namespace AthenaPoolTestDataDict { - std::pair< HepMcParticleLink , float> m_pair; + std::pair< HepMcParticleLink , float> d_pair; } diff --git a/InnerDetector/InDetRawEvent/InDetSimData/src/InDetSimData.cxx b/InnerDetector/InDetRawEvent/InDetSimData/src/InDetSimData.cxx index 9a3a2fb8f5e..18ae80461e9 100755 --- a/InnerDetector/InDetRawEvent/InDetSimData/src/InDetSimData.cxx +++ b/InnerDetector/InDetRawEvent/InDetSimData/src/InDetSimData.cxx @@ -10,20 +10,10 @@ // $Id: InDetSimData.cxx,v 1.4 2004-03-01 22:07:07 costanzo Exp $ -//<<<<<< INCLUDES >>>>>> #include "InDetSimData/InDetSimData.h" #include <iostream> -//<<<<<< PRIVATE DEFINES >>>>>> -//<<<<<< PRIVATE CONSTANTS >>>>>> -//<<<<<< PRIVATE TYPES >>>>>> -//<<<<<< PRIVATE VARIABLE DEFINITIONS >>>>>> -//<<<<<< PUBLIC VARIABLE DEFINITIONS >>>>>> -//<<<<<< CLASS STRUCTURE INITIALIZATION >>>>>> -//<<<<<< PRIVATE FUNCTION DEFINITIONS >>>>>> -//<<<<<< PUBLIC FUNCTION DEFINITIONS >>>>>> -//<<<<<< MEMBER FUNCTION DEFINITIONS >>>>>> InDetSimData::InDetSimData() : @@ -52,6 +42,13 @@ InDetSimData::InDetSimData (const std::vector<Deposit>& deposits, m_deposits = deposits; } +InDetSimData::InDetSimData (std::vector<Deposit>&& deposits, + int simDataWord) + : m_deposits (std::move (deposits)) +{ + m_word = (m_deposits.size()<<29 & 0xe0000000) | (simDataWord & 0x1fffffff); +} + InDetSimData::InDetSimData (const InDetSimData& other) :m_word(other.m_word), m_deposits(other.m_deposits) @@ -69,6 +66,16 @@ InDetSimData &InDetSimData::operator=(const InDetSimData& other) return *this; } +InDetSimData &InDetSimData::operator=(InDetSimData&& other) +{ + if(&other != this) + { + m_word=other.m_word; + m_deposits=std::move(other.m_deposits); + } + return *this; +} + InDetSimData::~InDetSimData() { // delete[] m_p_deposits; -- GitLab