ATLAS Offline Software
Loading...
Searching...
No Matches
AsgForwardElectronCalibrationTool Class Reference

Tool to apply DNN-based pT calibration to forward electrons for Run 4 using ITk and HGTD variables. More...

#include <AsgForwardElectronCalibrationTool.h>

Inheritance diagram for AsgForwardElectronCalibrationTool:
Collaboration diagram for AsgForwardElectronCalibrationTool:

Public Member Functions

virtual void print () const
 Print the state of the tool.
ServiceHandle< StoreGateSvc > & evtStore ()
 The standard StoreGateSvc (event store) Returns (kind of) a pointer to the StoreGateSvc.
const ServiceHandle< StoreGateSvc > & detStore () const
 The standard StoreGateSvc/DetectorStore Returns (kind of) a pointer to the StoreGateSvc.
virtual StatusCode sysInitialize () override
 Perform system initialization for an algorithm.
virtual StatusCode sysStart () override
 Handle START transition.
virtual std::vector< Gaudi::DataHandle * > inputHandles () const override
 Return this algorithm's input handles.
virtual std::vector< Gaudi::DataHandle * > outputHandles () const override
 Return this algorithm's output handles.
Gaudi::Details::PropertyBase & declareProperty (Gaudi::Property< T, V, H > &t)
void updateVHKA (Gaudi::Details::PropertyBase &)
MsgStream & msg () const
bool msgLvl (const MSG::Level lvl) const
Additional helper functions, not directly mimicking Athena
template<class T>
const T * getProperty (const std::string &name) const
 Get one of the tool's properties.
const std::string & msg_level_name () const __attribute__((deprecated))
 A deprecated function for getting the message level's name.
const std::string & getName (const void *ptr) const
 Get the name of an object that is / should be in the event store.
SG::sgkey_t getKey (const void *ptr) const
 Get the (hashed) key of an object that is in the event store.

Protected Member Functions

void renounceArray (SG::VarHandleKeyArray &handlesArray)
 remove all handles from I/O resolution
std::enable_if_t< std::is_void_v< std::result_of_t< decltype(&T::renounce)(T)> > &&!std::is_base_of_v< SG::VarHandleKeyArray, T > &&std::is_base_of_v< Gaudi::DataHandle, T >, void > renounce (T &h)
void extraDeps_update_handler (Gaudi::Details::PropertyBase &ExtraDeps)
 Add StoreName to extra input/output deps as needed.

Private Types

typedef ServiceHandle< StoreGateSvcStoreGateSvc_t

Private Member Functions

virtual ASG_TOOL_CLASS1(AsgForwardElectronCalibrationTool, IForwardElectronCalib) public ~AsgForwardElectronCalibrationTool ()
 Standard constructor.
virtual StatusCode initialize () override
 Gaudi Service Interface method implementations.
double calibrate (const EventContext &ctx, const xAOD::Electron *eg) const
 Return the DNN-calibrated pT in MeV Returns -999 on error.
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.7 < |eta| <= 3.2 Bin 2: 3.2 < |eta| <= 4.0 Returns -1 if out of range.
bool getInputs (const xAOD::Electron *eg, std::vector< float > &inputs) const
 Get 25 input variables Returns false on failure.
double softplus (double x) const
 Sftplus: log(1 + exp(x)).
double unscalePt (double x) const
 Undo MinMax pT scaling used during training.
Gaudi::Details::PropertyBase & declareGaudiProperty (Gaudi::Property< T, V, H > &hndl, const SG::VarHandleKeyType &)
 specialization for handling Gaudi::Property<SG::VarHandleKey>

Private Attributes

Gaudi::Property< double > m_pTMin {this,"pTMin", 10000, "Lower bound of pT Min scaling [MeV]"}
 pT scaling range used [MeV]
Gaudi::Property< double > m_pTMax {this,"pTMax", 255000, "Lower bound of pT Max scaling [MeV]"}
Gaudi::Property< std::vector< std::string > > m_modelFiles {this,"ModelFiles",{"","",""} , "lwtnn JSON files, one per eta bin (in eta order)"}
 One lwtnn JSON file / DNN per eta bin.
std::vector< std::unique_ptr< lwt::LightweightGraph > > m_graphs
std::vector< std::string > m_variables
 Input variable names.
StoreGateSvc_t m_evtStore
 Pointer to StoreGate (event store by default).
StoreGateSvc_t m_detStore
 Pointer to StoreGate (detector store by default).
std::vector< SG::VarHandleKeyArray * > m_vhka
bool m_varHandleArraysDeclared

Detailed Description

Tool to apply DNN-based pT calibration to forward electrons for Run 4 using ITk and HGTD variables.

Internal Note: https://cds.cern.ch/record/2922184

Workflow:

  1. Extract 25 input variables from the forward electron container
  2. Run DNN via lwtnn (MinMax scaler already into JSON as a batch norm layer)
  3. Apply softplus manually (not supported natively by lwtnn)
  4. Undo MinMax pT scaling -> calibrated pT in MeV
Author
Mathis Dubau (LAPP)
Date
Feb 2026

Based on ElectronDNNCalculator and AsgForwardElectronLikelihoodTool

Definition at line 43 of file AsgForwardElectronCalibrationTool.h.

Member Typedef Documentation

◆ StoreGateSvc_t

typedef ServiceHandle<StoreGateSvc> AthCommonDataStore< AthCommonMsg< AlgTool > >::StoreGateSvc_t
privateinherited

Definition at line 388 of file AthCommonDataStore.h.

Member Function Documentation

◆ calibrate()

double AsgForwardElectronCalibrationTool::calibrate ( const EventContext & ctx,
const xAOD::Electron * eg ) const
privatevirtual

Return the DNN-calibrated pT in MeV Returns -999 on error.

Implements IForwardElectronCalib.

Definition at line 129 of file AsgForwardElectronCalibrationTool.cxx.

131{
132 if (!eg) {
133 ATH_MSG_ERROR("Failed, no Electron object.");
134 return -999.;
135 }
136
137 const xAOD::CaloCluster* cluster = eg->caloCluster();
138 if (!cluster) {
139 ATH_MSG_WARNING("Failed, no cluster.");
140 return -999.;
141 }
142
143 // ITk electron must have a track
145 if (!track) {
146 ATH_MSG_WARNING("Failed, no track.");
147 return -999.;
148 }
149
150 const double absEta = std::abs(cluster->eta());
151 const int etaBin = getEtaBin(absEta);
152 if (etaBin < 0) {
153 ATH_MSG_WARNING("Electron |eta|=" << absEta
154 << " is outside allowed range.");
155 return -999.;
156 }
157
158
159 // Get input variables
160 std::vector<float> inputs;
161 if (!getInputs(eg, inputs)) return -999.;
162
163
164 // Compute the DNN output
165 std::map<std::string, std::map<std::string, double>> inputMap;
166 for (size_t i = 0; i < m_variables.size(); ++i)
167 inputMap["node_0"][m_variables[i]] = static_cast<float>(inputs[i]);
168
169 const auto outputs = m_graphs[etaBin]->compute(inputMap);
170 const double rawOut = outputs.begin()->second;
171 const double calibratedPt = unscalePt(softplus(rawOut));
172
173 // Round to 1 MeV precision due to lwtnn mismatch
174 double calibratedPt_rounded = std::round(calibratedPt);
175
176 return calibratedPt_rounded;
177}
#define ATH_MSG_ERROR(x)
#define ATH_MSG_WARNING(x)
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.
bool getInputs(const xAOD::Electron *eg, std::vector< float > &inputs) const
Get 25 input variables Returns false on failure.
double softplus(double x) const
Sftplus: log(1 + exp(x)).
std::vector< std::string > m_variables
Input variable names.
std::vector< std::unique_ptr< lwt::LightweightGraph > > m_graphs
virtual double eta() const
The pseudorapidity ( ) of the particle.
const xAOD::CaloCluster * caloCluster(size_t index=0) const
Pointer to the xAOD::CaloCluster/s that define the electron candidate.
const xAOD::TrackParticle * trackParticle(size_t index=0) const
Pointer to the xAOD::TrackParticle/s that match the electron candidate.
bool absEta(const xAOD::TauJet &tau, float &out)
setSAddress setEtaMS setDirPhiMS setDirZMS setBarrelRadius setEndcapAlpha setEndcapRadius setInterceptInner setEtaMap etaBin
CaloCluster_v1 CaloCluster
Define the latest version of the calorimeter cluster class.
TrackParticle_v1 TrackParticle
Reference the current persistent version:

◆ declareGaudiProperty()

Gaudi::Details::PropertyBase & AthCommonDataStore< AthCommonMsg< AlgTool > >::declareGaudiProperty ( Gaudi::Property< T, V, H > & hndl,
const SG::VarHandleKeyType &  )
inlineprivateinherited

specialization for handling Gaudi::Property<SG::VarHandleKey>

Definition at line 156 of file AthCommonDataStore.h.

158 {
160 hndl.value(),
161 hndl.documentation());
162
163 }
Gaudi::Details::PropertyBase & declareProperty(Gaudi::Property< T, V, H > &t)

◆ declareProperty()

Gaudi::Details::PropertyBase & AthCommonDataStore< AthCommonMsg< AlgTool > >::declareProperty ( Gaudi::Property< T, V, H > & t)
inlineinherited

Definition at line 145 of file AthCommonDataStore.h.

145 {
146 typedef typename SG::HandleClassifier<T>::type htype;
148 }
Gaudi::Details::PropertyBase & declareGaudiProperty(Gaudi::Property< T, V, H > &hndl, const SG::VarHandleKeyType &)
specialization for handling Gaudi::Property<SG::VarHandleKey>

◆ detStore()

const ServiceHandle< StoreGateSvc > & AthCommonDataStore< AthCommonMsg< AlgTool > >::detStore ( ) const
inlineinherited

The standard StoreGateSvc/DetectorStore Returns (kind of) a pointer to the StoreGateSvc.

Definition at line 95 of file AthCommonDataStore.h.

◆ evtStore()

ServiceHandle< StoreGateSvc > & AthCommonDataStore< AthCommonMsg< AlgTool > >::evtStore ( )
inlineinherited

The standard StoreGateSvc (event store) Returns (kind of) a pointer to the StoreGateSvc.

Definition at line 85 of file AthCommonDataStore.h.

◆ extraDeps_update_handler()

void AthCommonDataStore< AthCommonMsg< AlgTool > >::extraDeps_update_handler ( Gaudi::Details::PropertyBase & ExtraDeps)
protectedinherited

Add StoreName to extra input/output deps as needed.

use the logic of the VarHandleKey to parse the DataObjID keys supplied via the ExtraInputs and ExtraOuputs Properties to add the StoreName if it's not explicitly given

◆ getEtaBin()

int AsgForwardElectronCalibrationTool::getEtaBin ( double absEta) const
private

Select the eta bin index for |eta|, three eta bins: Bin 0: 2.5 < |eta| <= 2.7 Bin 1: 2.7 < |eta| <= 3.2 Bin 2: 3.2 < |eta| <= 4.0 Returns -1 if out of range.

Definition at line 182 of file AsgForwardElectronCalibrationTool.cxx.

183{
184 // Convention: x1 < |eta| <= x2
185 if (absEta > 2.5 && absEta <= 2.7) return 0;
186 if (absEta > 2.7 && absEta <= 3.2) return 1;
187 if (absEta > 3.2 && absEta <= 4.0) return 2;
188 return -1;
189}

◆ getInputs()

bool AsgForwardElectronCalibrationTool::getInputs ( const xAOD::Electron * eg,
std::vector< float > & inputs ) const
private

Get 25 input variables Returns false on failure.

Definition at line 194 of file AsgForwardElectronCalibrationTool.cxx.

196{
197 inputs.clear();
198 inputs.reserve(25);
199
200 const xAOD::CaloCluster* cluster = eg->caloCluster();
202
203 if (!cluster) { ATH_MSG_ERROR("No CaloCluster."); return false; }
204 if (!track) { ATH_MSG_ERROR("No TrackParticle."); return false; }
205
206 // x1, x2 = calo eta and phi
207 inputs.push_back(static_cast<float>(cluster->eta()));
208 inputs.push_back(static_cast<float>(cluster->phi()));
209
210 // x3, x4 = track eta and phi
211 inputs.push_back(static_cast<float>(track->eta()));
212 inputs.push_back(static_cast<float>(track->phi()));
213
214 // x5 = HGTD time
215 if (track->hasValidTime()) inputs.push_back(static_cast<float>(track->time()));
216 else
217 {
218 ATH_MSG_DEBUG("No valid time for the track while doing track->time()" );
219 inputs.push_back(-99);
220 }
221
222 // x6, x7 = ITk hit counts
223 inputs.push_back(static_cast<float>(eg->trackParticleSummaryIntValue(xAOD::numberOfPixelHits)));
224 inputs.push_back(static_cast<float>(eg->trackParticleSummaryIntValue(xAOD::numberOfSCTHits)));
225
226 // x8 to x14 = 7 calorimeter shower-shape moments
227 auto getMoment = [&](xAOD::CaloCluster::MomentType type,
228 const char* name) -> float {
229 double val{0.};
230 if (!cluster->retrieveMoment(type, val))
231 ATH_MSG_WARNING("Could not retrieve calo moment: " << name);
232 return val;
233 };
234
235 inputs.push_back(getMoment(xAOD::CaloCluster::ENG_FRAC_MAX, "ENG_FRAC_MAX"));
236 inputs.push_back(getMoment(xAOD::CaloCluster::LONGITUDINAL, "LONGITUDINAL"));
237 inputs.push_back(getMoment(xAOD::CaloCluster::SECOND_LAMBDA, "SECOND_LAMBDA"));
238 inputs.push_back(getMoment(xAOD::CaloCluster::LATERAL, "LATERAL"));
239 inputs.push_back(getMoment(xAOD::CaloCluster::SECOND_R, "SECOND_R"));
240 inputs.push_back(getMoment(xAOD::CaloCluster::CENTER_LAMBDA, "CENTER_LAMBDA"));
241 inputs.push_back(getMoment(xAOD::CaloCluster::SECOND_ENG_DENS, "SECOND_ENG_DENS"));
242
243 // x15 to x18 = track-calo matching
245 const char* name) -> float {
246 float val{0.f};
247 if (!eg->trackCaloMatchValue(val, type))
248 ATH_MSG_WARNING("Could not retrieve track-calo match: " << name);
249 return val;
250 };
251
252 inputs.push_back(getMatch(xAOD::EgammaParameters::deltaEta2,
253 "delta_eta2"));
254 inputs.push_back(getMatch(xAOD::EgammaParameters::deltaPhi2,
255 "delta_phi2"));
257 "delta_phi_rescaled2"));
259 "delta_phi_last"));
260
261 // x19 to x25 = Derived calorimeter energy fractions
262 // Prevent division by zero
263 const double caloE = cluster->e();
264 const double inv_E = (caloE != 0.) ? 1. / caloE : 0.;
265
266 using CS = CaloSampling::CaloSample;
267
268 // EM fractions:
269 // f_i^EM = energyBE(i) / caloE for i in {1,2,3}
270 inputs.push_back(static_cast<float>(cluster->energyBE(1) * inv_E));
271 inputs.push_back(static_cast<float>(cluster->energyBE(2) * inv_E));
272 inputs.push_back(static_cast<float>(cluster->energyBE(3) * inv_E));
273
274 // HAD fractions:
275 // f_0^HAD = HEC0 / caloE
276 // f_i^HAD = (HEC_i + FCAL_(i-1)) / caloE for i in {1,2,3}
277 inputs.push_back(static_cast<float>(
278 cluster->eSample(static_cast<CS>(CaloSampling::HEC0)) * inv_E));
279 inputs.push_back(static_cast<float>(
280 (cluster->eSample(static_cast<CS>(CaloSampling::HEC1)) +
281 cluster->eSample(static_cast<CS>(CaloSampling::FCAL0))) * inv_E));
282 inputs.push_back(static_cast<float>(
283 (cluster->eSample(static_cast<CS>(CaloSampling::HEC2)) +
284 cluster->eSample(static_cast<CS>(CaloSampling::FCAL1))) * inv_E));
285 inputs.push_back(static_cast<float>(
286 (cluster->eSample(static_cast<CS>(CaloSampling::HEC3)) +
287 cluster->eSample(static_cast<CS>(CaloSampling::FCAL2))) * inv_E));
288
289 return true;
290}
#define ATH_MSG_DEBUG(x)
bool retrieveMoment(MomentType type, double &value) const
Retrieve individual moment.
virtual double e() const
The total energy of the particle.
float eSample(const CaloSample sampling) const
float energyBE(const unsigned layer) const
Get the energy in one layer of the EM Calo.
virtual double phi() const
The azimuthal angle ( ) of the particle.
MomentType
Enums to identify different moments.
@ SECOND_ENG_DENS
Second Moment in E/V.
@ SECOND_LAMBDA
Second Moment in .
@ LATERAL
Normalized lateral moment.
@ LONGITUDINAL
Normalized longitudinal moment.
@ ENG_FRAC_MAX
Energy fraction of hottest cell.
@ SECOND_R
Second Moment in .
@ CENTER_LAMBDA
Shower depth at Cluster Centroid.
bool trackCaloMatchValue(float &value, const EgammaParameters::TrackCaloMatchType information) const
Accessor for Track to Calo Match Values.
uint8_t trackParticleSummaryIntValue(const SummaryType information, int index=0) const
Accessor to the matching track(s) int information (index = 0 is the best match) Will lead to an excep...
@ deltaPhiFromLastMeasurement
difference between the cluster phi (sampling 2) and the eta of the track extrapolated from the last m...
@ deltaEta2
difference between the cluster eta (second sampling) and the eta of the track extrapolated to the sec...
@ deltaPhiRescaled2
difference between the cluster phi (second sampling) and the phi of the track extrapolated to the sec...
@ deltaPhi2
difference between the cluster phi (second sampling) and the phi of the track extrapolated to the sec...
@ numberOfSCTHits
number of hits in SCT [unit8_t].
@ numberOfPixelHits
these are the pixel hits, including the b-layer [unit8_t].

◆ getKey()

SG::sgkey_t asg::AsgTool::getKey ( const void * ptr) const
inherited

Get the (hashed) key of an object that is in the event store.

This is a bit of a special one. StoreGateSvc and xAOD::Event both provide ways for getting the SG::sgkey_t key for an object that is in the store, based on a bare pointer. But they provide different interfaces for doing so.

In order to allow tools to efficiently perform this operation, they can use this helper function.

See also
asg::AsgTool::getName
Parameters
ptrThe bare pointer to the object that the event store should know about
Returns
The hashed key of the object in the store. If not found, an invalid (zero) key.

Definition at line 119 of file AsgTool.cxx.

119 {
120
121#ifdef XAOD_STANDALONE
122 // In case we use @c xAOD::Event, we have a direct function call
123 // for this.
124 return evtStore()->event()->getKey( ptr );
125#else
126 const SG::DataProxy* proxy = evtStore()->proxy( ptr );
127 return ( proxy == nullptr ? 0 : proxy->sgkey() );
128#endif // XAOD_STANDALONE
129 }
ServiceHandle< StoreGateSvc > & evtStore()

◆ getName()

const std::string & asg::AsgTool::getName ( const void * ptr) const
inherited

Get the name of an object that is / should be in the event store.

This is a bit of a special one. StoreGateSvc and xAOD::Event both provide ways for getting the std::string name for an object that is in the store, based on a bare pointer. But they provide different interfaces for doing so.

In order to allow tools to efficiently perform this operation, they can use this helper function.

See also
asg::AsgTool::getKey
Parameters
ptrThe bare pointer to the object that the event store should know about
Returns
The string name of the object in the store. If not found, an empty string.

Definition at line 106 of file AsgTool.cxx.

106 {
107
108#ifdef XAOD_STANDALONE
109 // In case we use @c xAOD::Event, we have a direct function call
110 // for this.
111 return evtStore()->event()->getName( ptr );
112#else
113 const SG::DataProxy* proxy = evtStore()->proxy( ptr );
114 static const std::string dummy = "";
115 return ( proxy == nullptr ? dummy : proxy->name() );
116#endif // XAOD_STANDALONE
117 }

◆ getProperty()

template<class T>
const T * asg::AsgTool::getProperty ( const std::string & name) const
inherited

Get one of the tool's properties.

◆ initialize()

StatusCode AsgForwardElectronCalibrationTool::initialize ( void )
overrideprivatevirtual

Gaudi Service Interface method implementations.

Reimplemented from asg::AsgTool.

Definition at line 59 of file AsgForwardElectronCalibrationTool.cxx.

60{
61 // Sanity checks
62 if (m_modelFiles.size() != 3) {
63 ATH_MSG_ERROR("Exactly 3 model files expected (one per eta bin): "
64 "[2.5,2.7], [2.7,3.2], [3.2,4.0]). Only got "
65 << m_modelFiles.size());
66 return StatusCode::FAILURE;
67 }
68
69 // Fixed variable names - must match the lwtnn JSON input
70 m_variables = {
71 // Calo eta and Phi
72 "x1_calo_eta",
73 "x2_calo_phi",
74 // ITk eta and Phi
75 "x3_track_eta",
76 "x4_track_phi",
77 // HGTD time
78 "x5_time",
79 // ITk hit counts
80 "x6_pixels",
81 "x7_strips",
82 // Shower shape moments
83 "x8_ENG_FRAC_MAX",
84 "x9_LONGITUDINAL",
85 "x10_SECOND_LAMBDA",
86 "x11_LATERAL",
87 "x12_SECOND_R",
88 "x13_CENTER_LAMBDA",
89 "x14_SECOND_ENG_DENS",
90 // Track-cluster matching variables
91 "x15_delta_eta2",
92 "x16_delta_phi2",
93 "x17_delta_phi_rescaled2",
94 "x18_delta_phi_last",
95 // Calo energy fractions in each layer
96 "x19_calo_frac_EM_1",
97 "x20_calo_frac_EM_2",
98 "x21_calo_frac_EM_3",
99 "x22_calo_frac_HAD_0",
100 "x23_calo_frac_HAD_1",
101 "x24_calo_frac_HAD_2",
102 "x25_calo_frac_HAD_3"
103 };
104 // More informations on Table 3 in Internal Note: https://cds.cern.ch/record/2922184
105
106 // Load one JSON per eta bin
107 m_graphs.reserve(3);
108 for (const auto& model : m_modelFiles) {
109 const std::string path = PathResolverFindCalibFile(model);
110 if (path.empty()) {
111 ATH_MSG_ERROR("Could not locate: " << model);
112 return StatusCode::FAILURE;
113 }
114 std::ifstream dnn_json(path);
115 auto parsed = lwt::parse_json_graph(dnn_json);
116 m_graphs.emplace_back(
117 std::make_unique<lwt::LightweightGraph>(parsed));
118 ATH_MSG_INFO("Loaded calibration model for bin "
119 << m_graphs.size() - 1 << ": " << path);
120 }
121
122 ATH_MSG_INFO("AsgForwardElectronCalibrationTool initialised");
123 return StatusCode::SUCCESS;
124}
#define ATH_MSG_INFO(x)
std::string PathResolverFindCalibFile(const std::string &logical_file_name)
Gaudi::Property< std::vector< std::string > > m_modelFiles
One lwtnn JSON file / DNN per eta bin.
path
python interpreter configuration --------------------------------------—
Definition athena.py:130

◆ inputHandles()

virtual std::vector< Gaudi::DataHandle * > AthCommonDataStore< AthCommonMsg< AlgTool > >::inputHandles ( ) const
overridevirtualinherited

Return this algorithm's input handles.

We override this to include handle instances from key arrays if they have not yet been declared. See comments on updateVHKA.

◆ msg()

MsgStream & AthCommonMsg< AlgTool >::msg ( ) const
inlineinherited

Definition at line 24 of file AthCommonMsg.h.

24 {
25 return this->msgStream();
26 }

◆ msg_level_name()

const std::string & asg::AsgTool::msg_level_name ( ) const
inherited

A deprecated function for getting the message level's name.

Instead of using this, weirdly named function, user code should get the string name of the current minimum message level (in case they really need it...), with:

MSG::name( msg().level() )

This function's name doesn't follow the ATLAS coding rules, and as such will be removed in the not too distant future.

Returns
The string name of the current minimum message level that's printed

Definition at line 101 of file AsgTool.cxx.

101 {
102
103 return MSG::name( msg().level() );
104 }
MsgStream & msg() const
const std::string & name(Level lvl)
Convenience function for translating message levels to strings.
Definition MsgLevel.cxx:19

◆ msgLvl()

bool AthCommonMsg< AlgTool >::msgLvl ( const MSG::Level lvl) const
inlineinherited

Definition at line 30 of file AthCommonMsg.h.

30 {
31 return this->msgLevel(lvl);
32 }

◆ outputHandles()

virtual std::vector< Gaudi::DataHandle * > AthCommonDataStore< AthCommonMsg< AlgTool > >::outputHandles ( ) const
overridevirtualinherited

Return this algorithm's output handles.

We override this to include handle instances from key arrays if they have not yet been declared. See comments on updateVHKA.

◆ print()

void asg::AsgTool::print ( ) const
virtualinherited

◆ renounce()

std::enable_if_t< std::is_void_v< std::result_of_t< decltype(&T::renounce)(T)> > &&!std::is_base_of_v< SG::VarHandleKeyArray, T > &&std::is_base_of_v< Gaudi::DataHandle, T >, void > AthCommonDataStore< AthCommonMsg< AlgTool > >::renounce ( T & h)
inlineprotectedinherited

Definition at line 380 of file AthCommonDataStore.h.

381 {
382 h.renounce();
384 }
std::enable_if_t< std::is_void_v< std::result_of_t< decltype(&T::renounce)(T)> > &&!std::is_base_of_v< SG::VarHandleKeyArray, T > &&std::is_base_of_v< Gaudi::DataHandle, T >, void > renounce(T &h)

◆ renounceArray()

void AthCommonDataStore< AthCommonMsg< AlgTool > >::renounceArray ( SG::VarHandleKeyArray & handlesArray)
inlineprotectedinherited

remove all handles from I/O resolution

Definition at line 364 of file AthCommonDataStore.h.

364 {
366 }

◆ softplus()

double AsgForwardElectronCalibrationTool::softplus ( double x) const
private

Sftplus: log(1 + exp(x)).

Definition at line 296 of file AsgForwardElectronCalibrationTool.cxx.

297{
298 // Avoids overflow for large x
299 return (x > 20.) ? x : std::log1p(std::exp(x));
300}
#define x

◆ sysInitialize()

virtual StatusCode AthCommonDataStore< AthCommonMsg< AlgTool > >::sysInitialize ( )
overridevirtualinherited

Perform system initialization for an algorithm.

We override this to declare all the elements of handle key arrays at the end of initialization. See comments on updateVHKA.

Reimplemented in asg::AsgMetadataTool, AthCheckedComponent< AthAlgTool >, AthCheckedComponent<::AthAlgTool >, and DerivationFramework::CfAthAlgTool.

◆ sysStart()

virtual StatusCode AthCommonDataStore< AthCommonMsg< AlgTool > >::sysStart ( )
overridevirtualinherited

Handle START transition.

We override this in order to make sure that conditions handle keys can cache a pointer to the conditions container.

◆ unscalePt()

double AsgForwardElectronCalibrationTool::unscalePt ( double x) const
private

Undo MinMax pT scaling used during training.

Definition at line 302 of file AsgForwardElectronCalibrationTool.cxx.

303{
304 // Inverse MinMaxScaler with feature_range=(0,1)
305 // Trained with:
306 // pTMin = 10 GeV
307 // pTMax = 255 GeV
308 return x * (m_pTMax - m_pTMin) + m_pTMin;
309}
Gaudi::Property< double > m_pTMin
pT scaling range used [MeV]

◆ updateVHKA()

void AthCommonDataStore< AthCommonMsg< AlgTool > >::updateVHKA ( Gaudi::Details::PropertyBase & )
inlineinherited

Definition at line 308 of file AthCommonDataStore.h.

308 {
309 // debug() << "updateVHKA for property " << p.name() << " " << p.toString()
310 // << " size: " << m_vhka.size() << endmsg;
311 for (auto &a : m_vhka) {
313 for (auto k : keys) {
314 k->setOwner(this);
315 }
316 }
317 }
std::vector< SG::VarHandleKeyArray * > m_vhka

◆ ~AsgForwardElectronCalibrationTool()

AsgForwardElectronCalibrationTool::~AsgForwardElectronCalibrationTool ( )
privatevirtualdefault

Standard constructor.

Standard destructor

Member Data Documentation

◆ m_detStore

StoreGateSvc_t AthCommonDataStore< AthCommonMsg< AlgTool > >::m_detStore
privateinherited

Pointer to StoreGate (detector store by default).

Definition at line 393 of file AthCommonDataStore.h.

◆ m_evtStore

StoreGateSvc_t AthCommonDataStore< AthCommonMsg< AlgTool > >::m_evtStore
privateinherited

Pointer to StoreGate (event store by default).

Definition at line 390 of file AthCommonDataStore.h.

◆ m_graphs

std::vector<std::unique_ptr<lwt::LightweightGraph> > AsgForwardElectronCalibrationTool::m_graphs
private

Definition at line 101 of file AsgForwardElectronCalibrationTool.h.

◆ m_modelFiles

Gaudi::Property<std::vector<std::string> > AsgForwardElectronCalibrationTool::m_modelFiles {this,"ModelFiles",{"","",""} , "lwtnn JSON files, one per eta bin (in eta order)"}
private

One lwtnn JSON file / DNN per eta bin.

Definition at line 100 of file AsgForwardElectronCalibrationTool.h.

100{this,"ModelFiles",{"","",""} , "lwtnn JSON files, one per eta bin (in eta order)"};

◆ m_pTMax

Gaudi::Property<double> AsgForwardElectronCalibrationTool::m_pTMax {this,"pTMax", 255000, "Lower bound of pT Max scaling [MeV]"}
private

Definition at line 97 of file AsgForwardElectronCalibrationTool.h.

97{this,"pTMax", 255000, "Lower bound of pT Max scaling [MeV]"};

◆ m_pTMin

Gaudi::Property<double> AsgForwardElectronCalibrationTool::m_pTMin {this,"pTMin", 10000, "Lower bound of pT Min scaling [MeV]"}
private

pT scaling range used [MeV]

Definition at line 96 of file AsgForwardElectronCalibrationTool.h.

96{this,"pTMin", 10000, "Lower bound of pT Min scaling [MeV]"};

◆ m_varHandleArraysDeclared

bool AthCommonDataStore< AthCommonMsg< AlgTool > >::m_varHandleArraysDeclared
privateinherited

Definition at line 399 of file AthCommonDataStore.h.

◆ m_variables

std::vector<std::string> AsgForwardElectronCalibrationTool::m_variables
private

Input variable names.

Definition at line 104 of file AsgForwardElectronCalibrationTool.h.

◆ m_vhka

std::vector<SG::VarHandleKeyArray*> AthCommonDataStore< AthCommonMsg< AlgTool > >::m_vhka
privateinherited

Definition at line 398 of file AthCommonDataStore.h.


The documentation for this class was generated from the following files: