diff --git a/Tracking/Acts/ActsEDM/ActsEDM/ATLAS_CHECK_THREAD_SAFETY b/Tracking/Acts/ActsEDM/ActsEDM/ATLAS_CHECK_THREAD_SAFETY new file mode 100644 index 0000000000000000000000000000000000000000..5aab7dc0ffc31e18f76cfe4315dd56c1d807b6e4 --- /dev/null +++ b/Tracking/Acts/ActsEDM/ActsEDM/ATLAS_CHECK_THREAD_SAFETY @@ -0,0 +1 @@ +Tracking/Acts/ActsEDM \ No newline at end of file diff --git a/Tracking/Acts/ActsEDM/ActsEDM/ActsEDMDict.h b/Tracking/Acts/ActsEDM/ActsEDM/ActsEDMDict.h new file mode 100644 index 0000000000000000000000000000000000000000..084eca15c32897102ac5bf228ca386c63a471b06 --- /dev/null +++ b/Tracking/Acts/ActsEDM/ActsEDM/ActsEDMDict.h @@ -0,0 +1,43 @@ +// Dear emacs, this is -*- c++ -*- + +/* + Copyright (C) 2002-2021 CERN for the benefit of the ATLAS collaboration +*/ + +#ifndef ACTSEDM_DICT_H +#define ACTSEDM_DICT_H 1 + +#include "AthLinks/DataLink.h" +#include "AthLinks/ElementLink.h" + +#define INSTANTIATE_TYPES( NS, TYPE ) \ + NS::TYPE dummy_##NS##_##TYPE##_1; \ + DataLink< NS::TYPE > dummy_##NS##_##TYPE##_2; \ + std::vector< DataLink< NS::TYPE > > dummy_##NS##_##TYPE##_3; + +#define INSTANTIATE_CONTAINER_TYPES( NS, TYPE ) \ + NS::TYPE dummy_##NS##_##TYPE##_1; \ + DataLink< NS::TYPE > dummy_##NS##_##TYPE##_2; \ + ElementLink< NS::TYPE > dummy_##NS##_##TYPE##_3; \ + std::vector< DataLink< NS::TYPE > > dummy_##NS##_##TYPE##_4; \ + std::vector< ElementLink< NS::TYPE > > dummy_##NS##_##TYPE##_5; \ + std::vector< std::vector< ElementLink< NS::TYPE > > > \ + dummy_##NS##_##TYPE##_6; + +#include "ActsEDM/ActsMeasurement.h" +#include "ActsEDM/ActsSpacePointData.h" +#include "ActsEDM/ActsSpacePoint.h" +#include "ActsEDM/ActsSeed.h" + +// Instantiate all necessary types for the dictionary. +namespace { + struct GCCXML_DUMMY_INSTANTIATION_ACTSEDM { + INSTANTIATE_TYPES( ActsTrk, SpacePointData ) + INSTANTIATE_CONTAINER_TYPES( ActsTrk, MeasurementContainer ) + INSTANTIATE_CONTAINER_TYPES( ActsTrk, SpacePointContainer ) + INSTANTIATE_CONTAINER_TYPES( ActsTrk, SeedContainer ) + }; +} + + +#endif diff --git a/Tracking/Acts/ActsEDM/ActsEDM/ActsMeasurement.h b/Tracking/Acts/ActsEDM/ActsEDM/ActsMeasurement.h new file mode 100644 index 0000000000000000000000000000000000000000..ccdbc3a5aa36f29c2f8af751fee2dfa2b7271c2e --- /dev/null +++ b/Tracking/Acts/ActsEDM/ActsEDM/ActsMeasurement.h @@ -0,0 +1,26 @@ +// Dear emacs, this is -*- c++ -*- + +/* + Copyright (C) 2002-2021 CERN for the benefit of the ATLAS collaboration +*/ + +#ifndef ACTSEDM_MEASUREMENT_H +#define ACTSEDM_MEASUREMENT_H 1 + +#include "Acts/EventData/Measurement.hpp" +#include "ActsGeometry/ATLASSourceLink.h" + +#include "AthContainers/DataVector.h" + +namespace ActsTrk { + typedef Acts::BoundVariantMeasurement< ATLASSourceLink > Measurement; + typedef DataVector< Acts::BoundVariantMeasurement< ATLASSourceLink > > MeasurementContainer; +} + +// Set up a CLID for the type: +#include "AthenaKernel/CLASS_DEF.h" +CLASS_DEF( ActsTrk::Measurement, 207128991, 1 ) +CLASS_DEF( ActsTrk::MeasurementContainer, 1261318992, 1) + +#endif + diff --git a/Tracking/Acts/ActsEDM/ActsEDM/ActsSeed.h b/Tracking/Acts/ActsEDM/ActsEDM/ActsSeed.h new file mode 100644 index 0000000000000000000000000000000000000000..89eb8a4d529fc80cc65baf5ad6e10af4ec60d024 --- /dev/null +++ b/Tracking/Acts/ActsEDM/ActsEDM/ActsSeed.h @@ -0,0 +1,25 @@ +// Dear emacs, this is -*- c++ -*- + +/* + Copyright (C) 2002-2021 CERN for the benefit of the ATLAS collaboration +*/ + +#ifndef ACTSEDM_SEED_H +#define ACTSEDM_SEED_H 1 + +#include "Acts/Seeding/Seed.hpp" +#include "ActsEDM/ActsSpacePoint.h" + +#include "AthContainers/DataVector.h" + +namespace ActsTrk { + typedef Acts::Seed< ActsTrk::SpacePoint > Seed; + typedef DataVector< Acts::Seed< ActsTrk::SpacePoint > > SeedContainer; +} + +// Set up a CLID for the type: +#include "AthenaKernel/CLASS_DEF.h" +CLASS_DEF( ActsTrk::Seed, 207128231, 1 ) +CLASS_DEF( ActsTrk::SeedContainer, 1261318102, 1) + +#endif diff --git a/Tracking/Acts/ActsEDM/ActsEDM/ActsSpacePoint.h b/Tracking/Acts/ActsEDM/ActsEDM/ActsSpacePoint.h new file mode 100644 index 0000000000000000000000000000000000000000..0618f4a53a514c29132fa83e7ee4c2554c2c07bb --- /dev/null +++ b/Tracking/Acts/ActsEDM/ActsEDM/ActsSpacePoint.h @@ -0,0 +1,72 @@ +// Dear emacs, this is -*- c++ -*- + +/* + Copyright (C) 2002-2021 CERN for the benefit of the ATLAS collaboration +*/ + +#ifndef ACTSEDM_SPACEPOINT_H +#define ACTSEDM_SPACEPOINT_H 1 + +#include "ActsEDM/ActsSpacePointData.h" + +namespace ActsTrk { + + class SpacePoint { + public: + SpacePoint() = delete; + template <typename position_t, typename variance_t> + SpacePoint(const Eigen::MatrixBase<position_t>& pos, + const Eigen::MatrixBase<variance_t>& var, + SpacePointData& data, + std::size_t measIndex); + + + inline double x() const; + inline double y() const; + inline double z() const; + inline double varianceR() const; + inline double varianceZ() const; + + inline std::size_t measurementIndex() const; + + private: + std::size_t m_index; + std::size_t m_measurementIndex; + SpacePointData* m_data; + }; + + template <typename position_t, typename variance_t> + SpacePoint::SpacePoint(const Eigen::MatrixBase<position_t>& pos, + const Eigen::MatrixBase<variance_t>& var, + SpacePointData& data, + std::size_t measIndex) + : m_measurementIndex(measIndex), + m_data(&data) + { + EIGEN_STATIC_ASSERT_VECTOR_SPECIFIC_SIZE(position_t, 3); + EIGEN_STATIC_ASSERT_VECTOR_SPECIFIC_SIZE(variance_t, 2); + + m_index = m_data->insert(pos,var); + } + + inline double SpacePoint::x() const { return m_data->x(m_index); } + inline double SpacePoint::y() const { return m_data->y(m_index); } + inline double SpacePoint::z() const { return m_data->z(m_index); } + inline double SpacePoint::varianceR() const { return m_data->varianceR(m_index); } + inline double SpacePoint::varianceZ() const { return m_data->varianceZ(m_index); } + + std::size_t SpacePoint::measurementIndex() const { return m_measurementIndex; } +} // Acts namespace + +#include "AthContainers/DataVector.h" +namespace ActsTrk { + typedef DataVector< ActsTrk::SpacePoint > SpacePointContainer; +} + +// Set up a CLID for the type: +#include "AthenaKernel/CLASS_DEF.h" +CLASS_DEF( ActsTrk::SpacePoint, 207128531, 1 ) +CLASS_DEF( ActsTrk::SpacePointContainer, 1262318102, 1) + +#endif + diff --git a/Tracking/Acts/ActsEDM/ActsEDM/ActsSpacePointData.h b/Tracking/Acts/ActsEDM/ActsEDM/ActsSpacePointData.h new file mode 100644 index 0000000000000000000000000000000000000000..76e435d98b31f96352d92eccbcd22144defe6880 --- /dev/null +++ b/Tracking/Acts/ActsEDM/ActsEDM/ActsSpacePointData.h @@ -0,0 +1,53 @@ +// Dear emacs, this is -*- c++ -*- + +/* + Copyright (C) 2002-2021 CERN for the benefit of the ATLAS collaboration +*/ + +#ifndef ACTSEDM_SPACEPOINTDATA_H +#define ACTSEDM_SPACEPOINTDATA_H 1 + +#include <vector> +#include "Acts/Definitions/Algebra.hpp" + +namespace ActsTrk { + + class SpacePointData { + public: + SpacePointData() = default; + SpacePointData(const SpacePointData&) = delete; + ~SpacePointData() = default; + + inline double x(std::size_t n) const; + inline double y(std::size_t n) const; + inline double z(std::size_t n) const; + inline double varianceR(std::size_t n) const; + inline double varianceZ(std::size_t n) const; + + std::size_t insert(const Acts::Vector3& position, + const Acts::Vector2& variance); + + void reserve(std::size_t n); + + private: + std::vector< double > m_pos_x; + std::vector< double > m_pos_y; + std::vector< double > m_pos_z; + std::vector< double > m_cov_r; + std::vector< double > m_cov_z; + }; + + inline double SpacePointData::x(std::size_t n) const { return m_pos_x.at(n); } + inline double SpacePointData::y(std::size_t n) const { return m_pos_y.at(n); } + inline double SpacePointData::z(std::size_t n) const { return m_pos_z.at(n); } + inline double SpacePointData::varianceR(std::size_t n) const { return m_cov_r.at(n); } + inline double SpacePointData::varianceZ(std::size_t n) const { return m_cov_z.at(n); } + +} // Acts namespace + + +// Set up a CLID for the type: +#include "AthenaKernel/CLASS_DEF.h" +CLASS_DEF( ActsTrk::SpacePointData, 207128530, 1 ) + +#endif diff --git a/Tracking/Acts/ActsEDM/ActsEDM/selection.xml b/Tracking/Acts/ActsEDM/ActsEDM/selection.xml new file mode 100644 index 0000000000000000000000000000000000000000..088311eb56824d16c971be6fcbd38cc188018d5f --- /dev/null +++ b/Tracking/Acts/ActsEDM/ActsEDM/selection.xml @@ -0,0 +1,20 @@ +<!-- Copyright (C) 2002-2021 CERN for the benefit of the ATLAS collaboration --> +<lcgdict> + + <class name="Measurement" /> + <class name="MeasurementContainer" + id="982AECB9-B116-44E0-A7C6-88939B01B050" /> + + <class name="SpacePointData" + id="E3B251F4-6D90-489E-98F8-2C7B73EA4700" /> + + <class name="SpacePoint" /> + <class name="SpacePointContainer" + id="9ED9A88B-E81E-46B2-9371-33122EAF9B4D" /> + + <class name="Seed" /> + <class name="SeedContainer" + id="936BD24D-A0FE-4684-9C95-6C895E38B56E" /> + +</lcgdict> + diff --git a/Tracking/Acts/ActsEDM/CMakeLists.txt b/Tracking/Acts/ActsEDM/CMakeLists.txt new file mode 100644 index 0000000000000000000000000000000000000000..42b8dd61949804f2abd5a1b296128a9c2d6abf40 --- /dev/null +++ b/Tracking/Acts/ActsEDM/CMakeLists.txt @@ -0,0 +1,34 @@ +# Copyright (C) 2002-2021 CERN for the benefit of the ATLAS collaboration + +# Declare the package name: +atlas_subdir( ActsEDM ) + +# External dependencies: +find_package( Acts COMPONENTS Core ) +find_package( Boost ) +find_package( Eigen ) + +atlas_add_library( ActsEDM + Root/*.cxx + PUBLIC_HEADERS ActsEDM + LINK_LIBRARIES ${Boost_LIBRARIES} ${EIGEN_LIBRARIES} + AthenaBaseComps GaudiKernel AtlasDetDescr CxxUtils + xAODCore ActsCore ActsFatras ActsGeometryLib BeamSpotConditionsData + MagFieldConditions MagFieldElements SiSPSeededTrackFinderData InDetRawData GeoPrimitives InDetPrepRawData + ) + +atlas_add_dictionary( ActsEDMDict + ActsEDM/ActsEDMDict.h + ActsEDM/selection.xml + LINK_LIBRARIES xAODCore ActsEDM + DATA_LINKS + ActsTrk::MeasurementContainer + ActsTrk::SpacePointData + ActsTrk::SpacePointContainer + ActsTrk::SeedContainer + ) + + + + + diff --git a/Tracking/Acts/ActsEDM/Root/ActsSpacePointData.cxx b/Tracking/Acts/ActsEDM/Root/ActsSpacePointData.cxx new file mode 100644 index 0000000000000000000000000000000000000000..024251002aa041e27d69a8456f367269a2b235e0 --- /dev/null +++ b/Tracking/Acts/ActsEDM/Root/ActsSpacePointData.cxx @@ -0,0 +1,33 @@ +// Dear emacs, this is -*- c++ -*- + +/* + Copyright (C) 2002-2021 CERN for the benefit of the ATLAS collaboration +*/ + +#include "ActsEDM/ActsSpacePointData.h" + +namespace ActsTrk { + std::size_t SpacePointData::insert(const Acts::Vector3& position, + const Acts::Vector2& variance) { + std::size_t index = m_pos_x.size(); + // position + m_pos_x.push_back( position[0] ); + m_pos_y.push_back( position[1] ); + m_pos_z.push_back( position[2] ); + // Variance + m_cov_r.push_back( variance[0] ); + m_cov_z.push_back( variance[1] ); + // return index where values have been saved + return index; + } + + void SpacePointData::reserve(std::size_t n) { + m_pos_x.reserve(n); + m_pos_y.reserve(n); + m_pos_z.reserve(n); + m_cov_r.reserve(n); + m_cov_z.reserve(n); + } + +} // ActsTrk namespace +