9 #ifndef OnlineDQMDigiAD_cmssw_H_ 10 #define OnlineDQMDigiAD_cmssw_H_ 54 std::vector<std::vector<float>>
Inference(std::vector<float> &digiHcalMapTW,
56 std::vector<float> &adThr,
79 const std::vector<std::vector<float>> &digiHcal2DHist_depth_2,
80 const std::vector<std::vector<float>> &digiHcal2DHist_depth_3,
81 const std::vector<std::vector<float>> &digiHcal2DHist_depth_4,
82 const std::vector<std::vector<float>> &digiHcal2DHist_depth_5,
83 const std::vector<std::vector<float>> &digiHcal2DHist_depth_6,
84 const std::vector<std::vector<float>> &digiHcal2DHist_depth_7,
85 const float LS_numEvents,
86 const float flagDecisionThr = 20);
95 const std::vector<std::vector<float>> &ad_model_output_vectors,
const int selOutputIdx = 7);
109 "e_rnn_hidden__layer_0_state_0",
110 "e_rnn_hidden__layer_0_state_1",
111 "e_rnn_hidden__layer_1_state_0",
112 "e_rnn_hidden__layer_1_state_1",
113 "d_rnn_hidden__layer_0_state_0",
114 "d_rnn_hidden__layer_0_state_1",
115 "d_rnn_hidden__layer_1_state_0",
116 "d_rnn_hidden__layer_1_state_1",
124 "pred_err_window_spatial",
125 "pred_err_spatial_scaled",
126 "pred_err_window_spatial_scaled",
127 "pred_err_spatial_scaled_aml",
128 "pred_err_window_spatial_scaled_aml",
129 "e_rnn_hidden__layer_0_state_0_o",
130 "e_rnn_hidden__layer_0_state_1_o",
131 "e_rnn_hidden__layer_1_state_0_o",
132 "e_rnn_hidden__layer_1_state_1_o",
133 "d_rnn_hidden__layer_0_state_0_o",
134 "d_rnn_hidden__layer_0_state_1_o",
135 "d_rnn_hidden__layer_1_state_0_o",
136 "d_rnn_hidden__layer_1_state_1_o",
143 {128, 32}, {128, 640}};
174 std::vector<std::vector<float>>
Map1DTo2DVector(
const std::vector<float> &input_1d_vec,
const int numSplits);
183 #endif // OnlineDQMDigiAD_cmssw_H_ std::vector< float > input_model_state_memory_e_0_0
std::vector< std::vector< std::vector< float > > > ONNXOutputToDQMHistMap(const std::vector< std::vector< float >> &ad_model_output_vectors, const int selOutputIdx=7)
Converts 1D serialized vector output of the onnx into 3d hcal-hehp vector.
const std::vector< std::string > output_names
std::vector< std::vector< float > > Inference_CMSSW(const std::vector< std::vector< float >> &digiHcal2DHist_depth_1, const std::vector< std::vector< float >> &digiHcal2DHist_depth_2, const std::vector< std::vector< float >> &digiHcal2DHist_depth_3, const std::vector< std::vector< float >> &digiHcal2DHist_depth_4, const std::vector< std::vector< float >> &digiHcal2DHist_depth_5, const std::vector< std::vector< float >> &digiHcal2DHist_depth_6, const std::vector< std::vector< float >> &digiHcal2DHist_depth_7, const float LS_numEvents, const float flagDecisionThr=20)
Perform inference on a single image.
std::vector< std::vector< float > > Map1DTo2DVector(const std::vector< float > &input_1d_vec, const int numSplits)
Converts serialized 1d vectors into 2d.
std::vector< std::vector< float > > Inference(std::vector< float > &digiHcalMapTW, std::vector< float > &numEvents, std::vector< float > &adThr, std::vector< float > &input_model_state_memory_e_0_0, std::vector< float > &input_model_state_memory_e_0_1, std::vector< float > &input_model_state_memory_e_1_0, std::vector< float > &input_model_state_memory_e_1_1, std::vector< float > &input_model_state_memory_d_0_0, std::vector< float > &input_model_state_memory_d_0_1, std::vector< float > &input_model_state_memory_d_1_0, std::vector< float > &input_model_state_memory_d_1_1)
Perform inference on a single image.
unsigned model_state_refresh_counter
std::vector< float > input_model_state_memory_e_1_0
OnlineDQMDigiAD(const std::string model_system_name, const std::string &modelFilepath, cms::Ort::Backend backend=cms::Ort::Backend::cpu)
Constructor.
const std::vector< std::vector< unsigned int > > model_state_layer_serialized_dims
std::vector< float > input_model_state_memory_d_1_1
const size_t num_state_vectors
std::string hcal_subsystem_name
const unsigned int model_state_inner_dim
std::vector< std::vector< float > > input_values
std::vector< float > input_model_state_memory_d_0_0
void InitializeState()
Resets ml model memory states to default and function needs to be called when new collision run start...
std::vector< std::vector< float > > output_values
std::vector< float > input_model_state_memory_d_0_1
const std::vector< std::string > hcal_modeled_systems
std::unique_ptr< cms::Ort::ONNXRuntime > ort_mSession
const std::vector< std::string > input_names
std::vector< float > input_model_state_memory_e_1_1
std::vector< float > PrepareONNXDQMMapVectors(std::vector< std::vector< std::vector< float >>> &digiHcal2DHist_depth_all)
Prepares model input serialized dqm histogram from 2D histogram inputs from the cmssw.
void IsModelExist(std::string hcal_subsystem_name)
check whether onnx model integration is added for the selected hcal system
std::vector< std::vector< int64_t > > input_shapes
std::vector< float > input_model_state_memory_e_0_1
const std::vector< std::vector< unsigned int > > model_state_layer_dims
std::vector< float > input_model_state_memory_d_1_0
std::vector< float > Serialize2DVector(const std::vector< std::vector< float >> &input_2d_vec)
Serializes 2d vectors into 1d.