ATLAS Offline Software
Loading...
Searching...
No Matches
egammaTransformerCalibTool.h
Go to the documentation of this file.
1/*
2 Copyright (C) 2002-2026 CERN for the benefit of the ATLAS collaboration
3*/
4
5#ifndef EGAMMATRANSFORMERCALIB_EGAMMATRANSFORMERCALIBTOOL_H
6#define EGAMMATRANSFORMERCALIB_EGAMMATRANSFORMERCALIBTOOL_H
7
8// Package includes
15
16// Framework includes
17#include "AsgTools/AsgTool.h"
19
20// Root includes
21#include "TFormula.h"
22#include "TH2Poly.h"
23#include "TObject.h"
24#include "TString.h"
25
26// STL includes
27#include <functional>
28#include <memory>
29#include <string>
30
48
50 virtual public IegammaMVACalibTool {
52 public:
53 egammaTransformerCalibTool(const std::string& type);
54 virtual ~egammaTransformerCalibTool() override;
55
56 virtual StatusCode initialize() override;
57
59 float getEnergy(const xAOD::CaloCluster& clus, const xAOD::Egamma* eg,
61 egammaMVACalib::GlobalEventInfo()) const override final;
62
63 private:
64 Gaudi::Property<int> m_particleType{
66 "What type of particle do we use"};
67
68 Gaudi::Property<bool> m_clusterEif0{
69 this, "useClusterIf0", true, "Use cluster energy if MVA response is 0"};
70
72 Gaudi::Property<std::string> m_folder{this, "folder", "",
73 "string with folder for weight files"};
74
76 Gaudi::Property<bool> m_isMC{this, "isMC", false, "Whether the input file is MC or data"};
77
78 Gaudi::Property<bool> m_useLayerCorrected{this, "useLayerCorrection", true,
79 "whether to use layer corrections"};
80
81 Gaudi::Property<std::string> m_layerCalibTune{this, "layerRecalibrationTune", "es2025_run3_extrapolate_gnn_v0",
82 "layer to use for layer corrections"};
83
84 Gaudi::Property<bool> m_useSaccCorrection{this, "useSaccCorrection", true,
85 "whether to use SACC correction for layer recalibration"};
86
87 Gaudi::Property<bool> m_useFixForMissingCells{this, "useFixForMissingCells", true,
88 "whether to apply fix for missing cells in layer recalibration, this is applied by default, this must be set to true whenever the timing cut fix is applied. Otherwise the layer calibration will not have correct scale factors for cell energies after timing cut fix"};
89
90 Gaudi::Property<bool> m_useExtraLayerScales{this, "useExtraLayerScales", false,
91 "whether to apply extra layer scales, this is for systematics studies, by default it is false and the extra layer scales are set to 1.0"};
92
93 Gaudi::Property<std::string> m_electronModelFile{
94 this, "ElectronModelFile", "electron_model_calibration.onnx",
95 "ONNX file for electron transformer model"};
96
97 Gaudi::Property<std::string> m_unconvertedPhotonModelFile{
98 this, "UnconvertedPhotonModelFile",
99 "unconverted_photon_model_calibration.onnx",
100 "ONNX file for unconverted photon transformer model"};
101
102 Gaudi::Property<std::string> m_convertedPhotonModelFile{
103 this, "ConvertedPhotonModelFile",
104 "converted_photon_model_calibration.onnx",
105 "ONNX file for converted photon transformer model"};
106
107 Gaudi::Property<std::string> m_forwardElectronModelFile{
108 this, "ForwardElectronModelFile",
109 "",
110 "ONNX file for forward electron transformer model, this is NOT "
111 "implemented yet"};
112
113 // Transformer model utils
114 std::unique_ptr<const FlavorTagInference::SaltModel> m_saltModel;
117 static constexpr double m_timeCut = 12.;
118
119 std::unique_ptr<egammaLayerRecalibTool> m_layerRecalibTool = nullptr;
120
121 // LG: scale for MG and LG need to be added later since the amount of work is not small.
122
124 ToolHandle<IegammaCellRecoveryTool> m_egammaCellRecoveryTool{
125 this,
126 "egammaCellRecoveryTool",
127 "",
128 "Optional tool that adds cells in L2 or L3 "
129 "that could have been rejected by timing cut"
130 };
131
134 StatusCode setupTransformerModel(const std::string& fileName);
135
136};
137
138#endif
#define ASG_TOOL_CLASS(CLASSNAME, INT1)
A tool used by the egammaMVASvc to help manage the MVAs.
Base class for the dual-use tool implementation classes.
Definition AsgTool.h:47
std::unique_ptr< const FlavorTagInference::SaltModel > m_saltModel
Gaudi::Property< bool > m_isMC
Layer calibration related properties.
Gaudi::Property< std::string > m_unconvertedPhotonModelFile
StatusCode setupTransformerModel(const std::string &fileName)
a utility to set up the transformer model, separated from initialize for better readability
Gaudi::Property< std::string > m_layerCalibTune
Gaudi::Property< bool > m_useLayerCorrected
Gaudi::Property< bool > m_useFixForMissingCells
Gaudi::Property< std::string > m_convertedPhotonModelFile
virtual StatusCode initialize() override
Dummy implementation of the initialisation function.
Gaudi::Property< std::string > m_folder
string with folder for weight files
Gaudi::Property< bool > m_useExtraLayerScales
egammaTransformerCalibTool(const std::string &type)
Gaudi::Property< std::string > m_electronModelFile
Gaudi::Property< bool > m_useSaccCorrection
std::unique_ptr< egammaLayerRecalibTool > m_layerRecalibTool
float getEnergy(const xAOD::CaloCluster &clus, const xAOD::Egamma *eg, const egammaMVACalib::GlobalEventInfo &gei=egammaMVACalib::GlobalEventInfo()) const override final
returns the calibrated energy
ToolHandle< IegammaCellRecoveryTool > m_egammaCellRecoveryTool
Pointer to the egammaCellRecoveryTool.
Gaudi::Property< bool > m_clusterEif0
Gaudi::Property< std::string > m_forwardElectronModelFile
CaloCluster_v1 CaloCluster
Define the latest version of the calorimeter cluster class.
Egamma_v1 Egamma
Definition of the current "egamma version".
Definition Egamma.h:17
A structure holding some global event information.