00001 // -*- c++ -*- 00002 #ifndef JETSELECTORTOOLS_JETSELECTORATTRIBUTE_H 00003 #define JETSELECTORTOOLS_JETSELECTORATTRIBUTE_H 00004 00005 #include "JetInterface/IJetSelector.h" 00006 #include "AsgTools/AsgTool.h" 00033 00034 class JetAttributeSelector : public asg::AsgTool , virtual public IJetSelector 00035 { 00036 ASG_TOOL_CLASS(JetAttributeSelector,IJetSelector) 00037 public: 00038 00041 struct SelValueRetriever { 00042 virtual float value(const xAOD::Jet& j) = 0; 00043 virtual ~SelValueRetriever(){}; 00044 }; 00045 00046 JetAttributeSelector(const std::string &t); 00047 virtual ~JetAttributeSelector(); 00048 00049 virtual StatusCode initialize() ; 00050 00051 virtual int keep(const xAOD::Jet& jet) const; 00052 00053 protected: 00054 SelValueRetriever * buildValueRetriever(const std::string& type, const std::string& name, int index); 00055 00056 float m_min; 00057 float m_max; 00058 00059 std::string m_attName; 00060 std::string m_attType; 00061 00062 int m_vectorAttIndex; 00063 SelValueRetriever *m_vretriever; 00064 00065 }; 00066 00067 00068 class JetAbsAttributeSelector : public JetAttributeSelector { 00069 00070 ASG_TOOL_CLASS0(JetAbsAttributeSelector) 00071 public: 00072 JetAbsAttributeSelector(const std::string &t); 00073 virtual int keep(const xAOD::Jet& jet) const; 00074 00075 }; 00076 00077 class JetAttributeRatioSelector : public JetAttributeSelector { 00078 00079 ASG_TOOL_CLASS0(JetAttributeRatioSelector) 00080 public: 00081 JetAttributeRatioSelector(const std::string &t); 00082 00083 virtual StatusCode initialize() ; 00084 00085 virtual int keep(const xAOD::Jet& jet) const; 00086 protected: 00087 00088 std::string m_attName2; 00089 std::string m_attType2; 00090 00091 int m_vectorAttIndex2; 00092 SelValueRetriever *m_vretriever2; 00093 00094 }; 00095 00096 00097 00098 00099 #endif