Commit 4ff76c05 authored by Nicola Orlando's avatar Nicola Orlando 📆
Browse files

Merge branch 'fix_branch_v0' into 'master'

Fix MuonSelect and menu

See merge request !3
parents 67018c62 90d476ee
Pipeline #3078460 created
/*
Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration
Copyright (C) 2002-2021 CERN for the benefit of the ATLAS collaboration
*/
/**
......@@ -21,7 +21,6 @@
// DetDescr includes
#include "CaloIdentifier/CaloCell_ID.h"
#include "CaloDetDescr/CaloDetDescrManager.h"
// Gaudi includes
#include "GaudiKernel/MsgStream.h"
......@@ -35,7 +34,6 @@
CaloClusterFakeReader::CaloClusterFakeReader(const std::string &name,
ISvcLocator *pSvcLocator) :
AthAlgorithm(name,pSvcLocator),
m_caloMgr(0),
m_calocellId(0)
{}
......@@ -47,7 +45,7 @@ StatusCode CaloClusterFakeReader::initialize()
{
ATH_MSG_INFO( "CaloClusterFakeReader::initialize()" );
ATH_CHECK( detStore()->retrieve(m_calocellId, "CaloCell_ID") );
ATH_CHECK( detStore()->retrieve(m_caloMgr) );
ATH_CHECK(m_caloMgrKey.initialize());
return StatusCode::SUCCESS;
}
......@@ -56,6 +54,9 @@ StatusCode CaloClusterFakeReader::execute()
{
ATH_MSG_DEBUG( "CaloClusterFakeReader::execute()" );
SG::ReadCondHandle<CaloDetDescrManager> caloMgrHandle{m_caloMgrKey};
ATH_CHECK(caloMgrHandle.isValid());
const CaloClusterContainer* clusCont = nullptr;
ATH_CHECK( evtStore()->retrieve(clusCont,"LArClusterCont") );
......@@ -66,7 +67,7 @@ StatusCode CaloClusterFakeReader::execute()
// Create container
const CaloCellContainer* caloCont1 = creator.createCaloCellContainer(m_calocellId,
m_caloMgr,
*caloMgrHandle,
msg());
CaloCellContainer::const_iterator first1 = caloCont1->begin();
......
/*
Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
Copyright (C) 2002-2021 CERN for the benefit of the ATLAS collaboration
*/
#ifndef SRC_CALOCLUSTERFAKEREADE_H
# define SRC_CALOCLUSTERFAKEREADE_H
#ifndef ATHENAPOOLTEST_CALOCLUSTERFAKEREADER_H
#define ATHENAPOOLTEST_CALOCLUSTERFAKEREADER_H
/**
* @file CaloClusterFakeReader.h
......@@ -27,9 +27,10 @@
#include "AthenaBaseComps/AthAlgorithm.h"
#include "CaloDetDescr/CaloDetDescrManager.h"
#include "StoreGate/ReadCondHandleKey.h"
class CaloCell_ID;
class CaloDetDescrManager;
class CaloCellContainer;
class CaloClusterContainer;
......@@ -44,13 +45,13 @@ public:
~CaloClusterFakeReader();
/// Algorithm initialize at begin of job
virtual StatusCode initialize();
virtual StatusCode initialize() override;
/// Algorithm execute once per event
virtual StatusCode execute();
virtual StatusCode execute() override;
/// Algorithm finalize at end of job
virtual StatusCode finalize();
virtual StatusCode finalize() override;
///////////////////////////////////////////////////////////////////
// Private methods:
......@@ -75,7 +76,10 @@ private:
void printCells(const CaloClusterContainer* clusCont) const;
/// DetDescr mgr for access to the id helper
const CaloDetDescrManager* m_caloMgr;
SG::ReadCondHandleKey<CaloDetDescrManager> m_caloMgrKey { this
, "CaloDetDescrManager"
, "CaloDetDescrManager"
, "SG Key for CaloDetDescrManager in the Condition Store" };
/// IDhelper for LAr needed for identifiable container
const CaloCell_ID* m_calocellId;
......
/*
Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
Copyright (C) 2002-2021 CERN for the benefit of the ATLAS collaboration
*/
#ifndef SRC_LARCELLCONTFAKECREATOR_H
# define SRC_LARCELLCONTFAKECREATOR_H
#ifndef ATHENAPOOLTEST_LARCELLCONTFAKECREATOR_H
#define ATHENAPOOLTEST_LARCELLCONTFAKECREATOR_H
/**
* @file LArCellContFakeCreator.h
......
/*
Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration
Copyright (C) 2002-2021 CERN for the benefit of the ATLAS collaboration
*/
/**
......@@ -18,12 +18,8 @@
#include "LArCellContFakeReader.h"
// Event includes
//#include "LArRecEvent/LArCellContainer.h"
// DetDescr includes
#include "CaloIdentifier/CaloCell_ID.h"
#include "CaloDetDescr/CaloDetDescrManager.h"
// test includes
#include "LArCellContFakeCreator.h"
......@@ -33,7 +29,6 @@
LArCellContFakeReader::LArCellContFakeReader(const std::string &name,
ISvcLocator *pSvcLocator) :
AthAlgorithm(name,pSvcLocator),
m_caloMgr(nullptr),
m_calocellId(nullptr)
{}
......@@ -42,7 +37,7 @@ StatusCode LArCellContFakeReader::initialize()
{
ATH_MSG_INFO( "LArCellContFakeReader::initialize()" );
ATH_CHECK( detStore()->retrieve(m_calocellId, "CaloCell_ID") );
ATH_CHECK( detStore()->retrieve(m_caloMgr) );
ATH_CHECK(m_caloMgrKey.initialize());
return StatusCode::SUCCESS;
}
......@@ -51,6 +46,9 @@ StatusCode LArCellContFakeReader::execute()
{
ATH_MSG_DEBUG("LArCellContFakeReader::execute()" );
SG::ReadCondHandle<CaloDetDescrManager> caloMgrHandle{m_caloMgrKey};
ATH_CHECK(caloMgrHandle.isValid());
// Retrieve container
const CaloCellContainer* caloCont = nullptr;
ATH_CHECK( evtStore()->retrieve(caloCont,"CaloCellCont1") );
......@@ -62,7 +60,7 @@ StatusCode LArCellContFakeReader::execute()
// Create container
MsgStream log(msgSvc(), name());
const CaloCellContainer* caloCont1 = creator.createCaloCellContainer(m_calocellId,
m_caloMgr,
*caloMgrHandle,
msg());
CaloCellContainer::const_iterator first = caloCont->begin();
......
/*
Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
Copyright (C) 2002-2021 CERN for the benefit of the ATLAS collaboration
*/
#ifndef SRC_LARCELLCONTFAKEREADER_H
# define SRC_LARCELLCONTFAKEREADER_H
#ifndef ATHENAPOOLTEST_LARCELLCONTFAKEREADER_H
#define ATHENAPOOLTEST_LARCELLCONTFAKEREADER_H
/**
* @file LArCellContFakeReader.h
......@@ -27,9 +27,9 @@
#include "AthenaBaseComps/AthAlgorithm.h"
#include "CaloDetDescr/CaloDetDescrManager.h"
#include "StoreGate/ReadCondHandleKey.h"
class CaloDetDescrManager;
class CaloCell_ID;
class CaloCellContainer;
......@@ -41,13 +41,13 @@ public:
LArCellContFakeReader(const std::string &name,ISvcLocator *pSvcLocator);
/// Algorithm initialize at begin of job
virtual StatusCode initialize();
virtual StatusCode initialize() override;
/// Algorithm execute once per event
virtual StatusCode execute();
virtual StatusCode execute() override;
/// Algorithm finalize at end of job
virtual StatusCode finalize();
virtual StatusCode finalize() override;
///////////////////////////////////////////////////////////////////
// Private methods:
......@@ -72,7 +72,10 @@ private:
void printCells(const CaloCellContainer* larCont) const;
/// Need DD mgr to create cells
const CaloDetDescrManager* m_caloMgr;
SG::ReadCondHandleKey<CaloDetDescrManager> m_caloMgrKey { this
, "CaloDetDescrManager"
, "CaloDetDescrManager"
, "SG Key for CaloDetDescrManager in the Condition Store" };
/// Need id helper to create cells
const CaloCell_ID* m_calocellId;
......
/*
Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
Copyright (C) 2002-2021 CERN for the benefit of the ATLAS collaboration
*/
......@@ -24,7 +24,6 @@
// DetDescr includes
#include "CaloIdentifier/CaloCell_ID.h"
#include "CaloDetDescr/CaloDetDescrManager.h"
// Gaudi includes
#include "GaudiKernel/MsgStream.h"
......@@ -38,7 +37,6 @@
LArCellContFakeWriter::LArCellContFakeWriter(const std::string &name,
ISvcLocator *pSvcLocator) :
AthAlgorithm(name,pSvcLocator),
m_caloMgr(nullptr),
m_calocellId(nullptr)
{}
......@@ -47,7 +45,7 @@ StatusCode LArCellContFakeWriter::initialize()
{
ATH_MSG_INFO( "LArCellContFakeWriter::initialize()" );
ATH_CHECK( detStore()->retrieve(m_calocellId, "CaloCell_ID") );
ATH_CHECK( detStore()->retrieve(m_caloMgr) );
ATH_CHECK(m_caloMgrKey.initialize());
return StatusCode::SUCCESS;
}
......@@ -56,12 +54,15 @@ StatusCode LArCellContFakeWriter::execute()
{
ATH_MSG_DEBUG("LArCellContFakeWriter::execute()" );
SG::ReadCondHandle<CaloDetDescrManager> caloMgrHandle{m_caloMgrKey};
ATH_CHECK(caloMgrHandle.isValid());
LArCellContFakeCreator creator;
// Create container
MsgStream log(msgSvc(), name());
CaloCellContainer* caloCont = creator.createCaloCellContainer(m_calocellId,
m_caloMgr,
*caloMgrHandle,
msg());
if (!caloCont) {
......
/*
Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
Copyright (C) 2002-2021 CERN for the benefit of the ATLAS collaboration
*/
#ifndef SRC_LARCELLCONTFAKEWRITER_H
# define SRC_LARCELLCONTFAKEWRITER_H
#ifndef ATHENAPOOLTEST_LARCELLCONTFAKEWRITER_H
#define ATHENAPOOLTEST_LARCELLCONTFAKEWRITER_H
/**
* @file LArCellContFakeWriter.h
......@@ -27,8 +27,9 @@
#include "AthenaBaseComps/AthAlgorithm.h"
#include "CaloDetDescr/CaloDetDescrManager.h"
#include "StoreGate/ReadCondHandleKey.h"
class CaloDetDescrManager;
class CaloCell_ID;
class CaloCellContainer;
......@@ -40,13 +41,13 @@ public:
LArCellContFakeWriter(const std::string &name,ISvcLocator *pSvcLocator);
/// Algorithm initialize at begin of job
virtual StatusCode initialize();
virtual StatusCode initialize() override;
/// Algorithm execute once per event
virtual StatusCode execute();
virtual StatusCode execute() override;
/// Algorithm finalize at end of job
virtual StatusCode finalize();
virtual StatusCode finalize() override;
///////////////////////////////////////////////////////////////////
// Private methods:
......@@ -71,7 +72,10 @@ private:
void printCells(const CaloCellContainer* larCont) const;
/// Need DD mgr to create cells
const CaloDetDescrManager* m_caloMgr;
SG::ReadCondHandleKey<CaloDetDescrManager> m_caloMgrKey { this
, "CaloDetDescrManager"
, "CaloDetDescrManager"
, "SG Key for CaloDetDescrManager in the Condition Store" };
/// Need id helper to create cells
const CaloCell_ID* m_calocellId;
......
/*
Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration
Copyright (C) 2002-2021 CERN for the benefit of the ATLAS collaboration
*/
/**
......@@ -30,7 +30,6 @@
// DetDescr includes
#include "CaloIdentifier/CaloCell_ID.h"
#include "CaloDetDescr/CaloDetDescrManager.h"
// Id includes
#include "InDetIdentifier/PixelID.h"
......@@ -49,15 +48,13 @@
#include <map>
// Constructor with parameters:
RDOReaderDoubleSelector::RDOReaderDoubleSelector(const std::string &name,
ISvcLocator *pSvcLocator) :
AthAlgorithm(name, pSvcLocator),
m_pixelId(nullptr),
m_sctId(nullptr),
m_trtId(nullptr),
m_caloMgr(nullptr),
m_calocellId(nullptr)
RDOReaderDoubleSelector::RDOReaderDoubleSelector(const std::string &name
, ISvcLocator *pSvcLocator)
: AthAlgorithm(name, pSvcLocator)
, m_pixelId(nullptr)
, m_sctId(nullptr)
, m_trtId(nullptr)
, m_calocellId(nullptr)
{}
// Initialize method:
......@@ -70,7 +67,7 @@ StatusCode RDOReaderDoubleSelector::initialize()
ATH_CHECK( detStore()->retrieve(m_trtId, "TRT_ID") );
ATH_CHECK( detStore()->retrieve(m_calocellId, "CaloCell_ID") );
ATH_CHECK( detStore()->retrieve(m_caloMgr) );
ATH_CHECK(m_caloMgrKey.initialize());
return StatusCode::SUCCESS;
}
......@@ -375,12 +372,15 @@ StatusCode RDOReaderDoubleSelector::checkCells() const
ATH_MSG_DEBUG( "Container '" << "CaloCellCont"
<< "' retrieved from StoreGate" );
SG::ReadCondHandle<CaloDetDescrManager> caloMgrHandle{m_caloMgrKey};
ATH_CHECK(caloMgrHandle.isValid());
LArCellContFakeCreator creator;
// Create container
MsgStream log(msgSvc(), name());
const CaloCellContainer* caloCont1 = creator.createCaloCellContainer(m_calocellId,
m_caloMgr,
*caloMgrHandle,
msg());
CaloCellContainer::const_iterator first = caloCont->begin();
......
/*
Copyright (C) 2002-2018 CERN for the benefit of the ATLAS collaboration
Copyright (C) 2002-2021 CERN for the benefit of the ATLAS collaboration
*/
#ifndef RDOREADERDOUBLESELECTOR_H
#define RDOREADERDOUBLESELECTOR_H
#ifndef ATHENAPOOLTEST_RDOREADERDOUBLESELECTOR_H
#define ATHENAPOOLTEST_RDOREADERDOUBLESELECTOR_H
/**
* @file RDOReaderDoubleSelector.h
......@@ -15,13 +15,13 @@
*
*/
// Base class
#include "AthenaBaseComps/AthAlgorithm.h"
#include "CaloDetDescr/CaloDetDescrManager.h"
#include "StoreGate/ReadCondHandleKey.h"
class PixelID;
class SCT_ID;
class TRT_ID;
class CaloDetDescrManager;
class CaloCell_ID;
class CaloCellContainer;
......@@ -36,13 +36,13 @@ public:
RDOReaderDoubleSelector(const std::string &name,ISvcLocator *pSvcLocator);
/// Algorithm initialize at begin of job
virtual StatusCode initialize();
virtual StatusCode initialize() override;
/// Algorithm execute once per event
virtual StatusCode execute();
virtual StatusCode execute() override;
/// Algorithm finalize at end of job
virtual StatusCode finalize();
virtual StatusCode finalize() override;
///////////////////////////////////////////////////////////////////
// Private methods:
......@@ -88,7 +88,10 @@ private:
const TRT_ID* m_trtId;
/// Need DD mgr to create cells
const CaloDetDescrManager* m_caloMgr;
SG::ReadCondHandleKey<CaloDetDescrManager> m_caloMgrKey { this
, "CaloDetDescrManager"
, "CaloDetDescrManager"
, "SG Key for CaloDetDescrManager in the Condition Store" };
/// Need id helper to create cells
const CaloCell_ID* m_calocellId;
......
......@@ -16,11 +16,11 @@ StatusCode CaloAlignCondAlg::initialize()
ATH_CHECK(m_condSvc.retrieve());
ATH_CHECK(m_readKeyGeoAlign.initialize());
ATH_CHECK(m_readKeyCellPosShift.initialize());
ATH_CHECK(m_writeKey.initialize());
ATH_CHECK(m_writeCaloMgrKey.initialize());
// Register Write Cond Handle
if(m_condSvc->regHandle(this, m_writeKey).isFailure()) {
ATH_MSG_ERROR("unable to register WriteCondHandle " << m_writeKey.fullKey() << " with CondSvc");
if(m_condSvc->regHandle(this, m_writeCaloMgrKey).isFailure()) {
ATH_MSG_ERROR("unable to register WriteCondHandle " << m_writeCaloMgrKey.fullKey() << " with CondSvc");
return StatusCode::FAILURE;
}
......@@ -30,8 +30,8 @@ StatusCode CaloAlignCondAlg::initialize()
StatusCode CaloAlignCondAlg::execute(const EventContext& ctx) const
{
// ____________ Construct Write Cond Handle and check its validity ____________
SG::WriteCondHandle<CaloDetDescrManager> writeHandle{m_writeKey,ctx};
if (writeHandle.isValid()) {
SG::WriteCondHandle<CaloDetDescrManager> writeCaloMgrHandle{m_writeCaloMgrKey,ctx};
if (writeCaloMgrHandle.isValid()) {
ATH_MSG_DEBUG("Found valid write handle");
return StatusCode::SUCCESS;
}
......@@ -39,35 +39,25 @@ StatusCode CaloAlignCondAlg::execute(const EventContext& ctx) const
// ____________ Get Read Cond Objects ____________
// 1. GeoAlignmentStore
SG::ReadCondHandle<GeoAlignmentStore> readHandleGeoAlign{m_readKeyGeoAlign,ctx};
const GeoAlignmentStore* readCdoGeoAlign{*readHandleGeoAlign};
if(!readCdoGeoAlign) {
ATH_MSG_ERROR("Null pointer to the read conditions object of type GeoAlignmentStore");
return StatusCode::FAILURE;
}
ATH_CHECK(readHandleGeoAlign.isValid());
ATH_MSG_DEBUG("Retrieved GeoAlignmentStore object form the Condition Store");
writeHandle.addDependency(readHandleGeoAlign);
writeCaloMgrHandle.addDependency(readHandleGeoAlign);
// 2. CaloCellPositionShift
SG::ReadCondHandle<CaloRec::CaloCellPositionShift> readHandleCellPosShift{m_readKeyCellPosShift,ctx};
const CaloRec::CaloCellPositionShift* readCdoCellPosShift{*readHandleCellPosShift};
if(!readCdoCellPosShift) {
ATH_MSG_ERROR("Null pointer to the read conditions object of type CaloRec::CaloCellPositionShift");
return StatusCode::FAILURE;
}
ATH_CHECK(readHandleCellPosShift.isValid());
ATH_MSG_DEBUG("Retrieved CaloRec::CaloCellPositionShift object form the Condition Store");
writeHandle.addDependency(readHandleCellPosShift);
writeCaloMgrHandle.addDependency(readHandleCellPosShift);
// ____________ Build new CaloDetDescrManager _________________
std::unique_ptr<CaloDetDescrManager> caloMgr = buildCaloDetDescr(serviceLocator()
, Athena::getMessageSvc()
, readCdoGeoAlign
, readCdoCellPosShift);
, *readHandleGeoAlign
, *readHandleCellPosShift);
ATH_CHECK(writeHandle.record(std::move(caloMgr)));
ATH_MSG_INFO("recorded new CaloDetDescr Manager condition object with key " << writeHandle.key()
<< " and range " << writeHandle.getRange());
ATH_CHECK(writeCaloMgrHandle.record(std::move(caloMgr)));
ATH_MSG_INFO("recorded new CaloDetDescr Manager condition object with key " << writeCaloMgrHandle.key()
<< " and range " << writeCaloMgrHandle.getRange());
return StatusCode::SUCCESS;
}
......@@ -42,7 +42,7 @@ class CaloAlignCondAlg final : public AthReentrantAlgorithm
, "LArCellPositionShift"
, "SG key of the CaloCellPositionShift" };
SG::WriteCondHandleKey<CaloDetDescrManager> m_writeKey {this
SG::WriteCondHandleKey<CaloDetDescrManager> m_writeCaloMgrKey {this
, "CaloDetDescrManager"
, "CaloDetDescrManager"
, "SG key of the resulting CaloDetDescrManager" };
......
......@@ -18,8 +18,6 @@
#include "CaloIdentifier/CaloCell_ID.h"
#include "CaloIdentifier/TileID.h"
#include "CaloIdentifier/CaloIdManager.h"
#include "CaloDetDescr/CaloDetDescrManager.h"
#include "CaloDetDescr/CaloDetDescrElement.h"
#include "Identifier/Identifier.h"
#include "Identifier/IdentifierHash.h"
#include <map> //useful in testMode
......
......@@ -12,7 +12,6 @@
#include <string>
class CaloCellContainer;
class CaloDetDescrManager;
class CaloCell_ID;
class TileID;
......
/*
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 CALOLOCALHADCALIB_GETLCDEADMATERIALTREE_H
......@@ -26,7 +26,6 @@
class TTree;
class TFile;
class CaloDetDescrManager;
class CaloCell_ID;
class CaloLocalHadCoeff;
class CaloHadDMCoeffData;
......@@ -99,7 +98,6 @@ class ATLAS_NOT_THREAD_SAFE GetLCDeadMaterialTree : public AthAlgorithm {
typedef std::vector<moment_name_pair> moment_name_vector;
std::vector<xAOD::CaloCluster::MomentType> m_momentForDMArea;
const CaloDetDescrManager* m_calo_dd_man;
const CaloCell_ID* m_calo_id;
};
......
/*
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 CALOLOCALHADCALIB_GETLCSINGLEPIONSPERF_H
......@@ -26,9 +26,7 @@
class AtlasDetectorID;
class CaloDetDescrManager;
class CaloCell_ID;
class CaloDepthTool;
class CaloDmDescrManager;
class TFile;
......@@ -59,9 +57,7 @@ class GetLCSinglePionsPerf : public AthAlgorithm
enum keys_norm_level {kLEVEL_PARTICLE, kLEVEL_CALIBHIT, kLEVEL_CALIBHIT_IDEAL };
const AtlasDetectorID* m_id_helper;
const CaloDetDescrManager* m_calo_dd_man;
const CaloCell_ID* m_calo_id;
//CaloDepthTool* m_caloDepthTool;
const CaloDmDescrManager *m_caloDmDescrManager;
SG::ReadHandleKey<xAOD::CaloClusterContainer> m_clusterBasicCollName;
......
......@@ -28,7 +28,6 @@
class TProfile2D;
class TFile;
class CaloDetDescrManager;
class CaloCell_ID;
class ClusWeight {
......
......@@ -33,7 +33,6 @@
#include "CaloEvent/CaloCell.h"
#include "CaloSimEvent/CaloCalibrationHit.h"
#include "CaloSimEvent/CaloCalibrationHitContainer.h"
#include "CaloDetDescr/CaloDetDescrManager.h"
#include "CaloIdentifier/CaloCell_ID.h"