|
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.
|
#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_ |
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.
| RunScaleCorrectionTool | ( | const std::string & | runScaleCfg, |
| const std::string & | meanCorrCfg = "", | ||
| const std::string & | meanCorrVariable = "" ) |
Definition at line 32 of file RunScaleCorrectionTool.cxx.
| 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.
| 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.
|
inline |
Definition at line 52 of file RunScaleCorrectionTool.h.
|
inline |
True if the run has its own entry (false -> the default is used).
Definition at line 55 of file RunScaleCorrectionTool.h.
|
inline |
Definition at line 51 of file RunScaleCorrectionTool.h.
|
private |
Track variable the binned means are looked up in (same choices as TrackSmearingTool).
Definition at line 85 of file RunScaleCorrectionTool.cxx.
|
private |
Mean difference mu_mc - mu_data in omega for this track.
Definition at line 91 of file RunScaleCorrectionTool.cxx.
| void printConfig | ( | ) | const |
Definition at line 130 of file RunScaleCorrectionTool.cxx.
|
private |
Definition at line 76 of file RunScaleCorrectionTool.h.
|
private |
Definition at line 65 of file RunScaleCorrectionTool.h.
|
private |
Definition at line 64 of file RunScaleCorrectionTool.h.
|
private |
Definition at line 78 of file RunScaleCorrectionTool.h.
|
private |
Definition at line 77 of file RunScaleCorrectionTool.h.
|
private |
Definition at line 61 of file RunScaleCorrectionTool.h.
|
private |
Definition at line 73 of file RunScaleCorrectionTool.h.
|
private |
Definition at line 78 of file RunScaleCorrectionTool.h.
|
private |
Definition at line 77 of file RunScaleCorrectionTool.h.
|
private |
Definition at line 78 of file RunScaleCorrectionTool.h.
|
private |
Definition at line 77 of file RunScaleCorrectionTool.h.
|
private |
Definition at line 74 of file RunScaleCorrectionTool.h.
|
private |
Definition at line 74 of file RunScaleCorrectionTool.h.
|
private |
Definition at line 75 of file RunScaleCorrectionTool.h.
|
private |
Definition at line 75 of file RunScaleCorrectionTool.h.
|
private |
Definition at line 60 of file RunScaleCorrectionTool.h.
|
private |
run -> (top, bot)
Definition at line 63 of file RunScaleCorrectionTool.h.
|
mutableprivate |
runs already reported as using the default
Definition at line 66 of file RunScaleCorrectionTool.h.