#ifndef ROOT_API_HPP #define ROOT_API_HPP #include #include #include #include "filval/api.hpp" #include "filval/root/value.hpp" namespace fv::root{ decltype(auto) lorentz_vectors(Value>* pt, Value>* eta, Value>* phi, Value>* mass, const std::string& alias=""){ typedef std::vector type; const std::string& name = root::LorentzVectors::fmt_name(pt, eta, phi, mass); if (check_exists(name)) return lookup(name); else return (Value*)new root::LorentzVectors(pt, eta, phi, mass, alias); } decltype(auto) lorentz_vectors(const std::string& pt_name, const std::string& eta_name, const std::string& phi_name, const std::string& mass_name, const std::string& alias=""){ return lorentz_vectors(lookup>(pt_name), lookup>(eta_name), lookup>(phi_name), lookup>(mass_name), alias); } decltype(auto) energies(Value>* vectors, const std::string& alias="") { typedef std::vector type; const std::string& name = root::Energies::fmt_name(vectors); if (check_exists(name)) return lookup(name); else return (Value*)new root::Energies(vectors, alias); } decltype(auto) energies(const std::string& vectors_name, const std::string& alias="") { return energies(lookup>(vectors_name), alias); } template decltype(auto) mva_data(Value* is_training, Value* is_signal, Value* weight, const std::pair*>&&... data_vals) { typedef typename root::MVAData mva_type; typedef typename mva_type::type type; std::string alias=""; const std::string& name = mva_type::fmt_name(is_training, is_signal, weight, std::forward*>>(data_vals)...); if (check_exists(name)) return lookup(name); else return (Value*)new mva_type(is_training, is_signal, weight, std::forward*>>(data_vals)...); } } #endif // ROOT_API_HPP