Helper Classes

namespace HelperClasses

Enums

enum ContainerType

Values:

UNKNOWN = 0
CONSTDV = 1
CONSTCONT = 2
enum ToolName

Values:

MUONSELECTOR
ELECTRONSELECTOR
PHOTONSELECTOR
JETSELECTOR
BJETSELECTOR
CALIBRATOR
CORRECTOR
SELECTOR
DEFAULT
class ElectronInfoSwitch
#include <HelperClasses.h>

The HelperClasses::IParticleInfoSwitch class for Electron Information.

Parameter Pattern Match
m_trigger trigger exact
m_isolation isolation exact
m_isolationKinematics isolationKinematics exact
m_quality quality exact
m_PID PID exact
m_trackparams trackparams exact
m_trackhitcont trackhitcont exact
m_effSF effSF exact
m_PIDWPs[XYZ] PID_XYZ pattern
m_isolWPs[“”] ISOL_ exact
m_isolWPs[“”] ISOL_NONE exact
m_isolWPs[XYZ] ISOL_XYZ pattern
m_trigWPs[XYZ] TRIG_XYZ pattern

Inherits from HelperClasses::IParticleInfoSwitch

Public Functions

bool has_exact(const std::string flag)

Search for an exact match in m_configDetails.

Parameters
  • flag: The string we search for.

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.

template <typename T>
class EnumParser
#include <HelperClasses.h>

template enum parser. Copied from: http://stackoverflow.com/a/726681

class EventInfoSwitch
#include <HelperClasses.h>

The HelperClasses::InfoSwitch struct for Event Information.

Parameter Pattern Match
m_eventCleaning eventCleaning exact
m_pileup pileup exact
m_pileupsys pileupsys exact
m_shapeEM shapeEM exact
m_shapeLC shapeLC exact
m_truth truth exact
m_caloClus caloClusters exact
m_weightsSys weightsSys exact

Inherits from HelperClasses::InfoSwitch

Public Functions

bool has_exact(const std::string flag)

Search for an exact match in m_configDetails.

Parameters
  • flag: The string we search for.

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.

class InfoSwitch
#include <HelperClasses.h>

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::JetTriggerInfoSwitch, HelperClasses::METInfoSwitch, HelperClasses::TrackInfoSwitch, HelperClasses::TriggerInfoSwitch

Public Functions

InfoSwitch(const std::string configStr)

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

Parameters
  • configStr: The configuration string to split up.

bool has_exact(const std::string flag)

Search for an exact match in m_configDetails.

Parameters
  • flag: The string we search for.

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.

class IParticleInfoSwitch
#include <HelperClasses.h>

The HelperClasses::InfoSwitch struct for IParticle Information.

Parameter Pattern Match
m_kinematic kinematic exact
m_numLeading NLeading partial
m_useTheS useTheS exact

Note

m_numLeading requires a number XX to follow it, defining the number of leading partiles and associate it with that variable.

For example:

m_configStr = "... NLeading4 ..."

will define int m_numLeading = 4.

Inherits from HelperClasses::InfoSwitch

Subclassed by HelperClasses::ElectronInfoSwitch, HelperClasses::JetInfoSwitch, HelperClasses::MuonInfoSwitch, HelperClasses::PhotonInfoSwitch, HelperClasses::TauInfoSwitch, HelperClasses::TruthInfoSwitch

Public Functions

bool has_exact(const std::string flag)

Search for an exact match in m_configDetails.

Parameters
  • flag: The string we search for.

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.

class JetInfoSwitch
#include <HelperClasses.h>

The HelperClasses::IParticleInfoSwitch class for Jet Information.

Parameter Pattern Match
m_substructure substructure exact
m_bosonCount bosonCount exact
m_VTags VTags exact
m_rapidity rapidity exact
m_clean clean exact
m_cleanLight cleanLight exact
m_energy energy exact
m_energyLight energyLight exact
m_scales scales exact
m_constscaleEta constscaleEta exact
m_detectorEta detectorEta exact
m_resolution resolution exact
m_truth truth exact
m_truthDetails truth_details exact
m_layer layer exact
m_trackPV trackPV exact
m_trackAll trackAll exact
m_jvt JVT exact
m_sfJVTName sfJVT partial
m_sffJVTName sffJVT partial
m_allTrack allTrack exact
m_allTrackPVSel allTrackPVSel exact
m_allTrackDetail allTrackDetail exact
m_constituent constituent exact
m_constituentAll constituentAll exact
m_flavorTag flavorTag exact
m_flavorTagHLT flavorTagHLT exact
m_sfFTagFix sfFTagFix partial
m_sfFTagFlt sfFTagFlt partial
m_sfFTagHyb sfFTagHyb partial
m_jetBTag jetBTag partial
m_area area exact
m_JVC JVC exact
m_tracksInJet tracksInJet partial
m_trackJetName trackJetName partial
m_hltVtxComp hltVtxComp exact
m_onlineBS onlineBS exact
m_onlineBSTool onlineBSTool exact
m_charge charge exact
m_vsLumiBlock vsLumiBlock exact
m_vsActualMu vsActualMu exact
m_lumiB_runN lumiB_runN exact
m_byAverageMu byAverageMu exact
m_byEta byEta exact
m_etaPhiMap etaPhiMap exact

Note

sfJVT requires a working point after it, for example:

m_configStr = "... sfJVTMedium ..."

sfFTagFix, sfFTagFlt and sfFTagHyb require a string of numbers pairwise AABB..MM..YYZZ succeeding it. This will create a vector of numbers (AA, BB, CC, ..., ZZ) associated with that variable. For example:

m_configStr = "... sfFTagFix010203 ..."

will define std::vector<int> m_sfFTagFix = {1,2,3}. THIS OPTION IS DEPRICATED!

jetBTag expects the format jetBTag_tagger_type_AABB..MM..YY.ZZ. This will create a vector of working points (AA, BB, CC, ..., ZZ) associated with that tagger. Several entries can be given. For example:

m_configStr = "... jetBTag_MV2c10_HybBEff_60707785 ..."

will define std::map<std::vector<std::pair<std::string,uint>>> m_jetBTag["MV2c10"] = {std::make_pair("HybBEff",60), std::make_pair("HybBEff",70) ,std::make_pair("HybBEff",77), std::make_pair("HybBEff",85)}.

trackJetName expects one or more track jet container names separated by an underscore. For example, the string trackJetName_GhostAntiKt2TrackJet_GhostVR30Rmax4Rmin02TrackJet will set the attriubte m_trackJetNames to {"GhostAntiKt2TrackJet", "GhostVR30Rmax4Rmin02TrackJet"}.

Inherits from HelperClasses::IParticleInfoSwitch

Public Functions

bool has_exact(const std::string flag)

Search for an exact match in m_configDetails.

Parameters
  • flag: The string we search for.

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.

class JetTriggerInfoSwitch
#include <HelperClasses.h>

The HelperClasses::InfoSwitch struct for Jet Trigger Information.

Parameter Pattern Match
m_kinematic kinematic exact
m_clean clean exact

Inherits from HelperClasses::InfoSwitch

Public Functions

bool has_exact(const std::string flag)

Search for an exact match in m_configDetails.

Parameters
  • flag: The string we search for.

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.

class METInfoSwitch
#include <HelperClasses.h>

The HelperClasses::InfoSwitch struct for Missing \(\text{E}_{\text{T}}\) Information.

Parameter Pattern Match
m_metClus metClus exact
m_metTrk metTrk exact
m_sigClus sigClus|all exact
m_sigTrk sigTrk|all exact
m_sigResolutionClus sigResolutionClus|all exact
m_sigResolutionTrk sigResolutionTrk|all exact
m_refEle refEle|all exact
m_refGamma refGamma|all exact
m_refTau refTau|all exact
m_refMuons refMuons|all exact
m_refJet refJet|all exact
m_refJetTrk refJetTrk exact
m_softClus softClus|all exact
m_softTrk softTrk|all exact

Note

For all except m_refJetTrk, you can pass in the string "all" to enable all information. You can force only calocluster- or track-based MET using m_metClus or m_metTrk.

Inherits from HelperClasses::InfoSwitch

Public Functions

bool has_exact(const std::string flag)

Search for an exact match in m_configDetails.

Parameters
  • flag: The string we search for.

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.

class MuonInfoSwitch
#include <HelperClasses.h>

The HelperClasses::IParticleInfoSwitch class for Muon Information.

Parameter Pattern Match
m_trigger trigger exact
m_isolation isolation exact
m_isolationKinematics isolationKinematics exact
m_quality quality exact
m_trackparams trackparams exact
m_trackhitcont trackhitcont exact
m_effSF effSF exact
m_energyLoss energyLoss exact

Inherits from HelperClasses::IParticleInfoSwitch

Public Functions

bool has_exact(const std::string flag)

Search for an exact match in m_configDetails.

Parameters
  • flag: The string we search for.

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.

class PhotonInfoSwitch
#include <HelperClasses.h>

The HelperClasses::IParticleInfoSwitch class for Photon Information.

Parameter Pattern Match
m_isolation isolation exact
m_PID PID exact
m_purity purity exact
m_effSF effSF exact
m_trigger trigger exact

Inherits from HelperClasses::IParticleInfoSwitch

Public Functions

bool has_exact(const std::string flag)

Search for an exact match in m_configDetails.

Parameters
  • flag: The string we search for.

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.

class TauInfoSwitch
#include <HelperClasses.h>

The HelperClasses::IParticleInfoSwitch struct for Tau Information.

Parameter Pattern Match
m_trackparams trackparams exact
m_trackhitcont trackhitcont exact

Inherits from HelperClasses::IParticleInfoSwitch

Public Functions

bool has_exact(const std::string flag)

Search for an exact match in m_configDetails.

Parameters
  • flag: The string we search for.

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.

class TrackInfoSwitch
#include <HelperClasses.h>

The HelperClasses::InfoSwitch struct for Track Information.

Parameter Pattern Match
m_kinematic kinematic exact
m_fitpars fitpars exact
m_numbers numbers exact
m_vertex vertex exact
m_useTheS useTheS exact

Inherits from HelperClasses::InfoSwitch

Public Functions

bool has_exact(const std::string flag)

Search for an exact match in m_configDetails.

Parameters
  • flag: The string we search for.

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.

class TriggerInfoSwitch
#include <HelperClasses.h>

The HelperClasses::InfoSwitch struct for Trigger Information.

Parameter Pattern Match
m_basic basic exact
m_menuKeys menuKeys exact
m_passTriggers passTriggers exact
m_passTrigBits passTrigBits exact

Inherits from HelperClasses::InfoSwitch

Public Functions

bool has_exact(const std::string flag)

Search for an exact match in m_configDetails.

Parameters
  • flag: The string we search for.

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.

class TruthInfoSwitch
#include <HelperClasses.h>

The HelperClasses::InfoSwitch struct for Truth Information.

Parameter Pattern Match
m_kinematic kinematic exact
m_type type exact
m_bVtx bVtx exact
m_parents parents exact
m_children children exact

Inherits from HelperClasses::IParticleInfoSwitch

Public Functions

bool has_exact(const std::string flag)

Search for an exact match in m_configDetails.

Parameters
  • flag: The string we search for.

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.