api.hpp 1.5 KB

123456789101112131415161718192021222324252627282930313233343536
  1. #ifndef ROOT_API_HPP
  2. #define ROOT_API_HPP
  3. #include <string>
  4. #include <vector>
  5. #include <tuple>
  6. #include "filval/api.hpp"
  7. #include "filval_root/value.hpp"
  8. namespace fv::root{
  9. Value<std::vector<TLorentzVector>>* lorentz_vectors(Value<std::vector<float>>* pt, Value<std::vector<float>>* eta,
  10. Value<std::vector<float>>* phi, Value<std::vector<float>>* mass,
  11. const std::string& alias=""){
  12. return new root::LorentzVectors(pt, eta, phi, mass, alias);
  13. }
  14. Value<std::vector<TLorentzVector>>* lorentz_vectors(const std::string& pt_name, const std::string& eta_name,
  15. const std::string& phi_name, const std::string& mass_name,
  16. const std::string& alias=""){
  17. return lorentz_vectors(lookup<std::vector<float>>(pt_name), lookup<std::vector<float>>(eta_name),
  18. lookup<std::vector<float>>(phi_name), lookup<std::vector<float>>(mass_name),
  19. alias);
  20. }
  21. Value<std::vector<float>>* energies(Value<std::vector<TLorentzVector>>* vectors,
  22. const std::string& alias=""){
  23. return new root::Energies(vectors, alias);
  24. }
  25. Value<std::vector<float>>* energies(const std::string& vectors_name,
  26. const std::string& alias=""){
  27. return energies(lookup<std::vector<TLorentzVector>>(vectors_name), alias);
  28. }
  29. }
  30. #endif // ROOT_API_HPP