value.hpp 1.0 KB

123456789101112131415161718192021222324252627282930313233
  1. #ifndef root_values_hpp
  2. #define root_values_hpp
  3. #include "value.hpp"
  4. #include "TLorentzVector.h"
  5. namespace filval::root{
  6. class DerivedLorentzVector : public DerivedValue<TLorentzVector>{
  7. protected:
  8. Value<double> *pt;
  9. Value<double> *eta;
  10. Value<double> *phi;
  11. Value<double> *m;
  12. void update_value(){
  13. value.SetPtEtaPhiM(pt->get_value(), eta->get_value(), phi->get_value(), m->get_value());
  14. }
  15. public:
  16. DerivedLorentzVector(ValueSet *values,
  17. const std::string &pt_label,
  18. const std::string &eta_label,
  19. const std::string &phi_label,
  20. const std::string &m_label){
  21. ValueSet &valueSet = *values;
  22. pt = (Value<double>*) valueSet[pt_label];
  23. eta = (Value<double>*) valueSet[eta_label];
  24. phi = (Value<double>*) valueSet[phi_label];
  25. m = (Value<double>*) valueSet[m_label];
  26. }
  27. };
  28. }
  29. #endif // root_values_hpp