00001
00002
00003 #ifndef ISOLATIONSELECTION_ISOLATIONSELECTIONTOOL_H
00004 #define ISOLATIONSELECTION_ISOLATIONSELECTIONTOOL_H
00005
00006
00007 #include "AsgTools/AsgTool.h"
00008 #include "AsgTools/ToolHandle.h"
00009
00010
00011 #include "IsolationSelection/IIsolationSelectionTool.h"
00012 #include "IsolationSelection/IsolationWP.h"
00013
00014
00015 class TFile;
00016 class TH1F;
00017
00018 class Interp3D;
00019
00020 namespace CP
00021 {
00022
00032
00033 class IsolationSelectionTool : public virtual CP::IIsolationSelectionTool,
00034 public asg::AsgTool {
00035
00037 ASG_TOOL_CLASS( IsolationSelectionTool , CP::IIsolationSelectionTool )
00038
00039 public:
00041 IsolationSelectionTool( const std::string& name );
00043 virtual ~IsolationSelectionTool();
00044
00046 virtual StatusCode initialize();
00048 virtual StatusCode finalize();
00049
00050 enum IsoWPType{Efficiency, Cut};
00051 virtual const Root::TAccept& accept( const xAOD::Photon& x ) const;
00052 virtual const Root::TAccept& accept( const xAOD::Electron& x ) const;
00053 virtual const Root::TAccept& accept( const xAOD::Muon& x ) const;
00054 virtual const Root::TAccept& accept( const strObj& x ) const;
00055 virtual const Root::TAccept& accept(const xAOD::IParticle& x) const;
00056
00057 virtual const Root::TAccept& getPhotonTAccept() const;
00058 virtual const Root::TAccept& getElectronTAccept() const;
00059 virtual const Root::TAccept& getMuonTAccept() const;
00060 virtual const Root::TAccept& getObjTAccept() const;
00061
00062 StatusCode addWP(std::string WP, xAOD::Type::ObjectType type);
00063 StatusCode addWP(IsolationWP* wp, xAOD::Type::ObjectType type);
00064 StatusCode addMuonWP(std::string wpname);
00065 StatusCode addPhotonWP(std::string wpname);
00066 StatusCode addElectronWP(std::string wpname);
00067 StatusCode addUserDefinedWP(std::string WPname, xAOD::Type::ObjectType ObjType, std::vector< std::pair<xAOD::Iso::IsolationType, std::string> >& cuts, std::string key="", IsoWPType type=Efficiency);
00068 StatusCode setIParticleCutsFrom(xAOD::Type::ObjectType ObjType);
00069 void addCutToWP(IsolationWP* wp, std::string key, const xAOD::Iso::IsolationType t, const std::string expression);
00070 std::vector< IsolationWP* >& getMuonWPs(){return m_muWPs;}
00071 std::vector< IsolationWP* >& getElectronWPs(){return m_elWPs;}
00072 std::vector< IsolationWP* >& getPhotonWPs(){return m_phWPs;}
00073 std::vector< IsolationWP* >& getObjWPs(){return m_objWPs;}
00074
00075
00076 void clearPhotonWPs() { m_phWPs.clear();}
00077 void clearElectronWPs() { m_elWPs.clear();}
00078 void clearMuonWPs() { m_muWPs.clear();}
00079
00080 private:
00081
00082 TDirectory* getTemporaryDirectory(void) const;
00083
00084 std::string m_muWPname;
00085 std::string m_elWPname;
00086 std::string m_phWPname;
00087 std::string m_muWPKey;
00088 std::string m_elWPKey;
00089 std::string m_phWPKey;
00090
00092 std::string m_calibFileName;
00093 std::shared_ptr<TFile> m_calibFile;
00094
00096 std::vector< IsolationWP* > m_muWPs;
00097 std::vector< IsolationWP* > m_elWPs;
00098 std::vector< IsolationWP* > m_phWPs;
00099 std::vector< IsolationWP* > m_objWPs;
00100
00102 mutable Root::TAccept m_photonAccept;
00103 mutable Root::TAccept m_electronAccept;
00104 mutable Root::TAccept m_muonAccept;
00105 mutable Root::TAccept m_objAccept;
00106
00108 std::vector< IsolationWP* >* m_iparWPs;
00109 mutable Root::TAccept* m_iparAccept;
00110
00111
00112 bool m_doInterpM, m_doInterpE;
00113 Interp3D *m_Interp;
00114
00115
00116 std::string m_TwikiLoc;
00117
00118 };
00119 }
00120
00121 #endif