/
githubmirror
/
cmssw
Обзор
Документация
Войти
/
githubmirror
/
cmssw
Код
Запросы
0
Пакеты
0
Релизы
0
Аналитика
Безопасность
master
DataFormats/PortableTestObjects/interface/TestSoA.h
77 строк
3 KB
markus
Remove MultiCollection from Remaining code base
14 янв 2026, 15:58
14 янв 2026, 15:58
57cee3f
Код
Авторство
О чём код?
#ifndef DataFormats_PortableTestObjects_interface_TestSoA_h #define DataFormats_PortableTestObjects_interface_TestSoA_h #include <array> #include <Eigen/Core> #include <Eigen/Dense> #include "DataFormats/Common/interface/StdArray.h" #include "DataFormats/SoATemplate/interface/SoACommon.h" #include "DataFormats/SoATemplate/interface/SoALayout.h" #include "DataFormats/SoATemplate/interface/SoABlocks.h" namespace portabletest { // the type aliases are needed because commas confuse macros using Array = edm::StdArray<short, 4>; //using Array = std::array<short, 4>; using Matrix = Eigen::Matrix<double, 3, 6>; // SoA layout with x, y, z, id fields GENERATE_SOA_LAYOUT(TestSoALayout, // columns: one value per element SOA_COLUMN(double, x), SOA_COLUMN(double, y), SOA_COLUMN(double, z), SOA_COLUMN(int32_t, id), // scalars: one value for the whole structure SOA_SCALAR(double, r), // column of arrays: one fixed-size array per element SOA_COLUMN(Array, flags), // Eigen columns: each matrix element is stored in a separate column SOA_EIGEN_COLUMN(Matrix, m)) using TestSoA = TestSoALayout<>; GENERATE_SOA_LAYOUT(TestSoALayout2, // columns: one value per element SOA_COLUMN(double, x2), SOA_COLUMN(double, y2), SOA_COLUMN(double, z2), SOA_COLUMN(int32_t, id2), // scalars: one value for the whole structure SOA_SCALAR(double, r2), // Eigen columns // the typedef is needed because commas confuse macros SOA_EIGEN_COLUMN(Matrix, m2)) using TestSoA2 = TestSoALayout2<>; GENERATE_SOA_LAYOUT(TestSoALayout3, // columns: one value per element SOA_COLUMN(double, x3), SOA_COLUMN(double, y3), SOA_COLUMN(double, z3), SOA_COLUMN(int32_t, id3), // scalars: one value for the whole structure SOA_SCALAR(double, r3), // Eigen columns // the typedef is needed because commas confuse macros SOA_EIGEN_COLUMN(Matrix, m3)) using TestSoA3 = TestSoALayout3<>; GENERATE_SOA_BLOCKS(SoABlocks2, SOA_BLOCK(first, TestSoALayout), SOA_BLOCK(second, TestSoALayout2)) using TestSoABlocks2 = SoABlocks2<>; GENERATE_SOA_BLOCKS(SoABlocks3, SOA_BLOCK(first, TestSoALayout), SOA_BLOCK(second, TestSoALayout2), SOA_BLOCK(third, TestSoALayout3)) using TestSoABlocks3 = SoABlocks3<>; } // namespace portabletest #endif // DataFormats_PortableTestObjects_interface_TestSoA_h