00001 #ifndef ISOLATIONSELECTION_ISOLATIONWP_H 00002 #define ISOLATIONSELECTION_ISOLATIONWP_H 00003 00004 #include <xAODPrimitives/tools/getIsolationAccessor.h> 00005 #include <IsolationSelection/IsolationCondition.h> 00006 #include "PATCore/TAccept.h" 00007 #include <map> 00008 00009 namespace CP 00010 { 00011 class IsolationWP{ 00012 public: 00013 IsolationWP(std::string name):m_name(name),m_cutValues(nullptr){}; 00014 ~IsolationWP(); 00015 std::string name(){return m_name;} 00016 void name(std::string name) {m_name = name;} 00017 00018 const Root::TAccept& accept(const xAOD::IParticle& p) const; 00019 const Root::TAccept& accept(const strObj& p) const; 00020 void addCut(IsolationCondition* cut); 00021 const Root::TAccept& getAccept(){return m_accept;} 00022 void saveCutValues(bool yes=true){ 00023 if(yes&&(!m_cutValues)) m_cutValues = new std::map< xAOD::Iso::IsolationType, float >(); 00024 else if((!yes)&&m_cutValues){delete m_cutValues;} 00025 } 00026 std::map< xAOD::Iso::IsolationType, float >* cutValues(){return m_cutValues;} 00027 00028 private: 00029 std::string m_name; 00030 std::vector< IsolationCondition* > m_cuts; 00031 std::map< xAOD::Iso::IsolationType, float >* m_cutValues; 00032 mutable Root::TAccept m_accept; 00033 }; 00034 } 00035 #endif // ISOLATIONSELECTION_ISOLATIONWP_H