filter.hpp 756 B

12345678910111213141516171819202122232425262728
  1. #ifndef root_filter_hpp
  2. #define root_filter_hpp
  3. #include "value.hpp"
  4. #include "TLorentzVector.h"
  5. namespace filval::root{
  6. class MassFilter : public Filter {
  7. private:
  8. Value<TLorentzVector> *lorentz_vector;
  9. Value<double> *mass_cut_low;
  10. Value<double> *mass_cut_high;
  11. void update_value(){
  12. double m = lorentz_vector->get_value().M();
  13. value = (m > mass_cut_low) && (m < mass_cut_high);
  14. }
  15. public:
  16. FilterAnd(Value<TLorentzVector> *lorentz_vector,
  17. Value<double> *mass_cut_low,
  18. Value<double> *mass_cut_high)
  19. :lorentz_vector(lorentz_vector),
  20. mass_cut_low(mass_cut_low),
  21. mass_cut_high(mass_cut_high){ }
  22. };
  23. }
  24. #endif // root_filter_hpp