CMS 3D CMS Logo

StringCutObjectSelector.h
Go to the documentation of this file.
1 #ifndef CommonTools_Utils_StringCutObjectSelector_h
2 #define CommonTools_Utils_StringCutObjectSelector_h
3 /* \class StringCutObjectSelector
4  *
5  * \author Luca Lista, INFN
6  *
7  * $Id: StringCutObjectSelector.h,v 1.4 2012/06/26 21:09:37 wmtan Exp $
8  */
14 
15 template<typename T, bool DefaultLazyness=false>
17  StringCutObjectSelector(const std::string & cut, bool lazy=DefaultLazyness) :
18  type_(typeid(T)) {
19  if(! reco::parser::cutParser<T>(cut, select_, lazy)) {
21  "failed to parse \"" + cut + "\"");
22  }
23  }
25  select_(select),
26  type_(typeid(T)) {
27  }
28  bool operator()(const T & t) const {
29  edm::ObjectWithDict o(type_, const_cast<T *>(& t));
30  return (*select_)(o);
31  }
32 
33 private:
36 };
37 
38 #endif
reco::parser::SelectorPtr select_
StringCutObjectSelector(const reco::parser::SelectorPtr &select)
boost::shared_ptr< SelectorBase > SelectorPtr
Definition: SelectorPtr.h:17
long double T
bool operator()(const T &t) const
StringCutObjectSelector(const std::string &cut, bool lazy=DefaultLazyness)