#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(Value* pt, Value* eta, Value* phi, Value* m) :pt(pt), eta(eta), phi(phi), m(m) { } LorentzVector(ValueSet *values, const std::string &pt_label, const std::string &eta_label, const std::string &phi_label, const std::string &m_label) :LorentzVector(dynamic_cast*>(values->at(pt_label)), dynamic_cast*>(values->at(eta_label)), dynamic_cast*>(values->at(phi_label)), dynamic_cast*>(values->at(m_label))){ } }; class LorentzVectorEnergy : public DerivedValue{ protected: Value* vector; void update_value(){ value = vector->get_value().E(); } public: LorentzVectorEnergy(Value* vector) :vector(vector){ } LorentzVectorEnergy(ValueSet *values, const std::string& vector_label) :LorentzVectorEnergy(dynamic_cast*>(values->at(vector_label))){ } }; } #endif // root_value_hpp