\(j\)

class JetCalibrator

A wrapper to a few JetETMiss packages. By setting the configuration parameters detailed in the header documentation, one can:

  • calibrate a given jet collection
  • apply systematic variations for JES
  • apply systematic variations for JER
  • decorate the jet with the decision of the Jet Cleaning tool

When considering systematics, a new xAOD::JetCollection is created for each systematic variation. The names are then saved in a vector for downstream algorithms to use.

Inherits from xAH::Algorithm

Public Functions

JetCalibrator()
EL::StatusCode setupJob(EL::Job &job)
EL::StatusCode fileExecute()
EL::StatusCode histInitialize()
EL::StatusCode changeInput(bool firstFile)
EL::StatusCode initialize()
EL::StatusCode execute()
EL::StatusCode postExecute()
EL::StatusCode finalize()
EL::StatusCode histFinalize()
StatusCode algInitialize()

Run any initializations commmon to all xAH Algorithms (such as registerInstance). Call this inside histInitialize for best results.

StatusCode algFinalize()

Run any finalizations common to all xAH Algorithms (such as unregisterInstance). Call this inside histFinalize for best results.

StatusCode parseSystValVector()

Parse string of systematic sigma levels in m_systValVectorString into m_systValVector.

Public Members

std::string m_inContainerName = ""

The name of the input container for this algorithm to read from TEvent or TStore

std::string m_outContainerName = ""

The name of the nominal output container written by the algorithm to TStore

If the algorithm applies systematic variations, for each shallow copy saved to TStore, the systematic name will be appended to this.

std::string m_jetAlgo = ""

set to AntiKt4EMTopo for AntiKt4EMTopoJets

std::string m_outputAlgo = ""

name of vector holding names of jet systematics given by the JetEtmiss Tools

bool m_writeSystToMetadata = false

Write systematics names to metadata.

std::string m_calibConfigData = "JES_MC15Prerecommendation_April2015.config"

config for JetCalibrationTool for Data

std::string m_calibConfigFullSim = "JES_MC15Prerecommendation_April2015.config"

config for JetCalibrationTool for Full Sim MC

std::string m_calibConfigAFII = "JES_Prerecommendation2015_AFII_Apr2015.config"

config for JetCalibrationTool for AFII MC

std::string m_calibConfig = ""

config files actually passed to JetCalibrationTool chosen from the above depending on what information stored in the input file

std::string m_calibSequence = "JetArea_Residual_Origin_EtaJES_GSC"

List of calibration steps. “Insitu” added automatically if running on data.

std::string m_JESUncertConfig = ""

config for JES Uncertainty Tool

std::string m_JESUncertMCType = "MC15"

JetUncertaintiesTool parameter.

bool m_setAFII = false

If you do not want to use SampleHandler to mark samples as AFII, this flag can be used to force run the AFII configurations.

With SampleHandler, one can define sample metadata in job steering macro. You can do this with relevant samples doing something like:

// access a single sample
Sample *sample = sh.get ("mc14_13TeV.blahblahblah");
sample->setMetaString("SimulationFlavour", "AFII");

bool m_forceInsitu = true

when running data “_Insitu” is appended to this string

bool m_jetCalibToolsDEV = false

when using DEV mode of JetCalibTools

std::string m_JERUncertConfig = ""
bool m_JERFullSys = false

Set systematic mode as Full (true) or Simple (false)

bool m_JERApplyNominal = false

Apply nominal smearing.

bool m_doCleaning = true

enable to apply jet cleaning decoration

std::string m_jetCleanCutLevel = "LooseBad"

Cut Level.

bool m_saveAllCleanDecisions = false

Save all cleaning decisions as decorators.

bool m_jetCleanUgly = false

Do Ugly cleaning ( i.e. TileGap 3 )

bool m_redoJVT = false

Recalculate JVT using the calibrated jet pT.

bool m_calculatefJVT = false

Calculate fJVT using the calibrated jet pT.

double m_fJVTCentralMaxPt = -1

Maximum pT of central jets used to compute fJVT decision.

std::string m_fJVTWorkingPoint = "Medium"

fJVT working point

std::string m_JvtAuxName = ""

Name of Jvt aux decoration. Was “JvtJvfcorr” in Rel 20.7, is now “JVFCorr” in Rel 21. Leave empty to use JetMomentTools default. This must be left empty for RootCore (r20.7) code!

bool m_sort = true

Sort the processed container elements by transverse momentum.

bool m_cleanParent = false

Apply jet cleaning to parent jet.

bool m_applyFatJetPreSel = false
bool m_doJetTileCorr = false

jet tile correction

std::string m_systNameJES = ""

If running systematics, the name of the systematic

float m_systValJES = 0.0

If running systematics, the value to set the systematic to

Note

This will set the systematic to the value \(\pm x\).

std::string m_systNameJER = ""

If running systematics, the name of the systematic

std::string m_name = "UnnamedAlgorithm"

All algorithms initialized should have a unique name, to differentiate them at the TObject level.

Note, GetName() returns a char* while this returns a std::string.

bool m_debug = false

m_debug is being deprecated

bool m_verbose = false

m_verbose is being deprecated

MSG::Level m_msgLevel = MSG::INFO

debug level

std::string m_systName = ""

If running systematics, the name of the systematic

float m_systVal = 0.0

If running systematics, the value to set the systematic to

Note

This will set the systematic to the value \(\pm x\).

std::string m_systValVectorString = ""

If running systematics, you can run multiple points and store them in here. A comma separated list of working points should be given to m_systValVectorString, and then parsed by calling parseSystValVector.

std::vector<float> m_systValVector
std::string m_eventInfoContainerName = "EventInfo"

If the xAOD has a different EventInfo container name, set it here

int m_isMC = -1

This is an override at the algorithm level to force analyzing MC or not.

Value Meaning
-1 Default, use eventInfo object to determine if data or mc
0 Treat the input as data
1 Treat the input as MC

Protected Functions

bool isMC()

Try to determine if we are running over data or MC. The xAH::Algorithm::m_isMC can be used

to fix the return value. Otherwise the EventInfo object is queried.

An exception is thrown if the type cannot be determined.

Return Value Meaning
0 Data
1 MC

void registerInstance()

Register the given instance under the moniker xAH::Algorithm::m_className

This will increase the reference count by 1.

int numInstances()

Return number of instances registered under the moniker xAH::Algorithm::m_className

This will return the reference count.

Warning

If for some reason the instance wasn’t registered, we spit out a warning.

void unregisterInstance()

Unregister the given instance under the moniker xAH::Algorithm::m_className

This will decrease the reference count by 1.

Warning

If for some reason the instance wasn’t registered, we spit out a warning.

template <typename T>
StatusCode checkToolStore(const std::string &tool_name)

Check whether the input CP tool already exists with this name in the asg::ToolStore

Depending on the outcome, the content of the map xAH::Algorithm::m_toolAlreadyUsed wll be set accordingly.

bool isToolAlreadyUsed(const std::string &tool_name)

Check whether the input CP tool has been already used by any xAH::Algorithm in the current job by scanning xAH::Algorithm::m_toolAlreadyUsed.

template <typename T>
void setToolName(asg::AnaToolHandle<T> &handle, std::string name = "") const

Note: This function does nothing in release 21.1! The native private tool mechanism is used instead.

Sets the name of a tool. If no name is needed, the tool will use the name of the algorithm plus a unique identifier (xAH::Algorithm::getAddress()) appended to ensure the tool is unique and effectively private.

The tool will not be guaranteed unique if two tools of the same type are created without a name passed in. But this is, at this point, up to the user and a more complex scenario than what this function tries to simplify on its own.

std::string getAddress() const

Return a std::string representation of this

Protected Attributes

std::string m_className = "Algorithm"

The moniker by which all instances are tracked in xAH::Algorithm::m_instanceRegistry

xAOD::TEvent *m_event = nullptr

The TEvent object

xAOD::TStore *m_store = nullptr

The TStore object

Private Members

bool m_runSysts = false

set to true if systematics asked for and exist

int m_numEvent
int m_numObject
bool m_isFullSim
std::vector<CP::SystematicSet> m_systList
std::vector<int> m_systType
asg::AnaToolHandle<IJetCalibrationTool> m_JetCalibrationTool_handle = {"JetCalibrationTool" , PRIVATETOOL}
asg::AnaToolHandle<ICPJetUncertaintiesTool> m_JetUncertaintiesTool_handle = {"JetUncertaintiesTool" , PRIVATETOOL}
asg::AnaToolHandle<IJERTool> m_JERTool_handle = {"JERTool" , PRIVATETOOL}
asg::AnaToolHandle<IJERSmearingTool> m_JERSmearingTool_handle = {"JERSmearingTool" , PRIVATETOOL}
asg::AnaToolHandle<IJetUpdateJvt> m_JVTUpdateTool_handle = {"JetVertexTaggerTool" , PRIVATETOOL}
asg::AnaToolHandle<IJetModifier> m_fJVTTool_handle = {"JetForwardJvtTool" , PRIVATETOOL}
asg::AnaToolHandle<IJetSelector> m_JetCleaningTool_handle = {"JetCleaningTool" , PRIVATETOOL}
asg::AnaToolHandle<CP::IJetTileCorrectionTool> m_JetTileCorrectionTool_handle = {"JetTileCorrectionTool", PRIVATETOOL}
std::vector<asg::AnaToolHandle<IJetSelector>> m_AllJetCleaningTool_handles
std::vector<std::string> m_decisionNames