LDMX Software
|
May contain traces of industrial strength snake oil.
This is a set of small single-header libraries. They require no installation and only need a C++14 compatible compiler. To use any of them just copy the header file into your own project and include it where needed. If you are using the CMake build system you can also add the full project as a subdirectory and use any of the libraries by linking with the dfelibs
target, i.e.
add_subdirectory(<path/to/dfelibs/folder>) ... target_link_library(<your/project/target> dfelibs)
All libraries are licensed under the terms of the MIT license.
Register arbitrary functions with the dispatcher
and call them by name with regular arguments
or with a list of string arguments that are automatically parsed into the correct types
Set-like and map-like containers that store the data internally as sorted, flat arrays continuous in memory (as opposed to a tree-like structure as e.g. in std::set
). This simplifies allocations and should yield better performance when only a few elements are stored.
Add some self-awareness to a POD type
and write it to disk in multiple formats:
The results are either comma-separated text values
x,b,z 1,1.4,-2 ...
tab-separated text values
x b z 1 1.4 -2 ...
binary NPY data or a ROOT TTree
. The last option requires the ROOT library as an additional external dependency.
Data stored in one of the delimiter-based formats or as a ROOT tree can also be read back in:
Delimiter-based readers support arbitrary column order and extra columns that are not part of the namedtuple definition. They can be read via
By default, all elements of the namedtuple must exist for the delimiter-based readers. Some elements can be marked as optional in the reader
and the corresponding element in the namedtuple will not be touched if the corresponding column does not exist on file.
Evaluate polynomial functions and their derivatives using either a (variable-sized) container of coefficients
or using the coefficients directly for fixed order polynomials:
The following libraries are archived and should probably not be used e.g. because they only provide limited functionality or better alternatives exist. But you never know and they might still be useful somewhere.
Note: Consider using Boost.Histogram instead.
Compose a multi-dimensional histogram with configurable axis types
and fill it with weighted or unweighted data
Note: Consider using small_vector
from Boost.Container instead.
A vector-like container of elements than can store a fixed number of elements directly in the container without allocating additional memory.