#include "FWCore/Utilities/interface/SoATuple.h"
Description: Structure of Arrays Tuple
Usage: Often we want to group data which are related to one item and then group related items. This is often done by making a structure,Foo, to hold the data related to one item and then place the structure into a container (e.g. std::vector<Foo>). This is referred to as an 'Array of Structures'. However, this grouping can be inefficient if not all of the data about one item are used at the same time. So to access one data for one item will cause the CPU to retrieve nearby memory which is then not used. If the code is looking at the same data for multiple items this will lead to many data cache misses in the CPU.
A different grouping is to place the first data element for all items into one array, the second data element for all items into a second array, then so on. This is referred to as a 'Structure of Arrays'.
This class will take an arbitrary number of template arguments and it will group data of that argument type together in memory.
Example: Data about one item is represented by a double, int and bool
One can then push data into the collection. You must insert all data for each item.
It is best if you call 'reserve' before pushing or emplacing items into the container in order to minimize memory allocations.
You get the data out by specify the 'ordinal' of the data element as well as the index
To help keep track of the purpose of the template arguments, we suggest using an enum to denote each one:
A non-default alignment for a stored type can be specified by using the edm::Aligned<T,I> where I is an unsigned int value denoting the requested byte alignment. There is also a specialized version, edm::AlignedVec which has the proper alignment for SSE operations (16 byte aligned).
which is equivalent to
Explicitly aligned types and defaultly aligned types can be freely mixed in any order within the template arguments.