ATLAS Offline Software
Loading...
Searching...
No Matches
InDetTrackBiasingTool.h
Go to the documentation of this file.
1// -*- c++ -*-
2/*
3 Copyright (C) 2002-2026 CERN for the benefit of the ATLAS collaboration
4*/
5
6#ifndef INDETTRACKSYSTEMATICSTOOLS_INDETTRACKBIASINGTOOL_H
7#define INDETTRACKSYSTEMATICSTOOLS_INDETTRACKBIASINGTOOL_H
8
11
12#include "AsgTools/AsgTool.h"
16
19
20#include <string>
21#include <vector>
22#include <memory> //for unique_ptr
23#include <cstdint> //for uint32_t
24#include <TH2.h>
25
26#include "TRandom3.h"
27
28class TFile;
29
30namespace InDet {
31
38
40 : public virtual IInDetTrackBiasingTool
41 , public virtual InDetTrackSystematicsTool
42 , public virtual CP::CorrectionTool< xAOD::TrackParticleContainer >
43 {
44
47
48 public:
49
50 InDetTrackBiasingTool (const std::string& name);
51 virtual ~InDetTrackBiasingTool();
52
53 virtual StatusCode initialize() override;
54 virtual void prepare() override {};
55
59 xAOD::TrackParticle*& out ) override;
61
62
64 virtual bool isAffectedBySystematic( const CP::SystematicVariation& ) const override;
66 virtual CP::SystematicSet affectingSystematics() const override;
68 virtual CP::SystematicSet recommendedSystematics() const override;
70 virtual StatusCode applySystematicVariation( const CP::SystematicSet& ) override;
71
72 protected:
73
74 StatusCode initHistograms();
75
76 float readHistogram(float fDefault, TH2* histogram, float phi, float eta) const;
77
78 // one entry per configured run period (ordered by ascending run number)
79 std::vector<std::unique_ptr<TH2>> m_biasD0Histograms;
80 std::vector<std::unique_ptr<TH2>> m_biasZ0Histograms;
81 std::vector<std::unique_ptr<TH2>> m_biasQoverPsagittaHistograms;
82
83 // paths and histogram names in the calibration files
84 std::string m_d0_nominal_histName = "d0/d0_theNominal";
85 std::string m_z0_nominal_histName = "z0/z0_theNominal";
86 std::string m_sagitta_nominal_histName = "sagitta/sagitta_theNominal";
87
88 Gaudi::Property<float> m_biasD0{this, "biasD0", 0.f, "Overall d0 bias (mm)."};
89 Gaudi::Property<float> m_biasZ0{this, "biasZ0", 0.f, "Overall z0 bias (mm)."};
90 Gaudi::Property<float> m_biasQoverPsagitta{this, "biasQoverPsagitta", 0.f, "Overall QoverP sagitta bias (TeV^-1)."};
91
92 Gaudi::Property<bool> m_applyD0Bias{this, "applyD0Bias", true, "Whether to apply the d0 bias from the calibration map."};
93 Gaudi::Property<bool> m_applyZ0Bias{this, "applyZ0Bias", true, "Whether to apply the z0 bias from the calibration map."};
94 Gaudi::Property<bool> m_applyQoverPBias{this, "applyQoverPBias", true, "Whether to apply the q/p sagitta bias from the calibration map."};
95
96 Gaudi::Property<bool> m_isMC{this, "isMC", true};
97 Gaudi::Property<uint32_t> m_runNumber{this, "runNumber", 0, "Manually override the run number used to select the calibration period."};
98
99 // calibration files and run number bounds for each period, configured per MC campaign via the python config.
100 // runNumberBounds has the form {lower0, upper0, upper1, upper2, ...} (N+1 entries for N periods),
101 // where period i spans (runNumberBounds[i], runNumberBounds[i+1]].
102 // May be omitted when only one calibration file is configured (all run numbers are accepted).
103 Gaudi::Property<std::vector<std::string>> m_calibFiles{this, "calibFiles", {}, "Calibration files, one per run period."};
104 Gaudi::Property<std::vector<unsigned int>> m_runNumberBounds{this, "runNumberBounds", {}, "Run number boundaries: {lower0, upper0, upper1, ...}. May be omitted when only one calibration file is configured."};
105
106 SG::ReadHandleKey<xAOD::EventInfo> m_evtInfoKey{this, "EvtInfo", "EventInfo", "EventInfo name"};
107
108 }; // class InDetTrackBiasingTool
109
110} // namespace InDet
111
112#endif
Scalar eta() const
pseudorapidity method
Scalar phi() const
phi method
#define ASG_TOOL_CLASS(CLASSNAME, INT1)
Property holding a SG store/key/clid from which a ReadHandle is made.
std::string histogram
Definition chains.cxx:52
Return value from object correction CP tools.
Helper base class for "correction tools".
Class to wrap a set of SystematicVariations.
This class biases tracks to emulate systematic distortions of the tracking geometry.
virtual StatusCode applySystematicVariation(const CP::SystematicSet &) override
configure the tool to apply a given list of systematic variations
virtual CP::CorrectionCode applyCorrection(xAOD::TrackParticle &track) override
Computes the tracks origin.
float readHistogram(float fDefault, TH2 *histogram, float phi, float eta) const
virtual CP::SystematicSet recommendedSystematics() const override
returns: list of recommended systematics to use with this tool
virtual bool isAffectedBySystematic(const CP::SystematicVariation &) const override
returns: whether the tool is affected by the systematic
Gaudi::Property< uint32_t > m_runNumber
Gaudi::Property< float > m_biasQoverPsagitta
SG::ReadHandleKey< xAOD::EventInfo > m_evtInfoKey
std::vector< std::unique_ptr< TH2 > > m_biasD0Histograms
Gaudi::Property< bool > m_applyQoverPBias
Gaudi::Property< std::vector< std::string > > m_calibFiles
Gaudi::Property< float > m_biasZ0
virtual ASG_TOOL_CLASS(InDetTrackBiasingTool, InDet::IInDetTrackBiasingTool) public ~InDetTrackBiasingTool()
virtual void prepare() override
virtual CP::CorrectionCode correctedCopy(const xAOD::TrackParticle &in, xAOD::TrackParticle *&out) override
Gaudi::Property< float > m_biasD0
Gaudi::Property< std::vector< unsigned int > > m_runNumberBounds
virtual CP::CorrectionCode applyContainerCorrection(xAOD::TrackParticleContainer &cont) override
virtual CP::SystematicSet affectingSystematics() const override
returns: list of systematics this tool can be affected by
std::vector< std::unique_ptr< TH2 > > m_biasQoverPsagittaHistograms
Gaudi::Property< bool > m_applyZ0Bias
std::vector< std::unique_ptr< TH2 > > m_biasZ0Histograms
Gaudi::Property< bool > m_applyD0Bias
virtual StatusCode initialize() override
Property holding a SG store/key/clid from which a ReadHandle is made.
Primary Vertex Finder.
TrackParticle_v1 TrackParticle
Reference the current persistent version:
TrackParticleContainer_v1 TrackParticleContainer
Definition of the current "TrackParticle container version".