ATLAS Offline Software
InDetTrackBiasingTool.h
Go to the documentation of this file.
1 // -*- c++ -*-
2 /*
3  Copyright (C) 2002-2022 CERN for the benefit of the ATLAS collaboration
4 */
5 
6 #ifndef INDETTRACKSYSTEMATICSTOOLS_INDETTRACKBIASINGTOOL_H
7 #define INDETTRACKSYSTEMATICSTOOLS_INDETTRACKBIASINGTOOL_H
8 
10 #include "AsgTools/AsgTool.h"
14 #include <string>
15 #include <vector>
16 
17 #include <TH2.h>
18 
19 #include "TRandom3.h"
20 
21 class TFile;
22 
23 namespace InDet {
24 
31 
33  : public virtual IInDetTrackBiasingTool
34  , public virtual InDetTrackSystematicsTool
35  , public virtual CP::CorrectionTool< xAOD::TrackParticleContainer >
36  {
37 
40 
41  public:
42 
43  InDetTrackBiasingTool (const std::string& name);
44  virtual ~InDetTrackBiasingTool();
45 
46  virtual StatusCode initialize() override;
47  virtual void prepare() override {};
48 
52  xAOD::TrackParticle*& out ) override;
54 
55 
57  virtual bool isAffectedBySystematic( const CP::SystematicVariation& ) const override;
59  virtual CP::SystematicSet affectingSystematics() const override;
61  virtual CP::SystematicSet recommendedSystematics() const override;
63  virtual StatusCode applySystematicVariation( const CP::SystematicSet& ) override;
64 
65  protected:
66 
69 
70  float readHistogram(float fDefault, TH2* histogram, float phi, float eta) const;
71 
72  float m_biasD0 = 0.f;
73  float m_biasZ0 = 0.f;
74  float m_biasQoverPsagitta = 0.f;
75 
76  std::unique_ptr<TH2> m_data15_biasD0Histogram = nullptr;
77  std::unique_ptr<TH2> m_data15_biasZ0Histogram = nullptr;
78  std::unique_ptr<TH2> m_data15_biasQoverPsagittaHistogram = nullptr;
79  std::unique_ptr<TH2> m_data15_biasD0HistError = nullptr;
80  std::unique_ptr<TH2> m_data15_biasZ0HistError = nullptr;
81  std::unique_ptr<TH2> m_data15_biasQoverPsagittaHistError = nullptr;
82 
83  std::unique_ptr<TH2> m_data16_1stPart_biasD0Histogram = nullptr;
84  std::unique_ptr<TH2> m_data16_1stPart_biasZ0Histogram = nullptr;
85  std::unique_ptr<TH2> m_data16_1stPart_biasQoverPsagittaHistogram = nullptr;
86  std::unique_ptr<TH2> m_data16_1stPart_biasD0HistError = nullptr;
87  std::unique_ptr<TH2> m_data16_1stPart_biasZ0HistError = nullptr;
88  std::unique_ptr<TH2> m_data16_1stPart_biasQoverPsagittaHistError = nullptr;
89 
90  std::unique_ptr<TH2> m_data16_2ndPart_biasD0Histogram = nullptr;
91  std::unique_ptr<TH2> m_data16_2ndPart_biasZ0Histogram = nullptr;
92  std::unique_ptr<TH2> m_data16_2ndPart_biasQoverPsagittaHistogram = nullptr;
93  std::unique_ptr<TH2> m_data16_2ndPart_biasD0HistError = nullptr;
94  std::unique_ptr<TH2> m_data16_2ndPart_biasZ0HistError = nullptr;
95  std::unique_ptr<TH2> m_data16_2ndPart_biasQoverPsagittaHistError = nullptr;
96 
97  std::unique_ptr<TH2> m_data17_1stPart_biasD0Histogram = nullptr;
98  std::unique_ptr<TH2> m_data17_1stPart_biasZ0Histogram = nullptr;
99  std::unique_ptr<TH2> m_data17_1stPart_biasQoverPsagittaHistogram = nullptr;
100  std::unique_ptr<TH2> m_data17_1stPart_biasD0HistError = nullptr;
101  std::unique_ptr<TH2> m_data17_1stPart_biasZ0HistError = nullptr;
102  std::unique_ptr<TH2> m_data17_1stPart_biasQoverPsagittaHistError = nullptr;
103 
104  std::unique_ptr<TH2> m_data17_2ndPart_biasD0Histogram = nullptr;
105  std::unique_ptr<TH2> m_data17_2ndPart_biasZ0Histogram = nullptr;
106  std::unique_ptr<TH2> m_data17_2ndPart_biasQoverPsagittaHistogram = nullptr;
107  std::unique_ptr<TH2> m_data17_2ndPart_biasD0HistError = nullptr;
108  std::unique_ptr<TH2> m_data17_2ndPart_biasZ0HistError = nullptr;
109  std::unique_ptr<TH2> m_data17_2ndPart_biasQoverPsagittaHistError = nullptr;
110 
111  std::unique_ptr<TH2> m_data18_1stPart_biasD0Histogram = nullptr;
112  std::unique_ptr<TH2> m_data18_1stPart_biasZ0Histogram = nullptr;
113  std::unique_ptr<TH2> m_data18_1stPart_biasQoverPsagittaHistogram = nullptr;
114  std::unique_ptr<TH2> m_data18_1stPart_biasD0HistError = nullptr;
115  std::unique_ptr<TH2> m_data18_1stPart_biasZ0HistError = nullptr;
116  std::unique_ptr<TH2> m_data18_1stPart_biasQoverPsagittaHistError = nullptr;
117 
118  std::unique_ptr<TH2> m_data18_2ndPart_biasD0Histogram = nullptr;
119  std::unique_ptr<TH2> m_data18_2ndPart_biasZ0Histogram = nullptr;
120  std::unique_ptr<TH2> m_data18_2ndPart_biasQoverPsagittaHistogram = nullptr;
121  std::unique_ptr<TH2> m_data18_2ndPart_biasD0HistError = nullptr;
122  std::unique_ptr<TH2> m_data18_2ndPart_biasZ0HistError = nullptr;
123  std::unique_ptr<TH2> m_data18_2ndPart_biasQoverPsagittaHistError = nullptr;
124 
125  // if neither of these is set manually, then the tool will try to get this from EventInfo in the event store.
126  // these options exist only as a manual override.
127  bool m_isData = false;
128  bool m_isSimulation = false;
130 
131  bool m_doD0Bias = true;
132  bool m_doZ0Bias = true;
133  bool m_doQoverPBias = true;
134 
135  // allow the user to configure which calibration files to use if desired
136  std::string m_calibFileData15;
143 
144  // paths and histogram names in the calibration files
145  std::string m_d0_nominal_histName = "d0/d0_theNominal";
146  std::string m_z0_nominal_histName = "z0/z0_theNominal";
147  std::string m_sagitta_nominal_histName = "sagitta/sagitta_theNominal";
148  std::string m_d0_uncertainty_histName = "d0/d0_theUncertainty";
149  std::string m_z0_uncertainty_histName = "z0/z0_theUncertainty";
150  std::string m_sagitta_uncertainty_histName = "sagitta/sagitta_theUncertainty";
151 
152  }; // class InDetTrackBiasingTool
153 
154 } // namespace InDet
155 
156 #endif
InDet::InDetTrackBiasingTool::m_sagitta_uncertainty_histName
std::string m_sagitta_uncertainty_histName
Definition: InDetTrackBiasingTool.h:150
InDet::InDetTrackBiasingTool::m_data17_2ndPart_biasQoverPsagittaHistError
std::unique_ptr< TH2 > m_data17_2ndPart_biasQoverPsagittaHistError
Definition: InDetTrackBiasingTool.h:109
CorrectionTool.h
InDet::InDetTrackBiasingTool::m_biasQoverPsagitta
float m_biasQoverPsagitta
Definition: InDetTrackBiasingTool.h:74
InDet::InDetTrackBiasingTool::initHistograms
StatusCode initHistograms()
Definition: InDetTrackBiasingTool.cxx:237
InDet::InDetTrackSystematicsTool
Definition: InDetTrackSystematicsTool.h:22
InDet::InDetTrackBiasingTool::m_doD0Bias
bool m_doD0Bias
Definition: InDetTrackBiasingTool.h:131
InDet::InDetTrackBiasingTool::m_data16_1stPart_biasQoverPsagittaHistogram
std::unique_ptr< TH2 > m_data16_1stPart_biasQoverPsagittaHistogram
Definition: InDetTrackBiasingTool.h:85
InDet::InDetTrackBiasingTool::m_z0_uncertainty_histName
std::string m_z0_uncertainty_histName
Definition: InDetTrackBiasingTool.h:149
InDet::InDetTrackBiasingTool::m_data18_1stPart_biasQoverPsagittaHistError
std::unique_ptr< TH2 > m_data18_1stPart_biasQoverPsagittaHistError
Definition: InDetTrackBiasingTool.h:116
InDet::InDetTrackBiasingTool::m_biasZ0
float m_biasZ0
Definition: InDetTrackBiasingTool.h:73
InDet::InDetTrackBiasingTool::m_d0_uncertainty_histName
std::string m_d0_uncertainty_histName
Definition: InDetTrackBiasingTool.h:148
InDet::InDetTrackBiasingTool::applySystematicVariation
virtual StatusCode applySystematicVariation(const CP::SystematicSet &) override
configure the tool to apply a given list of systematic variations
Definition: InDetTrackBiasingTool.cxx:484
InDet::InDetTrackBiasingTool::m_data17_2ndPart_biasZ0Histogram
std::unique_ptr< TH2 > m_data17_2ndPart_biasZ0Histogram
Definition: InDetTrackBiasingTool.h:105
xAOD::uint32_t
setEventNumber uint32_t
Definition: EventInfo_v1.cxx:127
InDet::InDetTrackBiasingTool::m_data18_2ndPart_biasQoverPsagittaHistError
std::unique_ptr< TH2 > m_data18_2ndPart_biasQoverPsagittaHistError
Definition: InDetTrackBiasingTool.h:123
InDet
Primary Vertex Finder.
Definition: VP1ErrorUtils.h:36
InDet::InDetTrackBiasingTool::m_data17_1stPart_biasQoverPsagittaHistogram
std::unique_ptr< TH2 > m_data17_1stPart_biasQoverPsagittaHistogram
Definition: InDetTrackBiasingTool.h:99
InDet::InDetTrackBiasingTool::m_data18_1stPart_biasZ0HistError
std::unique_ptr< TH2 > m_data18_1stPart_biasZ0HistError
Definition: InDetTrackBiasingTool.h:115
InDet::InDetTrackBiasingTool::m_data18_1stPart_biasQoverPsagittaHistogram
std::unique_ptr< TH2 > m_data18_1stPart_biasQoverPsagittaHistogram
Definition: InDetTrackBiasingTool.h:113
python.AthDsoLogger.out
out
Definition: AthDsoLogger.py:71
InDet::InDetTrackBiasingTool::m_data17_1stPart_biasZ0Histogram
std::unique_ptr< TH2 > m_data17_1stPart_biasZ0Histogram
Definition: InDetTrackBiasingTool.h:98
CP::SystematicSet
Class to wrap a set of SystematicVariations.
Definition: SystematicSet.h:31
InDet::InDetTrackBiasingTool::m_isSimulation
bool m_isSimulation
Definition: InDetTrackBiasingTool.h:128
InDet::InDetTrackBiasingTool::m_isData
bool m_isData
Definition: InDetTrackBiasingTool.h:127
InDet::InDetTrackBiasingTool::prepare
virtual void prepare() override
Definition: InDetTrackBiasingTool.h:47
InDet::InDetTrackBiasingTool::m_data18_2ndPart_biasD0Histogram
std::unique_ptr< TH2 > m_data18_2ndPart_biasD0Histogram
Definition: InDetTrackBiasingTool.h:118
InDet::InDetTrackBiasingTool::m_data17_2ndPart_biasZ0HistError
std::unique_ptr< TH2 > m_data17_2ndPart_biasZ0HistError
Definition: InDetTrackBiasingTool.h:108
InDet::InDetTrackBiasingTool::m_data16_1stPart_biasZ0Histogram
std::unique_ptr< TH2 > m_data16_1stPart_biasZ0Histogram
Definition: InDetTrackBiasingTool.h:84
InDet::InDetTrackBiasingTool::m_calibFileData16_1stPart
std::string m_calibFileData16_1stPart
Definition: InDetTrackBiasingTool.h:137
InDet::InDetTrackBiasingTool::m_data16_2ndPart_biasZ0Histogram
std::unique_ptr< TH2 > m_data16_2ndPart_biasZ0Histogram
Definition: InDetTrackBiasingTool.h:91
CP::SystematicVariation
Definition: SystematicVariation.h:47
InDet::InDetTrackBiasingTool::m_data16_1stPart_biasD0HistError
std::unique_ptr< TH2 > m_data16_1stPart_biasD0HistError
Definition: InDetTrackBiasingTool.h:86
InDet::InDetTrackBiasingTool::m_z0_nominal_histName
std::string m_z0_nominal_histName
Definition: InDetTrackBiasingTool.h:146
InDet::InDetTrackBiasingTool::m_data16_2ndPart_biasD0HistError
std::unique_ptr< TH2 > m_data16_2ndPart_biasD0HistError
Definition: InDetTrackBiasingTool.h:93
InDet::InDetTrackBiasingTool::applyContainerCorrection
virtual CP::CorrectionCode applyContainerCorrection(xAOD::TrackParticleContainer &cont) override
Definition: InDetTrackBiasingTool.cxx:464
InDet::InDetTrackBiasingTool::m_doQoverPBias
bool m_doQoverPBias
Definition: InDetTrackBiasingTool.h:133
InDet::InDetTrackBiasingTool::m_data15_biasD0Histogram
std::unique_ptr< TH2 > m_data15_biasD0Histogram
Definition: InDetTrackBiasingTool.h:76
InDet::InDetTrackBiasingTool::m_data15_biasZ0HistError
std::unique_ptr< TH2 > m_data15_biasZ0HistError
Definition: InDetTrackBiasingTool.h:80
InDet::InDetTrackBiasingTool::m_biasD0
float m_biasD0
Definition: InDetTrackBiasingTool.h:72
IInDetTrackBiasingTool.h
InDet::InDetTrackBiasingTool::m_calibFileData17_2ndPart
std::string m_calibFileData17_2ndPart
Definition: InDetTrackBiasingTool.h:140
InDet::InDetTrackBiasingTool::m_calibFileData18_2ndPart
std::string m_calibFileData18_2ndPart
Definition: InDetTrackBiasingTool.h:142
InDet::InDetTrackBiasingTool::m_calibFileData17_1stPart
std::string m_calibFileData17_1stPart
Definition: InDetTrackBiasingTool.h:139
InDet::InDetTrackBiasingTool::m_data17_1stPart_biasZ0HistError
std::unique_ptr< TH2 > m_data17_1stPart_biasZ0HistError
Definition: InDetTrackBiasingTool.h:101
InDet::InDetTrackBiasingTool::m_data17_1stPart_biasD0Histogram
std::unique_ptr< TH2 > m_data17_1stPart_biasD0Histogram
Definition: InDetTrackBiasingTool.h:97
InDet::InDetTrackBiasingTool::m_data15_biasD0HistError
std::unique_ptr< TH2 > m_data15_biasD0HistError
Definition: InDetTrackBiasingTool.h:79
InDet::InDetTrackBiasingTool::m_data18_1stPart_biasD0Histogram
std::unique_ptr< TH2 > m_data18_1stPart_biasD0Histogram
Definition: InDetTrackBiasingTool.h:111
InDet::InDetTrackBiasingTool::m_sagitta_nominal_histName
std::string m_sagitta_nominal_histName
Definition: InDetTrackBiasingTool.h:147
EL::StatusCode
::StatusCode StatusCode
StatusCode definition for legacy code.
Definition: PhysicsAnalysis/D3PDTools/EventLoop/EventLoop/StatusCode.h:22
InDet::IInDetTrackBiasingTool
Definition: IInDetTrackBiasingTool.h:24
InDet::InDetTrackBiasingTool
Definition: InDetTrackBiasingTool.h:36
InDet::InDetTrackBiasingTool::m_data18_2ndPart_biasZ0HistError
std::unique_ptr< TH2 > m_data18_2ndPart_biasZ0HistError
Definition: InDetTrackBiasingTool.h:122
InDet::InDetTrackBiasingTool::m_data17_1stPart_biasQoverPsagittaHistError
std::unique_ptr< TH2 > m_data17_1stPart_biasQoverPsagittaHistError
Definition: InDetTrackBiasingTool.h:102
InDet::InDetTrackBiasingTool::m_data18_1stPart_biasD0HistError
std::unique_ptr< TH2 > m_data18_1stPart_biasD0HistError
Definition: InDetTrackBiasingTool.h:114
InDet::InDetTrackBiasingTool::m_data17_2ndPart_biasD0Histogram
std::unique_ptr< TH2 > m_data17_2ndPart_biasD0Histogram
Definition: InDetTrackBiasingTool.h:104
InDet::InDetTrackBiasingTool::m_data15_biasQoverPsagittaHistogram
std::unique_ptr< TH2 > m_data15_biasQoverPsagittaHistogram
Definition: InDetTrackBiasingTool.h:78
InDet::InDetTrackBiasingTool::m_data15_biasZ0Histogram
std::unique_ptr< TH2 > m_data15_biasZ0Histogram
Definition: InDetTrackBiasingTool.h:77
DataVector
Derived DataVector<T>.
Definition: DataVector.h:581
InDet::InDetTrackBiasingTool::m_data18_2ndPart_biasD0HistError
std::unique_ptr< TH2 > m_data18_2ndPart_biasD0HistError
Definition: InDetTrackBiasingTool.h:121
CP::CorrectionTool
Helper base class for "correction tools".
Definition: CorrectionTool.h:42
name
std::string name
Definition: Control/AthContainers/Root/debug.cxx:221
InDet::InDetTrackBiasingTool::m_data17_1stPart_biasD0HistError
std::unique_ptr< TH2 > m_data17_1stPart_biasD0HistError
Definition: InDetTrackBiasingTool.h:100
InDet::InDetTrackBiasingTool::m_d0_nominal_histName
std::string m_d0_nominal_histName
Definition: InDetTrackBiasingTool.h:145
InDet::InDetTrackBiasingTool::m_calibFileData15
std::string m_calibFileData15
Definition: InDetTrackBiasingTool.h:136
InDet::InDetTrackBiasingTool::affectingSystematics
virtual CP::SystematicSet affectingSystematics() const override
returns: list of systematics this tool can be affected by
Definition: InDetTrackBiasingTool.cxx:474
InDet::InDetTrackBiasingTool::initialize
virtual StatusCode initialize() override
Definition: InDetTrackBiasingTool.cxx:53
InDetTrackSystematicsTool.h
InDet::InDetTrackBiasingTool::m_data16_2ndPart_biasD0Histogram
std::unique_ptr< TH2 > m_data16_2ndPart_biasD0Histogram
Definition: InDetTrackBiasingTool.h:90
InDet::InDetTrackBiasingTool::m_data16_1stPart_biasD0Histogram
std::unique_ptr< TH2 > m_data16_1stPart_biasD0Histogram
Definition: InDetTrackBiasingTool.h:83
InDet::InDetTrackBiasingTool::m_data17_2ndPart_biasQoverPsagittaHistogram
std::unique_ptr< TH2 > m_data17_2ndPart_biasQoverPsagittaHistogram
Definition: InDetTrackBiasingTool.h:106
InDet::InDetTrackBiasingTool::applyCorrection
virtual CP::CorrectionCode applyCorrection(xAOD::TrackParticle &track) override
Computes the tracks origin.
Definition: InDetTrackBiasingTool.cxx:89
InDet::InDetTrackBiasingTool::m_runNumber
uint32_t m_runNumber
Definition: InDetTrackBiasingTool.h:129
InDet::InDetTrackBiasingTool::m_data15_biasQoverPsagittaHistError
std::unique_ptr< TH2 > m_data15_biasQoverPsagittaHistError
Definition: InDetTrackBiasingTool.h:81
InDet::InDetTrackBiasingTool::correctedCopy
virtual CP::CorrectionCode correctedCopy(const xAOD::TrackParticle &in, xAOD::TrackParticle *&out) override
Definition: InDetTrackBiasingTool.cxx:458
InDet::InDetTrackBiasingTool::isAffectedBySystematic
virtual bool isAffectedBySystematic(const CP::SystematicVariation &) const override
returns: whether the tool is affected by the systematic
Definition: InDetTrackBiasingTool.cxx:469
InDet::InDetTrackBiasingTool::m_data16_1stPart_biasQoverPsagittaHistError
std::unique_ptr< TH2 > m_data16_1stPart_biasQoverPsagittaHistError
Definition: InDetTrackBiasingTool.h:88
ASG_TOOL_CLASS
#define ASG_TOOL_CLASS(CLASSNAME, INT1)
Definition: AsgToolMacros.h:68
InDet::InDetTrackBiasingTool::m_data16_1stPart_biasZ0HistError
std::unique_ptr< TH2 > m_data16_1stPart_biasZ0HistError
Definition: InDetTrackBiasingTool.h:87
CP::CorrectionCode
Return value from object correction CP tools.
Definition: CorrectionCode.h:31
InDet::InDetTrackBiasingTool::m_data17_2ndPart_biasD0HistError
std::unique_ptr< TH2 > m_data17_2ndPart_biasD0HistError
Definition: InDetTrackBiasingTool.h:107
InDet::InDetTrackBiasingTool::m_calibFileData18_1stPart
std::string m_calibFileData18_1stPart
Definition: InDetTrackBiasingTool.h:141
InDet::InDetTrackBiasingTool::m_data18_2ndPart_biasZ0Histogram
std::unique_ptr< TH2 > m_data18_2ndPart_biasZ0Histogram
Definition: InDetTrackBiasingTool.h:119
xAOD::track
@ track
Definition: TrackingPrimitives.h:512
xAOD::TrackParticle_v1
Class describing a TrackParticle.
Definition: TrackParticle_v1.h:43
InDet::InDetTrackBiasingTool::m_data16_2ndPart_biasZ0HistError
std::unique_ptr< TH2 > m_data16_2ndPart_biasZ0HistError
Definition: InDetTrackBiasingTool.h:94
AsgTool.h
InDet::InDetTrackBiasingTool::recommendedSystematics
virtual CP::SystematicSet recommendedSystematics() const override
returns: list of recommended systematics to use with this tool
Definition: InDetTrackBiasingTool.cxx:479
InDet::InDetTrackBiasingTool::m_data18_2ndPart_biasQoverPsagittaHistogram
std::unique_ptr< TH2 > m_data18_2ndPart_biasQoverPsagittaHistogram
Definition: InDetTrackBiasingTool.h:120
TrackParticleContainer.h
histogram
std::string histogram
Definition: chains.cxx:52
InDet::InDetTrackBiasingTool::m_data18_1stPart_biasZ0Histogram
std::unique_ptr< TH2 > m_data18_1stPart_biasZ0Histogram
Definition: InDetTrackBiasingTool.h:112
InDet::InDetTrackBiasingTool::m_data16_2ndPart_biasQoverPsagittaHistError
std::unique_ptr< TH2 > m_data16_2ndPart_biasQoverPsagittaHistError
Definition: InDetTrackBiasingTool.h:95
InDet::InDetTrackBiasingTool::m_data16_2ndPart_biasQoverPsagittaHistogram
std::unique_ptr< TH2 > m_data16_2ndPart_biasQoverPsagittaHistogram
Definition: InDetTrackBiasingTool.h:92
InDet::InDetTrackBiasingTool::m_calibFileData16_2ndPart
std::string m_calibFileData16_2ndPart
Definition: InDetTrackBiasingTool.h:138
InDet::InDetTrackBiasingTool::readHistogram
float readHistogram(float fDefault, TH2 *histogram, float phi, float eta) const
Definition: InDetTrackBiasingTool.cxx:440
InDet::InDetTrackBiasingTool::m_doZ0Bias
bool m_doZ0Bias
Definition: InDetTrackBiasingTool.h:132
InDet::InDetTrackBiasingTool::firstCall
StatusCode firstCall()
Definition: InDetTrackBiasingTool.cxx:399