CepGen 1.2.5
Central exclusive processes event generator
|
Collection of utilities.
Namespaces | |
namespace | env |
All environment variable-related utilities. | |
namespace | kt |
Classes | |
class | AbortHandler |
Object handling an user-driven process abortion. More... | |
class | Caller |
External command piping utility. More... | |
class | Derivator |
class | DocumentationGenerator |
Documentation generator object. More... | |
class | Drawable |
A generic object which can be drawn in the standard output. More... | |
class | Drawer |
A generic drawing utility. More... | |
struct | EnumHash |
A hasher table for an enumeration. More... | |
class | EventBrowser |
A user-friendly browser for the Event content. More... | |
class | Function1D |
Wrapper to a 1-dimensional function with optional parameters. More... | |
class | Functional |
A string-to-functional parser. More... | |
class | FunctionalExprTk |
class | FunctionalLibmatheval |
class | FunctionalMuParser |
class | FunctionalTinyExpr |
class | GnuplotDrawer |
Gnuplot drawable objects drawing utility. More... | |
class | Graph1D |
A one-dimensional graph object. More... | |
class | Graph2D |
A two-dimensional graph object. More... | |
class | GridDrawer |
Utility object to draw a grid values mapping. More... | |
class | GSLDerivator |
class | GSLFunctionWrapper |
GSL wrapper to define a functor as a GSL-digestible functional. More... | |
class | GSLMonteFunctionWrapper |
GSL wrapper to define a functor as an integrable functional. More... | |
struct | Hasher |
A hasher table for a given structure. More... | |
struct | Hasher< T, true > |
A hasher table for a given structure. More... | |
class | Hist1D |
1D histogram container More... | |
class | Hist2D |
2D histogram container More... | |
class | Histogram |
Generic text-based plotting utility. More... | |
class | Logger |
General purposes logger. More... | |
class | MatplotlibDrawer |
class | Piper |
External command piping utility. More... | |
class | ProcessVariablesAnalyser |
class | ProgressBar |
A simple progress indicator. More... | |
class | RandomGenerator |
A random number generator. More... | |
struct | RunAbortedException |
Exception raised when the user terminates the process. More... | |
class | TextDocumentationGenerator |
Text documentation generator object. More... | |
class | TextDrawer |
class | TimeKeeper |
Collection of clocks to benchmark execution blocks. More... | |
class | Timer |
A generic timer to extract the processing time between two steps in this software's flow. More... | |
class | TopdrawerDrawer |
class | YODADrawer |
Typedefs | |
typedef std::vector< const Drawable * > | DrawableColl |
A collection of drawable objects. | |
Enumerations | |
enum class | Colour { none = -1 , reset = 0 , black = 30 , red = 31 , green = 32 , yellow = 33 , blue = 34 , magenta = 35 , cyan = 36 , white = 37 } |
TTY-type enumeration of colours. More... | |
enum struct | Modifier : int16_t { none = -1 , reset = 0 , bold = 1 , dimmed = 1 << 1 , italic = 1 << 2 , underline = 1 << 3 , blink = 1 << 4 , reverse = 1 << 6 } |
Functions | |
double | mX2 (double xbj, double q2, double mp2) |
Compute the diffractive mass from virtuality/Bjorken x. | |
double | q2 (double xbj, double mp2, double mx2) |
Compute the virtuality from Bjorken x/diffractive mass. | |
double | xBj (double q2, double mp2, double mx2) |
Compute Bjorken x from virtuality/diffractive mass. | |
double | energyFromW (double w, double mp2, double m2) |
Compute energy from mass and emitted mass. | |
template<typename K , typename T > | |
std::vector< K > | keys (const std::map< K, T > &coll) |
Retrieve all keys from a map. | |
template<typename K , typename T > | |
std::vector< K > | keys (const std::unordered_map< K, T > &coll) |
Retrieve all keys from an unordered map. | |
template<typename T > | |
bool | contains (const std::vector< T > &coll, const T &item) |
Check if a vector contains an item. | |
template<typename T > | |
bool | contains (const std::set< T > &coll, const T &item) |
Check if a set contains an item. | |
template<typename K , typename T > | |
bool | contains (const std::unordered_map< K, T > &coll, const T &item) |
Check if an unordered map contains an item. | |
template<typename T > | |
void | normalise (std::vector< T > &coll) |
Remove duplicates and sort a collection. | |
template<typename T > | |
bool | uniform (const std::vector< T > &coll) |
Check if all elements of a collection are uniform. | |
bool | operator& (const Drawer::Mode &lhs, const Drawer::Mode::value_t &rhs) |
Drawer::Mode | operator| (const Drawer::Mode &lhs, const Drawer::Mode::value_t &rhs) |
std::ostream & | operator<< (std::ostream &os, const Drawer::Mode &mode) |
bool | fileExists (const std::string &) |
Check if the file exists. | |
std::string | fileExtension (const std::string &file) |
Small utility to retrieve the extension of a filename. | |
std::string | readFile (const std::string &) |
Read the content of a file into a string buffer. | |
Hist2D::contents_t | operator* (double scaling, const Hist2D::contents_t &oth) |
std::ostream & | operator<< (std::ostream &os, const Hist2D::contents_t &cnt) |
template<typename T > | |
bool | positive (const T &val) |
Check if a number is positive and finite. | |
template bool | positive< double > (const double &) |
template bool | positive< float > (const float &) |
template bool | positive< int > (const int &) |
double | fastHypot (double x, double y) |
double | fastHypot (double x, double y, double z) |
double | fastSqrtSqDiff (double, double) |
Compute the square root of the squared difference (sqrt(a^2-b^2)) | |
std::regex | kFloatRegex ("[+-]?[0-9]*\\.?[0-9]+([eEdD][+-]?[0-9]+)?", std::regex_constants::extended) |
std::string | yesno (bool test) |
Human-readable boolean printout Boldify a string for TTY-type output streams. | |
template<> | |
std::string | boldify (std::string str) |
String implementation of the boldification procedure. | |
template<> | |
std::string | boldify (const char *str) |
C-style character array implementation of the boldification procedure. | |
template<> | |
std::string | boldify (unsigned long ui) |
Unsigned long integer implementation of the boldification procedure. | |
Modifier | operator| (const Modifier &lhs, const Modifier &rhs) |
std::string | colourise (const std::string &, const Colour &, const Modifier &=Modifier::none) |
Colourise a string for TTY-type output streams. | |
std::string | parseSpecialChars (const std::string &) |
Transform all emoji-like special characters into their LaTeX representation. | |
std::string | sanitise (const std::string &) |
Replace all unsafe characters to build a computer-readable (and filename-safe) string. | |
std::string | timeAs (const std::string &fmt) |
Return the formatted date/time now. | |
size_t | replaceAll (std::string &str, const std::string &from, const std::string &to) |
Replace all occurrences of a text by another. | |
std::string | replaceAll (const std::string &str, const std::string &from, const std::string &to) |
Replace all occurrences of a text by another. | |
std::string | replaceAll (const std::string &str, const std::vector< std::pair< std::string, std::string > > &keys) |
Replace all occurrences of multiple texts by others. | |
template<> | |
std::string | toString (const std::wstring &str) |
Convert a wide characters to a standard characters string. | |
template<> | |
std::string | toString (const ParametersList ¶ms) |
Specialisation of string conversion of parameters list. | |
template<> | |
std::string | toString (const Limits &lim) |
Specialisation of string conversion of limits. | |
std::wstring | toWstring (const std::string &str) |
Convert a standard characters to a wide characters string. | |
template<> | |
std::string | toString (const double &val) |
std::string | toCamelCase (const std::string &, bool lower=true) |
Convert any case into a camelCase string. | |
std::string | randomString (size_t size) |
Generate a random string of a given size. | |
std::string | s (const std::string &, float, bool=true) |
Add a trailing "s" when needed. | |
std::vector< std::string > | split (const std::string &, char, bool trim=false) |
Split a string according to a separation character. | |
template<typename T > | |
std::string | merge (const std::vector< T > &, const std::string &) |
Merge a collection of a printable type in a single string. | |
template std::string | merge< std::string > (const std::vector< std::string > &, const std::string &) |
template std::string | merge< Limits > (const std::vector< Limits > &, const std::string &) |
template std::string | merge< unsigned short > (const std::vector< unsigned short > &, const std::string &) |
template std::string | merge< int > (const std::vector< int > &, const std::string &) |
template std::string | merge< unsigned long long > (const std::vector< unsigned long long > &, const std::string &) |
template std::string | merge< double > (const std::vector< double > &, const std::string &) |
template std::string | merge< ParametersList > (const std::vector< ParametersList > &, const std::string &) |
template<typename T > | |
std::string | merge (const std::vector< std::vector< T > > &, const std::string &) |
Merge a collection of collections of a printable type in a single string. | |
template std::string | merge< double > (const std::vector< std::vector< double > > &, const std::string &) |
std::string | merge (const ParametersList &, const std::string &) |
Trivial dimension-1 "merger" for parameters list input. | |
std::string | merge (const Limits &, const std::string &) |
Trivial dimension-1 "merger" for limits input. | |
bool | isInt (const std::string &) |
Check if a string is also an integer. | |
bool | isFloat (const std::string &) |
Check if a string is also a floating point number. | |
std::string | toUpper (const std::string &) |
Capitalise a string. | |
std::string | toLower (const std::string &) |
Lowercase version of a string. | |
template void | normalise (std::vector< std::string > &) |
std::string | ltrim (const std::string &str) |
Trim leading spaces. | |
std::string | rtrim (const std::string &str) |
Trim trailing spaces. | |
std::string | strip (const std::string &) |
Strip all special characters from string. | |
std::string | demangle (const char *) |
Demangle a type id if possible. | |
std::vector< std::string > | between (const std::string &str, const std::string &beg, const std::string &end) |
Get a (list of) substring(s) between two characters chains. | |
bool | startsWith (const std::string &, const std::string &) |
Check if a string starts with a given token. | |
bool | endsWith (const std::string &, const std::string &) |
Check if a string ends with a given token. | |
std::string | describeError (int errnum) |
Describe an error code. | |
std::ostream & | operator<< (std::ostream &os, const Colour &col) |
std::ostream & | operator<< (std::ostream &os, const Modifier &mod) |
template<typename T > | |
std::string | toString (const T &obj) |
Transform any type into a string. | |
template<> | |
std::string | toString (const Limits &) |
Specialisation of string conversion of limits. | |
template<> | |
std::string | toString (const ParametersList &) |
Specialisation of string conversion of parameters list. | |
template<> | |
std::string | toString (const std::string &obj) |
Trivial specialisation of string conversion of string. | |
template<> | |
std::string | toString (const double &) |
template<> | |
std::string | toString (const std::wstring &) |
Convert a wide characters to a standard characters string. | |
template<typename... Args> | |
std::string | format (const std::string &fmt, Args... args) |
Format a string using a printf style format descriptor. | |
template<typename... Args> | |
std::string | format (const std::wstring &fmt, Args... args) |
Format a wide string using a printf style format descriptor. | |
template<typename T > | |
std::string | boldify (T str) |
template<typename T > | |
std::string | merge (const T &val, const std::string &) |
Merge a a printable type in a single string. | |
template<typename T , size_t N> | |
std::string | merge (const std::array< T, N > &arr, const std::string &delim) |
Merge a collection of a printable type in a single string. | |
std::string | merge (const std::string &val, const std::string &) |
Trivial dimension-1 "merger" for string input. | |
template<class T > | |
std::string | repr (const std::vector< T > &vec, const std::function< std::string(const T &)> &printer, const std::string &sep=",") |
Helper to print a vector. | |
template<class T > | |
std::string | repr (const std::vector< T > &vec, const std::string &sep=",") |
Helper to print a vector. | |
std::string | trim (const std::string &str) |
Trim leading and trailing spaces. | |
Event | generateLPAIREvent () |
Generate a standard single-dissociative \(pp \to p^\ast (\gamma\gamma \to \mu^+\mu^-) p\) LPAIR event. | |
Variables | |
std::atomic< int > | gSignal |
Abort signal handler. | |
static const Limits | x_limits {0., 1.} |
typedef std::vector<const Drawable*> DrawableColl |
|
strong |
|
strong |
std::vector< std::string > between | ( | const std::string & | str, |
const std::string & | beg, | ||
const std::string & | end | ||
) |
[in] | beg | Start delimiter of the substring(s) |
[in] | end | End delimiter of the substring(s) |
Definition at line 351 of file String.cpp.
std::string boldify | ( | const char * | str | ) |
Definition at line 55 of file String.cpp.
std::string boldify | ( | std::string | str | ) |
Definition at line 49 of file String.cpp.
std::string boldify | ( | T | str | ) |
std::string boldify | ( | unsigned long | ui | ) |
Definition at line 61 of file String.cpp.
Definition at line 70 of file String.cpp.
bool contains | ( | const std::set< T > & | coll, |
const T & | item | ||
) |
Definition at line 52 of file Collections.h.
bool contains | ( | const std::unordered_map< K, T > & | coll, |
const T & | item | ||
) |
Definition at line 57 of file Collections.h.
bool contains | ( | const std::vector< T > & | coll, |
const T & | item | ||
) |
Definition at line 47 of file Collections.h.
std::string demangle | ( | const char * | name | ) |
Definition at line 341 of file String.cpp.
std::string describeError | ( | int | errnum | ) |
Definition at line 373 of file String.cpp.
bool endsWith | ( | const std::string & | str, |
const std::string & | end | ||
) |
Definition at line 367 of file String.cpp.
bool fileExists | ( | const std::string & | path | ) |
Definition at line 27 of file Filesystem.cpp.
std::string fileExtension | ( | const std::string & | file | ) |
Definition at line 29 of file Filesystem.cpp.
std::string format | ( | const std::string & | fmt, |
Args... | args | ||
) |
std::string format | ( | const std::wstring & | fmt, |
Args... | args | ||
) |
Event generateLPAIREvent | ( | ) |
Definition at line 30 of file EventUtils.h.
bool isFloat | ( | const std::string & | str | ) |
Definition at line 295 of file String.cpp.
bool isInt | ( | const std::string & | str | ) |
Definition at line 290 of file String.cpp.
std::vector< K > keys | ( | const std::map< K, T > & | coll | ) |
Definition at line 33 of file Collections.h.
std::vector< K > keys | ( | const std::unordered_map< K, T > & | coll | ) |
Definition at line 40 of file Collections.h.
std::regex kFloatRegex | ( | "?*\\.?+([eEdD][+-]?[0-9]+)?" | [+-][0-9][0-9], |
std::regex_constants::extended | |||
) |
std::string ltrim | ( | const std::string & | str | ) |
Definition at line 321 of file String.cpp.
std::string merge | ( | const Limits & | lim, |
const std::string & | |||
) |
Definition at line 284 of file String.cpp.
std::string merge | ( | const ParametersList & | plist, |
const std::string & | |||
) |
Definition at line 282 of file String.cpp.
std::string merge | ( | const std::array< T, N > & | arr, |
const std::string & | delim | ||
) |
std::string merge | ( | const std::string & | val, |
const std::string & | |||
) |
std::string merge | ( | const std::vector< std::vector< T > > & | vec, |
const std::string & | delim | ||
) |
Definition at line 268 of file String.cpp.
std::string merge | ( | const std::vector< T > & | vec, |
const std::string & | delim | ||
) |
Definition at line 248 of file String.cpp.
std::string merge | ( | const T & | val, |
const std::string & | |||
) |
template std::string merge< double > | ( | const std::vector< double > & | , |
const std::string & | |||
) |
template std::string merge< double > | ( | const std::vector< std::vector< double > > & | , |
const std::string & | |||
) |
template std::string merge< int > | ( | const std::vector< int > & | , |
const std::string & | |||
) |
template std::string merge< ParametersList > | ( | const std::vector< ParametersList > & | , |
const std::string & | |||
) |
template std::string merge< std::string > | ( | const std::vector< std::string > & | , |
const std::string & | |||
) |
template std::string merge< unsigned long long > | ( | const std::vector< unsigned long long > & | , |
const std::string & | |||
) |
template std::string merge< unsigned short > | ( | const std::vector< unsigned short > & | , |
const std::string & | |||
) |
template void normalise | ( | std::vector< std::string > & | ) |
void normalise | ( | std::vector< T > & | coll | ) |
Definition at line 63 of file Collections.h.
bool operator& | ( | const Drawer::Mode & | lhs, |
const Drawer::Mode::value_t & | rhs | ||
) |
Definition at line 30 of file Drawer.cpp.
Hist2D::contents_t operator* | ( | double | scaling, |
const Hist2D::contents_t & | oth | ||
) |
Definition at line 283 of file Hist2D.cpp.
std::ostream & operator<< | ( | std::ostream & | os, |
const Colour & | col | ||
) |
Definition at line 391 of file String.cpp.
std::ostream & operator<< | ( | std::ostream & | os, |
const Drawer::Mode & | mode | ||
) |
Definition at line 37 of file Drawer.cpp.
std::ostream & operator<< | ( | std::ostream & | os, |
const Hist2D::contents_t & | cnt | ||
) |
Definition at line 295 of file Hist2D.cpp.
std::ostream & operator<< | ( | std::ostream & | os, |
const Modifier & | mod | ||
) |
Definition at line 407 of file String.cpp.
Drawer::Mode operator| | ( | const Drawer::Mode & | lhs, |
const Drawer::Mode::value_t & | rhs | ||
) |
Definition at line 32 of file Drawer.cpp.
Definition at line 65 of file String.cpp.
std::string parseSpecialChars | ( | const std::string & | str | ) |
Definition at line 90 of file String.cpp.
template bool positive< double > | ( | const double & | ) |
template bool positive< float > | ( | const float & | ) |
template bool positive< int > | ( | const int & | ) |
std::string randomString | ( | size_t | size | ) |
Definition at line 221 of file String.cpp.
std::string readFile | ( | const std::string & | filename | ) |
Definition at line 31 of file Filesystem.cpp.
std::string replaceAll | ( | const std::string & | str, |
const std::string & | from, | ||
const std::string & | to | ||
) |
Definition at line 128 of file String.cpp.
std::string replaceAll | ( | const std::string & | str, |
const std::vector< std::pair< std::string, std::string > > & | keys | ||
) |
Definition at line 137 of file String.cpp.
size_t replaceAll | ( | std::string & | str, |
const std::string & | from, | ||
const std::string & | to | ||
) |
Definition at line 118 of file String.cpp.
std::string repr | ( | const std::vector< T > & | vec, |
const std::function< std::string(const T &)> & | printer, | ||
const std::string & | sep = "," |
||
) |
std::string repr | ( | const std::vector< T > & | vec, |
const std::string & | sep = "," |
||
) |
std::string rtrim | ( | const std::string & | str | ) |
Definition at line 327 of file String.cpp.
std::string s | ( | const std::string & | word, |
float | num, | ||
bool | show_number | ||
) |
Definition at line 228 of file String.cpp.
std::string sanitise | ( | const std::string & | str | ) |
Definition at line 105 of file String.cpp.
std::vector< std::string > split | ( | const std::string & | str, |
char | delim, | ||
bool | trim | ||
) |
Definition at line 233 of file String.cpp.
bool startsWith | ( | const std::string & | str, |
const std::string & | beg | ||
) |
Definition at line 365 of file String.cpp.
std::string strip | ( | const std::string & | str | ) |
Definition at line 334 of file String.cpp.
std::string timeAs | ( | const std::string & | fmt | ) |
Definition at line 110 of file String.cpp.
std::string toCamelCase | ( | const std::string & | in, |
bool | lower | ||
) |
Definition at line 186 of file String.cpp.
std::string toLower | ( | const std::string & | str | ) |
Definition at line 304 of file String.cpp.
std::string toString | ( | const double & | val | ) |
Definition at line 178 of file String.cpp.
std::string toString | ( | const double & | val | ) |
Definition at line 178 of file String.cpp.
std::string toString | ( | const Limits & | lim | ) |
Definition at line 165 of file String.cpp.
std::string toString | ( | const Limits & | lim | ) |
Definition at line 165 of file String.cpp.
std::string toString | ( | const ParametersList & | params | ) |
Definition at line 158 of file String.cpp.
std::string toString | ( | const ParametersList & | params | ) |
Definition at line 158 of file String.cpp.
std::string toString | ( | const std::wstring & | str | ) |
Definition at line 151 of file String.cpp.
std::string toString | ( | const std::wstring & | str | ) |
Definition at line 151 of file String.cpp.
std::string toUpper | ( | const std::string & | str | ) |
Definition at line 297 of file String.cpp.
std::wstring toWstring | ( | const std::string & | str | ) |
Definition at line 171 of file String.cpp.
bool uniform | ( | const std::vector< T > & | coll | ) |
Definition at line 72 of file Collections.h.
std::string yesno | ( | bool | test | ) |
T | type of variable to be boldified |
Definition at line 45 of file String.cpp.
std::atomic< int > gSignal |
Definition at line 39 of file GlobalFunctions.cpp.