ATLAS Offline Software
Loading...
Searching...
No Matches
AsgForwardElectronCalibrationTool.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 ASGFORWARDELECTRONCALIBRATIONTOOL_H
6#define ASGFORWARDELECTRONCALIBRATIONTOOL_H
7
25
26
28#include "AsgTools/AsgTool.h"
30
32
33#include "lwtnn/LightweightGraph.hh"
34
35#include <vector>
36#include <string>
37#include <memory>
38
39
40class EventContext;
41
42
44 : public asg::AsgTool
45 , virtual public IForwardElectronCalib
46{
49
50
51
52public:
53
55 AsgForwardElectronCalibrationTool(const std::string& myname);
58
59
61 virtual StatusCode initialize() override;
62
63
66 double calibrate(const EventContext& ctx,
67 const xAOD::Electron* eg) const override;
68
69
70
71
72
73private:
74
80 int getEtaBin(double absEta) const;
81
84 bool getInputs(const xAOD::Electron* eg,
85 std::vector<float>& inputs) const;
86
88 double softplus(double x) const;
89
91 double unscalePt(double x) const;
92
93
94
96 Gaudi::Property<double> m_pTMin {this,"pTMin", 10000, "Lower bound of pT Min scaling [MeV]"};
97 Gaudi::Property<double> m_pTMax {this,"pTMax", 255000, "Lower bound of pT Max scaling [MeV]"};
98
100 Gaudi::Property<std::vector<std::string>> m_modelFiles {this,"ModelFiles",{"","",""} , "lwtnn JSON files, one per eta bin (in eta order)"};
101 std::vector<std::unique_ptr<lwt::LightweightGraph>> m_graphs;
102
104 std::vector<std::string> m_variables;
105
106};
107
108#endif
#define ASG_TOOL_CLASS1
#define x
Tool to apply DNN-based pT calibration to forward electrons for Run 4 using ITk and HGTD variables.
int getEtaBin(double absEta) const
Select the eta bin index for |eta|, three eta bins: Bin 0: 2.5 < |eta| <= 2.7 Bin 1: 2....
double unscalePt(double x) const
Undo MinMax pT scaling used during training.
Gaudi::Property< std::vector< std::string > > m_modelFiles
One lwtnn JSON file / DNN per eta bin.
double calibrate(const EventContext &ctx, const xAOD::Electron *eg) const override
Return the DNN-calibrated pT in MeV Returns -999 on error.
bool getInputs(const xAOD::Electron *eg, std::vector< float > &inputs) const
Get 25 input variables Returns false on failure.
virtual StatusCode initialize() override
Gaudi Service Interface method implementations.
Gaudi::Property< double > m_pTMin
pT scaling range used [MeV]
double softplus(double x) const
Sftplus: log(1 + exp(x)).
std::vector< std::string > m_variables
Input variable names.
virtual ASG_TOOL_CLASS1(AsgForwardElectronCalibrationTool, IForwardElectronCalib) public ~AsgForwardElectronCalibrationTool()
Standard constructor.
std::vector< std::unique_ptr< lwt::LightweightGraph > > m_graphs
A tool used to Compute the pT Calibration.
Base class for the dual-use tool implementation classes.
Definition AsgTool.h:47
Electron_v1 Electron
Definition of the current "egamma version".