#ifndef root_value_hpp #define root_value_hpp #include "value.hpp" #include "TLorentzVector.h" namespace filval::root{ class LorentzVector : public DerivedValue{ protected: Value *pt; Value *eta; Value *phi; Value *m; void update_value(){ value.SetPtEtaPhiM(pt->get_value(), eta->get_value(), phi->get_value(), m->get_value()); } public: LorentzVector(const std::string& name, Value* pt, Value* eta, Value* phi, Value* m) :DerivedValue(name), pt(pt), eta(eta), phi(phi), m(m) { } LorentzVector(const std::string& name, const std::string &pt_label, const std::string &eta_label, const std::string &phi_label, const std::string &m_label) :LorentzVector(name, dynamic_cast*>(GenValue::get_value(pt_label)), dynamic_cast*>(GenValue::get_value(eta_label)), dynamic_cast*>(GenValue::get_value(phi_label)), dynamic_cast*>(GenValue::get_value(m_label))){ } }; class LorentzVectorEnergy : public DerivedValue{ protected: Value* vector; void update_value(){ value = vector->get_value().E(); } public: LorentzVectorEnergy(const std::string& name, Value* vector) :DerivedValue(name), vector(vector){ } LorentzVectorEnergy(const std::string& name, const std::string& vector_label) :LorentzVectorEnergy(name, dynamic_cast*>(GenValue::get_value(vector_label))){ } }; } #endif // root_value_hpp