Commit 9b667e4f authored by Christos Anastopoulos's avatar Christos Anastopoulos Committed by Graeme Stewart
Browse files

Add different correction for electron/converted/unconverted barrel/endcap...

Add different correction for electron/converted/unconverted barrel/endcap SuperCluster (egammaTools-01-02-08)

	* Add different correction for electron/converted/unconverted
	* barrel/endcap SuperCluster
	* Tag egammaTools-01-02-08

2016-09-18  David Di Valentino <david.di.valentino@cern.ch>

	* Change perigee extrap to only save eta, phi floats (not vector)
	* Tag egammaTools-01-02-07

2016-09-17  Christos Anastopoulos <Christos.Anastopoulos@cern.ch>

	* Fix coverity 109115
	* tagging egammaTools-01-02-06

2016-09-17  Christos Anastopoulos <Christos.Anastopoulos@cern.ch>

	* Store eta,phi of the seed as eta0,phi0
	* tagging egammaTools-01-02-05
...
(Long ChangeLog diff - truncated)
parent 2d041858
......@@ -34,7 +34,7 @@ atlas_depends_on_subdirs( PRIVATE
InnerDetector/InDetRecTools/InDetConversionFinderTools
InnerDetector/InDetRecTools/InDetRecToolInterfaces
LArCalorimeter/LArRecConditions
LArCalorimeter/LArTools
LArCalorimeter/LArCabling
LumiBlock/LumiBlockComps
PhysicsAnalysis/AnalysisCommon/PATCore
PhysicsAnalysis/ElectronPhotonID/ElectronPhotonFourMomentumCorrection
......@@ -63,7 +63,7 @@ atlas_add_component( egammaTools
src/*.cxx
src/components/*.cxx
INCLUDE_DIRS ${ROOT_INCLUDE_DIRS} ${CLHEP_INCLUDE_DIRS}
LINK_LIBRARIES ${ROOT_LIBRARIES} ${CLHEP_LIBRARIES} CaloConditions CaloEvent CaloIdentifier CaloRecLib CaloUtilsLib AthenaBaseComps AthenaKernel CxxUtils AthContainers SGTools StoreGateLib SGtests Identifier EventKernel EventPrimitives FourMom FourMomUtils NavFourMom xAODCaloEvent xAODEgamma xAODTracking xAODTruth GaudiKernel InDetConversionFinderToolsLib InDetRecToolInterfaces LArRecConditions LArToolsLib LumiBlockCompsLib PATCoreLib ElectronPhotonFourMomentumCorrectionLib ElectronPhotonSelectorToolsLib Particle ParticleTruth egammaMVACalibLib egammaRecEvent egammaUtils TrkEventPrimitives TrkMaterialOnTrack TrkParticleBase TrkPseudoMeasurementOnTrack TrkTrack VxVertex TrkToolInterfaces )
LINK_LIBRARIES ${ROOT_LIBRARIES} ${CLHEP_LIBRARIES} CaloConditions CaloEvent CaloIdentifier CaloRecLib CaloUtilsLib AthenaBaseComps AthenaKernel CxxUtils AthContainers SGTools StoreGateLib SGtests Identifier EventKernel EventPrimitives FourMom FourMomUtils NavFourMom xAODCaloEvent xAODEgamma xAODTracking xAODTruth GaudiKernel InDetConversionFinderToolsLib InDetRecToolInterfaces LArRecConditions LArCablingLib LumiBlockCompsLib PATCoreLib ElectronPhotonFourMomentumCorrectionLib ElectronPhotonSelectorToolsLib Particle ParticleTruth egammaMVACalibLib egammaRecEvent egammaUtils TrkEventPrimitives TrkMaterialOnTrack TrkParticleBase TrkPseudoMeasurementOnTrack TrkTrack VxVertex TrkToolInterfaces )
# Install files from the package:
atlas_install_headers( egammaTools )
......
......@@ -19,7 +19,7 @@ use FourMomUtils FourMomUtils-* Event
use EventPrimitives EventPrimitives-* Event
use AthContainers AthContainers-* Control
use LArRecConditions LArRecConditions-* LArCalorimeter
use LArTools LArTools-* LArCalorimeter
use LArCabling LArCabling-* LArCalorimeter
use LumiBlockComps LumiBlockComps-* LumiBlock
......
......@@ -11,7 +11,7 @@ from RecExConfig.RecFlags import rec
def configureClusterCorrections(swTool):
"Add attributes ClusterCorrectionToolsXX to egammaSwTool object"
from CaloClusterCorrection.CaloSwCorrections import make_CaloSwCorrections
from CaloClusterCorrection.CaloSwCorrections import *
from CaloRec.CaloRecMakers import _process_tools
clusterTypes = dict(
......@@ -29,10 +29,30 @@ def configureClusterCorrections(swTool):
cells_name=egammaKeys.caloCellKey() )
setattr(swTool, x, _process_tools (swTool, y) )
#Super cluster position only corrections
if jobproperties.egammaRecFlags.doSuperclusters():
clusterTypesSuper = dict(Ele55='ele55', Ele37='ele37',
Gam55='gam55_unconv',Gam37='gam37_unconv',
Econv55='gam55_conv', Econv37='gam37_conv'
)
for attrName, clName in clusterTypes.iteritems():
x = 'ClusterCorrectionToolsSuperCluster' + attrName
if not hasattr(swTool, x) or getattr(swTool, x):
continue
superclusterCorr= make_CaloSwCorrections(clName, suffix ='EGSuperCluster',
corrlist=[ [rfac,'v5'],[etaoff_b1,'v5'],[etaoff_e1, 'v5'],
[etaoff_b2,'v5'],[etaoff_e2,'v5'], [phioff_b2, 'v5data'],
[phioff_e2, 'v5data'], [update], [time], [listBadChannel]],
cells_name=egammaKeys.caloCellKey())
setattr(swTool, x ,_process_tools (swTool, superclusterCorr) )
#End of super cluster position only corrections
#-------------------------
egammaSwTool = ToolFactory(egammaToolsConf.egammaSwTool,
postInit=[configureClusterCorrections])
postInit=[configureClusterCorrections])
from egammaMVACalib import egammaMVACalibConf
egammaMVATool = ToolFactory(egammaMVACalibConf.egammaMVATool,
......@@ -45,6 +65,7 @@ EMClusterTool = ToolFactory(egammaToolsConf.EMClusterTool,
PhotonContainerName = egammaKeys.outputPhotonKey(),
ClusterCorrectionToolName = FullNameWrapper(egammaSwTool),
doSuperCluster = jobproperties.egammaRecFlags.doSuperclusters(),
applyMVAToSuperCluster=False,
MVACalibTool= egammaMVATool
)
......@@ -87,25 +108,32 @@ egammaTopoClusterCopier = ToolFactory( egammaToolsConf.egammaTopoClusterCopier,
IsHadronic = True
)
electronSuperClusterBuilder = ToolFactory( egammaToolsConf.electronSuperClusterBuilder,
name = 'electronSuperClusterBuilder',
ExtrapolationTool=EMExtrapolationTools,
UseBremFinder=False,
MVACalibTool= egammaMVATool,
TopoWindowEtaCells = 5,
TopoWindowPhiCells = 7
ClusterCorrectionTool=egammaSwTool,
CorrectClusters=True,
MVACalibTool=egammaMVATool,
CalibrateClusters=False,
EtThresholdCut=1000,
AddCellsWindowEtaCellsBarrel=3,
AddCellsWindowPhiCellsBarrel=999,
AddCellsWindowEtaCellsEndcap=5,
AddCellsWindowPhiCellsEndcap=999
)
photonSuperClusterBuilder = ToolFactory( egammaToolsConf.photonSuperClusterBuilder,
name = 'photonSuperClusterBuilder',
MVACalibTool= egammaMVATool
ClusterCorrectionTool=egammaSwTool,
CorrectClusters=True,
MVACalibTool= egammaMVATool,
CalibrateClusters=False,
AddCellsWindowEtaCellsBarrel=3,
AddCellsWindowPhiCellsBarrel=999,
AddCellsWindowEtaCellsEndcap=5,
AddCellsWindowPhiCellsEndcap=999
)
egammaTopoClusterMap = ToolFactory( egammaToolsConf.egammaTopoClusterMap,
name = 'egammaTopoClusterMap' )
#End of super clustering
# Electron Selectors
......
......@@ -402,7 +402,7 @@ StatusCode EMBremCollectionBuilder::refitTrack(const xAOD::TrackParticle* tmpTrk
}
//Save perigee eta, phi for later usage in supercluster algorithm.
std::vector<float> perigeeExtrapEta, perigeeExtrapPhi;
float perigeeExtrapEta(-999.), perigeeExtrapPhi(-999.);
if (trk_refit) {
auto tsos = trk_refit->trackStateOnSurfaces()->begin();
for (;tsos != trk_refit->trackStateOnSurfaces()->end(); ++tsos) {
......@@ -420,13 +420,12 @@ StatusCode EMBremCollectionBuilder::refitTrack(const xAOD::TrackParticle* tmpTrk
//Do the straight-line extrapolation.
bool hitEM2 = m_extrapolationTool->getEtaPhiAtCalo(pTrkPar.get(), &extrapEta, &extrapPhi);
if (hitEM2) {
perigeeExtrapEta.push_back(extrapEta);
perigeeExtrapPhi.push_back(extrapPhi);
perigeeExtrapEta = extrapEta;
perigeeExtrapPhi = extrapPhi;
} else {
ATH_MSG_INFO("Extrapolation to EM2 failed!");
perigeeExtrapEta.push_back(-999.);
perigeeExtrapPhi.push_back(-999.);
}
ATH_MSG_WARNING("Extrapolation to EM2 failed!");
}
break;
}
}
}
......@@ -456,10 +455,10 @@ StatusCode EMBremCollectionBuilder::refitTrack(const xAOD::TrackParticle* tmpTrk
aParticle->setTrackLink( trackLink );
aParticle->setVertexLink(tmpTrkPart->vertexLink());
static const SG::AuxElement::Accessor< std::vector<float> > pgExtrapEta ("perigeeExtrapEta");
static const SG::AuxElement::Accessor<float> pgExtrapEta ("perigeeExtrapEta");
pgExtrapEta(*aParticle) = perigeeExtrapEta;
static const SG::AuxElement::Accessor<std::vector<float> > pgExtrapPhi ("perigeeExtrapPhi");
static const SG::AuxElement::Accessor<float> pgExtrapPhi ("perigeeExtrapPhi");
pgExtrapPhi(*aParticle) = perigeeExtrapPhi;
//Add qoverP for the last measurement
......
......@@ -81,7 +81,7 @@ class EMBremCollectionBuilder : public AthAlgTool,virtual public IEMBremCollecti
double m_narrowDeltaPhiBrem;
double m_narrowRescale;
double m_narrowRescaleBrem;
bool m_useBremFinder;
//bool m_useBremFinder;
//collections
const xAOD::TrackParticleContainer* m_trackTES;
......
......@@ -36,6 +36,8 @@ EMClusterTool::EMClusterTool(const std::string& type, const std::string& name, c
"Name of the input photon container");
declareProperty("doSuperCluster", m_doSuperClusters = false,
"Do Super Cluster Reco");
declareProperty("applyMVAToSuperCluster", m_applySuperClusters = true,
"Protection to not do anything for superClusters");
declareInterface<IEMClusterTool>(this);
......@@ -164,7 +166,7 @@ void EMClusterTool::setNewCluster(xAOD::Egamma *eg,
} // Doing superClusters
else if ( m_doSuperClusters){
//copy over for super clusters
cluster = makeNewSuperCluster(*(eg->caloCluster()));
cluster = makeNewSuperCluster(*(eg->caloCluster()),eg);
}
else {
cluster = makeNewCluster(*(eg->caloCluster()), eg, egType);
......@@ -242,28 +244,17 @@ xAOD::CaloCluster* EMClusterTool::makeNewCluster(const xAOD::CaloCluster& cluste
return newClus;
}
xAOD::CaloCluster* EMClusterTool::makeNewSuperCluster(const xAOD::CaloCluster& cluster) const {
xAOD::CaloCluster* EMClusterTool::makeNewSuperCluster(const xAOD::CaloCluster& cluster,xAOD::Egamma *eg) const {
//
xAOD::CaloCluster* newClus = new xAOD::CaloCluster(cluster);
//
//Here we could apply corrections
//
//Fill position in calo frame
// fillPositionsInCalo(newClus);
//Fill the raw state using the original super cluster
// newClus->setRawE(cluster.e());
// newClus->setRawEta(cluster.eta());
// newClus->setRawPhi(cluster.phi());
// Now we decided that Alt* values are the seed values, and they are already set
// by the supercluster builder, so don't overwrite
// newClus->setAltE(cluster.e());
// newClus->setAltEta(cluster.eta());
// newClus->setAltPhi(cluster.phi());
//Here is should be a call to MVA calib, now again copy over
// newClus->setCalE(cluster.e());
// newClus->setCalEta(cluster.eta());
// newClus->setCalPhi(cluster.phi());
////
if(m_applySuperClusters){
if (newClus && m_MVACalibTool->execute(newClus,eg).isFailure()){
ATH_MSG_ERROR("Problem executing MVA cluster tool");
}
}
ATH_MSG_DEBUG("Cluster Energy after final calibration: "<<newClus->e());
return newClus;
}
// ==========================================================================
......
......@@ -87,7 +87,7 @@ class EMClusterTool : public egammaBaseTool, virtual public IEMClusterTool {
const xAOD::CaloCluster::ClusterSize&) const ;
/** @brief creation of new super cluster based on existing one */
xAOD::CaloCluster* makeNewSuperCluster(const xAOD::CaloCluster& cluster) const ;
xAOD::CaloCluster* makeNewSuperCluster(const xAOD::CaloCluster& cluster, xAOD::Egamma *eg) const ;
/** @brief Name of the output cluster container **/
std::string m_outputClusterContainerName;
......@@ -110,9 +110,12 @@ class EMClusterTool : public egammaBaseTool, virtual public IEMClusterTool {
/** @brief Name of tool for cluster corrections */
std::string m_ClusterCorrectionToolName;
/** @brief Call CaloClusterStoreHelper::finalizeClusters ? **/
/** @brief do super clusters **/
bool m_doSuperClusters;
/** @brief flag to protect against applying the MVA to super Clusters **/
bool m_applySuperClusters;
/** @brief Position in Calo frame**/
std::unique_ptr<CaloCellDetPos> m_caloCellDetPos;
};
......
......@@ -126,15 +126,8 @@ StatusCode EMShowerBuilder::initialize()
}
}
}
// Pointer to Tool Service
IToolSvc* p_toolSvc = 0;
StatusCode sc = service("ToolSvc", p_toolSvc);
if (sc.isFailure()) {
ATH_MSG_FATAL(" Tool Service not found ");
return StatusCode::FAILURE;
}
StatusCode sc = StatusCode::SUCCESS;
//Retrieve shower shape Tool
if (m_UseShowerShapeTool) {
if ((sc = RetrieveShowerShapeTool()).isFailure()) {
......
......@@ -15,20 +15,14 @@ changes :
***************************************************************************/
#include "GaudiKernel/MsgStream.h"
#include "xAODTracking/TrackParticleContainer.h"
#include "xAODTracking/VertexContainer.h"
#include "xAODTracking/VertexAuxContainer.h"
#include "InDetRecToolInterfaces/IVertexFinder.h"
#include "InDetConversionFinderTools/SingleTrackConversionTool.h"
#include "xAODEgamma/EgammaxAODHelpers.h"
#include "egammaUtils/EMConversionUtils.h"
#include "egammaInterfaces/IEMExtrapolationTools.h"
#include "EMVertexBuilder.h"
EMVertexBuilder::EMVertexBuilder(const std::string& type, const std::string& name, const IInterface* parent) :
......
......@@ -9,7 +9,6 @@
#include "egammaUtils/ParameterDownWeighter.h"
#include "egammaUtils/WeightedMeanCalc.h"
#include "egammaUtils/EMConversionUtils.h"
#include "CaloUtils/CaloVertexedCluster.h"
//NEW xAOD INCLUDES.
......
......@@ -12,7 +12,6 @@
#include "../egammaOQFlagsBuilder.h"
#include "../EMPIDBuilder.h"
#include "../egammaSwTool.h"
#include "../egammaTopoClusterMap.h"
#include "../electronSuperClusterBuilder.h"
#include "../photonSuperClusterBuilder.h"
#include "../egammaTopoClusterCopier.h"
......@@ -29,7 +28,6 @@ DECLARE_TOOL_FACTORY ( egammaCheckEnergyDepositTool )
DECLARE_TOOL_FACTORY ( egammaOQFlagsBuilder )
DECLARE_TOOL_FACTORY ( EMPIDBuilder )
DECLARE_TOOL_FACTORY ( egammaSwTool )
DECLARE_TOOL_FACTORY ( egammaTopoClusterMap )
DECLARE_TOOL_FACTORY ( electronSuperClusterBuilder )
DECLARE_TOOL_FACTORY ( photonSuperClusterBuilder )
DECLARE_TOOL_FACTORY ( egammaTopoClusterCopier )
......@@ -47,7 +45,6 @@ DECLARE_FACTORY_ENTRIES(egammaTools) {
DECLARE_TOOL ( egammaOQFlagsBuilder )
DECLARE_TOOL ( EMPIDBuilder )
DECLARE_TOOL ( egammaSwTool )
DECLARE_TOOL ( egammaTopoClusterMap )
DECLARE_TOOL ( electronSuperClusterBuilder )
DECLARE_TOOL ( photonSuperClusterBuilder )
DECLARE_TOOL ( egammaTopoClusterCopier )
......
......@@ -5,13 +5,14 @@
// INCLUDE HEADER FILES:
#include "egammaOQFlagsBuilder.h"
#include "xAODEgamma/Egamma.h"
#include "xAODEgamma/EgammaxAODHelpers.h"
#include "xAODCaloEvent/CaloCluster.h"
#include <algorithm>
#include <math.h>
#include "StoreGate/StoreGateSvc.h"
#include "CaloConditions/CaloAffectedRegionInfoVec.h"
#include "LArTools/LArCablingService.h"
#include "LArCabling/LArCablingService.h"
#include "Identifier/HWIdentifier.h"
#include "LArRecConditions/ILArBadChanTool.h"
#include "CaloIdentifier/LArEM_ID.h"
......@@ -82,56 +83,56 @@ StatusCode egammaOQFlagsBuilder::initialize()
//StoreGateSvc* detStore;
sc=service("DetectorStore",m_detStore);
if (sc.isFailure()) {
msg(MSG::ERROR) << "DetectorStore service not found !" << endreq;
msg(MSG::ERROR) << "DetectorStore service not found !" << endmsg;
return StatusCode::FAILURE;
} else {
//if (msgLvl(MSG::DEBUG)) msg(MSG::DEBUG) << "Found DetectorStore" << endreq;
//if (msgLvl(MSG::DEBUG)) msg(MSG::DEBUG) << "Found DetectorStore" << endmsg;
}
// Get BadChannelTool
sc=m_badChannelTool.retrieve();
if (sc.isFailure()) {
msg(MSG::ERROR) << "Could not retrieve LArBadChannelTool " << m_badChannelTool << endreq;
msg(MSG::ERROR) << "Could not retrieve LArBadChannelTool " << m_badChannelTool << endmsg;
return StatusCode::FAILURE;
} else {
//if (msgLvl(MSG::DEBUG)) msg(MSG::DEBUG) << "LArBadChannelTool" << m_badChannelTool << " retrieved" << endreq;
//if (msgLvl(MSG::DEBUG)) msg(MSG::DEBUG) << "LArBadChannelTool" << m_badChannelTool << " retrieved" << endmsg;
}
//Get CaloAffectedTool
sc = m_affectedTool.retrieve();
if (sc.isFailure()){
msg(MSG::ERROR) << "Could not retrieve CaloAffectedTool " << m_affectedTool << endreq;
msg(MSG::ERROR) << "Could not retrieve CaloAffectedTool " << m_affectedTool << endmsg;
return StatusCode::FAILURE;
} else {
//if (msgLvl(MSG::DEBUG)) msg(MSG::DEBUG) << "CaloAffectedTool" << m_affectedTool << " retrieved" << endreq;
//if (msgLvl(MSG::DEBUG)) msg(MSG::DEBUG) << "CaloAffectedTool" << m_affectedTool << " retrieved" << endmsg;
}
//Get LArCablingService
sc=m_larCablingSvc.retrieve();
if (sc.isFailure()) {
msg(MSG::ERROR) << "Could not retrieve LArCablingService " << m_larCablingSvc << endreq;
msg(MSG::ERROR) << "Could not retrieve LArCablingService " << m_larCablingSvc << endmsg;
return StatusCode::FAILURE;
} else {
//if (msgLvl(MSG::DEBUG)) msg(MSG::DEBUG) << "LArCablingService" << m_larCablingSvc << " retrieved" << endreq;
//if (msgLvl(MSG::DEBUG)) msg(MSG::DEBUG) << "LArCablingService" << m_larCablingSvc << " retrieved" << endmsg;
}
sc=m_detStore->retrieve(m_calocellId, "CaloCell_ID");
if(sc.isFailure()){
msg(MSG::WARNING) << "Cannot retrieve online_id" << endreq;
msg(MSG::WARNING) << "Cannot retrieve online_id" << endmsg;
return StatusCode::FAILURE;
} else {
//if (msgLvl(MSG::DEBUG)) msg(MSG::DEBUG) << "CaloCell_ID" << m_calocellId << " retrieved" << endreq;
//if (msgLvl(MSG::DEBUG)) msg(MSG::DEBUG) << "CaloCell_ID" << m_calocellId << " retrieved" << endmsg;
}
sc=m_detStore->retrieve(m_emHelper);
if(sc.isFailure()){
msg(MSG::WARNING) << "Cannot retrieve online_id" << endreq;
msg(MSG::WARNING) << "Cannot retrieve online_id" << endmsg;
return StatusCode::FAILURE;
} else {
//if (msgLvl(MSG::DEBUG)) msg(MSG::DEBUG) << "CaloCell_ID retrieved" << endreq;
//if (msgLvl(MSG::DEBUG)) msg(MSG::DEBUG) << "CaloCell_ID retrieved" << endmsg;
}
......@@ -203,12 +204,35 @@ StatusCode egammaOQFlagsBuilder::execute(xAOD::Egamma* eg)
if (eg==0) return StatusCode::SUCCESS;
const xAOD::CaloCluster* cluster = eg->caloCluster();
if (!cluster) return StatusCode::SUCCESS;
if (cluster->size()<=0) return StatusCode::SUCCESS;
unsigned int iflag = 0;
if (cluster->size()==0) return StatusCode::SUCCESS;
//
const float clusterEta = cluster->eta();
const float clusterPhi = cluster->phi();
//
//In case we have the sizes set during the cluster construction.
int etaSize=cluster->getClusterEtaSize();
int phiSize=cluster->getClusterPhiSize();
//If no proper size could be found automatically, deduce by hand
//for the known std cases
if (etaSize==0 && phiSize==0) {
bool isBarrel = xAOD::EgammaHelpers::isBarrel(cluster);
if (xAOD::EgammaHelpers::isElectron(eg)){
etaSize= (isBarrel ? 3 : 5);
phiSize= (isBarrel ? 7 : 5);
}
else if (xAOD::EgammaHelpers::isConvertedPhoton(eg)){
etaSize= (isBarrel ? 3 : 5);
phiSize= (isBarrel ? 7 : 5);
}
else{//unconverted photons
etaSize= (isBarrel ? 3 : 5);
phiSize= (isBarrel ? 7 : 5);
}
}
unsigned int iflag = 0;
//Find the central cell in the middle layer
bool foundCentralCell = egammaOQFlagsBuilder::findCentralCell(cluster);
......@@ -343,8 +367,8 @@ StatusCode egammaOQFlagsBuilder::execute(xAOD::Egamma* eg)
CaloSampling::CaloSample layer;
//--------------> PRE SAMPLER
deta=0.5*0.025*cluster->getClusterEtaSize();
dphi=0.5*0.025*cluster->getClusterPhiSize();
deta=0.5*0.025*etaSize;
dphi=0.5*0.025*phiSize;
layer=CaloSampling::PreSamplerE;
bool checkNNHV_PSE = m_affectedTool->isAffected(cluster ,deta , dphi ,layer,layer,1) ; //nnHVPS
......@@ -369,8 +393,8 @@ StatusCode egammaOQFlagsBuilder::execute(xAOD::Egamma* eg)
if(checkDEADHV_CORE_B || checkDEADHV_CORE_E) iflag |= ( 0x1 << xAOD::EgammaParameters::DeadHVS1S2S3Core);
//----------------> SAMPLINGS 1,2,3 : CLUSTER EDGE
deta=0.5*0.025*cluster->getClusterEtaSize();
dphi=0.5*0.025*cluster->getClusterPhiSize();
deta=0.5*0.025*etaSize;
dphi=0.5*0.025*phiSize;
layer=CaloSampling::EMB1;
bool checkNNHV_EMB1 = m_affectedTool->isAffected(cluster ,deta , dphi ,layer,layer,1) ; //nnHVPS
......
......@@ -18,7 +18,7 @@ Most of the informations are given separately for each layer of the EM calorimet
#include "egammaBaseTool.h"
#include "GaudiKernel/ToolHandle.h"
#include "LArRecConditions/ILArBadChanTool.h"
#include "LArTools/LArCablingService.h"
#include "LArCabling/LArCablingService.h"
#include "CaloIdentifier/LArEM_ID.h"
#include "Identifier/HWIdentifier.h"
#include "CaloIdentifier/CaloCell_ID.h"
......
/*
Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
*/
#include "egammaSuperClusterBuilder.h"
//
#include "CaloUtils/CaloClusterStoreHelper.h"
#include "CaloUtils/CaloCellList.h"
//
#include "xAODCaloEvent/CaloClusterAuxContainer.h"
#include "xAODCaloEvent/CaloCluster.h"
#include "xAODCaloEvent/CaloClusterKineHelper.h"
#include "egammaRecEvent/egammaRecContainer.h"
#include "xAODEgamma/EgammaEnums.h"
#include "xAODEgamma/PhotonxAODHelpers.h"
#include "xAODEgamma/EgammaxAODHelpers.h"
#include "xAODTracking/Vertex.h"
#include "xAODTracking/TrackParticle.h"
//
#include "FourMomUtils/P4Helpers.h"
#include <vector>
using CLHEP::GeV;
//////////////////////////////////////////////////////////////////////////////
//Athena interfaces.
//////////////////////////////////////////////////////////////////////////////
//Constructor.
egammaSuperClusterBuilder::egammaSuperClusterBuilder(const std::string& type,
const std::string& name,
const IInterface* parent) :
AthAlgTool(type, name, parent),
m_clusterCorrectionTool("egammaSwTool/egammaswtool")
{
declareProperty("EtThresholdCut", m_EtThresholdCut = 1.5*GeV,
"The minimum Et required of SEED clusters (not applied to secondaries)");
declareProperty("EMFracCut", m_emFracCut = 0.5,
"The minimum EM fraction required of both seed and secondary clusters");
declareProperty("SearchWindowEtaCellsBarrel", m_searchWindowEtaCellsBarrel = 3,
"Number of cells in eta of window in which to search for topoclusters");
declareProperty("SearchWindowPhiCellsBarrel", m_searchWindowPhiCellsBarrel = 5,
"Number of cells in phi of window in which to search for topoclusters");
declareProperty("SearchWindowEtaCellsEndcap", m_searchWindowEtaCellsEndcap = 3,
"Number of cells in eta of window in which to search for topoclusters");
declareProperty("SearchWindowPhiCellsEndcap", m_searchWindowPhiCellsEndcap = 5,
"Number of cells in phi of window in which to search for topoclusters");
declareProperty("AddCellsWindowEtaCellsBarrel", m_addCellsWindowEtaCellsBarrel = 3,
"Number of cells in eta of window around topocluster center to add cells");
declareProperty("AddCellsWindowPhiCellsBarrel", m_addCellsWindowPhiCellsBarrel = 999 /*7 for SW*/,
"Number of cells in phi of window around topocluster center to add cells");
declareProperty("AddCellsWindowEtaCellsEndcap", m_addCellsWindowEtaCellsEndcap = 5,
"Number of cells in eta of window around topocluster center to add cells");
declareProperty("AddCellsWindowPhiCellsEndcap", m_addCellsWindowPhiCellsEndcap = 999 /*5 for SW*/,
"Number of cells in phi of window around topocluster center to add cells");
declareProperty("SumRemainingCellsInWindow", m_sumRemainingCellsInWindow = false);
declareProperty("CorrectClusters", m_correctClusters = true,
"Whether to run cluster corrections");
declareProperty("CalibrateClusters", m_calibrateClusters = true,
"Whether to run cluster calibrations");
declareProperty("MVACalibTool", m_MVACalibTool);
declareProperty("ClusterCorrectionTool", m_clusterCorrectionTool);
m_searchWindowPhiBarrel = m_searchWindowPhiCellsBarrel * s_cellPhiSize * 0.5;
m_searchWindowEtaBarrel = m_searchWindowEtaCellsBarrel * s_cellEtaSize * 0.5;
m_searchWindowPhiEndcap = m_searchWindowPhiCellsEndcap * s_cellPhiSize * 0.5;
m_searchWindowEtaEndcap = m_searchWindowEtaCellsEndcap * s_cellEtaSize * 0.5;
m_addCellsWindowPhiBarrel = m_addCellsWindowPhiCellsBarrel * s_cellPhiSize * 0.5;
m_addCellsWindowEtaBarrel = m_addCellsWindowEtaCellsBarrel * s_cellEtaSize * 0.5;
m_addCellsWindowPhiEndcap = m_addCellsWindowPhiCellsEndcap * s_cellPhiSize * 0.5;
m_addCellsWindowEtaEndcap = m_addCellsWindowEtaCellsEndcap * s_cellEtaSize * 0.5;
}
StatusCode egammaSuperClusterBuilder::initialize() {
ATH_MSG_DEBUG(" Initializing egamma SuperClusterBuilder");
m_searchWindowPhiBarrel = m_searchWindowPhiCellsBarrel * s_cellPhiSize * 0.5;
m_searchWindowEtaBarrel = m_searchWindowEtaCellsBarrel * s_cellEtaSize * 0.5;
m_searchWindowPhiEndcap = m_searchWindowPhiCellsEndcap * s_cellPhiSize * 0.5;
m_searchWindowEtaEndcap = m_searchWindowEtaCellsEndcap * s_cellEtaSize * 0.5;
m_addCellsWindowPhiBarrel = m_addCellsWindowPhiCellsBarrel * s_cellPhiSize * 0.5;
m_addCellsWindowEtaBarrel = m_addCellsWindowEtaCellsBarrel * s_cellEtaSize * 0.5;
m_addCellsWindowPhiEndcap = m_addCellsWindowPhiCellsEndcap * s_cellPhiSize * 0.5;
m_addCellsWindowEtaEndcap = m_addCellsWindowEtaCellsEndcap * s_cellEtaSize * 0.5;
if (m_correctClusters) {
ATH_CHECK(m_clusterCorrectionTool.retrieve());