CMS 3D CMS Logo

List of all members | Public Member Functions | Private Member Functions | Private Attributes
OnlineDQMDigiAD Class Reference

#include <OnlineDQMDigiAD_cmssw.h>

Public Member Functions

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. More...
 
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. More...
 
void InitializeState ()
 Resets ml model memory states to default and function needs to be called when new collision run starts. More...
 
void IsModelExist (std::string hcal_subsystem_name)
 check whether onnx model integration is added for the selected hcal system More...
 
 OnlineDQMDigiAD (const std::string model_system_name, const std::string &modelFilepath, cms::Ort::Backend backend=cms::Ort::Backend::cpu)
 Constructor. More...
 
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. More...
 

Private Member Functions

std::vector< std::vector< float > > Map1DTo2DVector (const std::vector< float > &input_1d_vec, const int numSplits)
 Converts serialized 1d vectors into 2d. More...
 
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. More...
 
std::vector< float > Serialize2DVector (const std::vector< std::vector< float >> &input_2d_vec)
 Serializes 2d vectors into 1d. More...
 

Private Attributes

int64_t batch_size = 1
 
const std::vector< std::string > hcal_modeled_systems = {"he", "hb"}
 
std::string hcal_subsystem_name
 
std::vector< float > input_model_state_memory_d_0_0 {std::vector<float>(model_state_layer_serialized_dims[1][0])}
 
std::vector< float > input_model_state_memory_d_0_1 {std::vector<float>(model_state_layer_serialized_dims[1][0])}
 
std::vector< float > input_model_state_memory_d_1_0 {std::vector<float>(model_state_layer_serialized_dims[1][1])}
 
std::vector< float > input_model_state_memory_d_1_1 {std::vector<float>(model_state_layer_serialized_dims[1][1])}
 
std::vector< float > input_model_state_memory_e_0_0 {std::vector<float>(model_state_layer_serialized_dims[0][0])}
 
std::vector< float > input_model_state_memory_e_0_1 {std::vector<float>(model_state_layer_serialized_dims[0][0])}
 
std::vector< float > input_model_state_memory_e_1_0 {std::vector<float>(model_state_layer_serialized_dims[0][1])}
 
std::vector< float > input_model_state_memory_e_1_1 {std::vector<float>(model_state_layer_serialized_dims[0][1])}
 
const std::vector< std::string > input_names
 
std::vector< std::vector< int64_t > > input_shapes
 
std::vector< std::vector< float > > input_values
 
std::string model_path
 
const unsigned int model_state_inner_dim = 2
 
const std::vector< std::vector< unsigned int > > model_state_layer_dims
 
const std::vector< std::vector< unsigned int > > model_state_layer_serialized_dims
 
unsigned model_state_refresh_counter
 
const size_t num_state_vectors = 8
 
std::unique_ptr< cms::Ort::ONNXRuntimeort_mSession = nullptr
 
const std::vector< std::string > output_names
 
std::vector< std::vector< float > > output_values
 

Detailed Description

Definition at line 24 of file OnlineDQMDigiAD_cmssw.h.

Constructor & Destructor Documentation

◆ OnlineDQMDigiAD()

OnlineDQMDigiAD::OnlineDQMDigiAD ( const std::string  model_system_name,
const std::string &  modelFilepath,
cms::Ort::Backend  backend = cms::Ort::Backend::cpu 
)

Constructor.

Parameters
modelFilepathpath to the .onnx file
Backendbackend selection cpu or gpu

Definition at line 32 of file OnlineDQMDigiAD_cmssw.cc.

References jetsAK4_CHS_cff::backend, cms::Ort::ONNXRuntime::defaultSessionOptions(), edm::FileInPath::fullPath(), HLT_2023v12_cff::model_path, eostools::move(), and AlCaHLTBitMon_QueryRunRegistry::string.

34  {
35  std::string instanceName{"DESMOD Digioccupancy Map AD inference"};
36 
37  /**************** Initailize Model Memory States ******************/
38  InitializeState(); // initailize model memory states to zero
39 
40  /**************** Create ORT session ******************/
41  // Set up options for session
42  auto session_options = ONNXRuntime::defaultSessionOptions(backend);
43  // Create session by loading the onnx model
44  model_path = edm::FileInPath(modelFilepath).fullPath();
45  auto uOrtSession = std::make_unique<ONNXRuntime>(model_path, &session_options);
46  ort_mSession = std::move(uOrtSession);
47 
48  // check model availability
49  hcal_subsystem_name = model_system_name;
50 
51  IsModelExist(hcal_subsystem_name); // assert model integration for the given hcal system name
52 
53  if (hcal_subsystem_name == "he") {
54  std::vector<std::vector<int64_t>> input_shapes_ = {
55  {batch_size, 64, 72, 7, 1},
56  {batch_size, 1},
57  {1, 1},
66  input_shapes = input_shapes_;
67  }
68 
69  else if (hcal_subsystem_name == "hb") {
70  std::vector<std::vector<int64_t>> input_shapes_ = {
71  {batch_size, 64, 72, 4, 1},
72  {batch_size, 1},
73  {1, 1},
82  input_shapes = input_shapes_;
83  }
84 }
std::string fullPath() const
Definition: FileInPath.cc:161
std::string hcal_subsystem_name
const unsigned int model_state_inner_dim
void InitializeState()
Resets ml model memory states to default and function needs to be called when new collision run start...
std::unique_ptr< cms::Ort::ONNXRuntime > ort_mSession
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
const std::vector< std::vector< unsigned int > > model_state_layer_dims
def move(src, dest)
Definition: eostools.py:511

Member Function Documentation

◆ Inference()

std::vector< std::vector< float > > OnlineDQMDigiAD::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.

Parameters
digiHcalMapTWThe input digipccupany maps in time window
numEventsThe input number of events for map renormalization in time window
adThrThe anomaly detection decision threshold
input_model_state_memory_The model memory states
output_tensorsoutput arrays
Returns
the list of multidimensional arrays

Definition at line 183 of file OnlineDQMDigiAD_cmssw.cc.

References HLT_2023v12_cff::input_names, simpleEdmComparison::numEvents, and HLT_2023v12_cff::output_names.

193  {
194  /**************** Preprocessing ******************/
195  // Create input tensor (including size and value) from the loaded inputs
196  // Compute the product of all input dimension
197  // Assign memory for input tensor
198  // inputTensors will be used by the Session Run for inference
199 
200  input_values.clear();
201  input_values.emplace_back(digiHcalMapTW);
202  input_values.emplace_back(numEvents);
203  input_values.emplace_back(adThr);
212 
213  /**************** Inference ******************/
214 
216 
217  return output_values;
218 }
std::vector< float > input_model_state_memory_e_0_0
const std::vector< std::string > output_names
std::vector< float > input_model_state_memory_e_1_0
std::vector< float > input_model_state_memory_d_1_1
std::vector< std::vector< float > > input_values
std::vector< float > input_model_state_memory_d_0_0
std::vector< std::vector< float > > output_values
std::vector< float > input_model_state_memory_d_0_1
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< std::vector< int64_t > > input_shapes
std::vector< float > input_model_state_memory_e_0_1
std::vector< float > input_model_state_memory_d_1_0

◆ Inference_CMSSW()

std::vector< std::vector< float > > OnlineDQMDigiAD::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.

Parameters
digiHcal2DHist_depth_12D histogram digioccupancy of the 1st depth of the hcal-hehb
digiHcal2DHist_depth_22D histogram digioccupancy of the 2nd depth of the hcal-hehb
digiHcal2DHist_depth_32D histogram digioccupancy of the 3rd depth of the hcal-hehb
digiHcal2DHist_depth_42D histogram digioccupancy of the 4th depth of the hcal-hehb
digiHcal2DHist_depth_52D histogram digioccupancy of the 5th depth of the hcal-hehb
digiHcal2DHist_depth_52D histogram digioccupancy of the 6th depth of the hcal-hehb
digiHcal2DHist_depth_72D histogram digioccupancy of the 7th depth of the hcal-hehb
LS_numEventsThe input number of events for digioccupancy map renormalization
flagDecisionThrThe anomaly detection decision threshold, decrease to increase sensitivity
Returns
ad_model_output_vectors: the vectors of multidimensional arrays: output_data_0, output_data_1, ...

Definition at line 221 of file OnlineDQMDigiAD_cmssw.cc.

References gather_cfg::cout, mps_fire::i, simpleEdmComparison::numEvents, HLT_2023v12_cff::output_names, and AlCaHLTBitMon_QueryRunRegistry::string.

232 {
233  /**************** Prepare data ******************/
234  // merging all 2d hist into one 3d depth[ieta[iphi]]
235  std::vector<std::vector<std::vector<float>>> digiHcal2DHist_depth_all;
236 
237  if (hcal_subsystem_name == "he") {
238  digiHcal2DHist_depth_all.push_back(digiHcal2DHist_depth_1);
239  digiHcal2DHist_depth_all.push_back(digiHcal2DHist_depth_2);
240  digiHcal2DHist_depth_all.push_back(digiHcal2DHist_depth_3);
241  digiHcal2DHist_depth_all.push_back(digiHcal2DHist_depth_4);
242  digiHcal2DHist_depth_all.push_back(digiHcal2DHist_depth_5);
243  digiHcal2DHist_depth_all.push_back(digiHcal2DHist_depth_6);
244  digiHcal2DHist_depth_all.push_back(digiHcal2DHist_depth_7);
245  }
246 
247  else if (hcal_subsystem_name == "hb") {
248  digiHcal2DHist_depth_all.push_back(digiHcal2DHist_depth_1);
249  digiHcal2DHist_depth_all.push_back(digiHcal2DHist_depth_2);
250  digiHcal2DHist_depth_all.push_back(digiHcal2DHist_depth_3);
251  digiHcal2DHist_depth_all.push_back(digiHcal2DHist_depth_4);
252  }
253 
254  // convert the 3d depth[ieta[iphi]] vector into 1d and commbined
255  std::vector<float> digiHcalMapTW = PrepareONNXDQMMapVectors(digiHcal2DHist_depth_all);
256 
257  std::vector<float> adThr{flagDecisionThr}; // AD decision threshold, increase to reduce sensitivity
258  std::vector<float> numEvents{LS_numEvents};
259 
260  // call model inference
261  /**************** Inference ******************/
262  std::vector<std::vector<float>> output_tensors = Inference(digiHcalMapTW,
263  numEvents,
264  adThr,
273 
274  // auto output_tensors = Inference(digiHcalMapTW, numEvents, adThr);
275  //std::cout << "******* model inference is success *******" << std::endl;
276 
277  /**************** Output post processing ******************/
278  // split outputs into ad output vectors and state_memory vectors
279  std::string state_output_name_tag = "rnn_hidden";
280  std::vector<std::vector<float>> ad_model_output_vectors, ad_model_state_vectors;
281  for (size_t i = 0; i < output_tensors.size(); i++) {
282  std::string output_names_startstr = output_names[i].substr(
283  2, state_output_name_tag.length()); // Extract the same number of characters as str2 from mOutputNames
284  if (output_names_startstr == state_output_name_tag) {
285  ad_model_state_vectors.emplace_back(output_tensors[i]);
286  } else {
287  ad_model_output_vectors.emplace_back(output_tensors[i]);
288  }
289  }
290 
291  if (ad_model_output_vectors.size() == num_state_vectors) {
292  input_model_state_memory_e_0_0 = ad_model_state_vectors[0];
293  input_model_state_memory_e_0_1 = ad_model_state_vectors[1];
294  input_model_state_memory_e_1_0 = ad_model_state_vectors[2];
295  input_model_state_memory_e_1_1 = ad_model_state_vectors[3];
296  input_model_state_memory_d_0_0 = ad_model_state_vectors[4];
297  input_model_state_memory_d_0_1 = ad_model_state_vectors[5];
298  input_model_state_memory_d_1_0 = ad_model_state_vectors[6];
299  input_model_state_memory_d_1_1 = ad_model_state_vectors[7];
300  } else {
301  std::cout << "Warning: the number of output state vectors does NOT equals to expected!. The states are set to "
302  "default values."
303  << std::endl;
304  InitializeState();
305  }
306 
307  // # if onnx is returning serialized 1d vectors instead of vector of 3d vectors
308  // aml score and flag are at index 5 and 7 of the vector ad_model_output_vectors: anomaly score: ad_model_output_vectors[5], anomaly flags: ad_model_output_vectors[7]
309  /*
310  selOutputIdx: index to select of the onnx output. e.g. 5 is the anomaly score and 7 is the anomaly flag (1 is with anomaly, 0 is healthy)
311  std::vector<std::vector<std::vector<float>>> digiHcal3DHist_ANOMALY_FLAG = ONNXOutputToDQMHistMap(ad_model_output_vectors, 7)
312  std::vector<std::vector<std::vector<float>>> digiHcal3DHist_ANOMALY_SCORE = ONNXOutputToDQMHistMap(ad_model_output_vectors, 5)
313  */
314 
315  // reduce counter for each ls call. due to onnx double datatype handling limitation that might cause precision error to propagate.
316  if (--model_state_refresh_counter == 0)
317  InitializeState();
318 
319  return ad_model_output_vectors;
320 }
std::vector< float > input_model_state_memory_e_0_0
const std::vector< std::string > output_names
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
std::vector< float > input_model_state_memory_d_1_1
const size_t num_state_vectors
std::string hcal_subsystem_name
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< float > input_model_state_memory_d_0_1
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.
std::vector< float > input_model_state_memory_e_0_1
std::vector< float > input_model_state_memory_d_1_0

◆ InitializeState()

void OnlineDQMDigiAD::InitializeState ( )

Resets ml model memory states to default and function needs to be called when new collision run starts.

Definition at line 95 of file OnlineDQMDigiAD_cmssw.cc.

References ntuplemaker::fill, and nano_mu_digi_cff::float.

95  {
96  // model memory states vectors init, only when the runs starts or for the first LS
99  float(0.0)); // init model memory states-encoder_layer_0_state_0 to zero
102  float(0.0)); // init model memory states-encoder_layer_0_state_1 to zero
105  float(0.0)); // init model memory states-encoder_layer_1_state_0 to zero
108  float(0.0)); // init model memory states-encoder_layer_1_state_1 to zero
111  float(0.0)); // init model memory states-decoder_layer_0_state_0 to zero
114  float(0.0)); // init model memory states-decoder_layer_0_state_1 to zero
117  float(0.0)); // init model memory states-decoder_layer_1_state_0 to zero
120  float(0.0)); // init model memory states-decoder_layer_1_state_1 to zero
121 
122  // model_state_refresh_counter = 15; // counter set due to onnx double datatype handling limitation that might cause precision error to propagate.
124  1; // DQM multithread returns non-sequential LS. Hence, the model will not keep states (experimental)
125 }
std::vector< float > input_model_state_memory_e_0_0
unsigned model_state_refresh_counter
std::vector< float > input_model_state_memory_e_1_0
std::vector< float > input_model_state_memory_d_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_e_1_1
std::vector< float > input_model_state_memory_e_0_1
std::vector< float > input_model_state_memory_d_1_0

◆ IsModelExist()

void OnlineDQMDigiAD::IsModelExist ( std::string  hcal_subsystem_name)

check whether onnx model integration is added for the selected hcal system

Definition at line 86 of file OnlineDQMDigiAD_cmssw.cc.

References submitPVResolutionJobs::err, spr::find(), and AlCaHLTBitMon_QueryRunRegistry::string.

86  {
88  hcal_modeled_systems.end()) {
90  "ML for OnlineDQM is not currently supported for the selected " + hcal_subsystem_name + " system!\n";
91  throw std::invalid_argument(err);
92  }
93 }
void find(edm::Handle< EcalRecHitCollection > &hits, DetId thisDet, std::vector< EcalRecHitCollection::const_iterator > &hit, bool debug=false)
Definition: FindCaloHit.cc:19
std::string hcal_subsystem_name
const std::vector< std::string > hcal_modeled_systems

◆ Map1DTo2DVector()

std::vector< std::vector< float > > OnlineDQMDigiAD::Map1DTo2DVector ( const std::vector< float > &  input_1d_vec,
const int  numSplits 
)
private

Converts serialized 1d vectors into 2d.

Definition at line 137 of file OnlineDQMDigiAD_cmssw.cc.

References mps_fire::i.

138  {
139  std::size_t const splitted_size = input_1d_vec.size() / numSplits;
140  // check splitted_size*numSplits == input_1d_vec.size()
141  std::vector<std::vector<float>> output_2d_vec;
142 
143  for (size_t i = 0; i < input_1d_vec.size(); i += numSplits - 1) {
144  std::vector<float> chunch_vec(input_1d_vec.begin() + i, input_1d_vec.begin() + i + splitted_size);
145  output_2d_vec.push_back(chunch_vec);
146  }
147  return output_2d_vec;
148 }

◆ ONNXOutputToDQMHistMap()

std::vector< std::vector< std::vector< float > > > OnlineDQMDigiAD::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.

Parameters
ad_model_output_vectorsvector of 3D histogram maps the hcal-hehb, each vector output from the onnx. e.g 3d map of anomaly score and 3d map of anomaly flag or label
selOutputIdxindex to select of the onnx output. e.g. 5 is the anomaly score and 7 is the anomaly flag (1 is with anomaly, 0 is healthy)
Returns
ad_model_output_vectors: the vectors of multidimensional arrays: output_data_0, output_data_1, ...

Definition at line 164 of file OnlineDQMDigiAD_cmssw.cc.

165  {
166  // each output_vector is a serialized 3d hist map
167  const unsigned short numDepth = 7;
168  const unsigned short numDIeta = 64;
169 
170  const std::vector<float> &output_vector = ad_model_output_vectors[selOutputIdx];
171  std::vector<std::vector<float>> output_2d_vec = Map1DTo2DVector(output_vector, numDepth);
172 
173  std::vector<std::vector<std::vector<float>>> digiHcal3DHist;
174  for (const std::vector<float> &output_vector_depth : output_2d_vec) {
175  std::vector<std::vector<float>> digiHcal2DHist_depth = Map1DTo2DVector(output_vector_depth, numDIeta);
176  digiHcal3DHist.push_back(digiHcal2DHist_depth);
177  }
178 
179  return digiHcal3DHist;
180 }
std::vector< std::vector< float > > Map1DTo2DVector(const std::vector< float > &input_1d_vec, const int numSplits)
Converts serialized 1d vectors into 2d.

◆ PrepareONNXDQMMapVectors()

std::vector< float > OnlineDQMDigiAD::PrepareONNXDQMMapVectors ( std::vector< std::vector< std::vector< float >>> &  digiHcal2DHist_depth_all)
private

Prepares model input serialized dqm histogram from 2D histogram inputs from the cmssw.

Parameters
digiHcal2DHist_depth_all3D vector (depth[ieta[iphi]]) of combined 2D histogram digioccupancy of the any depth of the hcal

Definition at line 150 of file OnlineDQMDigiAD_cmssw.cc.

References trackerHitRTTI::vector.

151  {
152  std::vector<float> digi3DHistVector_serialized;
153 
154  for (const std::vector<std::vector<float>> &digiHcal2DHist_depth : digiHcal2DHist_depth_all) {
155  std::vector<float> digiHcalDHist_serialized_depth = Serialize2DVector(digiHcal2DHist_depth);
156  digi3DHistVector_serialized.insert(digi3DHistVector_serialized.end(),
157  digiHcalDHist_serialized_depth.begin(),
158  digiHcalDHist_serialized_depth.end());
159  }
160 
161  return digi3DHistVector_serialized;
162 }
std::vector< float > Serialize2DVector(const std::vector< std::vector< float >> &input_2d_vec)
Serializes 2d vectors into 1d.

◆ Serialize2DVector()

std::vector< float > OnlineDQMDigiAD::Serialize2DVector ( const std::vector< std::vector< float >> &  input_2d_vec)
private

Serializes 2d vectors into 1d.

Definition at line 127 of file OnlineDQMDigiAD_cmssw.cc.

References convertSQLitetoXML_cfg::output.

127  {
128  std::vector<float> output;
129  for (const auto &row : input_2d_vec) {
130  for (const auto &element : row) {
131  output.push_back(element);
132  }
133  }
134  return output;
135 }

Member Data Documentation

◆ batch_size

int64_t OnlineDQMDigiAD::batch_size = 1
private

Definition at line 162 of file OnlineDQMDigiAD_cmssw.h.

◆ hcal_modeled_systems

const std::vector<std::string> OnlineDQMDigiAD::hcal_modeled_systems = {"he", "hb"}
private

Definition at line 99 of file OnlineDQMDigiAD_cmssw.h.

◆ hcal_subsystem_name

std::string OnlineDQMDigiAD::hcal_subsystem_name
private

Definition at line 100 of file OnlineDQMDigiAD_cmssw.h.

◆ input_model_state_memory_d_0_0

std::vector<float> OnlineDQMDigiAD::input_model_state_memory_d_0_0 {std::vector<float>(model_state_layer_serialized_dims[1][0])}
private

Definition at line 156 of file OnlineDQMDigiAD_cmssw.h.

◆ input_model_state_memory_d_0_1

std::vector<float> OnlineDQMDigiAD::input_model_state_memory_d_0_1 {std::vector<float>(model_state_layer_serialized_dims[1][0])}
private

Definition at line 157 of file OnlineDQMDigiAD_cmssw.h.

◆ input_model_state_memory_d_1_0

std::vector<float> OnlineDQMDigiAD::input_model_state_memory_d_1_0 {std::vector<float>(model_state_layer_serialized_dims[1][1])}
private

Definition at line 158 of file OnlineDQMDigiAD_cmssw.h.

◆ input_model_state_memory_d_1_1

std::vector<float> OnlineDQMDigiAD::input_model_state_memory_d_1_1 {std::vector<float>(model_state_layer_serialized_dims[1][1])}
private

Definition at line 159 of file OnlineDQMDigiAD_cmssw.h.

◆ input_model_state_memory_e_0_0

std::vector<float> OnlineDQMDigiAD::input_model_state_memory_e_0_0 {std::vector<float>(model_state_layer_serialized_dims[0][0])}
private

Definition at line 152 of file OnlineDQMDigiAD_cmssw.h.

◆ input_model_state_memory_e_0_1

std::vector<float> OnlineDQMDigiAD::input_model_state_memory_e_0_1 {std::vector<float>(model_state_layer_serialized_dims[0][0])}
private

Definition at line 153 of file OnlineDQMDigiAD_cmssw.h.

◆ input_model_state_memory_e_1_0

std::vector<float> OnlineDQMDigiAD::input_model_state_memory_e_1_0 {std::vector<float>(model_state_layer_serialized_dims[0][1])}
private

Definition at line 154 of file OnlineDQMDigiAD_cmssw.h.

◆ input_model_state_memory_e_1_1

std::vector<float> OnlineDQMDigiAD::input_model_state_memory_e_1_1 {std::vector<float>(model_state_layer_serialized_dims[0][1])}
private

Definition at line 155 of file OnlineDQMDigiAD_cmssw.h.

◆ input_names

const std::vector<std::string> OnlineDQMDigiAD::input_names
private
Initial value:
= {
"input_data",
"input_data_exo",
"anomaly_std_th",
"e_rnn_hidden__layer_0_state_0",
"e_rnn_hidden__layer_0_state_1",
"e_rnn_hidden__layer_1_state_0",
"e_rnn_hidden__layer_1_state_1",
"d_rnn_hidden__layer_0_state_0",
"d_rnn_hidden__layer_0_state_1",
"d_rnn_hidden__layer_1_state_0",
"d_rnn_hidden__layer_1_state_1",
}

Definition at line 105 of file OnlineDQMDigiAD_cmssw.h.

◆ input_shapes

std::vector<std::vector<int64_t> > OnlineDQMDigiAD::input_shapes
private

Definition at line 164 of file OnlineDQMDigiAD_cmssw.h.

◆ input_values

std::vector<std::vector<float> > OnlineDQMDigiAD::input_values
private

Definition at line 163 of file OnlineDQMDigiAD_cmssw.h.

◆ model_path

std::string OnlineDQMDigiAD::model_path
private

Definition at line 102 of file OnlineDQMDigiAD_cmssw.h.

◆ model_state_inner_dim

const unsigned int OnlineDQMDigiAD::model_state_inner_dim = 2
private

Definition at line 141 of file OnlineDQMDigiAD_cmssw.h.

◆ model_state_layer_dims

const std::vector<std::vector<unsigned int> > OnlineDQMDigiAD::model_state_layer_dims
private
Initial value:
= {
{128, 32}, {128, 640}}

Definition at line 142 of file OnlineDQMDigiAD_cmssw.h.

◆ model_state_layer_serialized_dims

const std::vector<std::vector<unsigned int> > OnlineDQMDigiAD::model_state_layer_serialized_dims
private
Initial value:
= {
{256, 64},
{256,
1280}}

Definition at line 144 of file OnlineDQMDigiAD_cmssw.h.

◆ model_state_refresh_counter

unsigned OnlineDQMDigiAD::model_state_refresh_counter
private
Initial value:
=
1

Definition at line 149 of file OnlineDQMDigiAD_cmssw.h.

◆ num_state_vectors

const size_t OnlineDQMDigiAD::num_state_vectors = 8
private

Definition at line 140 of file OnlineDQMDigiAD_cmssw.h.

◆ ort_mSession

std::unique_ptr<cms::Ort::ONNXRuntime> OnlineDQMDigiAD::ort_mSession = nullptr
private

Definition at line 101 of file OnlineDQMDigiAD_cmssw.h.

◆ output_names

const std::vector<std::string> OnlineDQMDigiAD::output_names
private
Initial value:
= {
"target_data",
"pred_data",
"pred_err_spatial",
"pred_err_window_spatial",
"pred_err_spatial_scaled",
"pred_err_window_spatial_scaled",
"pred_err_spatial_scaled_aml",
"pred_err_window_spatial_scaled_aml",
"e_rnn_hidden__layer_0_state_0_o",
"e_rnn_hidden__layer_0_state_1_o",
"e_rnn_hidden__layer_1_state_0_o",
"e_rnn_hidden__layer_1_state_1_o",
"d_rnn_hidden__layer_0_state_0_o",
"d_rnn_hidden__layer_0_state_1_o",
"d_rnn_hidden__layer_1_state_0_o",
"d_rnn_hidden__layer_1_state_1_o",
}

Definition at line 120 of file OnlineDQMDigiAD_cmssw.h.

◆ output_values

std::vector<std::vector<float> > OnlineDQMDigiAD::output_values
private

Definition at line 163 of file OnlineDQMDigiAD_cmssw.h.