Class InfoSwitch

Inheritance Relationships

Derived Types

Class Documentation

class InfoSwitch

A struct that is used for parsing configuration strings and assigning booleans to various properties. Currently used in plotting code.

Strings are used to turn on and off histograms and branches in the tree The following structs hold the bools used to control the content and also have the string which is necessary to turn a set on. See the derived members for more information about what is supported. Each derived member should provide a table of parameters, patterns, and type of matching scheme used. The pattern will use standard PCRE-syntax when appropriate.

We support two major matching schemes:

Exact

If a variable is matched exactly to a string, then a boolean is set to True or False based on whether an exact match exists or not.

Partial

If a variable is partially matched to a string, then there is some specific pattern we are extracting that will succeed the partial match that determines what the variable will be set to (usually not a bool).

Subclassed by HelperClasses::EventInfoSwitch, HelperClasses::IParticleInfoSwitch, HelperClasses::METInfoSwitch, HelperClasses::TrackInfoSwitch, HelperClasses::TriggerInfoSwitch

Public Functions

inline InfoSwitch(const std::string configStr)

Constructor. Take in input string, create vector of tokens.

Parameters

configStr – The configuration string to split up.

inline bool has_exact(const std::string flag)

Search for an exact match in m_configDetails.

Parameters

flag – The string we search for.

inline bool has_match(const std::string flag)

Search for a partial match in m_configStr.

Parameters

flag – The string we search for.

std::string get_working_point(const std::string flag)

Search for a single flag in m_configDetails and parse out the working point.

Parameters

flag – The string we search for.

std::vector<std::string> get_working_points(const std::string flag)

Search for multiple flags in m_configDetails and parse out the working points.

Parameters

flag – The string we search for.

Protected Attributes

const std::string m_configStr

The input configuration string from which we split up into tokens.

std::set<std::string> m_configDetails

The vector of tokens from which we search through for finding matches.