00001
00002 #pragma once
00003
00004 #include "InDetTrackSystematicsTools/IInDetTrackBiasingTool.h"
00005 #include "AsgTools/AsgTool.h"
00006 #include "PATInterfaces/CorrectionTool.h"
00007 #include "InDetTrackSystematicsTools/InDetTrackSystematicsTool.h"
00008 #include "xAODTracking/TrackParticleContainer.h"
00009 #include <string>
00010 #include <vector>
00011
00012 #include <TH2.h>
00013
00014 #include "TRandom3.h"
00015
00016 class TFile;
00017
00018 namespace InDet {
00019
00026
00027 class InDetTrackBiasingTool
00028 : public virtual IInDetTrackBiasingTool
00029 , public virtual InDetTrackSystematicsTool
00030 , public virtual CP::CorrectionTool< xAOD::TrackParticleContainer >
00031 {
00032
00033 ASG_TOOL_CLASS( InDetTrackBiasingTool,
00034 InDet::IInDetTrackBiasingTool )
00035
00036 public:
00037
00038 InDetTrackBiasingTool (const std::string& name);
00039 virtual ~InDetTrackBiasingTool();
00040
00041 virtual StatusCode initialize() override;
00042 virtual void prepare() override {};
00043 virtual StatusCode finalize() override;
00044
00046 virtual CP::CorrectionCode applyCorrection(xAOD::TrackParticle& track) override;
00047 virtual CP::CorrectionCode correctedCopy( const xAOD::TrackParticle& in,
00048 xAOD::TrackParticle*& out );
00049 virtual CP::CorrectionCode applyContainerCorrection( xAOD::TrackParticleContainer& cont );
00050
00051
00053 virtual bool isAffectedBySystematic( const CP::SystematicVariation& ) const;
00055 virtual CP::SystematicSet affectingSystematics() const;
00057 virtual CP::SystematicSet recommendedSystematics() const;
00059 virtual CP::SystematicCode applySystematicVariation( const CP::SystematicSet& );
00060
00061 protected:
00062
00063 StatusCode initHistograms(int runNumber);
00064 StatusCode firstCall();
00065
00066 float readHistogram(float fDefault, TH2* histogram, float phi, float eta) const;
00067
00068
00069 float m_biasD0 = 0.f;
00070 float m_biasZ0 = 0.f;
00071 float m_biasQoverPsagitta = 0.f;
00072
00073 TH2* m_biasD0Histogram = nullptr;
00074 TH2* m_biasZ0Histogram = nullptr;
00075 TH2* m_biasQoverPsagittaHistogram = nullptr;
00076 TH2* m_biasD0HistError = nullptr;
00077 TH2* m_biasZ0HistError = nullptr;
00078 TH2* m_biasQoverPsagittaHistError = nullptr;
00079
00080
00081
00082 bool m_isData = false;
00083 bool m_isSimulation = false;
00084 uint32_t m_runNumber = 0;
00085
00086 bool m_doD0Bias = true;
00087 bool m_doZ0Bias = true;
00088 bool m_doQoverPBias = true;
00089
00090 };
00091
00092 }