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

#include <PFEnergyPredictorTool.h>

Inheritance diagram for PFEnergyPredictorTool:
Collaboration diagram for PFEnergyPredictorTool:

Public Member Functions

 PFEnergyPredictorTool (const std::string &type, const std::string &name, const IInterface *parent)
virtual StatusCode initialize () override
virtual StatusCode finalize () override
float runOnnxInference (std::vector< float > &tensor) const
float nnEnergyPrediction (const eflowRecTrack *ptr) const
void NormalizeTensor (std::vector< float > &tensor, size_t limit) const
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

Static Public Member Functions

static const InterfaceID & interfaceID ()

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

Gaudi::Details::PropertyBase & declareGaudiProperty (Gaudi::Property< T, V, H > &hndl, const SG::VarHandleKeyType &)
 specialization for handling Gaudi::Property<SG::VarHandleKey>

Private Attributes

std::unique_ptr< Ort::Session > m_session ATLAS_THREAD_SAFE
std::vector< const char * > m_input_node_names
std::vector< const char * > m_output_node_names
std::vector< int64_t > m_input_node_dims
ServiceHandle< AthOnnx::IOnnxRuntimeSvcm_svc {this, "ONNXRuntimeSvc", "AthOnnx::OnnxRuntimeSvc", "CaloMuonScoreTool ONNXRuntimeSvc"}
Gaudi::Property< std::string > m_model_filepath {this, "ModelPath", "////"}
Gaudi::Property< float > m_cellE_mean {this,"cellE_mean",-2.2852574689444385}
 Normalization constants for the inputs to the onnx model.
Gaudi::Property< float > m_cellE_std {this,"cellE_std",2.0100506557174946}
Gaudi::Property< float > m_cellPhi_std {this,"cellPhi_std",0.6916977411859621}
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

Definition at line 16 of file PFEnergyPredictorTool.h.

Member Typedef Documentation

◆ StoreGateSvc_t

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

Definition at line 388 of file AthCommonDataStore.h.

Constructor & Destructor Documentation

◆ PFEnergyPredictorTool()

PFEnergyPredictorTool::PFEnergyPredictorTool ( const std::string & type,
const std::string & name,
const IInterface * parent )

Definition at line 12 of file PFEnergyPredictorTool.cxx.

12 : AthAlgTool(type, name, parent)
13{
14
15}
AthAlgTool()
Default constructor:

Member Function Documentation

◆ 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

◆ finalize()

StatusCode PFEnergyPredictorTool::finalize ( )
overridevirtual

Definition at line 321 of file PFEnergyPredictorTool.cxx.

322{
323 return StatusCode::SUCCESS;
324}

◆ initialize()

StatusCode PFEnergyPredictorTool::initialize ( )
overridevirtual

Definition at line 18 of file PFEnergyPredictorTool.cxx.

19{
20 ATH_MSG_DEBUG("Initializing " << name());
21 if(m_model_filepath == "////"){
22 ATH_MSG_WARNING("model not provided tool will not work");
23 return StatusCode::SUCCESS;
24 }
25 ATH_CHECK(m_svc.retrieve());
26 std::string path = m_model_filepath;//Add path resolving code
27
28 Ort::SessionOptions session_options;
29 Ort::AllocatorWithDefaultOptions allocator;
30 session_options.SetIntraOpNumThreads(1);
31 session_options.SetGraphOptimizationLevel(ORT_ENABLE_BASIC);
32 m_session = std::make_unique<Ort::Session>(m_svc->env(), path.c_str(), session_options);
33
34 ATH_MSG_INFO("Created ONNX runtime session with model " << path);
35
36 size_t num_input_nodes = m_session->GetInputCount();
37 m_input_node_names.resize(num_input_nodes);
38
39 for (std::size_t i = 0; i < num_input_nodes; i++) {
40 // print input node names
41 char* input_name = m_session->GetInputNameAllocated(i, allocator).release();
42 ATH_MSG_INFO("Input " << i << " : "
43 << " name= " << input_name);
44 m_input_node_names[i] = input_name;
45 // print input node types
46 Ort::TypeInfo type_info = m_session->GetInputTypeInfo(i);
47 auto tensor_info = type_info.GetTensorTypeAndShapeInfo();
48 ONNXTensorElementDataType type = tensor_info.GetElementType();
49 ATH_MSG_INFO("Input " << i << " : "
50 << " type= " << type);
51
52 // print input shapes/dims
53 m_input_node_dims = tensor_info.GetShape();
54 m_input_node_dims[1] = 5430/5;
55 ATH_MSG_INFO("Input " << i << " : num_dims= " << m_input_node_dims.size());
56 for (std::size_t j = 0; j < m_input_node_dims.size(); j++) {
57 if (m_input_node_dims[j] < 0) m_input_node_dims[j] = 1;
58 ATH_MSG_INFO("Input " << i << " : dim " << j << "= " << m_input_node_dims[j]);
59 }
60 }
61
62 // output nodes
63 std::vector<int64_t> output_node_dims;
64 size_t num_output_nodes = m_session->GetOutputCount();
65 ATH_MSG_INFO("Have output nodes " << num_output_nodes);
66 m_output_node_names.resize(num_output_nodes);
67
68 for (std::size_t i = 0; i < num_output_nodes; i++) {
69 // print output node names
70 char* output_name = m_session->GetOutputNameAllocated(i, allocator).release();
71 ATH_MSG_INFO("Output " << i << " : "
72 << " name= " << output_name);
73 m_output_node_names[i] = output_name;
74
75 Ort::TypeInfo type_info = m_session->GetOutputTypeInfo(i);
76 auto tensor_info = type_info.GetTensorTypeAndShapeInfo();
77 ONNXTensorElementDataType type = tensor_info.GetElementType();
78 ATH_MSG_INFO("Output " << i << " : "
79 << " type= " << type);
80
81 // print output shapes/dims
82 output_node_dims = tensor_info.GetShape();
83 ATH_MSG_INFO("Output " << i << " : num_dims= " << output_node_dims.size());
84 for (std::size_t j = 0; j < output_node_dims.size(); j++) {
85 if (output_node_dims[j] < 0) output_node_dims[j] = 1;
86 ATH_MSG_INFO("Output" << i << " : dim " << j << "= " << output_node_dims[j]);
87 }
88 }
89
90 return StatusCode::SUCCESS;
91}
#define ATH_CHECK
Evaluate an expression and check for errors.
#define ATH_MSG_INFO(x)
#define ATH_MSG_WARNING(x)
#define ATH_MSG_DEBUG(x)
std::vector< const char * > m_input_node_names
Gaudi::Property< std::string > m_model_filepath
std::vector< const char * > m_output_node_names
std::vector< int64_t > m_input_node_dims
ServiceHandle< AthOnnx::IOnnxRuntimeSvc > m_svc
float j(const xAOD::IParticle &, const xAOD::TrackMeasurementValidation &hit, const Eigen::Matrix3d &jab_inv)
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.

◆ interfaceID()

const InterfaceID & PFEnergyPredictorTool::interfaceID ( )
inlinestatic

Definition at line 49 of file PFEnergyPredictorTool.h.

static const InterfaceID IID_PFEnergyPredictorTool("PFEnergyPredictorTool", 1, 0)

◆ msg()

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

Definition at line 24 of file AthCommonMsg.h.

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

◆ 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 }

◆ nnEnergyPrediction()

float PFEnergyPredictorTool::nnEnergyPrediction ( const eflowRecTrack * ptr) const

Definition at line 132 of file PFEnergyPredictorTool.cxx.

132 {
133
134 constexpr std::array<int,19> calo_numbers{1,2,3,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20};
135 constexpr std::array<int,12> fixed_r_numbers = {1,2,3,12,13,14,15,16,17,18,19,20};
136 constexpr std::array<double,12> fixed_r_vals = {1532.18, 1723.89, 1923.02, 2450.00, 2995.00, 3630.00, 3215.00,
137 3630.00, 2246.50, 2450.00, 2870.00, 3480.00
138 };
139 constexpr std::array<int, 7> fixed_z_numbers = {5,6,7,8,9,10,11};
140 constexpr std::array<double, 7> fixed_z_vals = {3790.03, 3983.68, 4195.84, 4461.25, 4869.50, 5424.50, 5905.00};
141 std::unordered_map<int, double> r_calo_dict;//change to flatmap in c++23
142 std::unordered_map<int, double> z_calo_dict;
143 for(size_t i=0; i<fixed_r_vals.size(); i++) r_calo_dict[fixed_r_numbers[i]] = fixed_r_vals[i];
144 for(size_t i=0; i<fixed_z_numbers.size(); i++) z_calo_dict[fixed_z_numbers[i]] = fixed_z_vals[i];
145
146 std::vector<float> inputnn;
147 inputnn.assign(5430, 0.0);
148 std::vector<eflowRecCluster*> matchedClusters;
149 const std::vector<eflowTrackClusterLink*>& links = ptr->getClusterMatches();
150
151 std::array<double, 19> etatotal = getEtaTrackCalo(ptr->getTrackCaloPoints());
152 std::array<double, 19> phitotal = getPhiTrackCalo(ptr->getTrackCaloPoints());
153
154 const std::array<double, 2> track{ptr->getTrack()->eta(), ptr->getTrack()->phi()};
155
156 for(auto *clink : links){
157 auto *cell = clink->getCluster()->getCluster();
158 float clusterE = cell->e()*1e-3;
159 float clusterEta = cell->eta();
160
161 if (clusterE < 0.0 || clusterE > 1e4f || std::abs(clusterEta) > 2.5) continue;
162
163 constexpr bool cutOnR = false;
164 if(cutOnR){
165 std::array<double, 2> p{clink->getCluster()->getCluster()->eta(), clink->getCluster()->getCluster()->phi()};
166 double part1 = p[0] - track[0];
167 double part2 = p[1] - track[1];
168 while(part1 > M_PI) part1 -= 2*M_PI;
169 while(part1 < -M_PI) part1 += 2*M_PI;
170 while(part2 > M_PI) part2 -= 2*M_PI;
171 while(part2 < -M_PI) part2 += 2*M_PI;
172 double R = std::sqrt(part1 * part1 + part2*part2);
173 if(R >= 1.2) continue;
174 }
175
176 matchedClusters.push_back(clink->getCluster());
177 }
178
179 std::vector<std::array<double, 5>> cells;
180
181 const eflowTrackCaloPoints& trackCaloPoints = ptr->getTrackCaloPoints();
182 bool trk_bool_em[2] = {false,false};
183 std::array<double,2> trk_em_eta = {trackCaloPoints.getEta(eflowCalo::EMB2), trackCaloPoints.getEta(eflowCalo::EME2)};
184 std::array<double,2> trk_em_phi = {trackCaloPoints.getPhi(eflowCalo::EMB2), trackCaloPoints.getPhi(eflowCalo::EME2)};
185 double eta_ctr;
186 double phi_ctr;
187 for(int i =0; i<2; i++) {
188 trk_bool_em[i] = std::abs(trk_em_eta[i]) < 2.5 && std::abs(trk_em_phi[i]) <= M_PI;
189 }
190 int nProj_em = (int)trk_bool_em[0] + (int)trk_bool_em[1];
191
192 if(nProj_em ==1) {
193 eta_ctr = trk_bool_em[0] ? trk_em_eta[0] : trk_em_eta[1];
194 phi_ctr = trk_bool_em[0] ? trk_em_phi[0] : trk_em_phi[1];
195 } else if(nProj_em==2) {
196 eta_ctr = (trk_em_eta[0] + trk_em_eta[1]) / 2.0;
197 phi_ctr = (trk_em_phi[0] + trk_em_phi[1]) / 2.0;
198 } else {
199 eta_ctr = ptr->getTrack()->eta();
200 phi_ctr = ptr->getTrack()->phi();
201 }
202
203
204
205 for(auto *cptr : matchedClusters){
206 auto *clustlink = cptr->getCluster();
207
208 for(auto it_cell = clustlink->cell_begin(); it_cell != clustlink->cell_end(); it_cell++){
209 const CaloCell* cell = (*it_cell);
210 float cellE = cell->e()*(it_cell.weight())*1e-3f;
211 if(cellE < 0.005) continue;//Cut from ntuple maker
212 const auto *theDDE=it_cell->caloDDE();
213 double cx=theDDE->x();
214 double cy=theDDE->y();
215
216 cells.emplace_back( std::array<double, 5> { cellE,
217 theDDE->eta() - eta_ctr,
218 theDDE->phi() - phi_ctr,
219 std::hypot(cx,cy), //rperp
220 0.0 } );
221 }
222 }
223
224
225 std::vector<bool> trk_bool(calo_numbers.size(), false);
226 std::vector<std::array<double,4>> trk_full(calo_numbers.size());
227 for(size_t j=0; j<phitotal.size(); j++) {
228 int cnum = calo_numbers[j];
229 double eta = etatotal[j];
230 double phi = phitotal[j];
231 if(std::abs(eta) < 2.5 && std::abs(phi) <= M_PI) {
232 trk_bool[j] = true;
233 trk_full[j][0] = eta;
234 trk_full[j][1] = phi;
235 trk_full[j][3] = cnum;
236 double rPerp =-99999;
237 if(auto itr = r_calo_dict.find(cnum); itr != r_calo_dict.end()) rPerp = itr->second;
238 else if(auto itr = z_calo_dict.find(cnum); itr != z_calo_dict.end())
239 {
240 double z = itr->second;
241 if(eta != 0.0){
242 double aeta = std::abs(eta);
243 rPerp = z*2.*std::exp(aeta)/(std::exp(2.0*aeta)-1.0);
244 }else rPerp =0.0; //Check if this makes sense
245 } else {
246 throw std::runtime_error("Calo sample num not found in dicts..");
247 }
248 trk_full[j][2] = rPerp;
249 } else {
250 trk_full[j].fill(0.0);
251 }
252 }
253 double trackP = std::abs(1. / ptr->getTrack()->qOverP()) * 1e-3;
254 int trk_proj_num = std::accumulate(trk_bool.begin(), trk_bool.end(), 0);
255 if(trk_proj_num ==0) {
256 trk_proj_num =1;
257 std::array<double,5> trk_arr{};
258
259 trk_arr[0] = trackP;
260 trk_arr[1] = ptr->getTrack()->eta() - eta_ctr;
261 trk_arr[2] = ptr->getTrack()->phi() - phi_ctr;
262 trk_arr[3] = 1532.18; // just place it in EMB1
263 trk_arr[4] = 1.;
264
265 cells.emplace_back(trk_arr);
266 } else {
267 for(size_t i =0; i<calo_numbers.size(); i++) {
268 if(!trk_bool[i]) continue;
269 std::array<double,5> trk_arr{};
270 trk_arr[0]= trackP/double(trk_proj_num);
271 trk_arr[1]= trk_full[i][0] - eta_ctr;
272 trk_arr[2]= trk_full[i][1] - phi_ctr;
273 trk_arr[3]= trk_full[i][2];
274 trk_arr[4]= 1.;
275
276 cells.emplace_back(trk_arr);
277 }
278 }
279
280 int index = 0;
281 for(auto &in : cells){
282 std::copy(in.begin(), in.end(), inputnn.begin() + index);
283 index+=5;
284 if(index >= static_cast<int>(inputnn.size()-4)) {
285 ATH_MSG_WARNING("Data exceeded tensor size");
286 break;
287 }
288 }
289
290 //Normalization prior to training
291 NormalizeTensor(inputnn, cells.size() * 5 );
292
293 float predictedEnergy = exp(runOnnxInference(inputnn)) * 1000.0;//Correct to MeV units
294 ATH_MSG_DEBUG("NN Predicted energy " << predictedEnergy);
295 return predictedEnergy;
296
297}
#define M_PI
Scalar eta() const
pseudorapidity method
Scalar phi() const
phi method
std::array< double, 19 > getPhiTrackCalo(const eflowTrackCaloPoints &trackCaloPoints)
std::array< double, 19 > getEtaTrackCalo(const eflowTrackCaloPoints &trackCaloPoints)
#define z
void NormalizeTensor(std::vector< float > &tensor, size_t limit) const
float runOnnxInference(std::vector< float > &tensor) const
double getPhi(eflowCalo::LAYER layer) const
double getEta(eflowCalo::LAYER layer) const
double R(const INavigable4Momentum *p1, const double v_eta, const double v_phi)
str index
Definition DeMoScan.py:362
void * ptr(T *p)
Definition SGImplSvc.cxx:74

◆ NormalizeTensor()

void PFEnergyPredictorTool::NormalizeTensor ( std::vector< float > & tensor,
size_t limit ) const

Definition at line 299 of file PFEnergyPredictorTool.cxx.

299 {
300 size_t i=0;
301 for(i =0;i<limit;i+=5){
302 auto &f = inputnn[i+3];
303 if(f!= 0.0f) f/= 3630.f;
304 auto &e = inputnn[i+0];
305 if(e!= 0.0f){
306 e = std::log(e);
308 }
309 auto &eta = inputnn[i+1];
310 if(eta!= 0.0) eta /= 0.7f;
311 auto &phi = inputnn[i+2];
312 if(phi!= 0.0) phi /= m_cellPhi_std;
313 }
314 if(i> inputnn.size()){
315 ATH_MSG_ERROR("Index exceeded tensor MEMORY CORRUPTION");
316 }
317}
#define ATH_MSG_ERROR(x)
Gaudi::Property< float > m_cellE_std
Gaudi::Property< float > m_cellPhi_std
Gaudi::Property< float > m_cellE_mean
Normalization constants for the inputs to the onnx model.

◆ 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.

◆ 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 }

◆ runOnnxInference()

float PFEnergyPredictorTool::runOnnxInference ( std::vector< float > & tensor) const

Definition at line 93 of file PFEnergyPredictorTool.cxx.

93 {
94 auto memory_info = Ort::MemoryInfo::CreateCpu(OrtArenaAllocator, OrtMemTypeDefault);
95 auto input_tensor_size = tensor.size();
96
97 Ort::Value input_tensor =
98 Ort::Value::CreateTensor<float>(memory_info, tensor.data(), input_tensor_size,
100
101 auto output_tensors = m_session->Run(Ort::RunOptions{nullptr}, m_input_node_names.data(), &input_tensor, m_input_node_names.size(),
103
104 const float *output_score_array = output_tensors.front().GetTensorData<float>();
105
106 // Binary classification - the score is just the first element of the output tensor
107 float output_score = output_score_array[0];
108
109 return output_score;
110}

◆ 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.

◆ 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

Member Data Documentation

◆ ATLAS_THREAD_SAFE

std::unique_ptr<Ort::Session> m_session PFEnergyPredictorTool::ATLAS_THREAD_SAFE
private

Definition at line 32 of file PFEnergyPredictorTool.h.

◆ m_cellE_mean

Gaudi::Property<float> PFEnergyPredictorTool::m_cellE_mean {this,"cellE_mean",-2.2852574689444385}
private

Normalization constants for the inputs to the onnx model.

Definition at line 43 of file PFEnergyPredictorTool.h.

43{this,"cellE_mean",-2.2852574689444385};

◆ m_cellE_std

Gaudi::Property<float> PFEnergyPredictorTool::m_cellE_std {this,"cellE_std",2.0100506557174946}
private

Definition at line 44 of file PFEnergyPredictorTool.h.

44{this,"cellE_std",2.0100506557174946};

◆ m_cellPhi_std

Gaudi::Property<float> PFEnergyPredictorTool::m_cellPhi_std {this,"cellPhi_std",0.6916977411859621}
private

Definition at line 45 of file PFEnergyPredictorTool.h.

45{this,"cellPhi_std",0.6916977411859621};

◆ 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_input_node_dims

std::vector<int64_t> PFEnergyPredictorTool::m_input_node_dims
private

Definition at line 38 of file PFEnergyPredictorTool.h.

◆ m_input_node_names

std::vector<const char *> PFEnergyPredictorTool::m_input_node_names
private

Definition at line 34 of file PFEnergyPredictorTool.h.

◆ m_model_filepath

Gaudi::Property<std::string> PFEnergyPredictorTool::m_model_filepath {this, "ModelPath", "////"}
private

Definition at line 40 of file PFEnergyPredictorTool.h.

40{this, "ModelPath", "////"};

◆ m_output_node_names

std::vector<const char *> PFEnergyPredictorTool::m_output_node_names
private

Definition at line 36 of file PFEnergyPredictorTool.h.

◆ m_svc

ServiceHandle<AthOnnx::IOnnxRuntimeSvc> PFEnergyPredictorTool::m_svc {this, "ONNXRuntimeSvc", "AthOnnx::OnnxRuntimeSvc", "CaloMuonScoreTool ONNXRuntimeSvc"}
private

Definition at line 39 of file PFEnergyPredictorTool.h.

39{this, "ONNXRuntimeSvc", "AthOnnx::OnnxRuntimeSvc", "CaloMuonScoreTool ONNXRuntimeSvc"};

◆ m_varHandleArraysDeclared

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

Definition at line 399 of file AthCommonDataStore.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: