Commit 9d9deb36 authored by Christos Anastopoulos's avatar Christos Anastopoulos Committed by Frank Winklmeier
Browse files

Use condition store for the caloDetDescrManager egamma

parent c37947c9
......@@ -36,6 +36,7 @@ StatusCode egammaForwardBuilder::initialize()
ATH_CHECK(m_outClusterContainerKey.initialize());
m_outClusterContainerCellLinkKey = m_outClusterContainerKey.key() + "_links";
ATH_CHECK(m_outClusterContainerCellLinkKey.initialize());
ATH_CHECK(m_caloDetDescrMgrKey.initialize());
// retrieve object quality tool
if (!m_objectQualityTool.empty()) {
......@@ -98,9 +99,11 @@ StatusCode egammaForwardBuilder::execute(const EventContext& ctx) const
ATH_MSG_FATAL("egammaForwardBuilder::Could not retrieve Cluster container");
return StatusCode::FAILURE;
}
//retrieve CaloDetDescr
const CaloDetDescrManager* calodetdescrmgr = nullptr;
ATH_CHECK(detStore()->retrieve(calodetdescrmgr, "CaloMgr"));
// retrieve CaloDetDescr
SG::ReadCondHandle<CaloDetDescrManager> caloDetDescrMgrHandle { m_caloDetDescrMgrKey, ctx };
ATH_CHECK(caloDetDescrMgrHandle.isValid());
const CaloDetDescrManager* calodetdescrmgr = *caloDetDescrMgrHandle;
// loop over input cluster container and create fwd electrons
xAOD::CaloClusterContainer::const_iterator clus_begin =
......
......@@ -30,6 +30,9 @@
#include "EventKernel/IParticle.h"
#include "StoreGate/ReadHandleKey.h"
#include "StoreGate/WriteHandleKey.h"
#include "StoreGate/ReadCondHandleKey.h"
#include "CaloDetDescr/CaloDetDescrManager.h"
#include "xAODCaloEvent/CaloClusterContainer.h"
#include "xAODCaloEvent/CaloCluster.h"
......@@ -91,6 +94,13 @@ class egammaForwardBuilder : public AthReentrantAlgorithm
"Name of the input cluster collection"
};
SG::ReadCondHandleKey<CaloDetDescrManager> m_caloDetDescrMgrKey {
this,
"CaloDetDescrManager",
"CaloDetDescrManager",
"SG Key for CaloDetDescrManager in the Condition Store"
};
/** @brief output electron container */
SG::WriteHandleKey<xAOD::ElectronContainer> m_electronOutputKey{
this,
......
......@@ -63,6 +63,8 @@ egammaSelectedTrackCopy::initialize()
ATH_CHECK(m_egammaCaloClusterSelector.retrieve());
ATH_CHECK(m_caloDetDescrMgrKey.initialize());
return StatusCode::SUCCESS;
}
......@@ -123,8 +125,10 @@ egammaSelectedTrackCopy::execute(const EventContext& ctx) const
auto allTRTTracks = m_AllTRTTracks.buffer();
auto selectedTRTTracks = m_SelectedTRTTracks.buffer();
const CaloDetDescrManager* calodetdescrmgr = nullptr;
ATH_CHECK( detStore()->retrieve(calodetdescrmgr,"CaloMgr") );
SG::ReadCondHandle<CaloDetDescrManager> caloDetDescrMgrHandle { m_caloDetDescrMgrKey, ctx };
ATH_CHECK(caloDetDescrMgrHandle.isValid());
const CaloDetDescrManager* calodetdescrmgr = *caloDetDescrMgrHandle;
// lets first check which clusters to seed on;
std::vector<const xAOD::CaloCluster*> passingClusters;
......
......@@ -11,8 +11,10 @@
#include "GaudiKernel/EventContext.h"
#include "GaudiKernel/ToolHandle.h"
#include "StoreGate/ReadHandleKey.h"
#include "StoreGate/WriteHandleKey.h"
#include "StoreGate/ReadCondHandleKey.h"
#include "StoreGate/WriteHandleKey.h"
#include "CaloDetDescr/CaloDetDescrManager.h"
#include "AthContainers/ConstDataVector.h"
#include "xAODCaloEvent/CaloClusterContainer.h"
......@@ -102,6 +104,13 @@ private:
"Input TrackParticles to select from"
};
SG::ReadCondHandleKey<CaloDetDescrManager> m_caloDetDescrMgrKey {
this,
"CaloDetDescrManager",
"CaloDetDescrManager",
"SG Key for CaloDetDescrManager in the Condition Store"
};
SG::WriteHandleKey<ConstDataVector<xAOD::TrackParticleContainer>>
m_OutputTrkPartContainerKey{ this,
"OutputTrkPartContainerName",
......
......@@ -30,6 +30,8 @@ egammaSuperClusterBuilder::initialize()
ATH_CHECK(m_inputEgammaRecContainerKey.initialize());
ATH_CHECK(m_egammaSuperRecCollectionKey.initialize());
ATH_CHECK(m_precorrClustersKey.initialize(SG::AllowEmpty));
ATH_CHECK(m_caloDetDescrMgrKey.initialize());
return egammaSuperClusterBuilderBase::initialize();
}
......@@ -68,8 +70,10 @@ egammaSuperClusterBuilder::execute(const EventContext& ctx) const
}
// The calo Det Descr manager
const CaloDetDescrManager* calodetdescrmgr = nullptr;
ATH_CHECK(detStore()->retrieve(calodetdescrmgr, "CaloMgr"));
SG::ReadCondHandle<CaloDetDescrManager> caloDetDescrMgrHandle { m_caloDetDescrMgrKey, ctx };
ATH_CHECK(caloDetDescrMgrHandle.isValid());
const CaloDetDescrManager* calodetdescrmgr = *caloDetDescrMgrHandle;
// Reserve a vector to keep track of what is used
std::vector<bool> isUsed(egammaRecs->size(), false);
......
......@@ -9,7 +9,11 @@
#include "GaudiKernel/EventContext.h"
#include "StoreGate/ReadHandleKey.h"
#include "StoreGate/ReadCondHandleKey.h"
#include "StoreGate/WriteHandleKey.h"
#include "CaloDetDescr/CaloDetDescrManager.h"
// Fwd declarations
#include "egammaRecEvent/egammaRecContainer.h"
#include "xAODCaloEvent/CaloClusterContainer.h"
......@@ -90,6 +94,13 @@ private:
"input egammaRec container"
};
SG::ReadCondHandleKey<CaloDetDescrManager> m_caloDetDescrMgrKey {
this,
"CaloDetDescrManager",
"CaloDetDescrManager",
"SG Key for CaloDetDescrManager in the Condition Store"
};
/** @brief Key for output egammaRec container */
SG::WriteHandleKey<EgammaRecContainer> m_egammaSuperRecCollectionKey{
this,
......
......@@ -41,6 +41,7 @@ electronSuperClusterBuilder::initialize()
ATH_CHECK(m_electronSuperRecCollectionKey.initialize());
ATH_CHECK(m_outputElectronSuperClustersKey.initialize());
ATH_CHECK(m_precorrClustersKey.initialize(SG::AllowEmpty));
ATH_CHECK(m_caloDetDescrMgrKey.initialize());
// Additional Window we search in
m_maxDelPhi = m_maxDelPhiCells * s_cellPhiSize * 0.5;
......@@ -87,8 +88,9 @@ electronSuperClusterBuilder::execute(const EventContext& ctx) const
}
// The calo Det Descr manager
const CaloDetDescrManager* calodetdescrmgr = nullptr;
ATH_CHECK(detStore()->retrieve(calodetdescrmgr, "CaloMgr"));
SG::ReadCondHandle<CaloDetDescrManager> caloDetDescrMgrHandle { m_caloDetDescrMgrKey, ctx };
ATH_CHECK(caloDetDescrMgrHandle.isValid());
const CaloDetDescrManager* calodetdescrmgr = *caloDetDescrMgrHandle;
// Reserve a vector to keep track of what is used
std::vector<bool> isUsed(egammaRecs->size(), false);
......
......@@ -9,8 +9,11 @@
#include "GaudiKernel/EventContext.h"
#include "StoreGate/ReadHandleKey.h"
#include "StoreGate/ReadCondHandleKey.h"
#include "StoreGate/WriteHandleKey.h"
#include "CaloDetDescr/CaloDetDescrManager.h"
// Fwd declarations
#include "egammaInterfaces/IEMTrackMatchBuilder.h"
#include "egammaRecEvent/egammaRecContainer.h"
......@@ -141,6 +144,13 @@ private:
"input egammaRec container"
};
SG::ReadCondHandleKey<CaloDetDescrManager> m_caloDetDescrMgrKey {
this,
"CaloDetDescrManager",
"CaloDetDescrManager",
"SG Key for CaloDetDescrManager in the Condition Store"
};
/** @brief Key for output egammaRec container */
SG::WriteHandleKey<EgammaRecContainer> m_electronSuperRecCollectionKey{
this,
......
......@@ -34,6 +34,7 @@ photonSuperClusterBuilder::initialize()
ATH_CHECK(m_photonSuperRecCollectionKey.initialize());
ATH_CHECK(m_outputPhotonSuperClustersKey.initialize());
ATH_CHECK(m_precorrClustersKey.initialize(SG::AllowEmpty));
ATH_CHECK(m_caloDetDescrMgrKey.initialize());
// retrieve conversion builder
if (m_doConversions) {
......@@ -78,8 +79,9 @@ photonSuperClusterBuilder::execute(const EventContext& ctx) const
}
// The calo Det Descr manager
const CaloDetDescrManager* calodetdescrmgr = nullptr;
ATH_CHECK(detStore()->retrieve(calodetdescrmgr, "CaloMgr"));
SG::ReadCondHandle<CaloDetDescrManager> caloDetDescrMgrHandle { m_caloDetDescrMgrKey, ctx };
ATH_CHECK(caloDetDescrMgrHandle.isValid());
const CaloDetDescrManager* calodetdescrmgr = *caloDetDescrMgrHandle;
// Reserve a vector to keep track of what is used
std::vector<bool> isUsed(egammaRecs->size(), false);
......
......@@ -10,6 +10,9 @@
#include "GaudiKernel/EventContext.h"
#include "StoreGate/ReadHandleKey.h"
#include "StoreGate/WriteHandleKey.h"
#include "StoreGate/ReadCondHandleKey.h"
#include "CaloDetDescr/CaloDetDescrManager.h"
// Fwd declarations
#include "egammaInterfaces/IEMConversionBuilder.h"
......@@ -122,6 +125,13 @@ private:
"input egammaRec container"
};
SG::ReadCondHandleKey<CaloDetDescrManager> m_caloDetDescrMgrKey {
this,
"CaloDetDescrManager",
"CaloDetDescrManager",
"SG Key for CaloDetDescrManager in the Condition Store"
};
/** @brief Key for output egammaRec container */
SG::WriteHandleKey<EgammaRecContainer> m_photonSuperRecCollectionKey{
this,
......
......@@ -41,6 +41,8 @@ xAODEgammaBuilder::initialize()
ATH_CHECK(m_photonClusterRecContainerKey.initialize(m_doPhotons));
ATH_CHECK(m_electronOutputKey.initialize());
ATH_CHECK(m_photonOutputKey.initialize());
ATH_CHECK(m_caloDetDescrMgrKey.initialize());
// retrieve tools
ATH_CHECK(m_clusterTool.retrieve());
ATH_CHECK(m_ShowerTool.retrieve());
......@@ -192,8 +194,9 @@ xAODEgammaBuilder::execute(const EventContext& ctx) const
}
}
const CaloDetDescrManager* calodetdescrmgr = nullptr;
ATH_CHECK(detStore()->retrieve(calodetdescrmgr, "CaloMgr"));
SG::ReadCondHandle<CaloDetDescrManager> caloDetDescrMgrHandle { m_caloDetDescrMgrKey, ctx };
ATH_CHECK(caloDetDescrMgrHandle.isValid());
const CaloDetDescrManager* calodetdescrmgr = *caloDetDescrMgrHandle;
// Shower Shapes
if (m_doElectrons) {
......
......@@ -59,16 +59,19 @@
#include "AthenaBaseComps/AthReentrantAlgorithm.h"
#include "GaudiKernel/ToolHandle.h"
//
#include "StoreGate/ReadHandleKey.h"
#include "StoreGate/WriteHandleKey.h"
//
#include "StoreGate/ReadCondHandleKey.h"
#include "CaloDetDescr/CaloDetDescrManager.h"
#include "xAODEgamma/ElectronFwd.h"
#include "xAODEgamma/PhotonFwd.h"
#include "xAODEgamma/ElectronContainer.h"
#include "xAODEgamma/PhotonContainer.h"
#include "xAODCaloEvent/CaloClusterContainer.h"
//
#include "EgammaAnalysisInterfaces/IEGammaAmbiguityTool.h"
#include "egammaInterfaces/IEMClusterTool.h"
#include "egammaInterfaces/IEMShowerBuilder.h"
......@@ -76,6 +79,7 @@
#include "egammaInterfaces/IegammaOQFlagsBuilder.h"
#include "egammaRecEvent/egammaRecContainer.h"
#include "egammaUtils/electronPearShapeAlignmentCorrection.h"
#include <memory>
class egammaRec;
......@@ -171,6 +175,13 @@ private:
"PhotonSuperRecCollection",
"Input container for electron Super Cluster egammaRec objects"};
SG::ReadCondHandleKey<CaloDetDescrManager> m_caloDetDescrMgrKey {
this,
"CaloDetDescrManager",
"CaloDetDescrManager",
"SG Key for CaloDetDescrManager in the Condition Store"
};
/** @brief Name of the dummy electron output collection*/
SG::WriteHandleKey<xAOD::ElectronContainer> m_dummyElectronOutputKey {this,
"DummyElectronOutputName", "",
......
......@@ -32,6 +32,7 @@ egammaLargeClusterMaker::initialize()
ATH_MSG_DEBUG("Initializing " << name() << "...");
ATH_CHECK(m_inputClusterCollection.initialize());
ATH_CHECK(m_cellsKey.initialize());
ATH_CHECK(m_caloDetDescrMgrKey.initialize());
ATH_MSG_DEBUG("Initialization successful");
return StatusCode::SUCCESS;
}
......@@ -51,8 +52,11 @@ egammaLargeClusterMaker::execute(const EventContext& ctx,
// retrieve the cell containers
SG::ReadHandle<CaloCellContainer> cellcoll(m_cellsKey, ctx);
const CaloDetDescrManager* dd_man = nullptr;
ATH_CHECK(detStore()->retrieve(dd_man, "CaloMgr"));
// retrieve CaloDetDescr
SG::ReadCondHandle<CaloDetDescrManager> caloDetDescrMgrHandle { m_caloDetDescrMgrKey, ctx };
ATH_CHECK(caloDetDescrMgrHandle.isValid());
const CaloDetDescrManager* calodetdescrmgr = *caloDetDescrMgrHandle;
// The main loop over clusters
for (const auto *cluster : *inputClusters) {
......@@ -97,7 +101,7 @@ egammaLargeClusterMaker::execute(const EventContext& ctx,
// the easiest is to look for the CaloDetDescrElement
const CaloDetDescrElement* dde =
dd_man->get_element(CaloCell_ID::LAREM, 0, barrel, eta, phi);
calodetdescrmgr->get_element(CaloCell_ID::LAREM, 0, barrel, eta, phi);
// if object does not exist then return
if (!dde) {
......@@ -113,7 +117,7 @@ egammaLargeClusterMaker::execute(const EventContext& ctx,
// around this position a hot cell is searched for in a window
// (m_neta*m_deta,m_nphi*m_dphi), by default (m_neta,m_nphi)=(7,7)
CaloLayerCalculator calc;
StatusCode sc = calc.fill(*dd_man,
StatusCode sc = calc.fill(*calodetdescrmgr,
cellcoll.ptr(),
cluster->etaSample(sam),
cluster->phiSample(sam),
......@@ -176,7 +180,7 @@ egammaLargeClusterMaker::execute(const EventContext& ctx,
// the easiest is to look for the CaloDetDescrElement
// const CaloDetDescrElement* get_element_FCAL (const CaloDetDescriptor* reg, double eta, double phi) const;
const CaloDetDescrElement* dde =
dd_man->get_element(subcalo, sampling_or_module, emec, eta, phi);
calodetdescrmgr->get_element(subcalo, sampling_or_module, emec, eta, phi);
// if object does not exist then return
if (!dde) {
......@@ -199,7 +203,7 @@ egammaLargeClusterMaker::execute(const EventContext& ctx,
// if In EMEC
CaloLayerCalculator calc;
StatusCode sc = calc.fill(*dd_man,
StatusCode sc = calc.fill(*calodetdescrmgr,
cellcoll.ptr(),
cluster->etaSample(sam),
cluster->phiSample(sam),
......
......@@ -16,6 +16,8 @@
#include "AthenaBaseComps/AthAlgTool.h"
#include "CaloDetDescr/CaloDetDescrManager.h"
#include "xAODCaloEvent/CaloClusterFwd.h"
#include "xAODCaloEvent/CaloClusterContainer.h"
......@@ -23,6 +25,8 @@
#include "GaudiKernel/ToolHandle.h"
#include "StoreGate/ReadHandleKey.h"
#include "StoreGate/ReadCondHandleKey.h"
class CaloCellContainer;
class CaloClusterCellLink;
......@@ -52,6 +56,13 @@ private:
SG::ReadHandleKey<CaloCellContainer> m_cellsKey {this,
"CellsName", "AllCalo", "Names of containers which contain cells"};
SG::ReadCondHandleKey<CaloDetDescrManager> m_caloDetDescrMgrKey {
this,
"CaloDetDescrManager",
"CaloDetDescrManager",
"SG Key for CaloDetDescrManager in the Condition Store"
};
/** @brief do FWD cell **/
Gaudi::Property<bool> m_isFWD{ this,
"doFWDelesurraundingWindows",
......
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