Commit 50fc9331 authored by Walter Lampl's avatar Walter Lampl Committed by Frank Winklmeier
Browse files

CaloCellList & clients: Adjust for CaloDetDescrManger moved from DetectorStore to ConditionStore

parent 1098192a
......@@ -1117,8 +1117,8 @@ void CaloFillRectangularCluster::makeCorrection (const Context& myctx,
// Build the candidate cell list.
// This 5 is a safe margin for cell_list calculation
// and should not be changed.
CaloCellList cell_list(cell_container);
cell_list.select(*calodetdescrmgr,eta,phi,seg.m_detas2*(m_neta+5),seg.m_dphis2*(m_nphi+5));
CaloCellList cell_list(calodetdescrmgr,cell_container);
cell_list.select(eta,phi,seg.m_detas2*(m_neta+5),seg.m_dphis2*(m_nphi+5));
// Do the calculation.
CaloClusterCorr::SamplingHelper_CaloCellList helper (*this,
......
ApplicationMgr.ExtSvc = { "StoreGateSvc/StoreGateSvc",
"StoreGateSvc/DetectorStore" };
"StoreGateSvc/DetectorStore",
"StoreGateSvc/ConditionStore"};
ToolSvc.testtool1.CaloClustersName = "Clusts1";
ToolSvc.testtool2.CaloClusterNames = { "Clusts1", "Clusts2" };
......
......@@ -210,8 +210,8 @@ CaloCellContainerFromClusterTool::process (CaloConstCellContainer* theCont,
double dphi = it_cluster->getClusterPhiSize() * 0.025;
// get cell lists for each sampling we want to add
for (int isamp : m_validSamplings) {
CaloCellList cell_list(cellContainer.cptr());
cell_list.select(*caloDDMgr,eta, phi, deta, dphi, isamp);
CaloCellList cell_list(caloDDMgr,cellContainer.cptr());
cell_list.select(eta, phi, deta, dphi, isamp);
ATH_MSG_DEBUG( "sampling " << isamp
<< ", size of list = " << cell_list.ncells()
......
......@@ -84,8 +84,8 @@ StatusCode CaloThinCellsByClusterAlg::execute (const EventContext& ctx) const
double dphi = clust->getClusterPhiSize() * 0.025;
// get cell lists for each sampling we want to add
for (int isamp : m_validSamplings) {
CaloCellList cell_list (cells.cptr());
cell_list.select (*caloDDMgr,eta, phi, deta, dphi, isamp);
CaloCellList cell_list (caloDDMgr,cells.cptr());
cell_list.select (eta, phi, deta, dphi, isamp);
ATH_MSG_DEBUG( "sampling " << isamp
<< ", size of list = " << cell_list.ncells()
......
......@@ -28,6 +28,7 @@
#include "CaloEvent/CaloTester.h"
#include "CaloGeoHelpers/CaloPhiRange.h"
#include "CaloDetDescr/CaloDetectorElements.h"
#include "CaloDetDescr/CaloDetDescrManager.h"
#include "CaloRec/Blob2ToolConstants.h"
#include "StoreGate/setupStoreGate.h"
#include "StoreGate/StoreGateSvc.h"
......@@ -60,7 +61,8 @@ void create_cluster (xAOD::CaloClusterContainer& clusts,
std::set<IdentifierHash>& hashes,
CaloSampling::CaloSample sam)
{
CaloCellList cell_list (&cells);
CaloCellList cell_list (CaloDetDescrManager::instance(),
&cells);
cell_list.select (eta, phi, 5*0.025, 5*0.025, sam);
for (const CaloCell* cell : cell_list) {
IdentifierHash idhash = cell->caloDDE()->calo_hash();
......
......@@ -42,10 +42,10 @@ class CaloCellList
public:
typedef std::vector<const CaloCell*> vector_type;
typedef vector_type::const_iterator list_iterator;
// CaloCellList();
CaloCellList(const CaloCellContainer* cell_container);
CaloCellList(const CaloCellContainer* cell_container, const CaloCell_ID::SUBCALO caloNum);
CaloCellList(const CaloCellContainer* cell_container, const std::vector<CaloCell_ID::SUBCALO>& caloNums);
CaloCellList() = delete;
CaloCellList(const CaloDetDescrManager* mgr, const CaloCellContainer* cell_container);
CaloCellList(const CaloDetDescrManager* mgr, const CaloCellContainer* cell_container, const CaloCell_ID::SUBCALO caloNum);
CaloCellList(const CaloDetDescrManager* mgr, const CaloCellContainer* cell_container, const std::vector<CaloCell_ID::SUBCALO>& caloNums);
~CaloCellList() = default;
......@@ -53,20 +53,11 @@ public:
// That is, we select cells within eta-deta .. eta+deta and similarly for
// phi.
void select(double eta, double phi, double deta, double dphi);
void select(double eta, double phi, double deta, double dphi, int sam);
void select(double eta, double phi, double dR);
void select(double eta, double phi, double deta, double dphi); //
void select(double eta, double phi, double deta, double dphi, int sam);//
void select(double eta, double phi, double dR);//
void select(double eta, double phi, double dR, int sam);
// Add overload accepting const CaloDetDescrManager&
void select(const CaloDetDescrManager& mgr, double eta, double phi, double deta, double dphi);
void select(const CaloDetDescrManager& mgr, double eta, double phi, double deta, double dphi, int sam);
void select(const CaloDetDescrManager& mgr, double eta, double phi, double dR);
void select(const CaloDetDescrManager& mgr, double eta, double phi, double dR, int sam);
list_iterator begin() const;
list_iterator end() const;
......@@ -75,8 +66,7 @@ public:
int ncells() const; // returns the number of cells
private:
void doSelect(const CaloDetDescrManager& mgr,
double eta,
void doSelect(double eta,
double phi,
double deta,
double dphi,
......@@ -84,6 +74,7 @@ private:
CaloCell_ID::CaloSample sam = CaloCell_ID::Unknown);
const CaloCellContainer* m_cellcont;
const CaloDetDescrManager* m_mgr;
std::vector<CaloCell_ID::SUBCALO> m_caloNums;
vector_type m_theCellVector;
double m_energy;
......
......@@ -150,31 +150,6 @@ public:
CaloSampling::CaloSample sampling,
xAOD::CaloCluster* tofill = 0);
/**
* @brief Calculate layer variables from a cell container.
* @param cell_container The cell container.
* @param eta The @f$\eta@f$ center of the cluster, for cell selection.
* @param phi The @f$\phi@f$ center of the cluster, for cell selection.
* @param deta The @f$\eta@f$ full width for cell selection.
* @param dphi The @f$\phi@f$ full width for cell selection.
* @param sampling The sampling for cell selection.
* @param tofill If non-null, then selected cells will be added
* to this cluster.
*
* This takes a list of cells from a cell container,
* selects those within a @c deta by @c dphi window around @c eta, @c phi
* in layer @c sampling, and fills the layer variables from them.
* If @c tofill is non-null, then selected cells will also be added
* to the cluster @c tofill.
*/
StatusCode fill (const CaloCellContainer* cell_container,
double eta,
double phi,
double deta,
double dphi,
CaloSampling::CaloSample sampling,
xAOD::CaloCluster* tofill = 0);
//@}
/** Data access. */
......
......@@ -26,8 +26,9 @@ square(double x)
}
}
CaloCellList::CaloCellList(const CaloCellContainer* cell_container)
CaloCellList::CaloCellList(const CaloDetDescrManager* mgr, const CaloCellContainer* cell_container)
: m_cellcont(cell_container)
, m_mgr(mgr)
, m_energy(0)
, m_et(0)
{
......@@ -37,8 +38,9 @@ CaloCellList::CaloCellList(const CaloCellContainer* cell_container)
}
// specify one calo number
CaloCellList::CaloCellList(const CaloCellContainer* cell_container, const CaloCell_ID::SUBCALO caloNum)
CaloCellList::CaloCellList(const CaloDetDescrManager* mgr, const CaloCellContainer* cell_container, const CaloCell_ID::SUBCALO caloNum)
: m_cellcont(cell_container)
, m_mgr(mgr)
, m_energy(0)
, m_et(0)
{
......@@ -48,9 +50,10 @@ CaloCellList::CaloCellList(const CaloCellContainer* cell_container, const CaloCe
// specify a vector of calonumber
// (if all calo it is more efficient to not specify anything)
CaloCellList::CaloCellList(const CaloCellContainer* cell_container,
CaloCellList::CaloCellList(const CaloDetDescrManager* mgr, const CaloCellContainer* cell_container,
const std::vector<CaloCell_ID::SUBCALO>& caloNums)
: m_cellcont(cell_container)
, m_mgr(mgr)
, m_energy(0)
, m_et(0)
......@@ -63,63 +66,29 @@ CaloCellList::CaloCellList(const CaloCellContainer* cell_container,
void
CaloCellList::select(double eta, double phi, double deta, double dphi)
{
const CaloDetDescrManager* mgr = CaloDetDescrManager::instance();
doSelect(*mgr, eta, phi, deta, dphi, -1);
doSelect(eta, phi, deta, dphi, -1);
}
void
CaloCellList::select(double eta, double phi, double deta, double dphi, int sam)
{
const CaloDetDescrManager* mgr = CaloDetDescrManager::instance();
doSelect(*mgr, eta, phi, deta, dphi, -1, static_cast<CaloCell_ID::CaloSample>(sam));
doSelect(eta, phi, deta, dphi, -1, static_cast<CaloCell_ID::CaloSample>(sam));
}
void
CaloCellList::select(double eta, double phi, double dR)
{
const CaloDetDescrManager* mgr = CaloDetDescrManager::instance();
doSelect(*mgr, eta, phi, dR, dR, dR);
doSelect(eta, phi, dR, dR, dR);
}
void
CaloCellList::select(double eta, double phi, double dR, int sam)
{
const CaloDetDescrManager* mgr = CaloDetDescrManager::instance();
doSelect(*mgr, eta, phi, dR, dR, dR, static_cast<CaloCell_ID::CaloSample>(sam));
doSelect(eta, phi, dR, dR, dR, static_cast<CaloCell_ID::CaloSample>(sam));
}
void
CaloCellList::select(const CaloDetDescrManager& mgr, double eta, double phi, double deta, double dphi)
{
doSelect(mgr, eta, phi, deta, dphi, -1);
}
void
CaloCellList::select(const CaloDetDescrManager& mgr,
double eta,
double phi,
double deta,
double dphi,
int sam)
{
doSelect(mgr, eta, phi, deta, dphi, -1, static_cast<CaloCell_ID::CaloSample>(sam));
}
void
CaloCellList::select(const CaloDetDescrManager& mgr, double eta, double phi, double dR)
{
doSelect(mgr, eta, phi, dR, dR, dR);
}
void
CaloCellList::select(const CaloDetDescrManager& mgr, double eta, double phi, double dR, int sam)
{
doSelect(mgr, eta, phi, dR, dR, dR, static_cast<CaloCell_ID::CaloSample>(sam));
}
void
CaloCellList::doSelect(const CaloDetDescrManager& mgr,
double eta,
CaloCellList::doSelect(double eta,
double phi,
double deta,
double dphi,
......@@ -140,12 +109,12 @@ CaloCellList::doSelect(const CaloDetDescrManager& mgr,
for (; itrCaloNum != itrEndCaloNum; ++itrCaloNum) {
CaloCell_ID::SUBCALO caloNum = *itrCaloNum;
if (sam != CaloCell_ID::Unknown) {
mgr.cellsInZone(eta - deta, eta + deta, phi - dphi, phi + dphi, sam, calo_mgr_vect);
m_mgr->cellsInZone(eta - deta, eta + deta, phi - dphi, phi + dphi, sam, calo_mgr_vect);
itrCaloNum = itrEndCaloNum - 1;
} else if (caloNum == CaloCell_ID::NSUBCALO) {
mgr.cellsInZone(eta - deta, eta + deta, phi - dphi, phi + dphi, calo_mgr_vect);
m_mgr->cellsInZone(eta - deta, eta + deta, phi - dphi, phi + dphi, calo_mgr_vect);
} else if (caloNum != CaloCell_ID::NOT_VALID) {
mgr.cellsInZone(eta - deta, eta + deta, phi - dphi, phi + dphi, caloNum, calo_mgr_vect);
m_mgr->cellsInZone(eta - deta, eta + deta, phi - dphi, phi + dphi, caloNum, calo_mgr_vect);
} else {
continue;
}
......
......@@ -62,8 +62,8 @@ CaloLayerCalculator::fill (const CaloDetDescrManager& mgr,
}
}
CaloCellList cell_list(cell_container);
cell_list.select(mgr,eta,phi,deta,dphi,sampling);
CaloCellList cell_list(&mgr,cell_container);
cell_list.select(eta,phi,deta,dphi,sampling);
fill (cell_list.begin(),
cell_list.end(),
......@@ -72,20 +72,6 @@ CaloLayerCalculator::fill (const CaloDetDescrManager& mgr,
return StatusCode::SUCCESS;
}
StatusCode
CaloLayerCalculator::fill (const CaloCellContainer* cell_container,
double eta,
double phi,
double deta,
double dphi,
CaloSampling::CaloSample sampling,
xAOD::CaloCluster* tofill /*= 0*/)
{
const CaloDetDescrManager* mgr = CaloDetDescrManager::instance();
return fill(*mgr, cell_container, eta, phi, deta, dphi, sampling, tofill);
}
/// Reset output variables to invalid values.
void CaloLayerCalculator::reset()
{
......
......@@ -205,8 +205,10 @@ const CaloCellContainer* fill_cells (CaloTester& tester)
void test1 (const CaloCellContainer* cells)
{
CaloLayerCalculator calc;
assert( calc.fill (cells, clust1_eta0, clust1_phi0,
const CaloDetDescrManager* mgr=CaloDetDescrManager::instance();
assert( calc.fill (*mgr,cells, clust1_eta0, clust1_phi0,
5*deta, 5*dphi, CaloSampling::EMB2) );
clust1_check (calc);
......@@ -227,7 +229,7 @@ void test1 (const CaloCellContainer* cells)
5*deta, 5*dphi, CaloSampling::EMB2);
clust1_check (calc, 0.75);
assert( calc.fill (cells, clust2_eta0, clust2_phi0,
assert( calc.fill (*mgr,cells, clust2_eta0, clust2_phi0,
5*deta, 5*dphi, CaloSampling::EMB2) );
clust2_check (calc);
}
......
......@@ -12,6 +12,8 @@
#include "LArCabling/LArOnOffIdMapping.h"
#include "LArIdentifier/LArOnlineID.h"
#include "LArElecCalib/ILArPedestal.h"
#include "StoreGate/ReadCondHandleKey.h"
#include "CaloDetDescr/CaloDetDescrManager.h"
#include "TTree.h"
class CaloCell_ID;
......@@ -55,6 +57,8 @@ class LArReadCells: public ::AthAlgorithm {
SG::ReadCondHandleKey<LArOnOffIdMapping> m_cablingKey{this,"CablingKey","LArOnOffIdMap","SG Key of LArOnOffIdMapping object"};
SG::ReadCondHandleKey<ILArPedestal> m_pedestalKey{this,"PedestalKey","LArPedestal","SG Key of Pedestal conditions object"};
SG::ReadCondHandleKey<CaloDetDescrManager> m_caloMgrKey{this,"CaloDetDescrManager", "CaloDetDescrManager"};
const LArOnlineID* m_lar_online_id = nullptr;
......
......@@ -72,7 +72,7 @@ StatusCode LArReadCells::initialize() {
ATH_CHECK( m_cablingKey.initialize() );
ATH_CHECK(m_pedestalKey.initialize());
ATH_CHECK(m_caloMgrKey.initialize());
ATH_MSG_INFO("Energy cut for time and quality computation: " << m_etcut);
return StatusCode::SUCCESS;
......@@ -94,6 +94,9 @@ StatusCode LArReadCells::execute() {
return StatusCode::FAILURE;
}
SG::ReadCondHandle<CaloDetDescrManager> caloMgrHandle{m_caloMgrKey};
const CaloDetDescrManager* caloDDMgr = *caloMgrHandle;
//Get Conditions input
SG::ReadCondHandle<ILArPedestal> pedHdl{m_pedestalKey};
const ILArPedestal* larPedestal=*pedHdl;
......@@ -150,7 +153,7 @@ StatusCode LArReadCells::execute() {
if ((m_calo_id->calo_sample(cellID)==CaloSampling::CaloSample::EMB2 || m_calo_id->calo_sample(cellID)==CaloSampling::CaloSample::EME2)
&& et>m_etcut2) {
CaloCellList myList(cell_container);
CaloCellList myList(caloDDMgr, cell_container);
myList.select((*first_cell)->eta(),(*first_cell)->phi(),0.10);
for (const CaloCell* cell : myList) {
Identifier cellID2 =cell->ID();
......
......@@ -16,11 +16,12 @@
#include "xAODEgamma/EgammaFwd.h"
#include "DerivationFrameworkInterfaces/IAugmentationTool.h"
#include "StoreGate/ReadHandleKey.h"
#include "StoreGate/ReadCondHandleKey.h"
#include "StoreGate/WriteHandleKey.h"
#include "xAODEgamma/EgammaContainer.h"
#include "CaloEvent/CaloCellContainer.h"
#include "xAODCaloEvent/CaloCluster.h"
#include "CaloDetDescr/CaloDetDescrManager.h"
#include "ExpressionEvaluation/ExpressionParserUser.h"
namespace DerivationFramework {
......@@ -41,7 +42,9 @@ namespace DerivationFramework {
SG::ReadHandleKey<CaloCellContainer> m_InputCellsSGKey{this, "InputCellsSGKey", "AllCalo", "SG key for input cells container"};
SG::WriteHandleKey<xAOD::CaloClusterContainer> m_OutputClusterSGKey{this, "OutputClusterSGKey", "EgammaDummyClusters", "SG key for output"};
SG::WriteHandleKey<CaloClusterCellLinkContainer> m_OutputCellLinkSGKey{this, "OutputCellLinksSGKey", "EgammaDummyCellLink", "SG key for output cell links"};
SG::ReadCondHandleKey<CaloDetDescrManager> m_caloMgrKey{this,"CaloDetDescrManager", "CaloDetDescrManager"};
std::string m_selectionString;
double m_dr;
......
......@@ -5,15 +5,16 @@
#include "CaloUtils/CaloCellList.h"
#include "CaloEvent/CaloCellContainer.h"
#include "xAODCaloEvent/CaloCluster.h"
#include "CaloDetDescr/CaloDetDescrManager.h"
#include "xAODEgamma/Egamma.h"
#include "CellsInCone.h"
void DerivationFramework::CellsInCone::egammaSelect(xAOD::CaloCluster* inputCl,
const CaloCellContainer* inputcells, const xAOD::Egamma* eg, const double dr){
void DerivationFramework::CellsInCone::egammaSelect(xAOD::CaloCluster* inputCl, const CaloCellContainer* inputcells,
const CaloDetDescrManager* caloMgr,const xAOD::Egamma* eg, const double dr){
std::vector<const CaloCell*> cells;
cells.reserve(100);
CaloCellList myList(inputcells);
CaloCellList myList(caloMgr,inputcells);
double egEta = eg->caloCluster()->etaBE(2);
double egPhi = eg->caloCluster()->phiBE(2);
......
......@@ -11,7 +11,8 @@ class CaloCellContainer;
namespace DerivationFramework {
namespace CellsInCone{
void egammaSelect(xAOD::CaloCluster* inputCl, const CaloCellContainer* inputcells, const xAOD::Egamma* eg, const double dr) ;
void egammaSelect(xAOD::CaloCluster* inputCl, const CaloCellContainer* inputcells,
const CaloDetDescrManager* caloMgr, const xAOD::Egamma* eg, const double dr) ;
}
}
#endif
......@@ -25,6 +25,7 @@ StatusCode DerivationFramework::CellsInConeThinning::initialize(){
ATH_CHECK(m_InputCellsSGKey.initialize());
ATH_CHECK(m_OutputClusterSGKey.initialize());
ATH_CHECK(m_OutputCellLinkSGKey.initialize());
ATH_CHECK(m_caloMgrKey.initialize());
if (!m_selectionString.empty()) {
ATH_CHECK( initializeParser(m_selectionString) );
......@@ -61,6 +62,10 @@ StatusCode DerivationFramework::CellsInConeThinning::addBranches() const{
ATH_MSG_ERROR( "Couldn't retrieve cell container with key: " <<m_InputCellsSGKey);
return StatusCode::FAILURE;
}
SG::ReadCondHandle<CaloDetDescrManager> caloMgrHandle{m_caloMgrKey};
const CaloDetDescrManager* caloDDMgr = *caloMgrHandle;
//We have a selection string
if (!m_selectionString.empty()) {
std::vector<int> entries = m_parser->evaluateAsVector();
......@@ -75,7 +80,7 @@ StatusCode DerivationFramework::CellsInConeThinning::addBranches() const{
for (const xAOD::Egamma* eg : *egammas){
if(static_cast<bool>(entries.at(index))){
xAOD::CaloCluster *dummy = CaloClusterStoreHelper::makeCluster(cells);
DerivationFramework::CellsInCone::egammaSelect(dummy,cells,eg,m_dr);
DerivationFramework::CellsInCone::egammaSelect(dummy,cells,caloDDMgr,eg,m_dr);
dclHdl->push_back(dummy);
}
++index;
......@@ -85,7 +90,7 @@ StatusCode DerivationFramework::CellsInConeThinning::addBranches() const{
else{
for (const xAOD::Egamma* eg : *egammas){
xAOD::CaloCluster *dummy = CaloClusterStoreHelper::makeCluster(cells);
DerivationFramework::CellsInCone::egammaSelect(dummy,cells,eg,m_dr);
DerivationFramework::CellsInCone::egammaSelect(dummy,cells,caloDDMgr,eg,m_dr);
dclHdl->push_back(dummy);
}
}
......
......@@ -25,6 +25,8 @@
#include "GaudiKernel/ToolHandle.h"
#include "MuidInterfaces/IMuidCaloEnergyMeas.h"
#include "StoreGate/ReadHandleKey.h"
#include "StoreGate/ReadCondHandleKey.h"
#include "CaloDetDescr/CaloDetDescrManager.h"
//<<<<<< CLASS DECLARATIONS >>>>>>
......@@ -62,15 +64,23 @@ namespace Rec {
LAREM = 2,
};
// private methods
void energyInCalo(CaloMeas& caloMeas, const CaloCellContainer* cellContainer, const CaloNoise* noiseCDO, double eta, double phi,
int iSubCalo) const;
void isolationEnergy(CaloMeas& caloMeas, const CaloCellContainer* cellContainer, const CaloNoise* noiseCDO, double eta, double phi,
int iSubCalo) const;
void energyInCalo(CaloMeas& caloMeas, const CaloCellContainer* cellContainer, const CaloDetDescrManager* detMgr,
const CaloNoise* noiseCDO, double eta, double phi, int iSubCalo) const;
double energyInTile(const CaloCellContainer* cellContainer, const CaloNoise* noiseCDO, double eta, double phi, int, int) const;
double energyInLArHEC(const CaloCellContainer* cellContainer, const CaloNoise* noiseCDO, double eta, double phi, int, int) const;
double energyInLArEM(const CaloCellContainer* cellContainer, const CaloNoise* noiseCDO, double eta, double phi, int, int) const;
int cellCounting(const CaloCellContainer* cellContainer, const CaloNoise* noiseCDO, double eta, double phi) const;
void isolationEnergy(CaloMeas& caloMeas, const CaloCellContainer* cellContainer, const CaloDetDescrManager* detMgr,
const CaloNoise* noiseCDO, double eta, double phi, int iSubCalo) const;
double energyInTile(const CaloCellContainer* cellContainer, const CaloDetDescrManager* detMgr, const CaloNoise* noiseCDO,
double eta, double phi, int, int) const;
double energyInLArHEC(const CaloCellContainer* cellContainer, const CaloDetDescrManager* detMgr, const CaloNoise* noiseCDO,
double eta, double phi, int, int) const;
double energyInLArEM(const CaloCellContainer* cellContainer, const CaloDetDescrManager* detMgr, const CaloNoise* noiseCDO,
double eta, double phi, int, int) const;
int cellCounting(const CaloCellContainer* cellContainer, const CaloDetDescrManager* detMgr, const CaloNoise* noiseCDO,
double eta, double phi) const;
//
int samplingID(const CaloCell* cell, int iSubCalo) const;
......@@ -97,7 +107,9 @@ namespace Rec {
"AllCalo",
"calo cell container location",
};
SG::ReadCondHandleKey<CaloDetDescrManager> m_caloMgrKey{this,"CaloDetDescrManager", "CaloDetDescrManager"};
double m_measurementConeTile;
double m_measurementConeLArHEC;
double m_measurementConeLArEM;
......
......@@ -73,7 +73,7 @@ namespace Rec {
ATH_CHECK(m_caloParamTool.retrieve());
ATH_CHECK(m_noiseCDOKey.initialize());
ATH_CHECK(m_cellContainerLocation.initialize());
ATH_CHECK(m_caloMgrKey.initialize());
return StatusCode::SUCCESS;
}
......@@ -103,19 +103,21 @@ namespace Rec {
}
const CaloNoise* noiseCDO = *noiseHdl;
SG::ReadCondHandle<CaloDetDescrManager> caloMgrHandle{m_caloMgrKey,ctx};
const CaloDetDescrManager* caloDDMgr = *caloMgrHandle;
// set measured tile energy, measured sampling fraction and isolation energy into CaloMeas
std::unique_ptr<CaloMeas> caloMeas = std::make_unique<CaloMeas>();
energyInCalo(*caloMeas, cellContainer.cptr(), noiseCDO, etaHad, phiHad, SubCaloId::TILE);
isolationEnergy(*caloMeas, cellContainer.cptr(), noiseCDO, etaHad, phiHad, SubCaloId::TILE);
energyInCalo(*caloMeas, cellContainer.cptr(), caloDDMgr, noiseCDO, etaHad, phiHad, SubCaloId::TILE);
isolationEnergy(*caloMeas, cellContainer.cptr(), caloDDMgr, noiseCDO, etaHad, phiHad, SubCaloId::TILE);
// similar for LArHEC
energyInCalo(*caloMeas, cellContainer.cptr(), noiseCDO, etaHad, phiHad, SubCaloId::LARHEC);
isolationEnergy(*caloMeas, cellContainer.cptr(), noiseCDO, etaHad, phiHad, SubCaloId::LARHEC);
energyInCalo(*caloMeas, cellContainer.cptr(), caloDDMgr, noiseCDO, etaHad, phiHad, SubCaloId::LARHEC);
isolationEnergy(*caloMeas, cellContainer.cptr(), caloDDMgr,noiseCDO, etaHad, phiHad, SubCaloId::LARHEC);
// and for the em calo
energyInCalo(*caloMeas, cellContainer.cptr(), noiseCDO, etaEM, phiEM, SubCaloId::LAREM);
isolationEnergy(*caloMeas, cellContainer.cptr(), noiseCDO, etaEM, phiEM, SubCaloId::LAREM);
energyInCalo(*caloMeas, cellContainer.cptr(), caloDDMgr, noiseCDO, etaEM, phiEM, SubCaloId::LAREM);
isolationEnergy(*caloMeas, cellContainer.cptr(), caloDDMgr, noiseCDO, etaEM, phiEM, SubCaloId::LAREM);
ATH_MSG_DEBUG(std::setiosflags(std::ios::fixed)
<< " Tile energy (GeV) :" << std::setw(8) << std::setprecision(3) << caloMeas->Tile_EnergyMeasured() / Units::GeV
......@@ -135,13 +137,13 @@ namespace Rec {
//<<<<<< PRIVATE MEMBER FUNCTION DEFINITIONS >>>>>>
int MuidCaloEnergyMeas::cellCounting(const CaloCellContainer* cellContainer, const CaloNoise* noiseCDO, double mu_eta,
double mu_phi) const {
int MuidCaloEnergyMeas::cellCounting(const CaloCellContainer* cellContainer, const CaloDetDescrManager* detMgr,
const CaloNoise* noiseCDO, double mu_eta, double mu_phi) const {
// int isubcalo = 2;
constexpr double lowest_threshold = 4 * 50.;
CaloCell_ID::SUBCALO iCalo = CaloCell_ID::LAREM;
CaloCellList myList(cellContainer, iCalo); // Construct the list
CaloCellList myList(detMgr,cellContainer, iCalo); // Construct the list