Skip to content
Snippets Groups Projects
Commit 3f2669f9 authored by Vakhtang Tsulaia's avatar Vakhtang Tsulaia
Browse files

Fixed the access to CaloDetDescrManager in TBRec

1. Switched TBCellContainerFillerTool to reading CaloDetDescrManager from
the Condition Store
2. Dropped the redundant dependency on CaloDetDescrManager from
TBClusterMaker, TBECLArRawChannelBuilder and TBEMECXTalkToyModel.
Instead they now retrieve CaloCell ID helpers directly from the
Detector Store

This is part of the ongoing migration of all clients of CaloDetDescrManager
parent f1699ec6
No related branches found
No related tags found
5 merge requests!69091Fix correlated smearing bug in JER in JetUncertainties in 22.0,!58791DataQualityConfigurations: Modify L1Calo config for web display,!51674Fixing hotSpotInHIST for Run3 HIST,!50012RecExConfig: Adjust log message levels from GetRunNumber and GetLBNumber,!47696Fixed the access to CaloDetDescrManager in TBRec (part I)
......@@ -14,9 +14,7 @@ TBCellContainerFillerTool::TBCellContainerFillerTool(
const std::string& type,
const std::string& name,
const IInterface* parent)
:base_class (type, name, parent) ,
m_theCaloDDM(0), m_theCaloCCIDM(0), m_onlineHelper(0),
m_hashMax(0)
:base_class (type, name, parent)
{
}
......@@ -25,10 +23,9 @@ TBCellContainerFillerTool::TBCellContainerFillerTool(
StatusCode TBCellContainerFillerTool::initialize()
{
ATH_CHECK(m_caloMgrKey.initialize());
// Cache pointers:
m_theCaloDDM = CaloDetDescrManager::instance() ;
m_theCaloCCIDM = m_theCaloDDM->getCaloCell_ID() ;
ATH_CHECK(detStore()->retrieve(m_theCaloCCIDM, "CaloCell_ID"));
m_hashMax = m_theCaloCCIDM->calo_cell_hash_max();
......@@ -39,9 +36,12 @@ StatusCode TBCellContainerFillerTool::initialize()
StatusCode
TBCellContainerFillerTool::process (CaloCellContainer* theCont,
const EventContext& /*ctx*/) const
const EventContext& ctx) const
{
SG::ReadCondHandle<CaloDetDescrManager> caloMgrHandle{m_caloMgrKey,ctx};
ATH_CHECK(caloMgrHandle.isValid());
const CaloDetDescrManager* caloMgr = *caloMgrHandle;
StatusCode returnSc = StatusCode::SUCCESS ;
unsigned int index = 0;
......@@ -68,23 +68,23 @@ TBCellContainerFillerTool::process (CaloCellContainer* theCont,
const CaloCell * theCell = theCont->findCell(IdentifierHash(theHash)) ;
CaloCell *nCell;
if(!theCell) {
Identifier cellid = m_theCaloCCIDM->cell_id(theHash);
HWIdentifier chid = m_onlineHelper->channel_Id(m_theCaloCCIDM->calo_cell_hash(cellid));
if(!chid.get_identifier32().get_compact()) continue;
const CaloDetDescrElement* cDDE = m_theCaloDDM->get_element(cellid);
if(!cDDE) { continue; }
if(cDDE->is_lar_hec())
nCell = new CaloCell(cDDE,0.,0.,0.,CaloGain::LARMEDIUMGAIN);
else
nCell = new CaloCell(cDDE,0.,0.,0.,CaloGain::LARHIGHGAIN);
ATH_MSG_VERBOSE ( "Adding 0. energy cell: " << m_theCaloCCIDM->cell_id(theHash));
theCont->push_back(nCell);
++added;
// }
Identifier cellid = m_theCaloCCIDM->cell_id(theHash);
HWIdentifier chid = m_onlineHelper->channel_Id(m_theCaloCCIDM->calo_cell_hash(cellid));
if(!chid.get_identifier32().get_compact()) continue;
const CaloDetDescrElement* cDDE = caloMgr->get_element(cellid);
if(!cDDE) continue;
if(cDDE->is_lar_hec()) {
nCell = new CaloCell(cDDE,0.,0.,0.,CaloGain::LARMEDIUMGAIN);
}
else {
nCell = new CaloCell(cDDE,0.,0.,0.,CaloGain::LARHIGHGAIN);
}
ATH_MSG_VERBOSE ( "Adding 0. energy cell: " << m_theCaloCCIDM->cell_id(theHash));
theCont->push_back(nCell);
++added;
}
}
// theCont->updateCaloIterators();
theCont->order();
return returnSc ;
......
/*
Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration
Copyright (C) 2002-2021 CERN for the benefit of the ATLAS collaboration
*/
#ifndef TBREC_TBCELLCONTAINERFILLERTOOL_H
#define TBREC_TBCELLCONTAINERFILLERTOOL_H
#include "AthenaBaseComps/AthAlgTool.h"
//#include "CaloUtils/ICaloCellMakerTool.h"
#include "CaloInterface/ICaloCellMakerTool.h"
#include "GaudiKernel/ToolHandle.h"
#include "CaloDetDescr/CaloDetDescrManager.h"
#include "StoreGate/ReadCondHandleKey.h"
class MsgStream;
class CaloDetDescrManager;
class CaloCell_ID;
class LArOnlineID;
......@@ -30,10 +30,14 @@ class TBCellContainerFillerTool
const EventContext& ctx) const override;
private:
const CaloDetDescrManager *m_theCaloDDM;
const CaloCell_ID * m_theCaloCCIDM;
const LArOnlineID* m_onlineHelper;
unsigned int m_hashMax;
SG::ReadCondHandleKey<CaloDetDescrManager> m_caloMgrKey { this
, "CaloDetDescrManager"
, "CaloDetDescrManager"
, "SG Key for CaloDetDescrManager in the Condition Store" };
const CaloCell_ID * m_theCaloCCIDM{nullptr};
const LArOnlineID* m_onlineHelper{nullptr};
unsigned int m_hashMax{0};
};
#endif
......@@ -5,13 +5,10 @@
#include "TBClusterMaker.h"
#include "CLHEP/Units/SystemOfUnits.h"
#include "CaloDetDescr/CaloDetDescrManager.h"
#include "CaloGeoHelpers/CaloPhiRange.h"
#include "CaloEvent/CaloCell.h"
#include "CaloEvent/CaloCellContainer.h"
//#include "CaloEvent/CaloCluster.h"
//#include "CaloEvent/CaloClusterContainer.h"
#include "xAODCaloEvent/CaloClusterContainer.h"
#include "xAODCaloEvent/CaloClusterKineHelper.h"
#include "CaloGeoHelpers/proxim.h"
......@@ -30,7 +27,6 @@ TBClusterMaker::TBClusterMaker(const std::string& type,
m_deltaR(0.02),
m_maxIter(4),
m_CellEnergyInADC(false),
m_calo_DDM(0),
m_calo_id(0)
{
// CaloCell Container Name
......@@ -56,9 +52,6 @@ TBClusterMaker::TBClusterMaker(const std::string& type,
// Cluster \f$ \phi \f$) from JO file
declareProperty("phiCluster",m_phi0=99.);
//m_numCluIterationsConverged = 0;
//m_numCluIterationsNonConverged = 0;
//m_numSeedCellNotFound = 0;
}
////////////////////
// Initialization //
......@@ -69,10 +62,8 @@ StatusCode TBClusterMaker::initialize(){
MsgStream log(msgSvc(), name());
log << MSG::INFO << "in initialize()" << endmsg;
// Get pointer to detector manager and CaloCell_ID:
m_calo_DDM = CaloDetDescrManager::instance();
m_calo_id = m_calo_DDM->getCaloCell_ID();
// Get pointer to CaloCell_ID:
ATH_CHECK(detStore()->retrieve(m_calo_id, "CaloCell_ID"));
ATH_CHECK( m_elecNoiseKey.initialize() );
// setup calorimeter module and sampling lookup tables
......
......@@ -16,7 +16,6 @@
* Like all other cluster maker tools this class derives from
* CaloClusterMakerTool. */
class CaloDetDescrManager;
class CaloDetDescrElement;
#include "CaloIdentifier/CaloCell_ID.h"
......@@ -85,13 +84,7 @@ class TBClusterMaker: public AthAlgTool, virtual public CaloClusterCollectionPro
/** True if cell enrgy is in ADC counts, default = FALSE **/
bool m_CellEnergyInADC;
/** Counters */
//int m_numSeedCellNotFound;
//int m_numCluIterationsConverged;
//int m_numCluIterationsNonConverged;
/** Services */
const CaloDetDescrManager* m_calo_DDM;
const CaloCell_ID* m_calo_id;
SG::ReadCondHandleKey<CaloNoise> m_elecNoiseKey
......
......@@ -3,14 +3,12 @@
*/
#include "TBECLArRawChannelBuilder.h"
#include "CaloDetDescr/CaloDetDescrManager.h"
#include "CaloIdentifier/CaloCell_ID.h"
#include "LArRawEvent/LArDigitContainer.h"
#include "TBEvent/TBPhase.h"
#include "LArElecCalib/ILArPedestal.h"
//#include "LArElecCalib/ILArRamp.h"
#include "LArElecCalib/ILArOFC.h"
#include "LArElecCalib/ILArShape.h"
#include "LArElecCalib/ILArGlobalTimeOffset.h"
......@@ -30,7 +28,6 @@ TBECLArRawChannelBuilder::TBECLArRawChannelBuilder (const std::string& name, ISv
AthAlgorithm(name, pSvcLocator),
m_onlineHelper(0),
m_calo_id(0),
m_calo_dd_man(0),
m_DataLocation("FREE"),
m_ChannelContainerName("LArRawChannels"),
m_useTDC(false),
......@@ -102,9 +99,9 @@ StatusCode TBECLArRawChannelBuilder::initialize(){
if (!m_useRamp)
{
// pointer to detector manager:
ATH_CHECK( detStore()->retrieve (m_calo_dd_man, "CaloMgr") );
m_calo_id = m_calo_dd_man->getCaloCell_ID();
// pointer to CaloCell ID helper:
ATH_CHECK( detStore()->retrieve (m_calo_id, "CaloCell_ID") );
for (int i=0; i<30; i++) {
m_adc2mev[i] = 0;
if (i == 6) m_adc2mev[i] = 0.041*637; // EMEC2
......
......@@ -21,7 +21,6 @@
#include "LArElecCalib/ILArHVScaleCorr.h"
class CaloCell_ID;
class CaloDetDescrManager;
class TBECLArRawChannelBuilder : public AthAlgorithm
{
......@@ -35,7 +34,6 @@ private:
//Services & Tools
const LArOnlineID* m_onlineHelper;
const CaloCell_ID* m_calo_id;
const CaloDetDescrManager* m_calo_dd_man;
SG::ReadCondHandleKey<LArOnOffIdMapping> m_cablingKey {this,"keyCabling", "LArOnOffIdMap", "Input key for Id mapping"} ;
SG::ReadCondHandleKey<ILArHVScaleCorr> m_offlineHVScaleCorrKey{this, "keyOfflineHVCorr", "LArHVScaleCorrRecomputed","Key for LArHVScaleCorr"};
......
......@@ -23,7 +23,6 @@ PURPOSE: A simple toy model to simulate longitudinal cross-talk
#include "CaloDetDescr/CaloDetDescrElement.h"
#include "CaloIdentifier/CaloCell_ID.h"
#include "CaloDetDescr/CaloDetDescrManager.h"
/////////////////////////////////////////////////////////////////////
// CONSTRUCTOR:
......@@ -35,7 +34,6 @@ TBEMECXTalkToyModel::TBEMECXTalkToyModel(
const IInterface* parent)
:base_class (type, name, parent),
m_caloSelection(false),
m_calo_dd_man(nullptr),
m_calo_id(nullptr)
{
declareProperty("CaloNums",m_caloNums);
......@@ -84,8 +82,7 @@ StatusCode TBEMECXTalkToyModel::initialize()
}
}
m_calo_dd_man = CaloDetDescrManager::instance();
m_calo_id = m_calo_dd_man->getCaloCell_ID();
ATH_CHECK(detStore()->retrieve(m_calo_id,"CaloCell_ID"));
ATH_MSG_VERBOSE ("XTalkScaleLong = " << m_xtalkScaleLong);
ATH_MSG_VERBOSE ("XTalkScaleEta = " << m_xtalkScaleEta);
......
/*
Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration
Copyright (C) 2002-2021 CERN for the benefit of the ATLAS collaboration
*/
#ifndef TBREC_TBEMECXTALKTOYMODEL_H
......@@ -12,9 +12,6 @@
#include "GaudiKernel/ToolHandle.h"
#include "CaloIdentifier/CaloCell_ID.h"
class CaloDetDescrManager;
class TBEMECXTalkToyModel
: public extends<AthAlgTool, ICaloCellMakerTool>
{
......@@ -37,7 +34,6 @@ public:
bool m_caloSelection ;
const CaloDetDescrManager * m_calo_dd_man;
const CaloCell_ID * m_calo_id;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment