1 #ifndef CombineTools_Systematics_h
2 #define CombineTools_Systematics_h
52 template <
typename F,
typename H,
typename... Ts>
54 std::vector<Ts>
const &... t) {
56 cross_imp([&](Ts
const &... ts) { f(he, ts...); }, t...);
59 template <
typename... Ts>
60 std::vector<std::tuple<Ts...>>
cross(std::vector<Ts>
const &... in) {
61 std::vector<std::tuple<Ts...>> res;
63 res.emplace_back(ts...);
72 std::map<std::tuple<
typename T::type...>,
double> tmap_;
77 for (
auto const& a : res) {
78 tmap_.insert(std::make_pair(a, val));
85 return tmap_.count(std::make_tuple(T::get(p)...));
93 return tmap_.find(std::make_tuple(T::get(p)...))->second;
104 return std::string(
"");
108 return std::string(
"");
114 return x(input..., val);
120 std::set<std::tuple<
typename T::type...>> res;
121 for (
auto const& x : tmap_) res.insert(x.first);
127 return std::make_tuple(T::get(p)...);
129 throw std::runtime_error(
FNERROR(
"Supplied pointer is null"));
137 std::map<std::tuple<
typename T::type...>, std::pair<double, double>> tmap_;
141 double val_d,
double val_u) {
143 for (
auto const& a : res)
144 tmap_.insert(std::make_pair(a, std::make_pair(val_d, val_u)));
150 return tmap_.count(std::make_tuple(T::get(p)...));
158 return tmap_.find(std::make_tuple(T::get(p)...))->second.first;
165 return tmap_.find(std::make_tuple(T::get(p)...))->second.second;
172 return std::string(
"");
176 return std::string(
"");
180 double val_d,
double val_u) {
182 return x(input..., val_d, val_u);
188 std::set<std::tuple<
typename T::type...>> res;
189 for (
auto const& x : tmap_) res.insert(x.first);
195 return std::make_tuple(T::get(p)...);
197 throw std::runtime_error(
FNERROR(
"Supplied pointer is null"));
205 std::map<std::tuple<
typename T::type...>, std::pair<std::string, std::string>> tmap_;
209 std::string formula, std::string args) {
211 for (
auto const& a : res)
212 tmap_.insert(std::make_pair(a, std::make_pair(formula, args)));
218 return tmap_.count(std::make_tuple(T::get(p)...));
233 return tmap_.find(std::make_tuple(T::get(p)...))->second.first;
235 return std::string(
"");
240 return tmap_.find(std::make_tuple(T::get(p)...))->second.second;
242 return std::string(
"");
247 std::string formula, std::string args) {
249 return x(input..., formula, args);
255 std::set<std::tuple<
typename T::type...>> res;
256 for (
auto const& x : tmap_) res.insert(x.first);
262 return std::make_tuple(T::get(p)...);
264 throw std::runtime_error(
FNERROR(
"Supplied pointer is null"));
virtual std::string const & process() const
virtual std::string const & bin() const
virtual int bin_id() const
virtual std::string const & analysis() const
virtual std::string const & era() const
virtual std::string const & mass() const
virtual std::string const & channel() const
std::string Args(ch::Process *) const
std::string Formula(ch::Process *) const
double ValD(ch::Process *p) const
static SystMapAsymm< T... > init(std::vector< typename T::type >... input, double val_d, double val_u)
bool Contains(ch::Process *p) const
std::set< std::tuple< typename T::type... > > GetTupleSet() const
auto GetTuple(ch::Process *p) const -> decltype(std::make_tuple(T::get(p)...))
double ValU(ch::Process *p) const
SystMapAsymm & operator()(std::vector< typename T::type >... input, double val_d, double val_u)
std::string Args(ch::Process *p) const
bool Contains(ch::Process *p) const
std::string Formula(ch::Process *p) const
double ValU(ch::Process *) const
double ValD(ch::Process *) const
SystMapFunc & operator()(std::vector< typename T::type >... input, std::string formula, std::string args)
auto GetTuple(ch::Process *p) const -> decltype(std::make_tuple(T::get(p)...))
std::set< std::tuple< typename T::type... > > GetTupleSet() const
static SystMapFunc< T... > init(std::vector< typename T::type >... input, std::string formula, std::string args)
std::set< std::tuple< typename T::type... > > GetTupleSet() const
auto GetTuple(ch::Process *p) const -> decltype(std::make_tuple(T::get(p)...))
bool Contains(ch::Process *p) const
double ValD(ch::Process *) const
std::string Args(ch::Process *) const
std::string Formula(ch::Process *) const
SystMap & operator()(std::vector< typename T::type >... input, double val)
double ValU(ch::Process *p) const
static SystMap< T... > init(std::vector< typename T::type >... input, double val)
static type get(ch::Process *p)
std::vector< std::tuple< Ts... > > cross(std::vector< Ts > const &... in)
static type get(ch::Process *p)
static type get(ch::Process *p)
static type get(ch::Process *p)
static type get(ch::Process *p)
static type get(ch::Process *p)
static type get(ch::Process *p)