|
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 <TrackCorrector.h>
Classes | |
| struct | Options |
| struct | Result |
Public Member Functions | |
| TrackCorrector (const std::string &cfgFile, const Options &opts) | |
| void | beginEvent (int run, const std::vector< MCParticle * > *mcParticles=nullptr) |
| std::vector< Result > | correct (const std::vector< Track * > &tracks, const std::vector< int > &charges={}) |
| bool | updatesVertex () const |
| bool | hasSmearing () const |
| bool | smearsOmega () const |
| bool | hasMomentumScale () const |
| void | printConfig () const |
Static Public Member Functions | |
| static void | correctVertex (Vertex *vtx, double r1, double r2) |
Private Member Functions | |
| std::string | resolvePath (const std::string &path) const |
| std::string | dataOrMc (const nlohmann::json &block) const |
Private Attributes | |
| std::string | cfgFile_ |
| Options | opts_ |
| int | run_ {-1} |
| std::map< std::string, double > | trackOffsets_ |
| std::string | z0OffsetFile_ |
| nlohmann::json | z0OffsetFits_ |
| int | z0OffsetRun_ {-1} |
| double | eleZ0Offset_ {0.} |
| double | posZ0Offset_ {0.} |
| std::string | z0CalibFile_ |
| std::shared_ptr< TrackBiasingTool > | z0Calib_ |
| std::shared_ptr< RunScaleCorrectionTool > | momentumScale_ |
| std::shared_ptr< TrackSmearingTool > | smearing_ |
| bool | smearOmega_ {false} |
| bool | smearZ0_ {true} |
| bool | applySmearing_ {false} |
| smearing configured, MC, and Options::doSmearing | |
| bool | updatesVertex_ {false} |
One entry point for the track corrections a processor applies: it owns the individual tools and runs them in a fixed order, configured by a single JSON.
JSON keys (all optional; a missing or empty key switches that step off). Relative paths are resolved against $HPSTR_BASE.
"trackOffsets": file with constant offsets {"track_z0": x, "track_time": t} "z0Offset": {"data": file, "mc": file} per-run v0-projection z0 means (elez0_mean / posz0_mean); the closest run at or below the event's run is used "z0Calib": {"data": file, "mc": file} linear z0 calibration, z0 -= slope*tanL + intercept "momentumScale": {"runScale": file, "meanCorr": file, "meanCorrVariable": ""} data only; see RunScaleCorrectionTool "smearing": {"cfg": file, "smearingFactor": 1.0, "smearOmega": true, "variable": "tanLambda", "requireTruthMatch": false, "smearZ0": true, "trackCollection": "KalmanFullTracks"} MC only, and only when Options::doSmearing is set
Order, each step applied to all tracks before the next: trackOffsets, z0Offset, z0Calib, momentumScale (data), z0 smearing (MC), momentum smearing (MC).
Per-job settings (data/MC, seed, whether to smear, truth-match override) are not in the JSON; the processor passes them in Options.
Definition at line 51 of file TrackCorrector.h.
| TrackCorrector | ( | const std::string & | cfgFile, |
| const Options & | opts ) |
Definition at line 36 of file TrackCorrector.cxx.
| void beginEvent | ( | int | run, |
| const std::vector< MCParticle * > * | mcParticles = nullptr ) |
Call once per event, before correct().
Definition at line 105 of file TrackCorrector.cxx.
| std::vector< TrackCorrector::Result > correct | ( | const std::vector< Track * > & | tracks, |
| const std::vector< int > & | charges = {} ) |
Correct the tracks in place. charges gives each track's charge sign, used to pick the electron or positron z0 offset; if empty, Track::getCharge() is used.
Definition at line 128 of file TrackCorrector.cxx.
|
static |
Scale the vertex momenta p1, p2 by the tracks' momentum ratios and the invariant mass by sqrt(r1 * r2), as TrackSmearingTool::updateVertexWithSmearP.
Definition at line 160 of file TrackCorrector.cxx.
|
private |
Definition at line 30 of file TrackCorrector.cxx.
|
inline |
Definition at line 90 of file TrackCorrector.h.
|
inline |
Definition at line 88 of file TrackCorrector.h.
| void printConfig | ( | ) | const |
Definition at line 166 of file TrackCorrector.cxx.
|
private |
Definition at line 23 of file TrackCorrector.cxx.
|
inline |
Definition at line 89 of file TrackCorrector.h.
|
inline |
True if correctVertex() should be called after correct() for vertex tracks.
Definition at line 80 of file TrackCorrector.h.
|
private |
smearing configured, MC, and Options::doSmearing
Definition at line 117 of file TrackCorrector.h.
|
private |
Definition at line 98 of file TrackCorrector.h.
|
private |
Definition at line 107 of file TrackCorrector.h.
|
private |
Definition at line 112 of file TrackCorrector.h.
|
private |
Definition at line 99 of file TrackCorrector.h.
|
private |
Definition at line 107 of file TrackCorrector.h.
|
private |
Definition at line 100 of file TrackCorrector.h.
|
private |
Definition at line 114 of file TrackCorrector.h.
|
private |
Definition at line 115 of file TrackCorrector.h.
|
private |
Definition at line 116 of file TrackCorrector.h.
|
private |
Definition at line 102 of file TrackCorrector.h.
|
private |
Definition at line 119 of file TrackCorrector.h.
|
private |
Definition at line 110 of file TrackCorrector.h.
|
private |
Definition at line 109 of file TrackCorrector.h.
|
private |
Definition at line 104 of file TrackCorrector.h.
|
private |
Definition at line 105 of file TrackCorrector.h.
|
private |
Definition at line 106 of file TrackCorrector.h.