10#include "CaloDetDescr/CaloDetDescrElement.h"
26 std::unique_ptr<TFile> fIn(TFile::Open(
28 if (!fIn || fIn->IsZombie())
31 return StatusCode::FAILURE;
33 TH1F *areaHist = (TH1F *)fIn->Get(
"jTowerArea_final_hist");
37 return StatusCode::FAILURE;
42 float scale = 1.0 / areaHist->GetBinContent(1);
43 for (
int towerIdx = 0; towerIdx < areaHist->GetNbinsX(); ++towerIdx)
44 m_towerAreas.push_back(areaHist->GetBinContent(towerIdx + 1) * scale);
46 return StatusCode::SUCCESS;
55 for (std::size_t scHashIdx = 0; scHashIdx <
m_scid->calo_cell_hash_max(); ++scHashIdx)
58 if (
m_scid->is_tile(scID) &&
m_scid->sampling(scID) != 2)
64 return StatusCode::FAILURE;
66 float superCellEta = dde->
eta_raw();
67 float superCellPhi = dde->
phi_raw();
68 if (std::abs(superCellEta) < 3.1)
70 float superCellDEta = dde->
deta();
71 float superCellDPhi = dde->
dphi();
72 JGTowerHelper helper(superCellEta, superCellDEta, superCellPhi, superCellDPhi);
73 helper.SetSCIndices(scHashIdx);
76 if (detName.find(
"FCAL0") != std::string::npos)
77 helper.SetSampling(2);
78 else if (detName.find(
"FCAL1") != std::string::npos)
79 helper.SetSampling(3);
80 else if (detName.find(
"FCAL2") != std::string::npos)
81 helper.SetSampling(4);
83 helper.SetSampling(0);
84 data.push_back(std::move(helper));
87 return StatusCode::SUCCESS;
95 return StatusCode::FAILURE;
98 for (std::size_t idx = 0; idx <
m_towerAreas.size(); ++idx)
100 return StatusCode::SUCCESS;
#define ATH_CHECK
Evaluate an expression and check for errors.
char data[hepevt_bytes_allocation_ATLAS]
const ServiceHandle< StoreGateSvc > & detStore() const
This class groups all DetDescr information related to a CaloCell.
float eta_raw() const
cell eta_raw
float dphi() const
cell dphi
float phi_raw() const
cell phi_raw
float deta() const
cell deta
const CaloDetDescrElement * get_element(const Identifier &cellId) const
get element by its identifier
static std::string getSamplingName(CaloSample theSample)
Returns a string (name) for each CaloSampling.
const CaloCell_SuperCell_ID * m_scid
JGTowerMappingDataCondAlgBase(const std::string &name, ISvcLocator *pSvcLocator)
const CaloCell_ID * m_ccid
virtual StatusCode initialize() override
virtual StatusCode loadTowerAreas(JGTowerMappingData &data) const override
virtual StatusCode buildForwardMapping(JGTowerMappingData &data, const CaloSuperCellDetDescrManager *mgr) const override
JTowerMappingDataCondAlg(const std::string &name, ISvcLocator *pSvcLocator)
Gaudi::Property< std::string > m_towerAreasFile
virtual ~JTowerMappingDataCondAlg() override
std::vector< float > m_towerAreas
virtual StatusCode initialize() override
const JTower_ID * m_jtowerID
static std::string find_calib_file(const std::string &logical_file_name)
eFexTowerBuilder creates xAOD::eFexTowerContainer from supercells (LATOME) and triggerTowers (TREX) i...
std::vector< JGTowerHelper > JGTowerMappingData