ATLAS Offline Software
InDetTrackSmearingTool.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_INDETTRACKSMEARINGTOOL_H
7 #define INDETTRACKSYSTEMATICSTOOLS_INDETTRACKSMEARINGTOOL_H
8 
9 // Framework include(s):
10 #include "AsgTools/AsgTool.h"
13 
14 //EDM include(s):
16 
17 // Local include(s):
20 
21 #include <TFile.h>
22 #include <TH2F.h>
23 #include <TF2.h>
24 #include <TRandom3.h>
25 
26 namespace InDet {
27 
29  : public virtual IInDetTrackSmearingTool
30  , public virtual InDetTrackSystematicsTool
31  , public virtual CP::CorrectionTool< xAOD::TrackParticleContainer >
32  {
33 
37  public:
39  InDetTrackSmearingTool( const std::string& name );
40  virtual ~InDetTrackSmearingTool();
41 
43  virtual StatusCode initialize() override;
46 
47  // we need explicit forwarding calls because CP::CorrectionTool does not have a pure interface
48  // this isn't really elegant (ideally these would come automatically) but we'd need IInDetTrackSmearingTool
49  // to inherit from CP::CorrectionTool, which would make it not pure-virtual.
50  // at least, forwarding calls are easy enough to read and understand.
52  xAOD::TrackParticle*& out ) override;
54 
56  virtual bool isAffectedBySystematic( const CP::SystematicVariation& ) const override;
58  virtual CP::SystematicSet affectingSystematics() const override;
60  virtual CP::SystematicSet recommendedSystematics() const override;
62  virtual StatusCode applySystematicVariation( const CP::SystematicSet& ) override;
63 
64  private:
65 
68 
70  float GetSmearD0Sigma(const xAOD::TrackParticle&) const;
71  float GetSmearZ0Sigma(const xAOD::TrackParticle&) const;
72 
73  int m_seed = 0;
74  std::unique_ptr<TRandom3> m_rnd;
75 
76  // StatusCode initHistogram(TH1*& histogram, std::string rootFileName, std::string histogramName) const;
77  // StatusCode initFunction(TF2*& function, std::string rootFileName, std::string functionName) const;
78  float readHistogram( TH2*, float pt, float eta ) const;
79 
80  // float readHistogram(TH1* histogram, float pt, float eta) const;
81  // float readHistograms(std::vector<TH1 *> histogram, float pt, float eta) const;
82  // histograms for dead module smearing as a function of p
83  TH1* m_smearD0Dead = nullptr;
84  TH1* m_smearZ0Dead = nullptr;
85 
86  TH2* m_smearD0_lowpt = nullptr;
87  TH2* m_smearZ0_lowpt = nullptr;
88  TH2* m_smearD0_lowpt_sys_up = nullptr;
89  TH2* m_smearZ0_lowpt_sys_up = nullptr;
90  TH2* m_smearD0_lowpt_sys_dw = nullptr;
91  TH2* m_smearZ0_lowpt_sys_dw = nullptr;
92 
93  TH2* m_smearD0_highpt = nullptr;
94  TH2* m_smearZ0_highpt = nullptr;
95  TH2* m_smearD0_highpt_sys_up = nullptr;
96  TH2* m_smearZ0_highpt_sys_up = nullptr;
97  TH2* m_smearD0_highpt_sys_dw = nullptr;
98  TH2* m_smearZ0_highpt_sys_dw = nullptr;
99 
100  // allow the user to configure which calibration files to use if desired
101  std::string m_calibFileD0Dead;
102  std::string m_calibFileZ0Dead;
103 
104  std::string m_calibFileIP_lowpt;
107 
108  std::string m_calibFileIP_CTIDE;
109 
111 
112  // for now, just set a flag to use CTIDE smearing for tracks in jets
113  bool m_doCTIDE = false;
114 
115  };
116 
117 }
118 
119 #endif
CorrectionTool.h
InDet::InDetTrackSmearingTool::m_smearZ0_highpt_sys_dw
TH2 * m_smearZ0_highpt_sys_dw
Definition: InDetTrackSmearingTool.h:98
InDet::InDetTrackSmearingTool::initHistograms
StatusCode initHistograms(int runNumber)
Definition: InDetTrackSmearingTool.cxx:258
InDet::InDetTrackSystematicsTool
Definition: InDetTrackSystematicsTool.h:22
InDet::InDetTrackSmearingTool::m_calibFileIP_highpt_Data17
std::string m_calibFileIP_highpt_Data17
Definition: InDetTrackSmearingTool.h:106
InDet::InDetTrackSmearingTool::correctedCopy
virtual CP::CorrectionCode correctedCopy(const xAOD::TrackParticle &in, xAOD::TrackParticle *&out) override
Definition: InDetTrackSmearingTool.cxx:356
InDet::InDetTrackSmearingTool::m_rnd
std::unique_ptr< TRandom3 > m_rnd
Definition: InDetTrackSmearingTool.h:74
InDet::InDetTrackSmearingTool::applySystematicVariation
virtual StatusCode applySystematicVariation(const CP::SystematicSet &) override
configure the tool to apply a given list of systematic variations
Definition: InDetTrackSmearingTool.cxx:383
ID
std::vector< Identifier > ID
Definition: CalibHitIDCheck.h:24
xAOD::uint32_t
setEventNumber uint32_t
Definition: EventInfo_v1.cxx:127
InDet::InDetTrackSmearingTool::m_calibFileD0Dead
std::string m_calibFileD0Dead
Definition: InDetTrackSmearingTool.h:101
InDet
Primary Vertex Finder.
Definition: VP1ErrorUtils.h:36
IInDetTrackSmearingTool.h
test_pyathena.pt
pt
Definition: test_pyathena.py:11
python.AthDsoLogger.out
out
Definition: AthDsoLogger.py:71
CP::SystematicSet
Class to wrap a set of SystematicVariations.
Definition: SystematicSet.h:31
InDet::InDetTrackSmearingTool::m_runNumber
uint32_t m_runNumber
Definition: InDetTrackSmearingTool.h:110
InDet::InDetTrackSmearingTool::recommendedSystematics
virtual CP::SystematicSet recommendedSystematics() const override
returns: list of recommended systematics to use with this tool
Definition: InDetTrackSmearingTool.cxx:377
InDet::InDetTrackSmearingTool::m_smearD0_highpt_sys_up
TH2 * m_smearD0_highpt_sys_up
Definition: InDetTrackSmearingTool.h:95
InDet::InDetTrackSmearingTool::m_smearZ0Dead
TH1 * m_smearZ0Dead
Definition: InDetTrackSmearingTool.h:84
InDet::InDetTrackSmearingTool::applyCorrection
virtual CP::CorrectionCode applyCorrection(xAOD::TrackParticle &ID) override
Smearing method.
Definition: InDetTrackSmearingTool.cxx:236
InDet::InDetTrackSmearingTool::m_smearZ0_lowpt_sys_up
TH2 * m_smearZ0_lowpt_sys_up
Definition: InDetTrackSmearingTool.h:89
CP::SystematicVariation
Definition: SystematicVariation.h:47
InDet::InDetTrackSmearingTool
Definition: InDetTrackSmearingTool.h:32
InDet::IInDetTrackSmearingTool
Simple interface for calibrating/correcting tracks (inner-detector particles)
Definition: IInDetTrackSmearingTool.h:33
InDet::InDetTrackSmearingTool::readHistogram
float readHistogram(TH2 *, float pt, float eta) const
Definition: InDetTrackSmearingTool.cxx:389
InDet::InDetTrackSmearingTool::firstCall
StatusCode firstCall()
Definition: InDetTrackSmearingTool.cxx:332
InDet::InDetTrackSmearingTool::m_smearZ0_lowpt_sys_dw
TH2 * m_smearZ0_lowpt_sys_dw
Definition: InDetTrackSmearingTool.h:91
InDet::InDetTrackSmearingTool::m_smearD0_lowpt_sys_up
TH2 * m_smearD0_lowpt_sys_up
Definition: InDetTrackSmearingTool.h:88
InDet::InDetTrackSmearingTool::m_smearZ0_highpt
TH2 * m_smearZ0_highpt
Definition: InDetTrackSmearingTool.h:94
InDet::InDetTrackSmearingTool::m_smearZ0_lowpt
TH2 * m_smearZ0_lowpt
Definition: InDetTrackSmearingTool.h:87
InDet::InDetTrackSmearingTool::applyContainerCorrection
virtual CP::CorrectionCode applyContainerCorrection(xAOD::TrackParticleContainer &cont) override
Definition: InDetTrackSmearingTool.cxx:362
InDet::InDetTrackSmearingTool::GetSmearZ0Sigma
float GetSmearZ0Sigma(const xAOD::TrackParticle &) const
Definition: InDetTrackSmearingTool.cxx:177
EL::StatusCode
::StatusCode StatusCode
StatusCode definition for legacy code.
Definition: PhysicsAnalysis/D3PDTools/EventLoop/EventLoop/StatusCode.h:22
InDet::InDetTrackSmearingTool::m_smearD0_lowpt
TH2 * m_smearD0_lowpt
Definition: InDetTrackSmearingTool.h:86
InDet::InDetTrackSmearingTool::m_smearD0_lowpt_sys_dw
TH2 * m_smearD0_lowpt_sys_dw
Definition: InDetTrackSmearingTool.h:90
DataVector
Derived DataVector<T>.
Definition: DataVector.h:794
InDet::InDetTrackSmearingTool::affectingSystematics
virtual CP::SystematicSet affectingSystematics() const override
returns: list of systematics this tool can be affected by
Definition: InDetTrackSmearingTool.cxx:372
CP::CorrectionTool
Helper base class for "correction tools".
Definition: CorrectionTool.h:42
name
std::string name
Definition: Control/AthContainers/Root/debug.cxx:228
InDetTrackSystematicsTool.h
InDet::InDetTrackSmearingTool::m_calibFileZ0Dead
std::string m_calibFileZ0Dead
Definition: InDetTrackSmearingTool.h:102
InDet::InDetTrackSmearingTool::m_doCTIDE
bool m_doCTIDE
Definition: InDetTrackSmearingTool.h:113
InDet::InDetTrackSmearingTool::m_smearD0_highpt
TH2 * m_smearD0_highpt
Definition: InDetTrackSmearingTool.h:93
InDet::InDetTrackSmearingTool::m_smearD0Dead
TH1 * m_smearD0Dead
Definition: InDetTrackSmearingTool.h:83
DeMoAtlasDataLoss.runNumber
string runNumber
Definition: DeMoAtlasDataLoss.py:64
InDet::InDetTrackSmearingTool::initialize
virtual StatusCode initialize() override
Function initialising the tool.
Definition: InDetTrackSmearingTool.cxx:72
InDet::InDetTrackSmearingTool::m_smearZ0_highpt_sys_up
TH2 * m_smearZ0_highpt_sys_up
Definition: InDetTrackSmearingTool.h:96
ASG_TOOL_CLASS
#define ASG_TOOL_CLASS(CLASSNAME, INT1)
Definition: AsgToolMacros.h:68
InDet::InDetTrackSmearingTool::m_calibFileIP_lowpt
std::string m_calibFileIP_lowpt
Definition: InDetTrackSmearingTool.h:104
CP::CorrectionCode
Return value from object correction CP tools.
Definition: CorrectionCode.h:31
InDet::InDetTrackSmearingTool::m_calibFileIP_highpt_Data16
std::string m_calibFileIP_highpt_Data16
Definition: InDetTrackSmearingTool.h:105
xAOD::TrackParticle_v1
Class describing a TrackParticle.
Definition: TrackParticle_v1.h:43
InDet::InDetTrackSmearingTool::m_smearD0_highpt_sys_dw
TH2 * m_smearD0_highpt_sys_dw
Definition: InDetTrackSmearingTool.h:97
InDet::InDetTrackSmearingTool::m_calibFileIP_CTIDE
std::string m_calibFileIP_CTIDE
Definition: InDetTrackSmearingTool.h:108
AsgTool.h
SystematicVariation.h
TrackParticleContainer.h
InDet::InDetTrackSmearingTool::GetSmearD0Sigma
float GetSmearD0Sigma(const xAOD::TrackParticle &) const
Get smearing widths to add to IPs.
Definition: InDetTrackSmearingTool.cxx:119
InDet::InDetTrackSmearingTool::isAffectedBySystematic
virtual bool isAffectedBySystematic(const CP::SystematicVariation &) const override
returns: whether the tool is affected by the systematic
Definition: InDetTrackSmearingTool.cxx:367
InDet::InDetTrackSmearingTool::m_seed
int m_seed
Definition: InDetTrackSmearingTool.h:73