Commit 9e40eee7 authored by Frank Winklmeier's avatar Frank Winklmeier
Browse files

Merge branch 'LArCellRec_DetDescrMgrCond' into 'master'

LArCellRec: MIgrate to CaloDetDescManager in CondStore

See merge request atlas/athena!46801
parents da525ba6 0e9d1d9c
......@@ -78,6 +78,8 @@ StatusCode LArCellBuilderFromLArRawChannelTool::initialize() {
}
}
ATH_CHECK(m_caloMgrKey.initialize());
//Compute total number of cells
......@@ -125,9 +127,6 @@ LArCellBuilderFromLArRawChannelTool::process (CaloCellContainer* theCellContaine
else
ATH_MSG_DEBUG("Got " << nRawChannels << " LArRawChannels");
const CaloDetDescrManager* caloDDM = nullptr;
ATH_CHECK( detStore()->retrieve (caloDDM, "CaloMgr") );
unsigned nCellsAdded=0;
std::bitset<CaloCell_ID::NSUBCALO> includedSubcalos;
......@@ -142,12 +141,11 @@ LArCellBuilderFromLArRawChannelTool::process (CaloCellContainer* theCellContaine
SG::ReadCondHandle<LArOnOffIdMapping> cablingHdl(m_cablingKey, ctx);
const LArOnOffIdMapping* cabling=*cablingHdl;
theCellContainer->resize(m_nTotalCells);
//LArRawChannelContainer::const_iterator itrRawChannel=rawColl->begin();
//LArRawChannelContainer::const_iterator lastRawChannel=rawColl->end();
//for ( ; itrRawChannel!=lastRawChannel; ++itrRawChannel) {
SG::ReadCondHandle<CaloDetDescrManager> caloMgrHandle{m_caloMgrKey,ctx};
const CaloDetDescrManager* caloDDM = *caloMgrHandle;
theCellContainer->resize(m_nTotalCells);
for (const LArRawChannel& rawChan : *rawColl) {
const HWIdentifier hwid=rawChan.channelID();
if ( cabling->isOnlineConnected(hwid)) {
......
......@@ -28,7 +28,7 @@
#include "CaloInterface/ICaloCellMakerTool.h"
#include "Identifier/HWIdentifier.h"
#include "LArIdentifier/LArOnlineID.h"
#include "CaloDetDescr/CaloDetDescrElement.h"
#include "CaloDetDescr/CaloDetDescrManager.h"
//#include "LArRawEvent/LArRawChannelContainer.h"
#include "LArRecConditions/LArBadChannelCont.h"
#include "AthAllocators/DataPool.h"
......@@ -36,7 +36,6 @@
class CaloCellContainer ;
class CaloDetDescrManager ;
class CaloCell_ID;
class CaloCellContainer ;
class LArRawChannelContainer;
......@@ -104,6 +103,9 @@ private:
const CaloCell_ID* m_caloCID;
SG::ReadCondHandleKey<LArBadFebCont> m_missingFebKey;
SG::ReadCondHandleKey<CaloDetDescrManager> m_caloMgrKey{this,"CaloDetDescrManager", "CaloDetDescrManager"};
};
......
......@@ -61,12 +61,20 @@ LArCellEmMiscalib::LArCellEmMiscalib(
StatusCode LArCellEmMiscalib::initialize()
{
ATH_MSG_INFO( " in LArCellEmMiscalib::initialize()" );
ATH_CHECK(m_caloMgrKey.initialize());
return StatusCode::SUCCESS;
}
ATH_CHECK( detStore()->retrieve( m_caloIdMgr ) );
ATH_CHECK( detStore()->retrieve(m_calodetdescrmgr) );
void LArCellEmMiscalib::initOnce() {
StatusCode sc;
sc=detStore()->retrieve( m_caloIdMgr );
sc.ignore();
SG::ReadCondHandle<CaloDetDescrManager> caloMgrHandle{m_caloMgrKey};
m_calodetdescrmgr = *caloMgrHandle;
static const bool CREATEIFNOTTHERE(true);
ATH_CHECK( service("AtRndmGenSvc", m_AtRndmGenSvc, CREATEIFNOTTHERE) );
sc=service("AtRndmGenSvc", m_AtRndmGenSvc, CREATEIFNOTTHERE);
sc.ignore();
m_engine = m_AtRndmGenSvc->setOnDefinedSeeds(m_seed,this->name());
......@@ -112,7 +120,7 @@ StatusCode LArCellEmMiscalib::initialize()
}
return StatusCode::SUCCESS;
return;
}
////////////////////////////////////////////////////////////////////////////////////////
......@@ -208,8 +216,8 @@ int LArCellEmMiscalib::region(int barrelec, double eta, double phi)
void LArCellEmMiscalib::MakeCorrection (CaloCell * theCell,
const EventContext& /*ctx*/) const
{
LArCellEmMiscalib* thisNC ATLAS_THREAD_SAFE = const_cast<LArCellEmMiscalib*>(this);
std::call_once(m_initOnce, &LArCellEmMiscalib::initOnce,thisNC);
float energy = theCell->energy();
float weight=1;
......
......@@ -70,6 +70,9 @@ class LArCellEmMiscalib : public CaloCellCorrection
std::vector<float> m_spread1;
std::vector<float> m_calib;
mutable std::once_flag m_initOnce;
void initOnce();
SG::ReadCondHandleKey<CaloDetDescrManager> m_caloMgrKey{this,"CaloDetDescrManager", "CaloDetDescrManager"};
};
#endif // not LARCELLREC_LARCELLEMMISCALIB_H
......@@ -18,7 +18,6 @@ PURPOSE: non linearity if only linear calibration fit is used
// INCLUDE LAr header files:
#include "LArNonLinearity.h"
#include "CaloIdentifier/CaloIdManager.h"
#include "CaloDetDescr/CaloDetDescrManager.h"
#include "CaloEvent/CaloCell.h"
// Units
......@@ -86,13 +85,10 @@ StatusCode LArNonLinearity::initialize()
ATH_MSG_INFO( name() );
ATH_MSG_INFO( " Initialize LArNonLinearity " );
// pointer to DD manager and helpers:
const CaloIdManager* caloIdMgr;
ATH_CHECK( detStore()->retrieve(caloIdMgr) );
m_emID = caloIdMgr->getEM_ID();
m_hecID = caloIdMgr->getHEC_ID();
m_fcalID = caloIdMgr->getFCAL_ID();
// pointer to identifier helpers:
ATH_CHECK(detStore()->retrieve(m_emID,"LArEM_ID"));
ATH_CHECK(detStore()->retrieve(m_hecID,"HEC_ID"));
ATH_CHECK(detStore()->retrieve(m_fcalID,"FCAL_ID"));
return StatusCode::SUCCESS;
}
......
......@@ -20,16 +20,20 @@ def LArGMCfg(configFlags):
if doAlignment:
if configFlags.Input.isMC:
#Monte Carlo case:
result.merge(addFolders(configFlags,["/LAR/Align","/LAR/LArCellPositionShift"],"LAR_OFL"))
result.merge(addFolders(configFlags,"/LAR/Align","LAR_OFL",className="DetCondKeyTrans"))
result.merge(addFolders(configFlags,"/LAR/LArCellPositionShift","LAR_OFL",className="CaloRec::CaloCellPositionShift"))
else:
if configFlags.Overlay.DataOverlay:
#Data overlay
result.merge(addFolders(configFlags, ["/LAR/Align"], "LAR_ONL"))
result.merge(addFolders(configFlags, ["/LAR/LArCellPositionShift"], "LAR_OFL", tag="LArCellPositionShift-ideal", db="OFLP200"))
result.merge(addFolders(configFlags, "/LAR/Align", "LAR_ONL",className="DetCondKeyTrans"))
result.merge(addFolders(configFlags, "/LAR/LArCellPositionShift", "LAR_OFL", tag="LArCellPositionShift-ideal", db="OFLP200",className="CaloRec::CaloCellPositionShift"))
else:
#Regular offline data processing
result.merge(addFolders(configFlags,["/LAR/Align","/LAR/LArCellPositionShift"],"LAR_ONL"))
result.merge(addFolders(configFlags,"/LAR/Align","LAR_ONL",className="DetCondKeyTrans"))
result.merge(addFolders(configFlags,"/LAR/LArCellPositionShift","LAR_ONL",className="CaloRec::CaloCellPositionShift"))
result.addCondAlgo(CompFactory.LArAlignCondAlg())
result.addCondAlgo(CompFactory.CaloAlignCondAlg())
return result
......
Markdown is supported
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