#ifndef RecoTauTag_RecoTau_DeepTauScaling_h
#define RecoTauTag_RecoTau_DeepTauScaling_h

#include <vector>
#include <map>
#include <cmath>
#include <limits>
#include <algorithm>

namespace deep_tau {
  namespace Scaling {
    constexpr float inf = std::numeric_limits<float>::infinity();
    enum class FeatureT {
      TauFlat,
      GridGlobal,
      PfCand_electron,
      PfCand_muon,
      PfCand_chHad,
      PfCand_nHad,
      PfCand_gamma,
      Electron,
      Muon
    };

    struct ScalingParams {
      std::vector<float> mean_;
      std::vector<float> std_;
      std::vector<float> lim_min_;
      std::vector<float> lim_max_;

      template <typename T>
      float scale(T value, int var_index) const {
        if (std::isfinite(value)) {
          const float mean = mean_.at(var_index);
          const float std = std_.at(var_index);
          const float lim_min = lim_min_.at(var_index);
          const float lim_max = lim_max_.at(var_index);
          const float norm_value = (static_cast<float>(value) - mean) / std;
          return std::clamp(norm_value, lim_min, lim_max);
        } else
          return 0.f;
      };
    };

    const std::map<std::pair<FeatureT, bool>, ScalingParams> scalingParamsMap_v2p1 = {
        {std::make_pair(FeatureT::TauFlat, false),
         {
             // mean_
             {21.49,  20.0,   0.0,   0., 0.6669, 1.,    0,       1,       0,       47.78, 0,      9.029,
              57.59,  0,      0,     0,  1.731,  22.38, -0.0241, 0.0675,  0.7973,  0,     0.0018, 2.26,
              0,      0.0026, 2.928, 0., 0,      4.717, -0.0003, -0.0009, -0.0022, 0.,    0.,     0.,
              0.0052, 0.,     1.538, 0,  0.,     0,     0.,      2.95,    0.0,     0,     0.0042},

             // std_
             {9.713,
              980.0,
              2.3,
              3.141592653589793,
              0.6553,
              4.2,
              1,
              2,
              2,
              123.5,
              1,
              26.42,
              155.3,
              1,
              1,
              1,
              6.846,
              16.34,
              0.0074,
              0.0128,
              3.456,
              1,
              0.0085,
              4.191,
              1,
              0.0114,
              4.466,
              0.0190,
              1,
              11.78,
              0.7362,
              0.7354,
              1.993,
              1,
              1.,
              1,
              0.01433,
              1.,
              4.401,
              1,
              1,
              1,
              3.141592653589793,
              3.927,
              1.,
              1.0,
              0.0323},

             // lim_min_
             {-5, 0.,   -1.0, -1., -5, 0,    -inf, 0,    0,    -5,   -inf, -5, -5,   -inf, -inf, -inf,
              -5, -5,   -5,   -5,  -5, -inf, -5,   -5,   -inf, -5,   -5,   -5, -inf, -5,   -5,   -5,
              -5, -inf, 0,    0,   -5, 0,    -5,   -inf, 0,    -inf, 0,    -5, -1.0, -inf, -5},

             // lim_max_
             {5,   1., 1.0, 1., 5,   1, inf, 1, 1, 5,   inf, 5, 5, inf, inf, inf, 5, 5,   5, 5, 5,   inf, 5, 5,
              inf, 5,  5,   5,  inf, 5, 5,   5, 5, inf, 1,   1, 5, 1,   5,   inf, 1, inf, 1, 5, 1.0, inf, 5},
         }},  // end TauFlat

        {std::make_pair(FeatureT::GridGlobal, false),
         {
             // mean_
             {21.49, 20.0, 0.0, 0},
             // std_
             {9.713, 980.0, 2.3, 1},
             // lim_min_
             {-5, 0., -1.0, -inf},
             // lim_max_
             {5., 1., 1.0, inf},
         }},  // end GridGlobal

        {std::make_pair(FeatureT::PfCand_electron, false),
         {// mean_
          {0, 0.304, 0.0, 0.0, 0, 0, 0, 0, 0, 0, 0, 0.001, 0, 0.0003, 0, 0, 0., 1.634, 0.001, 24.56, 2.272, 15.18},

          // std_
          {1,     1.845,  0.5,    0.5,   7., 1,     1,    1,    10.0,  0.1221, 0.1226,
           1.024, 0.3411, 0.3385, 1.307, 1,  0.171, 6.45, 1.02, 210.4, 8.439,  3.203},

          // lim_min_
          {-inf, -5, -1.0, -1.0, 0., -inf, -inf, -inf, 0., -5, -5, -5, -5, -5, -5, -inf, -5, -5, -5, -5, -5, -5},

          // lim_max_
          {inf, 5, 1.0, 1.0, 1.,  inf, inf, inf, 1., 5, 5,
           5,   5, 5,   5,   inf, 5,   5,   5,   5,  5, 5}}},  // end PfCand_electron, is_innner=false

        {std::make_pair(FeatureT::PfCand_electron, true),
         {// mean_
          {0, 0.9792, 0.0, 0.0, 0, 0, 0, 0, 0, 0, 0, 0.001, 0, 0.0003, 0, 0, 0., 1.634, 0.001, 24.56, 2.272, 15.18},

          // std_
          {1,     0.5383, 0.1,    0.1,   7., 1,     1,    1,    10.0,  0.1221, 0.1226,
           1.024, 0.3411, 0.3385, 1.307, 1,  0.171, 6.45, 1.02, 210.4, 8.439,  3.203},

          // lim_min_
          {-inf, -5, -1.0, -1.0, 0., -inf, -inf, -inf, 0., -5, -5, -5, -5, -5, -5, -inf, -5, -5, -5, -5, -5, -5},

          // lim_max_
          {inf, 5, 1.0, 1.0, 1.,  inf, inf, inf, 1., 5, 5,
           5,   5, 5,   5,   inf, 5,   5,   5,   5,  5, 5}}},  // end PfCand_electron, is_innner=true

        {std::make_pair(FeatureT::PfCand_gamma, false),
         {
             // mean
             {0,  0.02576, 0.0,    0.0,    0, 0,      0,     0,      0,     0.,    0.,   0.,
              0., 0.001,   0.0008, 0.0038, 0, 0.0004, 4.271, 0.0071, 162.1, 4.268, 12.25},

             // std
             {1,      0.3833, 0.5,    0.5,   7., 3.,    1,     1,     1,     7.,    0.0067, 0.0069,
              0.0578, 0.9565, 0.9592, 2.154, 1,  0.882, 63.78, 5.285, 622.4, 15.47, 4.774},

             // lim_min
             {-inf, -5, -1.0, -1.0, 0., 0., -inf, -inf, -inf, 0., -5, -5, -5, -5, -5, -5, -inf, -5, -5, -5, -5, -5, -5},

             // lim_max
             {inf, 5, 1.0, 1.0, 1., 1., inf, inf, inf, 1., 5, 5, 5, 5, 5, 5, inf, 5, 5, 5, 5, 5, 5},

         }},  // end PfCand_gamma, is_innner=false

        {std::make_pair(FeatureT::PfCand_gamma, true),
         {
             // mean
             {0,  0.6048, 0.0,    0.0,    0, 0,      0,     0,      0,     0.,    0.,   0.,
              0., 0.001,  0.0008, 0.0038, 0, 0.0004, 4.271, 0.0071, 162.1, 4.268, 12.25},

             // std
             {1,      1.669,  0.1,    0.1,   7., 3.,    1,     1,     1,     7.,    0.0067, 0.0069,
              0.0578, 0.9565, 0.9592, 2.154, 1,  0.882, 63.78, 5.285, 622.4, 15.47, 4.774},

             // lim_min
             {-inf, -5, -1.0, -1.0, 0., 0., -inf, -inf, -inf, 0., -5, -5, -5, -5, -5, -5, -inf, -5, -5, -5, -5, -5, -5},

             // lim_max
             {inf, 5, 1.0, 1.0, 1., 1., inf, inf, inf, 1., 5, 5, 5, 5, 5, 5, inf, 5, 5, 5, 5, 5, 5},

         }},  // end PfCand_gamma, is_innner=true

        {std::make_pair(FeatureT::Electron, false),
         {
             // mean
             {0,     0.5111, 0.0,   0.0,    0,     1.729, 0.1439, 1.794,   1.531,   1.531,  0.7735, 0.7735, 1.625,
              1.993, 70.25,  2.432, 2.034,  6.64,  4.183, 0.,     -0.0001, -0.0001, 0.0002, 0.0001, 0.0004, 0,
              0,     0.0008, 14.04, 0.0099, 3.049, 16.52, 1.355,  5.046,   0,       2.411,  15.16},

             // std
             {1,     2.765,  0.5,   0.5,    1,     1.644, 0.3284, 2.079,  1.424,  1.424,  0.935,  0.935,  1.581,
              1.308, 58.16,  15.13, 13.96,  36.8,  20.63, 0.0363, 0.0512, 0.0541, 0.0553, 0.0523, 0.0777, 1,
              1,     0.0052, 69.48, 0.0851, 10.39, 2.806, 16.81,  3.119,  1,      6.98,   5.26},

             // lim_min
             {-inf, -5, -1.0, -1.0, -inf, -5, -5,   -5,   -5, -5, -5, -5, -5, -5, -5, -5,   -5, -5, -5,
              -5,   -5, -5,   -5,   -5,   -5, -inf, -inf, -5, -5, -5, -5, -5, -5, -5, -inf, -5, -5},

             // lim_max
             {inf, 5, 1.0, 1.0, inf, 5, 5,   5,   5, 5, 5, 5, 5, 5, 5, 5,   5, 5, 5,
              5,   5, 5,   5,   5,   5, inf, inf, 5, 5, 5, 5, 5, 5, 5, inf, 5, 5},
         }},  // end Electron, is_innner=false

        {std::make_pair(FeatureT::Electron, true),
         {
             // mean
             {0,     1.067,  0.0,   0.0,    0,     1.729, 0.1439, 1.794,   1.531,   1.531,  0.7735, 0.7735, 1.625,
              1.993, 70.25,  2.432, 2.034,  6.64,  4.183, 0.,     -0.0001, -0.0001, 0.0002, 0.0001, 0.0004, 0,
              0,     0.0008, 14.04, 0.0099, 3.049, 16.52, 1.355,  5.046,   0,       2.411,  15.16},

             // std
             {1,     1.521,  0.1,   0.1,    1,     1.644, 0.3284, 2.079,  1.424,  1.424,  0.935,  0.935,  1.581,
              1.308, 58.16,  15.13, 13.96,  36.8,  20.63, 0.0363, 0.0512, 0.0541, 0.0553, 0.0523, 0.0777, 1,
              1,     0.0052, 69.48, 0.0851, 10.39, 2.806, 16.81,  3.119,  1,      6.98,   5.26},

             // lim_min
             {-inf, -5, -1.0, -1.0, -inf, -5, -5,   -5,   -5, -5, -5, -5, -5, -5, -5, -5,   -5, -5, -5,
              -5,   -5, -5,   -5,   -5,   -5, -inf, -inf, -5, -5, -5, -5, -5, -5, -5, -inf, -5, -5},

             // lim_max
             {inf, 5, 1.0, 1.0, inf, 5, 5,   5,   5, 5, 5, 5, 5, 5, 5, 5,   5, 5, 5,
              5,   5, 5,   5,   5,   5, inf, inf, 5, 5, 5, 5, 5, 5, 5, inf, 5, 5},
         }},  // end Electron, is_innner=true

        {std::make_pair(FeatureT::PfCand_muon, false),
         {
             // mean
             {0,       0.0861,  0.0,    0.0,     0, 0,       0,     0,       0,     0.,   -0.0007, 0.0001,
              -0.0117, -0.0001, 0.0004, -0.0118, 0, -0.0045, 4.575, -0.0117, 80.37, 0.69, 17.5},

             // std
             {1,     0.4065, 0.5,    0.5,   7., 3.,     1.,    1.,    1.,    11.,   0.6869, 0.6784,
              4.097, 0.8642, 0.8561, 4.405, 1,  0.9655, 42.36, 4.097, 343.3, 1.711, 5.11},

             // lim_min
             {-inf, -5, -1.0, -1.0, 0., 0., -inf, -inf, -inf, 0., -5, -5, -5, -5, -5, -5, -inf, -5, -5, -5, -5, -5, -5},

             // lim_max
             {inf, 5, 1.0, 1.0, 1., 1., inf, inf, inf, 1.0, 5, 5, 5, 5, 5, 5, inf, 5, 5, 5, 5, 5, 5},

         }},  // end PfCand_muon, is_innner=false

        {std::make_pair(FeatureT::PfCand_muon, true),
         {
             // mean
             {0,       0.9509,  0.0,    0.0,     0, 0,       0,     0,       0,     0.,   -0.0007, 0.0001,
              -0.0117, -0.0001, 0.0004, -0.0118, 0, -0.0045, 4.575, -0.0117, 80.37, 0.69, 17.5},

             // std
             {1,     0.4294, 0.1,    0.1,   7., 3.,     1.,    1.,    1.,    11.,   0.6869, 0.6784,
              4.097, 0.8642, 0.8561, 4.405, 1,  0.9655, 42.36, 4.097, 343.3, 1.711, 5.11},

             // lim_min
             {-inf, -5, -1.0, -1.0, 0., 0., -inf, -inf, -inf, 0., -5, -5, -5, -5, -5, -5, -inf, -5, -5, -5, -5, -5, -5},

             // lim_max
             {inf, 5, 1.0, 1.0, 1., 1., inf, inf, inf, 1.0, 5, 5, 5, 5, 5, 5, inf, 5, 5, 5, 5, 5, 5},

         }},  // end PfCand_muon, is_innner=true

        {std::make_pair(FeatureT::Muon, false),
         {
             // mean
             {0,  0.2678, 0.0, 0.0, 0.0019, 8.98, 0,  21.52, 21.84, 0,  0,  0,  0.2273, 0., 0., 0., 0., 0., 0.,
              0., 0.,     0.,  0.,  0.,     0.,   0., 0.,    0.,    0., 0., 0., 0.,     0., 0., 0., 0., 0.},

             // std
             {1,    3.592, 0.5, 0.5,  1.039, 71.17, 1,    265.8, 10.59, 1,   1,   1,   0.4865,
              2.0,  2.0,   2.0, 2.0,  6.0,   2.0,   2.0,  2.0,   7.,    6.0, 4.0, 4.0, 12.0,
              12.0, 12.0,  8.0, 24.0, 12.0,  12.0,  12.0, 4.0,   4.0,   2.0, 2.0},

             // lim_min
             {-inf, -5, -1.0, -1.0, -5, -5, -inf, -5, -5, -inf, -inf, -inf, -5, 0., 0., 0., 0., 0., 0.,
              0.,   0., 0.,   0.,   0., 0., 0.,   0., 0., 0.,   0.,   0.,   0., 0., 0., 0., 0., 0.},

             // lim_max
             {inf, 5,   1.0, 1.0, 5,   5,   inf, 5,   5,   inf, inf, inf, 5,   1.0, 1.0, 1.0, 1.0, 1.0, 1.0,
              1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0},

         }},  // end Muon, is_innner=false

        {std::make_pair(FeatureT::Muon, true),
         {
             // mean
             {0,  0.7966, 0.0, 0.0, 0.0019, 8.98, 0,  21.52, 21.84, 0,  0,  0,  0.2273, 0., 0., 0., 0., 0., 0.,
              0., 0.,     0.,  0.,  0.,     0.,   0., 0.,    0.,    0., 0., 0., 0.,     0., 0., 0., 0., 0.},

             // std
             {1,    3.402, 0.1, 0.1,  1.039, 71.17, 1,    265.8, 10.59, 1,   1,   1,   0.4865,
              2.0,  2.0,   2.0, 2.0,  6.0,   2.0,   2.0,  2.0,   7.,    6.0, 4.0, 4.0, 12.0,
              12.0, 12.0,  8.0, 24.0, 12.0,  12.0,  12.0, 4.0,   4.0,   2.0, 2.0},

             // lim_min
             {-inf, -5, -1.0, -1.0, -5, -5, -inf, -5, -5, -inf, -inf, -inf, -5, 0., 0., 0., 0., 0., 0.,
              0.,   0., 0.,   0.,   0., 0., 0.,   0., 0., 0.,   0.,   0.,   0., 0., 0., 0., 0., 0.},

             // lim_max
             {inf, 5,   1.0, 1.0, 5,   5,   inf, 5,   5,   inf, inf, inf, 5,   1.0, 1.0, 1.0, 1.0, 1.0, 1.0,
              1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0},

         }},  // end Muon, is_innner=true

        {std::make_pair(FeatureT::PfCand_chHad, false),
         {
             // mean
             {0,       0.0194,  0.0,    0.0,     0, 0,      0,     0,       0,     0,      0,     0., 0.0005, -0.0008,
              -0.0201, -0.0014, 0.0022, -0.0138, 0, -0.012, 6.417, -0.0246, 301.3, 0.7876, 13.92, 0,  0.},

             // std
             {1,     0.1865, 0.5,   0.5,   1, 7,     3,     1,     1,     1,     1,     12.0, 1.735, 1.752,
              8.333, 1.93,   1.948, 8.622, 1, 2.386, 36.28, 7.618, 491.1, 3.694, 6.581, 1,    2.6},

             // lim_min
             {-inf, -5, -1.0, -1.0, -inf, 0., 0., -inf, -inf, -inf, -inf, 0.,   -5, -5,
              -5,   -5, -5,   -5,   -inf, -5, -5, -5,   -5,   -5,   -5,   -inf, 0.},

             // lim_max
             {inf, 5, 1.0, 1.0, inf, 1., 1., inf, inf, inf, inf, 1.0, 5,  5,
              5,   5, 5,   5,   inf, 5,  5,  5,   5,   5,   5,   inf, 1.0},
         }},  // end PfCand_chHad, is_innner=false

        {std::make_pair(FeatureT::PfCand_chHad, true),
         {
             // mean
             {0,       0.2564,  0.0,    0.0,     0, 0,      0,     0,       0,     0,      0,     0., 0.0005, -0.0008,
              -0.0201, -0.0014, 0.0022, -0.0138, 0, -0.012, 6.417, -0.0246, 301.3, 0.7876, 13.92, 0,  0.},

             // std
             {1,     0.8607, 0.1,   0.1,   1, 7,     3,     1,     1,     1,     1,     12.0, 1.735, 1.752,
              8.333, 1.93,   1.948, 8.622, 1, 2.386, 36.28, 7.618, 491.1, 3.694, 6.581, 1,    2.6},

             // lim_min
             {-inf, -5, -1.0, -1.0, -inf, 0., 0., -inf, -inf, -inf, -inf, 0.,   -5, -5,
              -5,   -5, -5,   -5,   -inf, -5, -5, -5,   -5,   -5,   -5,   -inf, 0.},

             // lim_max
             {inf, 5, 1.0, 1.0, inf, 1., 1., inf, inf, inf, inf, 1.0, 5,  5,
              5,   5, 5,   5,   inf, 5,  5,  5,   5,   5,   5,   inf, 1.0},
         }},  // end PfCand_chHad, is_innner=true

        {std::make_pair(FeatureT::PfCand_nHad, false),
         {
             // mean
             {0, 0.0502, 0.0, 0.0, 0, 0, 0},

             // std
             {1, 0.4266, 0.5, 0.5, 1, 1, 1},

             // lim_min
             {-inf, -5, -1.0, -1.0, -inf, -inf, -inf},

             // lim_max
             {inf, 5, 1.0, 1.0, inf, inf, inf},

         }},  // end PfCand_nHad, is_innner=false

        {std::make_pair(FeatureT::PfCand_nHad, true),
         {
             // mean
             {0, 0.3163, 0.0, 0.0, 0, 0, 0},

             // std
             {1, 0.2769, 0.1, 0.1, 1, 1, 1},

             // lim_min
             {-inf, -5, -1.0, -1.0, -inf, -inf, -inf},

             // lim_max
             {inf, 5, 1.0, 1.0, inf, inf, inf},

         }},  // end PfCand_nHad, is_innner=true

    };  // end scalingParamsMap_v2p1

    const std::map<std::pair<FeatureT, bool>, ScalingParams> scalingParamsMap_v2p5 = {
        {std::make_pair(FeatureT::TauFlat, false),
         {
             // mean_
             {25.0,       510.0,      0.0,
              0.5762,     1.967,      0,
              1,          0,          14.32,
              0,          2.213,      11.36,
              0,          0,          0,
              1.202,      22.17,      0,
              0.002281,   2.392,      0,
              0.00318,    2.991,      3.212e-05,
              0,          16.75,      -0.0008515,
              -0.0001629, -0.0007875, -5.564,
              0.5,        0.5,        0.007766,
              0.5,        1.672,      0,
              0.5,        0,          1.5707963267948966,
              2.256,      0.0,        0,
              0.0002029},

             // std_
             {25.0,     490.0, 2.3,
              0.5293,   1.133, 1,
              1,        1,     44.8,
              1,        6.783, 48.09,
              1,        1,     1,
              3.739,    13.68, 1,
              0.009705, 4.187, 1,
              0.01452,  4.527, 0.4518,
              1,        191.7, 0.4016,
              0.4041,   1.157, 8.72,
              0.5,      0.5,   0.01834,
              0.5,      5.058, 1,
              0.5,      1,     1.5707963267948966,
              2.943,    1.0,   1,
              0.03612},

             // lim_min_
             {-1.0, -1.0, -1.0, -5,   -5, -inf, -inf, -inf, -5,   -inf, -5,   -5,   -inf, -inf, -inf,
              -5,   -5,   -inf, -5,   -5, -inf, -5,   -5,   -5,   -inf, -5,   -5,   -5,   -5,   -5,
              -1.0, -1.0, -5,   -1.0, -5, -inf, -1.0, -inf, -1.0, -5,   -1.0, -inf, -5},

             // lim_max_
             {1.0, 1.0, 1.0, 5, 5, inf, inf, inf, 5,   inf, 5, 5,   inf, inf, inf, 5,   5,   inf, 5,   5,   inf, 5,
              5,   5,   inf, 5, 5, 5,   5,   5,   1.0, 1.0, 5, 1.0, 5,   inf, 1.0, inf, 1.0, 5,   1.0, inf, 5},
         }},  // end TauFlat

        {std::make_pair(FeatureT::GridGlobal, false),
         {
             // mean_
             {
                 25.0,
                 510.0,
                 0.0,
                 0,
             },
             // std_
             {
                 25.0,
                 490.0,
                 2.3,
                 1,
             },
             // lim_min_
             {-1.0, -1.0, -1.0, -inf},
             // lim_max_
             {1.0, 1.0, 1.0, inf},
         }},  // end GridGlobal

        {std::make_pair(FeatureT::PfCand_electron, false),
         {// mean_
          {0,       0.3457,   0.0,       0.0,       0, 0,        0,     0,        5.0,   -0.0008022, -2.653e-05,
           0.00382, 0.002371, 0.0003833, 0.0004431, 0, 0.000397, 3.409, 0.003507, 169.6, 4.561,      12.6},

          // std_
          {1,     1.164,  0.5,    0.5,   1, 1,      1,     1,   5.0,   0.4081, 0.4056,
           3.329, 0.6623, 0.6648, 3.548, 1, 0.5572, 16.07, 3.3, 486.1, 14.8,   3.729},

          // lim_min_
          {-inf, -5, -1.0, -1.0, -inf, -inf, -inf, -inf, -1.0, -5, -5, -5, -5, -5, -5, -inf, -5, -5, -5, -5, -5, -5},

          // lim_max_
          {inf, 5, 1.0, 1.0, inf, inf, inf, inf, 1.0, 5, 5,
           5,   5, 5,   5,   inf, 5,   5,   5,   5,   5, 5}}},  // end PfCand_electron, is_inner=false

        {std::make_pair(FeatureT::PfCand_electron, true),
         {// mean_
          {0,         0.9558,    0.0,       0.0,       0, 0,         0,     0,         5.0,   -2.888e-06, 7.215e-06,
           0.0002156, 0.0002385, 6.221e-05, 0.0003546, 0, 3.333e-05, 1.412, 0.0002181, 21.72, 2.387,      14.73},

          // std_
          {1,      0.2323, 0.1,    0.1,   1, 1,       1,     1,      5.0,   0.03703, 0.03682,
           0.5552, 0.1855, 0.1867, 0.749, 1, 0.05183, 3.111, 0.5551, 230.5, 8.818,   3.125},

          // lim_min_
          {-inf, -5, -1.0, -1.0, -inf, -inf, -inf, -inf, -1.0, -5, -5, -5, -5, -5, -5, -inf, -5, -5, -5, -5, -5, -5},

          // lim_max_
          {inf, 5, 1.0, 1.0, inf, inf, inf, inf, 1.0, 5, 5,
           5,   5, 5,   5,   inf, 5,   5,   5,   5,   5, 5}}},  // end PfCand_electron, is_inner=true

        {std::make_pair(FeatureT::PfCand_gamma, false),
         {
             // mean
             {0,         0.02024,  0.0,       0.0,      0, 0,        0,    0,       0,     3.5,   2.364e-08, -1.355e-07,
              5.947e-07, 0.001155, -3.88e-05, 0.001081, 0, 0.003532, 4.09, 0.02207, 175.0, 4.798, 12.18},

             // std
             {1,       0.1801, 0.5,    0.5,   1, 1,     1,     1,     1,     3.5,   0.003674, 0.00371,
              0.02345, 0.4628, 0.4667, 1.057, 1, 1.006, 11.45, 4.517, 546.1, 16.85, 4.741},

             // lim_min
             {-inf, -5, -1.0, -1.0, -inf, -inf, -inf, -inf, -inf, -1.0, -5, -5,
              -5,   -5, -5,   -5,   -inf, -5,   -5,   -5,   -5,   -5,   -5},

             // lim_max
             {inf, 5, 1.0, 1.0, inf, inf, inf, inf, inf, 1.0, 5, 5, 5, 5, 5, 5, inf, 5, 5, 5, 5, 5, 5},

         }},  // end PfCand_gamma, is_inner=false

        {std::make_pair(FeatureT::PfCand_gamma, true),
         {
             // mean
             {0, 0.2681,     0.0,        0.0,       0,        0,         0,          0,
              0, 3.5,        -6.701e-06, 4.799e-06, 3.08e-05, 0.0009319, -0.0001133, 0.0007838,
              0, -0.0003009, 3.826,      0.01115,   114.2,    4.218,     12.27},

             // std
             {1,      0.5467, 0.1,    0.1,   1, 1,     1,     1,     1,     3.5,   0.02348, 0.02357,
              0.2203, 0.4899, 0.4941, 1.284, 1, 0.633, 20.83, 4.191, 439.3, 15.84, 4.562},

             // lim_min
             {-inf, -5, -1.0, -1.0, -inf, -inf, -inf, -inf, -inf, -1.0, -5, -5,
              -5,   -5, -5,   -5,   -inf, -5,   -5,   -5,   -5,   -5,   -5},

             // lim_max
             {inf, 5, 1.0, 1.0, inf, inf, inf, inf, inf, 1.0, 5, 5, 5, 5, 5, 5, inf, 5, 5, 5, 5, 5, 5},

         }},  // end PfCand_gamma, is_inner=true

        {std::make_pair(FeatureT::Electron, false),
         {
             // mean
             {0,          0.3827,     0.0,        0.0,       0,         1.37,  0.3215, 1.793,    1.093, 1.093,
              1.013,      1.013,      1.063,      1.445,     13.07,     3.797, 2.624,  5.68,     2.231, -0.0001921,
              -0.0009969, -0.0008593, -0.0008999, -0.001147, -0.001182, 0,     0,      0.001218, 31.5,  0.05644,
              6.344,      14.65,      1.917,      6.866,     0,         1.862, 12.15},

             // std
             {1,     1.272,   0.5,   0.5,    1,     8.381, 0.5275, 2.419,  82.69,  82.69,  673.8,  673.8,  5.614,
              2.021, 27.8,    21.65, 19.0,   41.93, 21.58, 0.1324, 0.1474, 0.1548, 0.1514, 0.1452, 0.1966, 1,
              1,     0.00775, 82.72, 0.2343, 292.7, 3.103, 229.2,  5.051,  1,      5.64,   5.557},

             // lim_min
             {-inf, -5, -1.0, -1.0, -inf, -5, -5,   -5,   -5, -5, -5, -5, -5, -5, -5, -5,   -5, -5, -5,
              -5,   -5, -5,   -5,   -5,   -5, -inf, -inf, -5, -5, -5, -5, -5, -5, -5, -inf, -5, -5},

             // lim_max
             {inf, 5, 1.0, 1.0, inf, 5, 5,   5,   5, 5, 5, 5, 5, 5, 5, 5,   5, 5, 5,
              5,   5, 5,   5,   5,   5, inf, inf, 5, 5, 5, 5, 5, 5, 5, inf, 5, 5},
         }},  // end Electron, is_inner=false

        {std::make_pair(FeatureT::Electron, true),
         {
             // mean
             {0,          0.9372,    0.0,       0.0,       0,         1.654, 0.1878, 2.055,    2.593, 2.593,
              1.006,      1.006,     1.749,     2.0,       59.55,     1.748, 1.404,  5.054,    3.078, -4.413e-06,
              -1.477e-05, 9.209e-07, 0.0001262, 8.781e-05, 0.0003861, 0,     0,      0.000632, 15.88, 0.005635,
              3.163,      16.15,     1.669,     5.276,     0,         2.813, 14.46},

             // std
             {1,     0.4817,   0.1,   0.1,     1,     1.104, 0.3595, 2.141,   1183.0,  1183.0,  233.5,   233.5,   88.75,
              1.278, 44.9,     2.591, 2.199,   14.8,  10.23, 0.0119, 0.02151, 0.02331, 0.03042, 0.03347, 0.05816, 1,
              1,     0.004139, 50.36, 0.05148, 15.01, 2.752, 431.6,  2.463,   1,       8.186,   5.149},

             // lim_min
             {-inf, -5, -1.0, -1.0, -inf, -5, -5,   -5,   -5, -5, -5, -5, -5, -5, -5, -5,   -5, -5, -5,
              -5,   -5, -5,   -5,   -5,   -5, -inf, -inf, -5, -5, -5, -5, -5, -5, -5, -inf, -5, -5},

             // lim_max
             {inf, 5, 1.0, 1.0, inf, 5, 5,   5,   5, 5, 5, 5, 5, 5, 5, 5,   5, 5, 5,
              5,   5, 5,   5,   5,   5, inf, inf, 5, 5, 5, 5, 5, 5, 5, inf, 5, 5},
         }},  // end Electron, is_inner=true

        {std::make_pair(FeatureT::PfCand_muon, false),
         {
             // mean
             {0, 0.142,     0.0,        0.0,        0,        0,        0,          0,
              0, 5.5,       -9.307e-05, -0.0008956, -0.01717, 0.001419, -0.0001845, -0.01638,
              0, -0.008642, 10.87,      -0.01718,   296.6,    0.7838,   17.99},

             // std
             {1,     0.618, 0.5,   0.5,   1, 1,     1,     1,     1,     5.5,   1.123, 1.108,
              6.913, 1.229, 1.216, 7.147, 1, 1.578, 58.34, 6.915, 515.9, 2.933, 6.317},

             // lim_min
             {-inf, -5, -1.0, -1.0, -inf, -inf, -inf, -inf, -inf, -1.0, -5, -5,
              -5,   -5, -5,   -5,   -inf, -5,   -5,   -5,   -5,   -5,   -5},

             // lim_max
             {inf, 5, 1.0, 1.0, inf, inf, inf, inf, inf, 1.0, 5, 5, 5, 5, 5, 5, inf, 5, 5, 5, 5, 5, 5},

         }},  // end PfCand_muon, is_inner=false

        {std::make_pair(FeatureT::PfCand_muon, true),
         {
             // mean
             {0, 0.9561,     0.0,        0.0,       0,         0,         0,          0,
              0, 5.5,        -9.493e-06, 2.109e-06, -0.005042, 0.0001233, -1.605e-06, -0.004842,
              0, -2.842e-05, 1.391,      -0.005043, 10.48,     0.5868,    17.11},

             // std
             {1,      0.1959, 0.1,    0.1,    1, 1,      1,     1,      1,     5.5,   0.0752, 0.07712,
              0.8103, 0.2137, 0.2138, 0.9617, 1, 0.1077, 7.796, 0.8103, 155.9, 1.003, 4.29},

             // lim_min
             {-inf, -5, -1.0, -1.0, -inf, -inf, -inf, -inf, -inf, -1.0, -5, -5,
              -5,   -5, -5,   -5,   -inf, -5,   -5,   -5,   -5,   -5,   -5},

             // lim_max
             {inf, 5, 1.0, 1.0, inf, inf, inf, inf, inf, 1.0, 5, 5, 5, 5, 5, 5, inf, 5, 5, 5, 5, 5, 5},

         }},  // end PfCand_muon, is_inner=true

        {std::make_pair(FeatureT::Muon, false),
         {
             // mean
             {0,   0.3645, 0.0, 0.0,  0.00344, 17.54, 0,   24.78, 17.92, 0,   0,   0,   0.3221,
              1.0, 1.0,    1.0, 1.0,  3.0,     1.0,   1.0, 1.0,   3.5,   3.0, 2.0, 2.0, 6.0,
              6.0, 6.0,    4.0, 12.0, 6.0,     6.0,   6.0, 2.0,   2.0,   1.0, 1.0},

             // std
             {1,   85.0, 0.5, 0.5,  1.557, 97.45, 1,   2022.0, 6.573, 1,   1,   1,   0.6166,
              1.0, 1.0,  1.0, 1.0,  3.0,   1.0,   1.0, 1.0,    3.5,   3.0, 2.0, 2.0, 6.0,
              6.0, 6.0,  4.0, 12.0, 6.0,   6.0,   6.0, 2.0,    2.0,   1.0, 1.0},

             // lim_min
             {-inf, -5,   -1.0, -1.0, -5,   -5,   -inf, -5,   -5,   -inf, -inf, -inf, -5,
              -1.0, -1.0, -1.0, -1.0, -1.0, -1.0, -1.0, -1.0, -1.0, -1.0, -1.0, -1.0, -1.0,
              -1.0, -1.0, -1.0, -1.0, -1.0, -1.0, -1.0, -1.0, -1.0, -1.0, -1.0},

             // lim_max
             {inf, 5,   1.0, 1.0, 5,   5,   inf, 5,   5,   inf, inf, inf, 5,   1.0, 1.0, 1.0, 1.0, 1.0, 1.0,
              1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0},

         }},  // end Muon, is_inner=false

        {std::make_pair(FeatureT::Muon, true),
         {
             // mean
             {0,   1.033, 0.0, 0.0,  0.001217, 5.403, 0,   7.2, 18.58, 0,   0,   0,   0.09762,
              1.0, 1.0,   1.0, 1.0,  3.0,      1.0,   1.0, 1.0, 3.5,   3.0, 2.0, 2.0, 6.0,
              6.0, 6.0,   4.0, 12.0, 6.0,      6.0,   6.0, 2.0, 2.0,   1.0, 1.0},

             // std
             {1,   65.51, 0.1, 0.1,  0.2033, 36.07, 1,   263.3, 5.019, 1,   1,   1,   0.3956,
              1.0, 1.0,   1.0, 1.0,  3.0,    1.0,   1.0, 1.0,   3.5,   3.0, 2.0, 2.0, 6.0,
              6.0, 6.0,   4.0, 12.0, 6.0,    6.0,   6.0, 2.0,   2.0,   1.0, 1.0},

             // lim_min
             {-inf, -5,   -1.0, -1.0, -5,   -5,   -inf, -5,   -5,   -inf, -inf, -inf, -5,
              -1.0, -1.0, -1.0, -1.0, -1.0, -1.0, -1.0, -1.0, -1.0, -1.0, -1.0, -1.0, -1.0,
              -1.0, -1.0, -1.0, -1.0, -1.0, -1.0, -1.0, -1.0, -1.0, -1.0, -1.0},

             // lim_max
             {inf, 5,   1.0, 1.0, 5,   5,   inf, 5,   5,   inf, inf, inf, 5,   1.0, 1.0, 1.0, 1.0, 1.0, 1.0,
              1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0},

         }},  // end Muon, is_inner=true

        {std::make_pair(FeatureT::PfCand_chHad, false),
         {
             // mean
             {0, 0.02191,  0.0,  0.0,      0,         0,         0,        0,         0,
              0, 0,        6.0,  0.00106,  -0.001523, -0.008181, 0.004498, 4.287e-06, -0.007022,
              0, -0.01495, 6.04, -0.01381, 323.5,     0.753,     13.6,     0,         1.3},

             // std
             {1,     0.08964, 0.5,   0.5,   1, 1,     1,     1,     1,     1,     1,     6.0, 1.732, 1.741,
              8.372, 1.783,   1.792, 8.447, 1, 2.481, 33.16, 8.026, 443.9, 3.439, 6.624, 1,   1.3},

             // lim_min
             {-inf, -5, -1.0, -1.0, -inf, -inf, -inf, -inf, -inf, -inf, -inf, -1.0, -5,  -5,
              -5,   -5, -5,   -5,   -inf, -5,   -5,   -5,   -5,   -5,   -5,   -inf, -1.0},

             // lim_max
             {inf, 5, 1.0, 1.0, inf, inf, inf, inf, inf, inf, inf, 1.0, 5,  5,
              5,   5, 5,   5,   inf, 5,   5,   5,   5,   5,   5,   inf, 1.0},
         }},  // end PfCand_chHad, is_inner=false

        {std::make_pair(FeatureT::PfCand_chHad, true),
         {
             // mean
             {0, 0.2482,    0.0,  0.0,       0,          0,         0,        0,        0,
              0, 0,         6.0,  0.0003524, -0.0003693, -0.002133, 0.003532, 0.000612, -0.0003197,
              0, -0.001701, 4.04, -0.002282, 61.12,      0.9004,    14.73,    0,        1.3},

             // std
             {1,     0.3601, 0.1,   0.1,   1, 1,     1,     1,     1,     1,    1,     6.0, 0.8533, 0.8569,
              4.132, 1.033,  1.039, 4.436, 1, 1.001, 16.62, 3.254, 244.4, 4.37, 5.599, 1,   1.3},

             // lim_min
             {-inf, -5, -1.0, -1.0, -inf, -inf, -inf, -inf, -inf, -inf, -inf, -1.0, -5,  -5,
              -5,   -5, -5,   -5,   -inf, -5,   -5,   -5,   -5,   -5,   -5,   -inf, -1.0},

             // lim_max
             {inf, 5, 1.0, 1.0, inf, inf, inf, inf, inf, inf, inf, 1.0, 5,  5,
              5,   5, 5,   5,   inf, 5,   5,   5,   5,   5,   5,   inf, 1.0},
         }},  // end PfCand_chHad, is_inner=true

        {std::make_pair(FeatureT::PfCand_nHad, false),
         {
             // mean
             {0, 0.05398, 0.0, 0.0, 0, 0, 0},

             // std
             {1, 0.2929, 0.5, 0.5, 1, 1, 1},

             // lim_min
             {-inf, -5, -1.0, -1.0, -inf, -inf, -inf},

             // lim_max
             {inf, 5, 1.0, 1.0, inf, inf, inf},

         }},  // end PfCand_nHad, is_inner=false

        {std::make_pair(FeatureT::PfCand_nHad, true),
         {
             // mean
             {0, 0.2553, 0.0, 0.0, 0, 0, 0},

             // std
             {1, 0.2687, 0.1, 0.1, 1, 1, 1},

             // lim_min
             {-inf, -5, -1.0, -1.0, -inf, -inf, -inf},

             // lim_max
             {inf, 5, 1.0, 1.0, inf, inf, inf},

         }},  // end PfCand_nHad, is_inner=true

    };  // end scalingParamsMap_v2p5

    const std::map<std::pair<FeatureT, bool>, ScalingParams> scalingParamsMap_PhaseIIv2p5 = {
        {std::make_pair(FeatureT::TauFlat, false),
         {
             // mean_
             {100.0,      510.0,     0.0,
              0.5718,     2.181,     0,
              1,          0,         14.32,
              0,          2.243,     12.67,
              0,          0,         0,
              0.4827,     101.3,     0,
              0.001571,   3.935,     0,
              0.002075,   4.328,     0.001592,
              0,          93.74,     0.0003602,
              -1.718e-05, -0.001134, -2.712,
              0.5,        0.5,       0.007457,
              0.5,        1.072,     0,
              0.5,        0,         1.5707963267948966,
              4.13,       0.0,       0,
              -0.0008631},

             // std_
             {100.0,    490.0,  3.0,
              0.5081,   1.593,  1,
              1,        1,      41.7,
              1,        6.779,  39.88,
              1,        1,      1,
              2.298,    32.93,  1,
              0.008156, 8.897,  1,
              0.01112,  8.502,  0.8673,
              1,        862.9,  0.3587,
              0.3585,   1.599,  19.88,
              0.5,      0.5,    0.01698,
              0.5,      0.5388, 1,
              0.5,      1,      1.5707963267948966,
              3.313,    1.0,    1,
              0.9046},

             // lim_min_
             {-1.0, -1.0, -1.0, -5,   -5, -inf, -inf, -inf, -5,   -inf, -5,   -5,   -inf, -inf, -inf,
              -5,   -5,   -inf, -5,   -5, -inf, -5,   -5,   -5,   -inf, -5,   -5,   -5,   -5,   -5,
              -1.0, -1.0, -5,   -1.0, -5, -inf, -1.0, -inf, -1.0, -5,   -1.0, -inf, -5},

             // lim_max_
             {1.0, 1.0, 1.0, 5, 5, inf, inf, inf, 5,   inf, 5, 5,   inf, inf, inf, 5,   5,   inf, 5,   5,   inf, 5,
              5,   5,   inf, 5, 5, 5,   5,   5,   1.0, 1.0, 5, 1.0, 5,   inf, 1.0, inf, 1.0, 5,   1.0, inf, 5},
         }},  // end TauFlat

        {std::make_pair(FeatureT::GridGlobal, false),
         {
             // mean_
             {100.0, 510.0, 0.0, 0},
             // std_
             {100.0, 490.0, 3.0, 1},
             // lim_min_
             {-1.0, -1.0, -1.0, -inf},
             // lim_max_
             {1.0, 1.0, 1.0, inf},
         }},  // end GridGlobal

        {std::make_pair(FeatureT::PfCand_electron, false),
         {
             // mean_
             {0,        0.1106,    0.0,        0.0,      0, 0,         0,     0,       7.5,   -0.000121, 5.664e-06,
              0.002146, -0.001255, -0.0001182, 0.003788, 0, 0.0008399, 6.696, 0.02434, 827.1, 2.902,     11.96},

             // std_
             {1,     1.069,  0.5,    0.5,   1, 1,       1,     1,     7.5,    0.11,  0.1115,
              5.572, 0.4267, 0.4208, 6.163, 1, 0.09652, 10.57, 5.509, 1507.0, 11.02, 6.747},

             // lim_min_
             {-inf, -5, -1.0, -1.0, -inf, -inf, -inf, -inf, -1.0, -5, -5, -5, -5, -5, -5, -inf, -5, -5, -5, -5, -5, -5},

             // lim_max_
             {inf, 5, 1.0, 1.0, inf, inf, inf, inf, 1.0, 5, 5, 5, 5, 5, 5, inf, 5, 5, 5, 5, 5, 5},
         }},  // end PfCand_electron, is_inner=false

        {std::make_pair(FeatureT::PfCand_electron, true),
         {
             // mean_
             {0,        0.8424,     0.0,      0.0,      0, 0,         0,     0,        7.5,   -1.594e-05, -1.615e-05,
              0.001503, -0.0001738, -0.00201, 0.008298, 0, 3.245e-05, 2.908, 0.001685, 105.5, 1.305,      11.81},

             // std_
             {1,     0.6145, 0.1,    0.1,   1, 1,       1,     1,     7.5,   0.01716, 0.01745,
              1.209, 0.5551, 0.5364, 3.608, 1, 0.02022, 6.137, 1.189, 877.8, 5.948,   6.481},

             // lim_min_
             {-inf, -5, -1.0, -1.0, -inf, -inf, -inf, -inf, -1.0, -5, -5, -5, -5, -5, -5, -inf, -5, -5, -5, -5, -5, -5},

             // lim_max_
             {inf, 5, 1.0, 1.0, inf, inf, inf, inf, 1.0, 5, 5, 5, 5, 5, 5, inf, 5, 5, 5, 5, 5, 5},
         }},  // end PfCand_electron, is_inner=true

        {std::make_pair(FeatureT::PfCand_gamma, false),
         {
             // mean
             {0,          0.01285,    0.0,      0.0,      0, 0,        0,    0,     0,      3.5,  4.308e-06, 1.919e-06,
              -0.0005881, -0.0009704, 0.000131, 0.001519, 0, 0.007348, 12.2, 4.698, 3080.0, 32.8, 5.8},

             // std
             {1,      0.07524, 0.5,    0.5,   1, 1,       1,     1,     1,      3.5,   0.003429, 0.003318,
              0.5228, 0.4157,  0.4125, 2.441, 1, 0.03917, 8.802, 5.297, 4449.0, 38.05, 1.6},

             // lim_min
             {-inf, -5, -1.0, -1.0, -inf, -inf, -inf, -inf, -inf, -1.0, -5, -5,
              -5,   -5, -5,   -5,   -inf, -5,   -5,   -5,   -5,   -5,   -5},

             // lim_max
             {inf, 5, 1.0, 1.0, inf, inf, inf, inf, inf, 1.0, 5, 5, 5, 5, 5, 5, inf, 5, 5, 5, 5, 5, 5},

         }},  // end PfCand_gamma, is_inner=false

        {std::make_pair(FeatureT::PfCand_gamma, true),
         {
             // mean
             {0, 0.1594,   0.0,       0.0,        0,         0,          0,          0,
              0, 3.5,      1.295e-05, -8.435e-06, -0.001344, -0.0006508, -0.0004855, 0.004292,
              0, 0.001246, 7.58,      -0.4247,    1903.0,    18.11,      7.873},

             // std
             {1,      0.4276, 0.1,   0.1,   1, 1,       1,    1,     1,      3.5,   0.004268, 0.003182,
              0.6095, 0.3957, 0.394, 2.006, 1, 0.02973, 10.0, 6.273, 3515.0, 39.42, 1.51},

             // lim_min
             {-inf, -5, -1.0, -1.0, -inf, -inf, -inf, -inf, -inf, -1.0, -5, -5,
              -5,   -5, -5,   -5,   -inf, -5,   -5,   -5,   -5,   -5,   -5},

             // lim_max
             {inf, 5, 1.0, 1.0, inf, inf, inf, inf, inf, 1.0, 5, 5, 5, 5, 5, 5, inf, 5, 5, 5, 5, 5, 5},

         }},  // end PfCand_gamma, is_inner=true

        {std::make_pair(FeatureT::Electron, false),
         {
             // mean
             {0,          0.3915,     0.0,       0.0,        0,          0.978, 0.4455, 1.803,     2.508, 2.508,
              1.726,      1.726,      1.957,     2.223,      10.34,      2.985, 1.6,    1.761,     1.041, 0.0001027,
              -0.0002442, -0.0002209, 5.576e-05, -0.0004276, -0.0004178, 0,     0,      0.0002244, 3.137, 0.01031,
              52.28,      8.907,      2.1,       7.053,      0,          1.288, 15.6},

             // std
             {1,     1.379,    0.5,   0.5,    1,      2.605, 0.6392,  2.079,   102.2,  102.2,   99.4,  99.4,   41.23,
              1.889, 12.54,    10.94, 9.838,  4.864,  2.771, 0.04308, 0.04422, 0.0429, 0.06296, 0.133, 0.1179, 1,
              1,     0.001352, 13.06, 0.0315, 1867.0, 1.421, 77.27,   6.956,   1,      1.081,   6.592},

             // lim_min
             {-inf, -5, -1.0, -1.0, -inf, -5, -5,   -5,   -5, -5, -5, -5, -5, -5, -5, -5,   -5, -5, -5,
              -5,   -5, -5,   -5,   -5,   -5, -inf, -inf, -5, -5, -5, -5, -5, -5, -5, -inf, -5, -5},

             // lim_max
             {inf, 5, 1.0, 1.0, inf, 5, 5,   5,   5, 5, 5, 5, 5, 5, 5, 5,   5, 5, 5,
              5,   5, 5,   5,   5,   5, inf, inf, 5, 5, 5, 5, 5, 5, 5, inf, 5, 5},
         }},  // end Electron, is_inner=false

        {std::make_pair(FeatureT::Electron, true),
         {
             // mean
             {0,          1.005,      0.0,       0.0,       0,         1.219, 0.1747, 2.046,     2.11,  2.11,
              1.784,      1.784,      2.07,      2.439,     45.29,     2.077, 1.602,  2.207,     1.535, 6.492e-06,
              -3.824e-06, -5.448e-06, 4.593e-05, 9.523e-05, 4.193e-05, 0,     0,      0.0002632, 2.268, 0.003118,
              4.976,      9.803,      1.455,     6.346,     0,         1.241, 15.65},

             // std
             {1,       1.014,   0.1,     0.1,     1,      0.5406, 0.3296, 1.92,     20.89, 20.89,
              23.88,   23.88,   5.072,   1.783,   39.63,  3.758,  3.153,  4.36,     2.753, 0.01403,
              0.01394, 0.01382, 0.02341, 0.04605, 0.0464, 1,      1,      0.001201, 10.6,  0.004481,
              35.88,   1.185,   36.29,   3.076,   1,      0.726,  5.13},

             // lim_min
             {-inf, -5, -1.0, -1.0, -inf, -5, -5,   -5,   -5, -5, -5, -5, -5, -5, -5, -5,   -5, -5, -5,
              -5,   -5, -5,   -5,   -5,   -5, -inf, -inf, -5, -5, -5, -5, -5, -5, -5, -inf, -5, -5},

             // lim_max
             {inf, 5, 1.0, 1.0, inf, 5, 5,   5,   5, 5, 5, 5, 5, 5, 5, 5,   5, 5, 5,
              5,   5, 5,   5,   5,   5, inf, inf, 5, 5, 5, 5, 5, 5, 5, inf, 5, 5},
         }},  // end Electron, is_inner=true

        {std::make_pair(FeatureT::PfCand_muon, false),
         {
             // mean
             {0, 0.06569,    0.0,        0.0,        0,      0,         0,         0,
              0, 5.5,        -7.842e-05, -0.0001811, 0.0152, 1.847e-05, -0.002452, 0.01452,
              0, -0.0003077, 4.264,      0.01624,    652.1,  0.8343,    21.51},

             // std
             {1,     0.8174, 0.5,    0.5,   1, 1,      1,     1,     1,     5.5,    0.06539, 0.06323,
              6.064, 0.4649, 0.4612, 6.464, 1, 0.0908, 25.46, 6.063, 832.1, 0.8017, 5.72},

             // lim_min
             {-inf, -5, -1.0, -1.0, -inf, -inf, -inf, -inf, -inf, -1.0, -5, -5,
              -5,   -5, -5,   -5,   -inf, -5,   -5,   -5,   -5,   -5,   -5},

             // lim_max
             {inf, 5, 1.0, 1.0, inf, inf, inf, inf, inf, 1.0, 5, 5, 5, 5, 5, 5, inf, 5, 5, 5, 5, 5, 5},

         }},  // end PfCand_muon, is_inner=false

        {std::make_pair(FeatureT::PfCand_muon, true),
         {
             // mean
             {0, 0.9535,    0.0,        0.0,        0,         0,          0,         0,
              0, 5.5,       -3.664e-05, 1.199e-05,  -0.001638, -0.0003709, 0.0004101, -0.0002903,
              0, 4.724e-05, 2.692,      -0.0007676, 69.4,      0.4363,     18.07},

             // std
             {1,     0.6853, 0.1,    0.1,   1, 1,       1,    1,     1,     5.5,    0.02, 0.02026,
              1.248, 0.188,  0.1894, 1.374, 1, 0.02816, 17.5, 1.248, 742.1, 0.6667, 4.928},

             // lim_min
             {-inf, -5, -1.0, -1.0, -inf, -inf, -inf, -inf, -inf, -1.0, -5, -5,
              -5,   -5, -5,   -5,   -inf, -5,   -5,   -5,   -5,   -5,   -5},

             // lim_max
             {inf, 5, 1.0, 1.0, inf, inf, inf, inf, inf, 1.0, 5, 5, 5, 5, 5, 5, inf, 5, 5, 5, 5, 5, 5},

         }},  // end PfCand_muon, is_inner=true

        {std::make_pair(FeatureT::Muon, false),
         {
             // mean
             {0,   0.1419, 0.0, 0.0,  -7.344e-05, 7.819, 0,   35.42, 17.91, 0,   0,   0,   0.05448,
              1.0, 1.0,    1.0, 1.0,  3.0,        1.0,   1.0, 1.0,   3.5,   3.0, 2.0, 2.0, 6.0,
              6.0, 6.0,    4.0, 12.0, 6.0,        6.0,   6.0, 2.0,   2.0,   1.0, 1.0},

             // std
             {1,   5.958, 0.5, 0.5,  0.1345, 49.28, 1,   274.6, 5.823, 1,   1,   1,   0.2388,
              1.0, 1.0,   1.0, 1.0,  3.0,    1.0,   1.0, 1.0,   3.5,   3.0, 2.0, 2.0, 6.0,
              6.0, 6.0,   4.0, 12.0, 6.0,    6.0,   6.0, 2.0,   2.0,   1.0, 1.0},

             // lim_min
             {-inf, -5,   -1.0, -1.0, -5,   -5,   -inf, -5,   -5,   -inf, -inf, -inf, -5,
              -1.0, -1.0, -1.0, -1.0, -1.0, -1.0, -1.0, -1.0, -1.0, -1.0, -1.0, -1.0, -1.0,
              -1.0, -1.0, -1.0, -1.0, -1.0, -1.0, -1.0, -1.0, -1.0, -1.0, -1.0},

             // lim_max
             {inf, 5,   1.0, 1.0, 5,   5,   inf, 5,   5,   inf, inf, inf, 5,   1.0, 1.0, 1.0, 1.0, 1.0, 1.0,
              1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0},

         }},  // end Muon, is_inner=false

        {std::make_pair(FeatureT::Muon, true),
         {
             // mean
             {0,   1.153, 0.0, 0.0,  -1.624e-05, 21.24, 0,   15.0, 18.63, 0,   0,   0,   0.05187,
              1.0, 1.0,   1.0, 1.0,  3.0,        1.0,   1.0, 1.0,  3.5,   3.0, 2.0, 2.0, 6.0,
              6.0, 6.0,   4.0, 12.0, 6.0,        6.0,   6.0, 2.0,  2.0,   1.0, 1.0},

             // std
             {1,   35.54, 0.1, 0.1,  0.16, 105.2, 1,   269.2, 4.874, 1,   1,   1,   0.2431,
              1.0, 1.0,   1.0, 1.0,  3.0,  1.0,   1.0, 1.0,   3.5,   3.0, 2.0, 2.0, 6.0,
              6.0, 6.0,   4.0, 12.0, 6.0,  6.0,   6.0, 2.0,   2.0,   1.0, 1.0},

             // lim_min
             {-inf, -5,   -1.0, -1.0, -5,   -5,   -inf, -5,   -5,   -inf, -inf, -inf, -5,
              -1.0, -1.0, -1.0, -1.0, -1.0, -1.0, -1.0, -1.0, -1.0, -1.0, -1.0, -1.0, -1.0,
              -1.0, -1.0, -1.0, -1.0, -1.0, -1.0, -1.0, -1.0, -1.0, -1.0, -1.0},

             // lim_max
             {inf, 5,   1.0, 1.0, 5,   5,   inf, 5,   5,   inf, inf, inf, 5,   1.0, 1.0, 1.0, 1.0, 1.0, 1.0,
              1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0},

         }},  // end Muon, is_inner=true

        {std::make_pair(FeatureT::PfCand_chHad, false),
         {
             // mean
             {0, 0.02063,   0.0,   0.0,       0,         0,       0,          0,          0,
              0, 0,         6.0,   7.994e-06, 1.326e-05, 0.00378, -0.0005101, -2.036e-05, 0.004647,
              0, 0.0002569, 1.772, 0.004969,  695.1,     0.6393,  15.17,      0,          1.3},

             // std
             {1,     0.06009, 0.5,    0.5,   1, 1,       1,     1,     1,     1,      1,     6.0, 0.04616, 0.04631,
              5.925, 0.3523,  0.3541, 6.099, 1, 0.04398, 5.968, 5.843, 756.6, 0.8879, 6.185, 1,   1.3},

             // lim_min
             {-inf, -5, -1.0, -1.0, -inf, -inf, -inf, -inf, -inf, -inf, -inf, -1.0, -5,  -5,
              -5,   -5, -5,   -5,   -inf, -5,   -5,   -5,   -5,   -5,   -5,   -inf, -1.0},

             // lim_max
             {inf, 5, 1.0, 1.0, inf, inf, inf, inf, inf, inf, inf, 1.0, 5,  5,
              5,   5, 5,   5,   inf, 5,   5,   5,   5,   5,   5,   inf, 1.0},
         }},  // end PfCand_chHad, is_inner=false

        {std::make_pair(FeatureT::PfCand_chHad, true),
         {
             // mean
             {0, 0.1902,    0.0,   0.0,       0,         0,        0,          0,         0,
              0, 0,         6.0,   -3.22e-05, 1.892e-05, 0.001798, -0.0005992, 0.0003633, 0.004573,
              0, 8.158e-05, 4.518, 0.006913,  287.4,     0.5699,   16.18,      0,         1.3},

             // std
             {1,     0.3578, 0.1,    0.1,   1, 1,       1,    1,     1,     1,      1,     6.0, 0.0326, 0.03277,
              4.021, 0.413,  0.4153, 4.324, 1, 0.03025, 11.8, 3.547, 728.6, 0.8056, 5.736, 1,   1.3},

             // lim_min
             {-inf, -5, -1.0, -1.0, -inf, -inf, -inf, -inf, -inf, -inf, -inf, -1.0, -5,  -5,
              -5,   -5, -5,   -5,   -inf, -5,   -5,   -5,   -5,   -5,   -5,   -inf, -1.0},

             // lim_max
             {inf, 5, 1.0, 1.0, inf, inf, inf, inf, inf, inf, inf, 1.0, 5,  5,
              5,   5, 5,   5,   inf, 5,   5,   5,   5,   5,   5,   inf, 1.0},
         }},  // end PfCand_chHad, is_inner=true

        {std::make_pair(FeatureT::PfCand_nHad, false),
         {
             // mean
             {0, 0.01414, 0.0, 0.0, 0, 0, 0},

             // std
             {1, 0.05509, 0.5, 0.5, 1, 1, 1},

             // lim_min
             {-inf, -5, -1.0, -1.0, -inf, -inf, -inf},

             // lim_max
             {inf, 5, 1.0, 1.0, inf, inf, inf},

         }},  // end PfCand_nHad, is_inner=false

        {std::make_pair(FeatureT::PfCand_nHad, true),
         {
             // mean
             {0, 0.1149, 0.0, 0.0, 0, 0, 0},

             // std
             {1, 0.2151, 0.1, 0.1, 1, 1, 1},

             // lim_min
             {-inf, -5, -1.0, -1.0, -inf, -inf, -inf},

             // lim_max
             {inf, 5, 1.0, 1.0, inf, inf, inf},

         }},  // end PfCand_nHad, is_inner=true

    };  // end scalingParamsMap_PhaseIIv2p5

  };  // namespace Scaling
};    // namespace deep_tau

#endif
