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
9// Author: Ben Hodkinson <ben.hodkinson@cern.ch>
11
12#ifndef JETCALIBTOOLS_SMEARINGCALIBSTEP_H
13#define JETCALIBTOOLS_SMEARINGCALIBSTEP_H
14
15#include "AsgTools/AsgTool.h"
17#include "AsgTools/ToolHandle.h"
19
21
25
26#include "TRandom3.h"
27#include "boost/thread/tss.hpp"
28
30 : public asg::AsgTool,
31 virtual public IJetCalibStep {
32
34
35 public:
36 SmearingCalibStep(const std::string& name = "SmearingCalibStep");
37
38 virtual StatusCode initialize() override;
39 virtual StatusCode calibrate(xAOD::JetContainer&) const override;
40
41 virtual StatusCode getNominalResolutionData(const xAOD::Jet& jet, const JetHelper::JetContext& jc, double& resolution) const override;
42 virtual StatusCode getNominalResolutionMC(const xAOD::Jet& jet, const JetHelper::JetContext& jc, double& resolution) const override;
43
44 private:
45 Gaudi::Property<std::string> m_jetInScale {this, "InScale", "JetGSCScaleMomentum", "Starting jet scale"};
46 Gaudi::Property<std::string> m_jetOutScale {this, "OutScale", "JetSmearedMomentum", "Ending jet scale"};
47 Gaudi::Property<std::string> m_smearType {this, "SmearType", "FourVec", "How to smear: pt, eta or FourVec"};
48
49 ToolHandle<JetHelper::IVarTool> m_histToolMC {this, "HistoReaderMC", "HistoInput2D", "Instance of HistoInput1D or HistoInput2D for reading histogram for MC"};
50 ToolHandle<JetHelper::IVarTool> m_histToolData {this, "HistoReaderData", "HistoInput2D", "Instance of HistoInput1D or HistoInput2D for reading histogram for data"};
51
52 // Helper methods
53 StatusCode getSigmaSmear(xAOD::Jet& jet, const JetHelper::JetContext & jc, double& sigmaSmear) const;
54 StatusCode getNominalResolution(const xAOD::Jet& jet, JetHelper::JetContext jc, double& resolution) const;
55 TRandom3* getTLSRandomGen(unsigned long seed) const;
56
57 // Private enums
58 enum class SmearType
59 {
60 UNKNOWN=0, // Unknown/unset/etc
61 Pt, // pT smearing (JpTR)
62 Mass, // Mass smearing (JMR)
63 FourVec // Four-vector smearing (JER)
64 };
66
67 mutable boost::thread_specific_ptr<TRandom3> m_rand_tls; // thread-specific random number generator
68};
69
70#endif
#define ASG_TOOL_CLASS(CLASSNAME, INT1)
Class JetContext Designed to read AOD information related to the event, N vertices,...
Definition JetContext.h:24
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".