ATLAS Offline Software
Loading...
Searching...
No Matches
AutoencoderExampleAlgorithm.h
Go to the documentation of this file.
1/*
2 Copyright (C) 2002-2026 for the benefit of the ATLAS collaboration
3*/
4
5// Pipeline to install an Example Autoencoder as new a dqm algorithm
6// Author: Cary David Randazzo, November 2025, Louisiana Tech University
7
8// Demonstration Note:
9// The following is required by all new algorithms.
10// The following two lines must be changed to MyAlgorithm_H
11#ifndef AutoencoderExampleAlgorithm_H
12#define AutoencoderExampleAlgorithm_H
13#include <dqm_core/Algorithm.h>
14
15// Required if using onnx framework for your model.
16#include <onnxruntime_cxx_api.h>
17
18// Algorithm specific:
19// Add the includes necessary for your algorithm.
20#include <string>
21#include <vector>
22#include <iosfwd>
23#include <memory>
24
25
26// Demonstration Note:
27// The method below for extracting data is specific to the algorithm that was created for the example.
28// What data you will work with and how its extracted and manipulated is up to you in the code.
29class TH2;
30class TObject;
31
32// Demonstration Note:
33// The following is required by all new algorithms.
34namespace dqm_algorithms
35{
36 std::vector<std::vector<float>> extract_histogram_data(const TH2* hist);
37
38 struct AutoencoderExampleAlgorithm : public dqm_core::Algorithm
39 {
41
42 virtual ~AutoencoderExampleAlgorithm() override = default;
43
44 virtual AutoencoderExampleAlgorithm* clone() override;
45
46 virtual dqm_core::Result * execute( const std::string & , const TObject & , const dqm_core::AlgorithmConfig & ) override;
47
48 using dqm_core::Algorithm::printDescription;
49 void printDescription(std::ostream& out);
50
51
52 Ort::Env env;
53 Ort::SessionOptions session_options;
54 std::unique_ptr<Ort::Session> session;
55 std::vector<std::string> input_names;
56 std::vector<std::string> output_names;
57 };
58
59}
60
61// Demonstration Note:
62// The following is required by all new algorithms. (The comment shows what the condition is closing, can be removed.)
63#endif // AutoencoderExampleAlgorithm_H
std::vector< std::vector< float > > extract_histogram_data(const TH2 *hist)
virtual AutoencoderExampleAlgorithm * clone() override
virtual ~AutoencoderExampleAlgorithm() override=default
virtual dqm_core::Result * execute(const std::string &, const TObject &, const dqm_core::AlgorithmConfig &) override