ATLAS Offline Software
InputPreprocessor.h
Go to the documentation of this file.
1 /*
2  Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration
3 */
4 
5 #ifndef INPUT_PREPROCESSOR_HH_TAURECTOOLS
6 #define INPUT_PREPROCESSOR_HH_TAURECTOOLS
7 
10 
11 #include <Eigen/Dense>
12 #include <map>
13 #include <vector>
14 
15 namespace lwtDev {
16 
17  using Eigen::VectorXd;
18  using Eigen::MatrixXd;
19 
20  // use a normal map externally, since these are more common in user
21  // code. TODO: is it worth changing to unordered_map?
22  typedef std::map<std::string, double> ValueMap;
23  typedef std::vector<std::pair<std::string, double> > ValueVector;
24  typedef std::map<std::string, std::vector<double> > VectorMap;
25 
26  // ______________________________________________________________________
27  // input preprocessor (handles normalization and packing into Eigen)
28 
30  {
31  public:
32  InputPreprocessor(const std::vector<Input>& inputs);
33  VectorXd operator()(const ValueMap&) const;
34  private:
35  // input transformations
36  VectorXd m_offsets;
37  VectorXd m_scales;
38  std::vector<std::string> m_names;
39  };
40 
42  {
43  public:
44  InputVectorPreprocessor(const std::vector<Input>& inputs);
45  MatrixXd operator()(const VectorMap&) const;
46  private:
47  // input transformations
48  VectorXd m_offsets;
49  VectorXd m_scales;
50  std::vector<std::string> m_names;
51  };
52 }
53 
54 #endif // INPUT_PREPROCESSOR_HH_TAURECTOOLS
lwtDev::InputVectorPreprocessor::operator()
MatrixXd operator()(const VectorMap &) const
Definition: InputPreprocessor.cxx:57
lwtDev::ValueMap
std::map< std::string, double > ValueMap
Definition: InputPreprocessor.h:22
lwtDev::VectorMap
std::map< std::string, std::vector< double > > VectorMap
Definition: InputPreprocessor.h:24
lwtDev::InputPreprocessor
Definition: InputPreprocessor.h:30
lwtDev::InputVectorPreprocessor::m_names
std::vector< std::string > m_names
Definition: InputPreprocessor.h:50
lwtDev::InputVectorPreprocessor::m_scales
VectorXd m_scales
Definition: InputPreprocessor.h:49
lwtDev::InputPreprocessor::m_scales
VectorXd m_scales
Definition: InputPreprocessor.h:37
lwtDev::InputVectorPreprocessor
Definition: InputPreprocessor.h:42
lwtDev::InputVectorPreprocessor::m_offsets
VectorXd m_offsets
Definition: InputPreprocessor.h:48
postInclude.inputs
inputs
Definition: postInclude.SortInput.py:15
lwtDev::InputPreprocessor::InputPreprocessor
InputPreprocessor(const std::vector< Input > &inputs)
Definition: InputPreprocessor.cxx:12
lwtDev::InputVectorPreprocessor::InputVectorPreprocessor
InputVectorPreprocessor(const std::vector< Input > &inputs)
Definition: InputPreprocessor.cxx:39
lwtDev::InputPreprocessor::m_names
std::vector< std::string > m_names
Definition: InputPreprocessor.h:38
lwtDev::ValueVector
std::vector< std::pair< std::string, double > > ValueVector
Definition: InputPreprocessor.h:23
lwtDev
Definition: Reconstruction/tauRecTools/Root/lwtnn/Exceptions.cxx:8
lightweight_network_config.h
lwtDev::InputPreprocessor::m_offsets
VectorXd m_offsets
Definition: InputPreprocessor.h:36
lwtDev::InputPreprocessor::operator()
VectorXd operator()(const ValueMap &) const
Definition: InputPreprocessor.cxx:24
Exceptions.h