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

Merge branch 'master-trigt1-calomgr' into 'master'

TrigT1CaloFexPerf: switched to reading Calo Super Cell manager from Cond Store

See merge request !58929
parents 9efd2889 5872312f
Branches
Tags
4 merge requests!59674InDetPerformanceMonitoring with LumiBlock selection,!59383cppcheck in trigger code: Prefer prefix ++/-- operators for non-primitive types.,!58990Draft:Fixing bug in FTF config when running with Reco_tf,!58929TrigT1CaloFexPerf: switched to reading Calo Super Cell manager from Cond Store
/*
Copyright (C) 2002-2022 CERN for the benefit of the ATLAS collaboration
*/
#include "GTowerMappingDataCondAlg.h" #include "GTowerMappingDataCondAlg.h"
#include "TMath.h" #include "TMath.h"
#include "TVector2.h" #include "TVector2.h"
...@@ -89,4 +93,4 @@ namespace LVL1 ...@@ -89,4 +93,4 @@ namespace LVL1
helper.setArea(gFEX::towerArea(helper.Eta())); helper.setArea(gFEX::towerArea(helper.Eta()));
return StatusCode::SUCCESS; return StatusCode::SUCCESS;
} }
} // namespace LVL1 } // namespace LVL1
\ No newline at end of file
/*
Copyright (C) 2002-2022 CERN for the benefit of the ATLAS collaboration
*/
#include "JGTowerMappingDataCondAlgBase.h" #include "JGTowerMappingDataCondAlgBase.h"
#include "AthenaKernel/IOVInfiniteRange.h" #include "AthenaKernel/IOVInfiniteRange.h"
#include "StoreGate/WriteCondHandle.h" #include "StoreGate/WriteCondHandle.h"
#include "CaloDetDescr/CaloDetDescrManager.h"
#include "CaloDetDescr/CaloDetDescrElement.h" #include "CaloDetDescr/CaloDetDescrElement.h"
#include "TMath.h" #include "TMath.h"
#include "TVector2.h" #include "TVector2.h"
...@@ -22,6 +25,7 @@ namespace LVL1 ...@@ -22,6 +25,7 @@ namespace LVL1
StatusCode JGTowerMappingDataCondAlgBase::initialize() StatusCode JGTowerMappingDataCondAlgBase::initialize()
{ {
ATH_CHECK(m_outputKey.initialize()); ATH_CHECK(m_outputKey.initialize());
ATH_CHECK(m_caloSuperCellMgrKey.initialize());
ATH_CHECK(detStore()->retrieve(m_ccid)); ATH_CHECK(detStore()->retrieve(m_ccid));
ATH_CHECK(detStore()->retrieve(m_scid)); ATH_CHECK(detStore()->retrieve(m_scid));
return StatusCode::SUCCESS; return StatusCode::SUCCESS;
...@@ -37,8 +41,8 @@ namespace LVL1 ...@@ -37,8 +41,8 @@ namespace LVL1
return StatusCode::SUCCESS; return StatusCode::SUCCESS;
} }
const JGTowerBase_ID *jgTowerID = getJGTowerID(); const JGTowerBase_ID *jgTowerID = getJGTowerID();
const CaloSuperCellDetDescrManager *scDetMgr{nullptr}; SG::ReadCondHandle<CaloSuperCellDetDescrManager> caloSuperCellMgrHandle{m_caloSuperCellMgrKey,ctx};
ATH_CHECK(detStore()->retrieve(scDetMgr)); const CaloSuperCellDetDescrManager *scDetMgr = *caloSuperCellMgrHandle;
// JGTowerMappingData is typedef of std::vector<JGTowerHelper> // JGTowerMappingData is typedef of std::vector<JGTowerHelper>
auto data = std::make_unique<JGTowerMappingData>(); auto data = std::make_unique<JGTowerMappingData>();
......
...@@ -7,6 +7,7 @@ ...@@ -7,6 +7,7 @@
#include "AthenaBaseComps/AthReentrantAlgorithm.h" #include "AthenaBaseComps/AthReentrantAlgorithm.h"
#include "StoreGate/WriteCondHandleKey.h" #include "StoreGate/WriteCondHandleKey.h"
#include "StoreGate/ReadCondHandleKey.h"
#include "TrigT1CaloFexPerf/JGTowerMappingData.h" #include "TrigT1CaloFexPerf/JGTowerMappingData.h"
#include "CaloIdentifier/CaloCell_SuperCell_ID.h" #include "CaloIdentifier/CaloCell_SuperCell_ID.h"
#include "CaloIdentifier/CaloCell_ID.h" #include "CaloIdentifier/CaloCell_ID.h"
...@@ -27,6 +28,8 @@ namespace LVL1 ...@@ -27,6 +28,8 @@ namespace LVL1
private: private:
SG::WriteCondHandleKey<JGTowerMappingData> m_outputKey{ SG::WriteCondHandleKey<JGTowerMappingData> m_outputKey{
this, "MappingData", ""}; this, "MappingData", ""};
SG::ReadCondHandleKey<CaloSuperCellDetDescrManager> m_caloSuperCellMgrKey{
this,"CaloSuperCellDetDescrManager","CaloSuperCellDetDescrManager","SG key of the resulting CaloSuperCellDetDescrManager"};
Gaudi::Property<bool> m_mapTileCells{this, "MapTileCells", false}; Gaudi::Property<bool> m_mapTileCells{this, "MapTileCells", false};
protected: protected:
......
/*
Copyright (C) 2002-2022 CERN for the benefit of the ATLAS collaboration
*/
#include "JTowerMappingDataCondAlg.h" #include "JTowerMappingDataCondAlg.h"
#include "TH1F.h" #include "TH1F.h"
#include "TFile.h" #include "TFile.h"
...@@ -95,4 +99,4 @@ namespace LVL1 ...@@ -95,4 +99,4 @@ namespace LVL1
data.at(idx).setArea(m_towerAreas.at(idx)); data.at(idx).setArea(m_towerAreas.at(idx));
return StatusCode::SUCCESS; return StatusCode::SUCCESS;
} }
} // namespace LVL1 } // namespace LVL1
\ No newline at end of file
/** /*
* Copyright (C) 2002-2021 CERN for the benefit of the ATLAS collaboration Copyright (C) 2002-2022 CERN for the benefit of the ATLAS collaboration
*/ */
#include "SCEmulation.h" #include "SCEmulation.h"
#include "StoreGate/ReadHandle.h" #include "StoreGate/ReadHandle.h"
#include "StoreGate/WriteHandle.h" #include "StoreGate/WriteHandle.h"
#include "StoreGate/ReadCondHandle.h" #include "StoreGate/ReadCondHandle.h"
#include "PathResolver/PathResolver.h" #include "PathResolver/PathResolver.h"
#include "CaloDetDescr/CaloDetDescrManager.h"
#include "CaloIdentifier/CaloCell_SuperCell_ID.h" #include "CaloIdentifier/CaloCell_SuperCell_ID.h"
#include <memory> #include <memory>
#include <TFile.h> #include <TFile.h>
...@@ -96,7 +95,7 @@ namespace LVL1 ...@@ -96,7 +95,7 @@ namespace LVL1
ATH_CHECK(m_caloBCIDAverageKey.initialize(m_useBCID)); ATH_CHECK(m_caloBCIDAverageKey.initialize(m_useBCID));
ATH_CHECK(m_caloNoiseSigmaDiffKey.initialize(m_useNoise)); ATH_CHECK(m_caloNoiseSigmaDiffKey.initialize(m_useNoise));
ATH_CHECK(detStore()->retrieve(m_scellMgr)); ATH_CHECK(m_caloSuperCellMgrKey.initialize());
ATH_CHECK(detStore()->retrieve(m_caloIdMgr)); ATH_CHECK(detStore()->retrieve(m_caloIdMgr));
std::unique_ptr<TFile> timingFile(TFile::Open(PathResolver::find_calib_file(m_cellTimingFile).c_str())); std::unique_ptr<TFile> timingFile(TFile::Open(PathResolver::find_calib_file(m_cellTimingFile).c_str()));
...@@ -240,6 +239,9 @@ namespace LVL1 ...@@ -240,6 +239,9 @@ namespace LVL1
caloNoiseSigmaDiff = handle.cptr(); caloNoiseSigmaDiff = handle.cptr();
} }
SG::ReadCondHandle<CaloSuperCellDetDescrManager> caloSuperCellMgrHandle{m_caloSuperCellMgrKey,ctx};
const CaloSuperCellDetDescrManager* scellMgr = *caloSuperCellMgrHandle;
auto evtInfo = SG::makeHandle(m_evtInfoKey, ctx); auto evtInfo = SG::makeHandle(m_evtInfoKey, ctx);
if (!evtInfo.isValid()) if (!evtInfo.isValid())
{ {
...@@ -365,7 +367,7 @@ namespace LVL1 ...@@ -365,7 +367,7 @@ namespace LVL1
for (std::size_t idx = 0; idx < energies.size(); ++idx) for (std::size_t idx = 0; idx < energies.size(); ++idx)
{ {
const CaloDetDescrElement *dde = m_scellMgr->get_element(idx); const CaloDetDescrElement *dde = scellMgr->get_element(idx);
if (!dde) if (!dde)
{ {
ATH_MSG_WARNING("Invalid DDE for hash index " << idx); ATH_MSG_WARNING("Invalid DDE for hash index " << idx);
...@@ -416,4 +418,4 @@ namespace LVL1 ...@@ -416,4 +418,4 @@ namespace LVL1
{ {
return getIndex(m_etBins.at(sample), et); return getIndex(m_etBins.at(sample), et);
} }
} // namespace LVL1 } // namespace LVL1
\ No newline at end of file
/** /*
* Copyright (C) 2002-2021 CERN for the benefit of the ATLAS collaboration Copyright (C) 2002-2021 CERN for the benefit of the ATLAS collaboration
*/ */
#ifndef TRIGT1CALOFEXPERF_SCEMULATION_H #ifndef TRIGT1CALOFEXPERF_SCEMULATION_H
#define TRIGT1CALOFEXPERF_SCEMULATION_H #define TRIGT1CALOFEXPERF_SCEMULATION_H
...@@ -41,6 +41,9 @@ namespace LVL1 ...@@ -41,6 +41,9 @@ namespace LVL1
this, "CaloBCIDAverage", "CaloBCIDAverage"}; this, "CaloBCIDAverage", "CaloBCIDAverage"};
SG::ReadCondHandleKey<CaloNoiseSigmaDiff> m_caloNoiseSigmaDiffKey{ SG::ReadCondHandleKey<CaloNoiseSigmaDiff> m_caloNoiseSigmaDiffKey{
this, "CaloNoiseSigmaDiff", "CaloNoiseSigmaDiff"}; this, "CaloNoiseSigmaDiff", "CaloNoiseSigmaDiff"};
/// Super cell manager key
SG::ReadCondHandleKey<CaloSuperCellDetDescrManager> m_caloSuperCellMgrKey{
this,"CaloSuperCellDetDescrManager","CaloSuperCellDetDescrManager","SG key of the resulting CaloSuperCellDetDescrManager"};
SG::WriteHandleKey<CaloCellContainer> m_outputSuperCellsKey; SG::WriteHandleKey<CaloCellContainer> m_outputSuperCellsKey;
/// Offline<->supercell mapping tool /// Offline<->supercell mapping tool
...@@ -61,8 +64,6 @@ namespace LVL1 ...@@ -61,8 +64,6 @@ namespace LVL1
// Map keys are sampling, eta bin, phi bin // Map keys are sampling, eta bin, phi bin
std::map<std::tuple<CaloSampling::CaloSample, std::size_t, std::size_t>, std::map<float, float>> m_timingSamples; std::map<std::tuple<CaloSampling::CaloSample, std::size_t, std::size_t>, std::map<float, float>> m_timingSamples;
/// Super cell manager
const CaloSuperCellDetDescrManager *m_scellMgr{nullptr};
/// Calo ID helpers /// Calo ID helpers
const CaloIdManager *m_caloIdMgr{nullptr}; const CaloIdManager *m_caloIdMgr{nullptr};
...@@ -72,4 +73,4 @@ namespace LVL1 ...@@ -72,4 +73,4 @@ namespace LVL1
}; //> end class SCEmulation }; //> end class SCEmulation
} // namespace LVL1 } // namespace LVL1
#endif //> !TRIGT1CALOFEXPERF_SCEMULATION_H #endif //> !TRIGT1CALOFEXPERF_SCEMULATION_H
\ No newline at end of file
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment