ATLAS Offline Software
Public Member Functions | Private Attributes | List of all members
lwt::atlas::FastInputPreprocessor Class Reference

#include <FastInputPreprocessor.h>

Collaboration diagram for lwt::atlas::FastInputPreprocessor:

Public Member Functions

 FastInputPreprocessor (const std::vector< Input > &inputs, const std::vector< std::string > &order)
 
VectorXd operator() (const VectorXd &) const
 

Private Attributes

VectorXd m_offsets
 
VectorXd m_scales
 
std::vector< size_t > m_indices
 

Detailed Description

Definition at line 32 of file FastInputPreprocessor.h.

Constructor & Destructor Documentation

◆ FastInputPreprocessor()

lwt::atlas::FastInputPreprocessor::FastInputPreprocessor ( const std::vector< Input > &  inputs,
const std::vector< std::string > &  order 
)

Definition at line 44 of file FastInputPreprocessor.cxx.

46  :
47  m_offsets(inputs.size()),
48  m_scales(inputs.size())
49  {
50  size_t in_num = 0;
51  for (const auto& input: inputs) {
52  m_offsets(in_num) = input.offset;
53  m_scales(in_num) = input.scale;
54  in_num++;
55  }
56  m_indices = get_value_indices(order, inputs);
57  }

Member Function Documentation

◆ operator()()

VectorXd lwt::atlas::FastInputPreprocessor::operator() ( const VectorXd &  in) const

Definition at line 58 of file FastInputPreprocessor.cxx.

58  {
59  VectorXd invec(m_indices.size());
60  size_t input_number = 0;
61  for (size_t index: m_indices) {
62  if (static_cast<int>(index) >= in.rows()) {
63  throw NNEvaluationException(
64  "index " + std::to_string(index) + " is out of range, scalar "
65  "input only has " + std::to_string(in.rows()) + " entries");
66  }
67  invec(input_number) = in(index);
68  input_number++;
69  }
70  return (invec + m_offsets).cwiseProduct(m_scales);
71  }

Member Data Documentation

◆ m_indices

std::vector<size_t> lwt::atlas::FastInputPreprocessor::m_indices
private

Definition at line 42 of file FastInputPreprocessor.h.

◆ m_offsets

VectorXd lwt::atlas::FastInputPreprocessor::m_offsets
private

Definition at line 40 of file FastInputPreprocessor.h.

◆ m_scales

VectorXd lwt::atlas::FastInputPreprocessor::m_scales
private

Definition at line 41 of file FastInputPreprocessor.h.


The documentation for this class was generated from the following files:
lwt::atlas::FastInputPreprocessor::m_indices
std::vector< size_t > m_indices
Definition: FastInputPreprocessor.h:42
index
Definition: index.py:1
lwt::atlas::FastInputPreprocessor::m_scales
VectorXd m_scales
Definition: FastInputPreprocessor.h:41
postInclude.inputs
inputs
Definition: postInclude.SortInput.py:15
mc.order
order
Configure Herwig7.
Definition: mc.Herwig7_Dijet.py:12
PlotPulseshapeFromCool.input
input
Definition: PlotPulseshapeFromCool.py:106
lwt::atlas::FastInputPreprocessor::m_offsets
VectorXd m_offsets
Definition: FastInputPreprocessor.h:40
ActsTrk::to_string
std::string to_string(const DetectorType &type)
Definition: GeometryDefs.h:34