HiggsAnalysis-KITHiggsToTauTau
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros
MinimalPlotlevelFilter.h
Go to the documentation of this file.
1 
2 #pragma once
3 
4 #include "Artus/Core/interface/FilterBase.h"
5 
6 #include "HiggsAnalysis/KITHiggsToTauTau/interface/HttTypes.h"
7 
8 
22 // template<class HttTypes>
23 class MinimalPlotlevelFilter : public FilterBase<HttTypes>
24 {
25 public:
26  typedef std::function<float(event_type const&, product_type const&)> float_extractor_lambda;
27 
28  virtual std::string GetFilterId() const override;
29 
30  void Init(setting_type const& settings, metadata_type& metadata) override;
31 
32  template<typename T>
33  void RemoveSubstrs(typename std::basic_string<T>& s,char p) const
34  {
35  typename std::basic_string<T>::size_type n = 1;
36  for (typename std::basic_string<T>::size_type i = s.find(p); i != typename std::basic_string<T>().npos; i = s.find(p))
37  {
38  s.erase(i, n);
39  }
40  }
41 
42  bool EvaluateSubExpression(std::string& expression, event_type const& event, product_type const& product, setting_type const& settings) const;
43 
44  virtual bool DoesEventPass(event_type const& event, product_type const& product, setting_type const& settings, metadata_type const& metadata) const override;
45 
46 private:
47  std::vector<float_extractor_lambda> m_ExpressionQuantities;
48  std::vector<std::string> m_ExpressionNames;
49  mutable std::vector<std::string> m_SubExpressions;
50 };
virtual bool DoesEventPass(event_type const &event, product_type const &product, setting_type const &settings, metadata_type const &metadata) const override
Definition: MinimalPlotlevelFilter.cc:134
list n
Definition: reduce_mergedFiles.py:148
Definition: MinimalPlotlevelFilter.h:23
void Init(setting_type const &settings, metadata_type &metadata) override
Definition: MinimalPlotlevelFilter.cc:16
std::function< float(event_type const &, product_type const &)> float_extractor_lambda
Definition: MinimalPlotlevelFilter.h:26
bool EvaluateSubExpression(std::string &expression, event_type const &event, product_type const &product, setting_type const &settings) const
Definition: MinimalPlotlevelFilter.cc:57
void RemoveSubstrs(typename std::basic_string< T > &s, char p) const
Definition: MinimalPlotlevelFilter.h:33
virtual std::string GetFilterId() const override
Definition: MinimalPlotlevelFilter.cc:12