ATLAS Offline Software
Loading...
Searching...
No Matches
egammaMVACalibTool.h
Go to the documentation of this file.
1/*
2 Copyright (C) 2002-2025 CERN for the benefit of the ATLAS collaboration
3*/
4
5#ifndef EGAMMAMVACALIB_EGAMMAMVACALIBTOOL_H
6#define EGAMMAMVACALIB_EGAMMAMVACALIBTOOL_H
7
8// Package includes
11#include "MVAUtils/BDT.h"
13
14// Framework includes
15#include "AsgTools/AsgTool.h"
17
18//Root includes
19#include "TH2Poly.h"
20#include "TObject.h"
21#include "TString.h"
22#include "TFormula.h"
23
24// STL includes
25#include <string>
26#include <memory>
27#include <functional>
28
30struct Funcs;
31}
32
33
69
72public:
73 egammaMVACalibTool(const std::string& type);
74 virtual ~egammaMVACalibTool() override;
75
76 virtual StatusCode initialize() override;
77
83
88
90 float getEnergy(const xAOD::CaloCluster& clus,
91 const xAOD::Egamma* eg,
93 const override final;
94
98 "What type of particle do we use"};
99
100 Gaudi::Property<int> m_shiftType {this,
101 "ShiftType", MEAN10TOTRUE,
102 "Shift corrections to apply to value"};
103
104 Gaudi::Property<int> m_calibrationType {this,
105 "CalibrationType", correctEaccordion,
106 "What type of calibration to apply"};
107
108 Gaudi::Property<bool> m_clusterEif0 {this,
109 "useClusterIf0", true,
110 "Use cluster energy if MVA response is 0"};
111
113 Gaudi::Property<std::string> m_folder {this,
114 "folder", "",
115 "string with folder for weight files"};
116
117 Gaudi::Property<bool> m_useLayerCorrected {this,
118 "use_layer_corrected", false,
119 "whether to use layer corrections"};
120
122 std::unique_ptr<TH2Poly> m_hPoly;
123
125 std::vector<MVAUtils::BDT> m_BDTs;
126
128 // (Need to hide this type to avoid a cling bug:
129 // https://github.com/root-project/root/issues/18833)
130 std::unique_ptr<egammaMVACalibTool_detail::Funcs> m_funcs;
131
133 std::vector<TFormula> m_shifts;
134
136 StatusCode setupBDT(const egammaMVAFunctions::funcMap_t& funcLibrary,
137 const std::string& fileName);
138
140 static const TString& getString(TObject* obj) ;
141
142};
143
144#endif
#define ASG_TOOL_CLASS(CLASSNAME, INT1)
A tool used by the egammaMVASvc to help manage the MVAs.
Support class for PropertyMgr.
Definition Property.h:23
Base class for the dual-use tool implementation classes.
Definition AsgTool.h:47
Gaudi::Property< std::string > m_folder
string with folder for weight files
float getEnergy(const xAOD::CaloCluster &clus, const xAOD::Egamma *eg, const egammaMVACalib::GlobalEventInfo &gei=egammaMVACalib::GlobalEventInfo()) const override final
returns the calibrated energy
Gaudi::Property< bool > m_clusterEif0
virtual StatusCode initialize() override
Dummy implementation of the initialisation function.
std::vector< TFormula > m_shifts
shifts formulas
egammaMVACalibTool(const std::string &type)
Gaudi::Property< bool > m_useLayerCorrected
StatusCode setupBDT(const egammaMVAFunctions::funcMap_t &funcLibrary, const std::string &fileName)
a function called by initialize to setup the BDT, funcs, and shifts.
std::unique_ptr< egammaMVACalibTool_detail::Funcs > m_funcs
where the pointers to the funcs to calculate the vars per BDT
CalibrationType
how the output of the BDT is used correctEaccordion: energy = raw energy * BDT fullCalibration: energ...
Gaudi::Property< int > m_calibrationType
Gaudi::Property< int > m_shiftType
virtual ~egammaMVACalibTool() override
std::unique_ptr< TH2Poly > m_hPoly
A TH2Poly used to extract bin numbers. Note there is an offset of 1.
ShiftType
shift to be applied after the BDT.
Gaudi::Property< int > m_particleType
std::vector< MVAUtils::BDT > m_BDTs
Where the BDTs are stored.
static const TString & getString(TObject *obj)
a utility to get a TString out of an TObjString pointer
=============================================================================
std::unordered_map< std::string, std::function< float(const xAOD::Egamma *, const xAOD::CaloCluster *)> > funcMap_t
Define the map type since it's long.
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.
#define private