Commit 1d234b36 authored by Christos Anastopoulos's avatar Christos Anastopoulos Committed by Graeme Stewart
Browse files

Fix the cluster only interface needed by superClusters (egammaMVACalib-01-02-08)

	* Fix the cluster only interface needed by superClusters
	* tag egammaMVACalib-01-02-08
parent 592affbc
......@@ -14,7 +14,6 @@ atlas_depends_on_subdirs( PUBLIC
GaudiKernel
PRIVATE
Reconstruction/MVAUtils
Reconstruction/egamma/egammaRecEvent
Control/CxxUtils
Tools/PathResolver )
......@@ -27,18 +26,18 @@ atlas_add_library( egammaMVACalibLib
PUBLIC_HEADERS egammaMVACalib
PRIVATE_INCLUDE_DIRS ${ROOT_INCLUDE_DIRS}
LINK_LIBRARIES AsgTools xAODCaloEvent xAODEgamma xAODTracking GaudiKernel
PRIVATE_LINK_LIBRARIES ${ROOT_LIBRARIES} egammaRecEvent CxxUtils PathResolver MVAUtils )
PRIVATE_LINK_LIBRARIES ${ROOT_LIBRARIES} CxxUtils PathResolver MVAUtils )
atlas_add_component( egammaMVACalib
src/components/*.cxx
INCLUDE_DIRS ${ROOT_INCLUDE_DIRS}
LINK_LIBRARIES ${ROOT_LIBRARIES} AsgTools xAODCaloEvent xAODEgamma xAODTracking egammaRecEvent GaudiKernel CxxUtils PathResolver egammaMVACalibLib MVAUtils )
LINK_LIBRARIES ${ROOT_LIBRARIES} AsgTools xAODCaloEvent xAODEgamma xAODTracking GaudiKernel CxxUtils PathResolver egammaMVACalibLib MVAUtils )
atlas_add_dictionary( egammaMVACalibDict
egammaMVACalib/egammaMVACalibDict.h
egammaMVACalib/selection.xml
INCLUDE_DIRS ${ROOT_INCLUDE_DIRS}
LINK_LIBRARIES ${ROOT_LIBRARIES} AsgTools xAODCaloEvent xAODEgamma xAODTracking egammaRecEvent GaudiKernel CxxUtils PathResolver egammaMVACalibLib MVAUtils )
LINK_LIBRARIES ${ROOT_LIBRARIES} AsgTools xAODCaloEvent xAODEgamma xAODTracking GaudiKernel CxxUtils PathResolver egammaMVACalibLib MVAUtils )
# Install files from the package:
atlas_install_python_modules( python/*.py )
......
......@@ -5,20 +5,15 @@
#include "egammaMVACalib/egammaMVATool.h"
#include "egammaMVACalib/egammaMVACalib.h"
#include "egammaMVACalib/egammaMVATree.h"
#include "egammaRecEvent/egammaRec.h"
#include "xAODEgamma/Egamma.h"
#include "xAODEgamma/EgammaDefs.h"
#include "xAODEgamma/Electron.h"
#include "xAODEgamma/Photon.h"
#include "xAODCaloEvent/CaloCluster.h"
#include "xAODEgamma/EgammaxAODHelpers.h"
#include "xAODTracking/Vertex.h"
#include "xAODTracking/TrackParticle.h"
#include "xAODTracking/TrackingPrimitives.h"
#include "PathResolver/PathResolver.h"
#include "CxxUtils/make_unique.h"
......@@ -188,13 +183,12 @@ StatusCode egammaMVATool::execute(xAOD::CaloCluster* cluster,const xAOD::Egamma*
return StatusCode::SUCCESS;
}
StatusCode egammaMVATool::execute(xAOD::CaloCluster* cluster,const egammaRec* eg,
xAOD::EgammaParameters::EgammaType egType){
if (!eg || !cluster) {
StatusCode egammaMVATool::execute(xAOD::CaloCluster* cluster, const xAOD::EgammaParameters::EgammaType egType){
if (!cluster) {
ATH_MSG_ERROR("Invalid Pointer to egamma or cluster object");
return StatusCode::FAILURE;
}
double mvaE = getEnergy(cluster, eg, egType);
double mvaE = getEnergy(cluster, egType);
ATH_MSG_DEBUG( "Calculated MVA calibrated energy = " << mvaE );
if (mvaE > 0) {
cluster->setCalE(mvaE);
......@@ -245,8 +239,6 @@ float egammaMVATool::getEnergy(const xAOD::CaloCluster* cluster, const std::stri
}
return 0;
}
getClusterVariables(cluster);
if(egType == "Electron"){
......@@ -331,7 +323,6 @@ float egammaMVATool::getEnergy(const xAOD::CaloCluster* cluster, const xAOD::Ele
ATH_MSG_ERROR("No electron passed");
return 0;
}
if (m_new_version) {
ATH_MSG_DEBUG("updating variables electron");
m_MVATreeElectron->update(el, cluster);
......@@ -339,7 +330,6 @@ float egammaMVATool::getEnergy(const xAOD::CaloCluster* cluster, const xAOD::Ele
}
else {
getClusterVariables(cluster);
return m_mvaElectron->getMVAEnergyElectron(m_rawcl_Es0,
m_rawcl_Es1,
m_rawcl_Es2,
......@@ -402,11 +392,8 @@ float egammaMVATool::getEnergy(const xAOD::CaloCluster* cluster, const xAOD::Pho
}
}
float egammaMVATool::getEnergy(const xAOD::CaloCluster* cluster, const egammaRec*,
xAOD::EgammaParameters::EgammaType)
{
// placeholder
return cluster->e();
float egammaMVATool::getEnergy(const xAOD::CaloCluster* cluster, const xAOD::EgammaParameters::EgammaType egType){
return ( (egType==xAOD::EgammaParameters::electron) ? getEnergy(cluster, "Electron") : getEnergy(cluster, "Photon") );
}
bool egammaMVATool::getClusterVariables(const xAOD::CaloCluster* cluster){
......
......@@ -22,7 +22,6 @@ use xAODTracking xAODTracking-* Event/xAOD
apply_pattern cmake_add_command command="find_package(ROOT COMPONENTS Tree TreePlayer TMVA XMLIO)"
private
use egammaRecEvent egammaRecEvent-* Reconstruction/egamma
use CxxUtils CxxUtils-* Control
use PathResolver PathResolver-* Tools
use AtlasReflex AtlasReflex-* External
......
......@@ -18,7 +18,6 @@
#include "xAODCaloEvent/CaloClusterFwd.h"
#include "xAODTracking/VertexFwd.h"
class egammaRec;
class IegammaMVATool : virtual public asg::IAsgTool{
/// Declare the interface that the class provides
......@@ -32,8 +31,7 @@ public:
virtual StatusCode finalize() = 0;
/** @brief execute method*/
virtual StatusCode execute(xAOD::CaloCluster* cluster,const xAOD::Egamma* eg)=0;
virtual StatusCode execute(xAOD::CaloCluster* cluster,const egammaRec* egRec,
xAOD::EgammaParameters::EgammaType egType)=0;
virtual StatusCode execute(xAOD::CaloCluster* cluster,const xAOD::EgammaParameters::EgammaType egType)=0;
virtual StatusCode hltexecute(xAOD::CaloCluster* cluster, const std::string& egType)=0;
};
......
......@@ -43,15 +43,13 @@ public:
*/
StatusCode execute(xAOD::CaloCluster* cluster,const xAOD::Egamma* eg);
StatusCode execute(xAOD::CaloCluster* cluster,const egammaRec* egRec,
xAOD::EgammaParameters::EgammaType egType);
StatusCode execute(xAOD::CaloCluster* cluster, const xAOD::EgammaParameters::EgammaType egType);
StatusCode hltexecute(xAOD::CaloCluster* cluster, const std::string& egType);
float getEnergy(const xAOD::CaloCluster* cluster, const xAOD::Egamma*);
float getEnergy(const xAOD::CaloCluster* cluster, const xAOD::Electron*);
float getEnergy(const xAOD::CaloCluster* cluster, const xAOD::Photon*);
float getEnergy(const xAOD::CaloCluster* cluster, const egammaRec*,
xAOD::EgammaParameters::EgammaType egType);
float getEnergy(const xAOD::CaloCluster* cluster, const xAOD::EgammaParameters::EgammaType egType);
float getEnergy(const xAOD::CaloCluster* cluster, const std::string&);
private:
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment