HighLAND
|
#include <Parameters.hxx>
Public Member Functions | |
bool | HasParameter (std::string) |
Check if Parameter is stored in database. | |
int | GetParameterI (std::string) |
Get parameter. Value is returned as integer. | |
double | GetParameterD (std::string) |
Get parameter. Value is returned as double. | |
std::string | GetParameterS (std::string) |
Get parameter. Value is returned as string. | |
void | ClearMapOfParameters () |
Clear all the parameters that have been read. | |
UnitsParser * | GetUnitsTableParser () |
void | ReadParamOverrideFile (TString filename) |
int | LoadParametersFile (TString packageName, UInt_t tryFileMode=0, bool fixParameters=false) |
Load the parameters for a given package - needed for multi-threading. | |
void | LoadParametersFiles (const std::vector< std::string > &packageNames, bool fixed=false) |
Load the parameters for a list of packages. | |
void | SetReadParamOverrideFilePointPassed () |
Set whether the point in which the overwride parameters file is read is passed or not. | |
void | CheckReadParamOverrideFilePointPassed (std::string parameterName) |
Static Public Member Functions | |
static Parameters & | Get (void) |
This class provides access to a set of parameters that are defined in a set of text files. The parameters can be used at runtime, by calling ND::params().GetParameterI("tutAnalsyis.param.name") or similar.
Parameters files should be placed in the "parameters" directory in an analysis package, and named as tutAnalysis.parameters.dat, where tutAnalysis is the name of the analysis package. This is where the code will look for a parameter, unless you have already specified the parameter in an "override" file (see below).
The format for parameters files is: < tutAnalysis.param.name = 12345 > Note that you should have spaces between the <>= symbols and your parameter names / values. The first bit of your parameter name MUST be the same as your package name. After that you can have whatever you like. It is useful to use the "dots" to logically group parameters that are related. For example, you could have tutAnalysis.Cuts.PullMu.Max
and tutAnalysis.Cuts.PullMu.Min
.
Parameters can be read as integers, doubles or strings, using the ND::params().GetParameterI(), ND::params().GetParameterD() and ND::params().GetParameterS() functions, respectively.
You don't need to do anything special to use the ND::params() singleton - the first time you call one of the ND::params().GetParameter functions it will parse the relevant parameters file.
You can use a parameters "override" file to override the values set in the normal parameters file. This override file can contain a subset of the parameters (even just 1 or 2), and can be placed anywhere on your file system. Specify the path to this override file using the -p
command-line option. This is very useful if you're using the FLuxWeighting, for example, so that you can run multiple jobs in parallel, and can specify to apply the run 1 flux to run 1 MC files, run 2 flux to run 2 MC files etc.
Definition at line 59 of file Parameters.hxx.
void Parameters::CheckReadParamOverrideFilePointPassed | ( | std::string | parameterName | ) |
Checks whether the point in which the overwride parameters file is read is passed or not. To be used in GetParameters methods. It stops and prints an error message if the ReadParamOverrideFile point is not yet passed
Definition at line 259 of file Parameters.cxx.
|
inlinestatic |
Get a reference to the singleton instance of dummy database information. If this is first attempt at reference then singleton is instantiated and parameters are read from text files.
Definition at line 69 of file Parameters.hxx.
|
inline |
Return the class which parses any units specified in the parameters file, and converts them to a consistent set of HEP units.
Definition at line 92 of file Parameters.hxx.
void Parameters::ReadParamOverrideFile | ( | TString | filename | ) |
This command allows the user to set parameters from the command line; the command is different from the standard file reading, in that the parameters that are set are 'fixed'. Ie, they are immutable and cannot be changed, even if they exist in some other parameters file that is read in later.
Definition at line 192 of file Parameters.cxx.