ATLAS Offline Software
Loading...
Searching...
No Matches
SmearingCalibStep.h
Go to the documentation of this file.
1
2
3/*
4 Copyright (C) 2002-2024 CERN for the benefit of the ATLAS collaboration
5*/
6
7// SmearingCalibStep.h
8// Header file for class SmearingCalibStep
10
11#ifndef JETCALIBTOOLS_SMEARINGCALIBSTEP_H
12#define JETCALIBTOOLS_SMEARINGCALIBSTEP_H
13
14#include "AsgTools/AsgTool.h"
16#include "AsgTools/ToolHandle.h"
18
20
24
25#include "TRandom3.h"
26#include "boost/thread/tss.hpp"
27
29 : public asg::AsgTool,
30 virtual public IJetCalibStep {
31
33
34 public:
35 SmearingCalibStep(const std::string& name = "SmearingCalibStep");
36
37 virtual StatusCode initialize() override;
38 virtual StatusCode calibrate(xAOD::JetContainer&) const override;
39
40 virtual StatusCode getNominalResolutionData(const xAOD::Jet& jet, const JetHelper::JetContext& jc, double& resolution) const override;
41 virtual StatusCode getNominalResolutionMC(const xAOD::Jet& jet, const JetHelper::JetContext& jc, double& resolution) const override;
42
43 private:
44 Gaudi::Property<std::string> m_jetInScale {this, "InScale", "JetGSCScaleMomentum", "Starting jet scale"};
45 Gaudi::Property<std::string> m_jetOutScale {this, "OutScale", "JetSmearedMomentum", "Ending jet scale"};
46 Gaudi::Property<std::string> m_smearType {this, "SmearType", "FourVec", "How to smear: pt, eta or FourVec"};
47
48 ToolHandle<JetHelper::IVarTool> m_histToolMC {this, "HistoReaderMC", "HistoInput2D", "Instance of HistoInput1D or HistoInput2D for reading histogram for MC"};
49 ToolHandle<JetHelper::IVarTool> m_histToolData {this, "HistoReaderData", "HistoInput2D", "Instance of HistoInput1D or HistoInput2D for reading histogram for data"};
50
51 // Helper methods
52 StatusCode getSigmaSmear(xAOD::Jet& jet, const JetHelper::JetContext & jc, double& sigmaSmear) const;
53 StatusCode getNominalResolution(const xAOD::Jet& jet, JetHelper::JetContext jc, double& resolution) const;
54 TRandom3* getTLSRandomGen(unsigned long seed) const;
55
56 // Private enums
57 enum class SmearType
58 {
59 UNKNOWN=0, // Unknown/unset/etc
60 Pt, // pT smearing (JpTR)
61 Mass, // Mass smearing (JMR)
62 FourVec // Four-vector smearing (JER)
63 };
65
66 mutable boost::thread_specific_ptr<TRandom3> m_rand_tls; // thread-specific random number generator
67};
68
69#endif
#define ASG_TOOL_CLASS(CLASSNAME, INT1)
Class JetContext Designed to read AOD information related to the event, N vertices,...
Definition JetContext.h:23
ToolHandle< JetHelper::IVarTool > m_histToolMC
virtual StatusCode getNominalResolutionData(const xAOD::Jet &jet, const JetHelper::JetContext &jc, double &resolution) const override
TRandom3 * getTLSRandomGen(unsigned long seed) const
Gaudi::Property< std::string > m_jetOutScale
ToolHandle< JetHelper::IVarTool > m_histToolData
SmearingCalibStep(const std::string &name="SmearingCalibStep")
Gaudi::Property< std::string > m_smearType
virtual StatusCode calibrate(xAOD::JetContainer &) const override
Apply calibration to a jet container.
virtual StatusCode getNominalResolutionMC(const xAOD::Jet &jet, const JetHelper::JetContext &jc, double &resolution) const override
Gaudi::Property< std::string > m_jetInScale
boost::thread_specific_ptr< TRandom3 > m_rand_tls
virtual StatusCode initialize() override
Dummy implementation of the initialisation function.
StatusCode getSigmaSmear(xAOD::Jet &jet, const JetHelper::JetContext &jc, double &sigmaSmear) const
StatusCode getNominalResolution(const xAOD::Jet &jet, JetHelper::JetContext jc, double &resolution) const
Base class for the dual-use tool implementation classes.
Definition AsgTool.h:47
Jet_v1 Jet
Definition of the current "jet version".
JetContainer_v1 JetContainer
Definition of the current "jet container version".