7 #include "filval_root/value.hpp" 11 lorentz_vectors(Value<
std::vector<
float>>* pt, Value<
std::vector<
float>>* eta,
12 Value<
std::vector<
float>>* phi, Value<
std::vector<
float>>* mass,
13 const
std::
string& alias=""){
14 typedef std::vector<TLorentzVector> type;
15 const std::string& name = root::LorentzVectors::fmt_name(pt, eta, phi, mass);
16 if (check_exists<type>(name))
17 return lookup<type>(name);
19 return (Value<type>*)
new root::LorentzVectors(pt, eta, phi, mass, alias);
23 lorentz_vectors(const
std::
string& pt_name, const
std::
string& eta_name,
24 const
std::
string& phi_name, const
std::
string& mass_name,
25 const
std::
string& alias=""){
26 return lorentz_vectors(lookup<std::vector<float>>(pt_name), lookup<std::vector<float>>(eta_name),
27 lookup<std::vector<float>>(phi_name), lookup<std::vector<float>>(mass_name),
32 energies(Value<
std::vector<TLorentzVector>>* vectors, const
std::
string& alias="") {
33 typedef std::vector<float> type;
34 const std::string& name = root::Energies::fmt_name(vectors);
35 if (check_exists<type>(name))
36 return lookup<type>(name);
38 return (Value<type>*)
new root::Energies(vectors, alias);
42 energies(const
std::
string& vectors_name, const
std::
string& alias="") {
43 return energies(lookup<std::vector<TLorentzVector>>(vectors_name), alias);
46 template<
typename... DataTypes>
48 mva_data(Value<
bool>* is_training, Value<
bool>* is_signal, Value<
double>* weight,
49 const
std::pair<
std::
string, Value<DataTypes>*>&&... data_vals) {
50 typedef typename root::MVAData<DataTypes...> mva_type;
51 typedef typename mva_type::type type;
53 const std::string& name = mva_type::fmt_name(is_training, is_signal, weight,
54 std::forward<
const std::pair<std::string,Value<DataTypes>*>>(data_vals)...);
55 if (check_exists<type>(name))
56 return lookup<type>(name);
58 return (Value<type>*)
new mva_type(is_training, is_signal, weight,
59 std::forward<
const std::pair<std::string,Value<DataTypes>*>>(data_vals)...);
63 #endif // ROOT_API_HPP