ATLAS Offline Software
Loading...
Searching...
No Matches
TFCSMLCalorimeterSimulator.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 ISF_TFCSMLCALORIMETERSIMULATOR_H
6#define ISF_TFCSMLCALORIMETERSIMULATOR_H
7
8// ISF includes
9#include <map>
10#include <vector>
11#include <string>
12#include <fstream>
13
16
17// generic network class
19
20
21
22
24public:
27
28 typedef struct {
29 std::vector<unsigned int> bin_index_vector;
30 std::vector<float> E_vector;
31 } layer_t;
32
33 typedef struct {
34 std::vector<layer_t> event_data;
35 } event_t;
36
37 bool loadSimulator(std::string& filename);
38
39 void Print() const;
40
41 VNetworkBase::NetworkOutputs predictVoxels(TFCSSimulationState &simulstate, float eta, float energy) const;
42 event_t getEvent(TFCSSimulationState &simulstate, float eta, float energy) const;
44
45 void setInputShapes(std::vector<long unsigned int>& layer_boundaries, std::vector<long unsigned int>& used_layers) {
46 m_layer_boundaries = layer_boundaries;
47 m_used_layers = used_layers;
48 m_nVoxels = layer_boundaries.back();
49 m_nLayers = used_layers.size();
50 };
51
52private:
53
54 std::unique_ptr<VNetworkBase> m_onnx_model = nullptr;
55
56 int m_nEvents = 1; // Currently no batching supported from ONNX handler
57
58 // Default shapes for the photon barrel-CFM
59 // Should be set using setInputShapes for other models
60 std::vector<long unsigned int> m_layer_boundaries = {0, 36, 200, 310, 346, 382};
61 std::vector<long unsigned int> m_used_layers = {0, 1, 2, 3, 12};
62 long unsigned int m_nVoxels = 382;
63 long unsigned int m_nLayers= 5;
64
65
66 ClassDef(TFCSMLCalorimeterSimulator, 1) // TFCSMLCalorimeterSimulator
67};
68
69#endif //> !ISF_TFCSMLCALORIMETERSIMULATOR_H
Scalar eta() const
pseudorapidity method
Cut down AthMessaging.
Definition MLogging.h:176
VNetworkBase::NetworkOutputs predictVoxels() const
std::unique_ptr< VNetworkBase > m_onnx_model
void setInputShapes(std::vector< long unsigned int > &layer_boundaries, std::vector< long unsigned int > &used_layers)
event_t getEvent(TFCSSimulationState &simulstate, float eta, float energy) const
bool loadSimulator(std::string &filename)
std::vector< long unsigned int > m_used_layers
std::vector< long unsigned int > m_layer_boundaries
std::map< std::string, double > NetworkOutputs
Format for network outputs.