hpstr
The Heavy Photon Search Toolkit for Reconstruction (hpstr) provides an interface to physics data from the HPS experiment saved in the LCIO format and converts it into an ROOT based format.
Loading...
Searching...
No Matches
RunScaleCorrectionTool Class Reference

#include <RunScaleCorrectionTool.h>

Public Member Functions

 RunScaleCorrectionTool (const std::string &runScaleCfg, const std::string &meanCorrCfg="", const std::string &meanCorrVariable="")
double getScale (int run, bool isTop) const
double apply (Track &track, int run) const
bool hasRunScale () const
bool hasMeanCorr () const
bool hasRun (int run) const
void printConfig () const

Private Member Functions

double lookupValue (const Track &track) const
double omegaMeanShift (const Track &track, bool isTop) const

Private Attributes

std::string runScaleCfg_
std::string meanCorrCfg_
std::map< int, std::pair< double, double > > scales_
 run -> (top, bot)
double defaultTop_ {1.0}
double defaultBot_ {1.0}
std::set< int > warnedRuns_
 runs already reported as using the default
std::string meanCorrVariable_
double omegaMuDataTop_ {0.}
double omegaMuDataBot_ {0.}
double omegaMuMcTop_ {0.}
double omegaMuMcBot_ {0.}
bool binnedMeans_ {false}
std::vector< double > edgesTop_
std::vector< double > muDataTop_
std::vector< double > muMcTop_
std::vector< double > edgesBot_
std::vector< double > muDataBot_
std::vector< double > muMcBot_

Detailed Description

Data momentum scale corrections for tracks: a run-by-run scale and, optionally, a mean correction. Either can be switched off by leaving its config empty.

Run-by-run scale (runScaleCfg): the "runScale" block of a FEE scale JSON, e.g. analysis/data/smearing/fee_scale_smearing_2021_3p74.json,

"runScale": { "default": {"top": k, "bot": k}, "runs": { "<run>": {"top": k, "bot": k, ...}, ... } }

With half = top if tanLambda > 0 else bot, px, py, pz are multiplied by k and omega divided by k; runs not in the table use runScale.default.

Mean correction (meanCorrCfg): a JSON in the TrackSmearingTool schema. It applies the same correction as TrackSmearingTool's data mode, omega' = omega + (mu_mc - mu_data), with the momentum scaled by omega / omega'. With meanCorrVariable empty the unbinned "omegaSmearing" mu_data/mu_mc are used; with "phi0", "tanLambda" or "nHits" the means come from "omegaSmearing_binned_<variable>" (falling back to the unbinned ones if that table has no means), looked up as TrackSmearingTool does.

The run scale is applied first, then the mean correction. The tool is meant for data only – the caller decides when to use it. Smearing is not touched.

Definition at line 40 of file RunScaleCorrectionTool.h.

Constructor & Destructor Documentation

◆ RunScaleCorrectionTool()

RunScaleCorrectionTool ( const std::string & runScaleCfg,
const std::string & meanCorrCfg = "",
const std::string & meanCorrVariable = "" )

Definition at line 32 of file RunScaleCorrectionTool.cxx.

Member Function Documentation

◆ apply()

double apply ( Track & track,
int run ) const

Apply the configured corrections to the track. Returns the total momentum scale applied.

Definition at line 110 of file RunScaleCorrectionTool.cxx.

◆ getScale()

double getScale ( int run,
bool isTop ) const

Run-by-run scale factor for this run and detector half (1 if no run scale is configured).

Definition at line 100 of file RunScaleCorrectionTool.cxx.

◆ hasMeanCorr()

bool hasMeanCorr ( ) const
inline

Definition at line 52 of file RunScaleCorrectionTool.h.

◆ hasRun()

bool hasRun ( int run) const
inline

True if the run has its own entry (false -> the default is used).

Definition at line 55 of file RunScaleCorrectionTool.h.

◆ hasRunScale()

bool hasRunScale ( ) const
inline

Definition at line 51 of file RunScaleCorrectionTool.h.

◆ lookupValue()

double lookupValue ( const Track & track) const
private

Track variable the binned means are looked up in (same choices as TrackSmearingTool).

Definition at line 85 of file RunScaleCorrectionTool.cxx.

◆ omegaMeanShift()

double omegaMeanShift ( const Track & track,
bool isTop ) const
private

Mean difference mu_mc - mu_data in omega for this track.

Definition at line 91 of file RunScaleCorrectionTool.cxx.

◆ printConfig()

void printConfig ( ) const

Definition at line 130 of file RunScaleCorrectionTool.cxx.

Member Data Documentation

◆ binnedMeans_

bool binnedMeans_ {false}
private

Definition at line 76 of file RunScaleCorrectionTool.h.

◆ defaultBot_

double defaultBot_ {1.0}
private

Definition at line 65 of file RunScaleCorrectionTool.h.

◆ defaultTop_

double defaultTop_ {1.0}
private

Definition at line 64 of file RunScaleCorrectionTool.h.

◆ edgesBot_

std::vector<double> edgesBot_
private

Definition at line 78 of file RunScaleCorrectionTool.h.

◆ edgesTop_

std::vector<double> edgesTop_
private

Definition at line 77 of file RunScaleCorrectionTool.h.

◆ meanCorrCfg_

std::string meanCorrCfg_
private

Definition at line 61 of file RunScaleCorrectionTool.h.

◆ meanCorrVariable_

std::string meanCorrVariable_
private

Definition at line 73 of file RunScaleCorrectionTool.h.

◆ muDataBot_

std::vector<double> muDataBot_
private

Definition at line 78 of file RunScaleCorrectionTool.h.

◆ muDataTop_

std::vector<double> muDataTop_
private

Definition at line 77 of file RunScaleCorrectionTool.h.

◆ muMcBot_

std::vector<double> muMcBot_
private

Definition at line 78 of file RunScaleCorrectionTool.h.

◆ muMcTop_

std::vector<double> muMcTop_
private

Definition at line 77 of file RunScaleCorrectionTool.h.

◆ omegaMuDataBot_

double omegaMuDataBot_ {0.}
private

Definition at line 74 of file RunScaleCorrectionTool.h.

◆ omegaMuDataTop_

double omegaMuDataTop_ {0.}
private

Definition at line 74 of file RunScaleCorrectionTool.h.

◆ omegaMuMcBot_

double omegaMuMcBot_ {0.}
private

Definition at line 75 of file RunScaleCorrectionTool.h.

◆ omegaMuMcTop_

double omegaMuMcTop_ {0.}
private

Definition at line 75 of file RunScaleCorrectionTool.h.

◆ runScaleCfg_

std::string runScaleCfg_
private

Definition at line 60 of file RunScaleCorrectionTool.h.

◆ scales_

std::map<int, std::pair<double, double> > scales_
private

run -> (top, bot)

Definition at line 63 of file RunScaleCorrectionTool.h.

◆ warnedRuns_

std::set<int> warnedRuns_
mutableprivate

runs already reported as using the default

Definition at line 66 of file RunScaleCorrectionTool.h.


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