00001
00002
00003 #ifndef MVA_CALIB_TOOL_H_
00004 #define MVA_CALIB_TOOL_H_
00005
00006 #include <string>
00007 #include <set>
00008
00009 #include "AsgTools/AsgTool.h"
00010 #include "egammaMVACalib/IegammaMVATool.h"
00011 #include "xAODTracking/TrackParticleFwd.h"
00012
00013 class egammaMVACalib;
00014 class egammaMVATreeElectron;
00015 class egammaMVATreePhoton;
00016
00017 class egammaMVATool : virtual public IegammaMVATool,
00018 public asg::AsgTool
00019 {
00020
00021 ASG_TOOL_CLASS( egammaMVATool, IegammaMVATool )
00022 public:
00024 egammaMVATool( const std::string& name );
00026 ~egammaMVATool();
00027
00029 StatusCode initialize();
00030
00032 StatusCode finalize();
00033
00040 StatusCode execute(xAOD::CaloCluster* cluster,const xAOD::Egamma* eg);
00041 StatusCode execute(xAOD::CaloCluster* cluster,const egammaRec* egRec,
00042 xAOD::EgammaParameters::EgammaType egType);
00043 StatusCode hltexecute(xAOD::CaloCluster* cluster, const std::string& egType);
00044
00045 float getEnergy(const xAOD::CaloCluster* cluster, const xAOD::Egamma*);
00046 float getEnergy(const xAOD::CaloCluster* cluster, const xAOD::Electron*);
00047 float getEnergy(const xAOD::CaloCluster* cluster, const xAOD::Photon*);
00048 float getEnergy(const xAOD::CaloCluster* cluster, const egammaRec*,
00049 xAOD::EgammaParameters::EgammaType egType);
00050 float getEnergy(const xAOD::CaloCluster* cluster, const std::string&);
00051
00052 private:
00053 std::set<std::string> guess_variables(const std::string& filename);
00054 bool getClusterVariables(const xAOD::CaloCluster*);
00055 bool getConversionVariables(const xAOD::Vertex*);
00056
00057
00058 float getPtAtFirstMeasurement(const xAOD::TrackParticle*) const;
00059
00060 private:
00061
00062 std::unique_ptr<egammaMVACalib> m_mvaElectron;
00063 std::unique_ptr<egammaMVACalib> m_mvaPhoton;
00064 std::unique_ptr<egammaMVATreeElectron> m_MVATreeElectron;
00065 std::unique_ptr<egammaMVATreePhoton> m_MVATreePhoton;
00066
00067
00068 std::string m_folder;
00069
00070 bool m_new_version;
00071 bool m_use_layer_corrected;
00072
00074
00075 double m_rawcl_Es0;
00076 double m_rawcl_Es1;
00077 double m_rawcl_Es2;
00078 double m_rawcl_Es3;
00079 double m_cl_eta;
00080 double m_cl_E;
00081 double m_ptconv;
00082 double m_pt1conv;
00083 double m_pt2conv;
00084 double m_cl_etaCalo;
00085 double m_cl_phiCalo;
00086 int m_convtrk1nPixHits;
00087 int m_convtrk1nSCTHits;
00088 int m_convtrk2nPixHits;
00089 int m_convtrk2nSCTHits;
00090 double m_Rconv;
00091
00093
00094 };
00095
00096 #endif