13 vsprintf(buffer,
fmt,args);
15 return std::string(buffer);
26 return StatusCode::SUCCESS;
39 return StatusCode::SUCCESS;
45 std::unique_ptr<CaloTowerGeometry> towerGeo=std::make_unique<CaloTowerGeometry>(caloDDM);
69 ATH_MSG_INFO(
"recorded new CaloTowerGeometry object with key " << writeHandle.
key() <<
" and range " << writeHandle.
getRange());
71 return StatusCode::SUCCESS;
79 logger.push_back(fmtMsg(
"[%s] +-------- Tower Index Mapping ---------+------------+------------+",this->name().c_str()));
80 logger.push_back(fmtMsg(
"[%s] | %10.10s | %10.10s | %10.10s | %10.10s | %10.10s |",this->name().c_str(),
"TowerIndex",
" EtaIndex ",
" PhiIndex ",
" Eta ",
" Phi "));
81 logger.push_back(fmtMsg(
"[%s] +------------+------------+------------+------------+------------+",this->name().c_str()));
86 logger.push_back(fmtMsg(
"[%s] | %5zu | %5zu | %5zu | %6.3f | %6.3f |",this->name().c_str(),i,etaIndex,phiIndex,
eta,
phi));
88 logger.push_back(fmtMsg(
"[%s] +------------+------------+------------+------------+------------+",this->name().c_str()));
90 std::ofstream logfile;
92 for (
const auto& mlog :
logger ) {
93 logfile << mlog << std::endl;
100 std::ofstream towerfile;
101 towerfile.open(
"towermap.dat");
102 auto it=towerGeo->
begin();
103 unsigned cellCounter=0;
104 for (;it!=towerGeo->
end();++it,++cellCounter) {
105 towerfile << cellCounter <<
": ";
106 for (
const auto& item : *it) {
107 auto idx=std::get<0>(item);
108 double w=std::get<1>(item);
109 towerfile <<
" (" << idx <<
"," << w <<
");";
111 towerfile << std::endl;
Scalar eta() const
pseudorapidity method
Scalar phi() const
phi method
#define ATH_CHECK
Evaluate an expression and check for errors.
This class provides the client interface for accessing the detector description information common to...
StatusCode execute(const EventContext &ctx) const override final
Gaudi::Property< double > m_fcal3Yslice
Gaudi::Property< std::string > m_towerGridFile
Gaudi::Property< unsigned > m_towerEtaBins
Gaudi::Property< double > m_fcal2Xslice
Gaudi::Property< double > m_towerEtaMax
Gaudi::Property< bool > m_adjustEta
StatusCode initialize() override final
SG::WriteCondHandleKey< CaloTowerGeometry > m_outputKey
Gaudi::Property< double > m_fcal2Yslice
SG::ReadCondHandleKey< CaloDetDescrManager > m_caloMgrKey
Gaudi::Property< std::string > m_towerMapFile
Gaudi::Property< double > m_towerPhiMax
Gaudi::Property< double > m_fcal3Xslice
Gaudi::Property< double > m_towerEtaMin
Gaudi::Property< double > m_towerPhiMin
void dump(const CaloTowerGeometry *towerGeo) const
Gaudi::Property< double > m_fcal1Yslice
Gaudi::Property< double > m_fcal1Xslice
Gaudi::Property< unsigned > m_towerPhiBins
Retrieve the list of towers associated with a calorimeter cell referenced by its hash identifier.
uint_t m_towerBins
Maximum number of towers.
elementmap_t::const_iterator begin() const
Iterator points to first entry in internal look-up table (only const access!)
index_t phiIndexFromTowerIndex(index_t towerIdx) const
Get tower bin index for a given global tower index.
double towerEta(index_t towerIndex) const
Return pseudorapidity from global tower index (bin center)
elementmap_t::const_iterator end() const
Iterator marks end of internal look-up table (only const access)
double towerPhi(index_t towerIndex) const
Return azimuth from global tower index (bin center)
index_t etaIndexFromTowerIndex(index_t towerIdx) const
Get tower bin index for a given global tower index.
const std::string & key() const
void addDependency(const EventIDRange &range)
const EventIDRange & getRange() const
StatusCode record(const EventIDRange &range, T *t)
record handle, with explicit range DEPRECATED
static Root::TMsgLogger logger("iLumiCalc")
std::string fmtMsg(const char *fmt,...)