00001 #ifndef PhotonVertexSelection_PhotonVertexSelectionTool_h
00002 #define PhotonVertexSelection_PhotonVertexSelectionTool_h
00003
00004
00005 #include "AsgTools/AsgTool.h"
00006 #include "AsgTools/AnaToolHandle.h"
00007
00008
00009 #include "xAODEgamma/PhotonContainer.h"
00010
00011
00012 #include "PhotonVertexSelection/IPhotonVertexSelectionTool.h"
00013
00014
00015 namespace TMVA { class Reader; }
00016 namespace CP { class IPhotonPointingTool; }
00017
00018 namespace CP {
00019
00028 class PhotonVertexSelectionTool : public virtual IPhotonVertexSelectionTool,
00029 public asg::AsgTool {
00030
00032 ASG_TOOL_CLASS(PhotonVertexSelectionTool, CP::IPhotonVertexSelectionTool)
00033
00034 private:
00036 std::string m_configFileCase1;
00037 std::string m_configFileCase2;
00038 float m_convPtCut;
00039 bool m_updatePointing;
00040 std::string m_vertexContainerName;
00041 std::string m_derivationPrefix;
00042
00044 asg::AnaToolHandle<CP::IPhotonPointingTool> m_pointingTool;
00045
00047 TMVA::Reader *m_mva1;
00048 TMVA::Reader *m_mva2;
00049
00051 float m_sumPt2;
00052 float m_sumPt;
00053 float m_deltaPhi;
00054 float m_deltaZ;
00055
00057 int m_case;
00058
00060 std::vector<std::pair<const xAOD::Vertex*, float> > m_vertexMLP;
00061
00062 private:
00064 TLorentzVector getEgammaVector(const xAOD::EgammaContainer *egammas) const;
00065
00067 static bool sortMLP(const std::pair<const xAOD::Vertex*, float> &a, const std::pair<const xAOD::Vertex*, float> &b);
00068
00069
00070 public:
00071 PhotonVertexSelectionTool(const std::string &name);
00072 virtual ~PhotonVertexSelectionTool();
00073
00076
00078 virtual StatusCode initialize();
00079
00081
00084
00086 StatusCode getVertex(const xAOD::EgammaContainer &egammas, const xAOD::Vertex* &vertex, bool ignoreConv = false);
00087
00089 std::vector<std::pair<const xAOD::Vertex*, float> >& getVertex(const xAOD::EgammaContainer &egammas, bool ignoreConv = false);
00090
00095 int getCase() const { return m_case; }
00096
00098 const xAOD::Vertex* getPrimaryVertexFromConv(const xAOD::PhotonContainer *photons) const;
00099
00101 const CP::IPhotonPointingTool* photonPointingTool() const;
00102
00104
00105 };
00106
00107 }
00108
00109
00110 #endif // PhotonVertexSelection_PhotonVertexSelectionTool_h