Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2023-03-17 10:51:04

0001 #ifndef DataFormats_PortableTestObjects_interface_TestSoA_h
0002 #define DataFormats_PortableTestObjects_interface_TestSoA_h
0003 
0004 #include <Eigen/Core>
0005 #include <Eigen/Dense>
0006 
0007 #include "DataFormats/SoATemplate/interface/SoACommon.h"
0008 #include "DataFormats/SoATemplate/interface/SoALayout.h"
0009 #include "DataFormats/SoATemplate/interface/SoAView.h"
0010 
0011 namespace portabletest {
0012 
0013   using Matrix = Eigen::Matrix<double, 3, 6>;
0014   // SoA layout with x, y, z, id fields
0015   GENERATE_SOA_LAYOUT(TestSoALayout,
0016                       // columns: one value per element
0017                       SOA_COLUMN(double, x),
0018                       SOA_COLUMN(double, y),
0019                       SOA_COLUMN(double, z),
0020                       SOA_COLUMN(int32_t, id),
0021                       // scalars: one value for the whole structure
0022                       SOA_SCALAR(double, r),
0023                       // Eigen columns
0024                       // the typedef is needed because commas confuse macros
0025                       SOA_EIGEN_COLUMN(Matrix, m))
0026 
0027   using TestSoA = TestSoALayout<>;
0028 
0029 }  // namespace portabletest
0030 
0031 #endif  // DataFormats_PortableTestObjects_interface_TestSoA_h