AmpGen 2.1
Loading...
Searching...
No Matches
AmpGen::Argument< TYPE > Class Template Reference

Detailed Description

template<typename TYPE>
class AmpGen::Argument< TYPE >

Structure to flexibly pass blocks of "Named" parameters to functions, to approximate the behaviour of Python's named arguments. Typical usage is for constructors with variable arguments, such as to read data from the disk. The interface for the user is typically

EventList events("files.root",
type,
GetGenPDF(true),
WeightBranch("eventWeight"),
Branches({"K_PX","K_PY",...}));

Internally these arguments are used to construct an ArgumentPack, and then read out using getArg<TYPE>, so for this example:

auto pdfSize = args.getArg<CacheSize>().val;
auto filter = args.getArg<Filter>().val;
auto getGenPdf = args.getArg<GetGenPdf>(true).val;
auto weightBranch = args.getArg<WeightBranch>().val;
auto branches = args.getArg<Branches>().val;
auto applySym = args.getArg<ApplySym>().val;
auto entryList = args.getArg<EntryList>().val;
Template Parameters
TYPEType of the argument, such as a string, a number, a bool etc.

Definition at line 55 of file ArgumentPack.h.

Public Member Functions

template<typename T>
 Argument (T x)
 
 Argument ()=default
 
 operator TYPE () const
 

Public Attributes

TYPE val = { TYPE() }
 
Inheritance diagram for AmpGen::Argument< TYPE >:
AmpGen::IArgument

Constructor & Destructor Documentation

◆ Argument() [1/2]

template<typename TYPE>
template<typename T>
AmpGen::Argument< TYPE >::Argument ( T x)
inlineexplicit

Definition at line 58 of file ArgumentPack.h.

◆ Argument() [2/2]

template<typename TYPE>
AmpGen::Argument< TYPE >::Argument ( )
default

Member Function Documentation

◆ operator TYPE()

template<typename TYPE>
AmpGen::Argument< TYPE >::operator TYPE ( ) const
inline

Definition at line 60 of file ArgumentPack.h.

Member Data Documentation

◆ val

template<typename TYPE>
TYPE AmpGen::Argument< TYPE >::val = { TYPE() }

Definition at line 61 of file ArgumentPack.h.


The documentation for this class was generated from the following file: