3 #ifndef CALOREC_CALOTOPOCLUSTERFROMTOWERHELPERS
4 #define CALOREC_CALOTOPOCLUSTERFROMTOWERHELPERS
6 #include "CaloGeoHelpers/CaloSampling.h"
14 #define _SNAMELU( NAME ) { CaloSampling::NAME , std::string( #NAME ) }
15 #define _SIDLU( ID ) { std::string( #ID ) , CaloSampling::ID }
17 #define _MNAMELU( NAME ) { xAOD::CaloCluster::NAME, std::string( #NAME ) }
18 #define _MIDLU( ID ) { std::string( #ID ) , xAOD::CaloCluster::ID }
35 typedef std::array<double,CaloSampling::Unknown>
valarray_t;
163 static const std::map<CaloSampling::CaloSample,std::string> samplingNames = {
181 static const std::map<std::string,CaloSampling::CaloSample> samplingIds = {
201 static const std::map<xAOD::CaloCluster::MomentType,std::string> clusterMomentNames = {
228 static const std::map<std::string,xAOD::CaloCluster::MomentType> clusterMomentTypes = {
238 _MIDLU( ENG_CALIB_TILEG3 ),
_MIDLU( ENG_CALIB_DEAD_TOT ),
_MIDLU( ENG_CALIB_DEAD_EMB0 ),
_MIDLU( ENG_CALIB_DEAD_TILE0 ),
_MIDLU( ENG_CALIB_DEAD_TILEG3 ),
239 _MIDLU( ENG_CALIB_DEAD_EME0 ),
_MIDLU( ENG_CALIB_DEAD_HEC0 ),
_MIDLU( ENG_CALIB_DEAD_FCAL ),
_MIDLU( ENG_CALIB_DEAD_LEAKAGE ),
_MIDLU( ENG_CALIB_DEAD_UNCLASS ),
241 _MIDLU( TIME_DigiHSTruth ),
_MIDLU( ENERGY_CALIB_DigiHSTruth ),
_MIDLU( ETA_CALIB_DigiHSTruth ),
_MIDLU( PHI_CALIB_DigiHSTruth ),
_MIDLU( TIME_CALIB_DigiHSTruth ),
242 _MIDLU( FIRST_PHI_DigiHSTruth ),
_MIDLU( FIRST_ETA_DigiHSTruth ),
_MIDLU( SECOND_R_DigiHSTruth ),
_MIDLU( SECOND_LAMBDA_DigiHSTruth ),
_MIDLU( DELTA_PHI_DigiHSTruth ),
243 _MIDLU( DELTA_THETA_DigiHSTruth ),
_MIDLU( DELTA_ALPHA_DigiHSTruth ),
_MIDLU( CENTER_X_DigiHSTruth ),
_MIDLU( CENTER_Y_DigiHSTruth ),
_MIDLU( CENTER_Z_DigiHSTruth ),
244 _MIDLU( CENTER_MAG_DigiHSTruth ),
_MIDLU( CENTER_LAMBDA_DigiHSTruth ),
_MIDLU( LATERAL_DigiHSTruth ),
_MIDLU( LONGITUDINAL_DigiHSTruth ),
_MIDLU( ENG_FRAC_EM_DigiHSTruth ),
245 _MIDLU( ENG_FRAC_MAX_DigiHSTruth ),
_MIDLU( ENG_FRAC_CORE_DigiHSTruth ),
_MIDLU( FIRST_ENG_DENS_DigiHSTruth ),
_MIDLU( SECOND_ENG_DENS_DigiHSTruth ),
246 _MIDLU( ISOLATION_DigiHSTruth ),
_MIDLU( ENG_BAD_CELLS_DigiHSTruth ),
_MIDLU( N_BAD_CELLS_DigiHSTruth ),
_MIDLU( N_BAD_CELLS_CORR_DigiHSTruth ),
247 _MIDLU( BAD_CELLS_CORR_E_DigiHSTruth ),
_MIDLU( BADLARQ_FRAC_DigiHSTruth ),
_MIDLU( ENG_POS_DigiHSTruth ),
_MIDLU( SIGNIFICANCE_DigiHSTruth ),
248 _MIDLU( CELL_SIGNIFICANCE_DigiHSTruth ),
_MIDLU( CELL_SIG_SAMPLING_DigiHSTruth ),
_MIDLU( AVG_LAR_Q_DigiHSTruth ),
_MIDLU( AVG_TILE_Q_DigiHSTruth ),
249 _MIDLU( ENG_BAD_HV_CELLS_DigiHSTruth ),
_MIDLU( N_BAD_HV_CELLS_DigiHSTruth ),
_MIDLU( EM_PROBABILITY_DigiHSTruth ),
_MIDLU( HAD_WEIGHT_DigiHSTruth ),
250 _MIDLU( OOC_WEIGHT_DigiHSTruth ),
_MIDLU( DM_WEIGHT_DigiHSTruth )
254 static bool haveMomentType(
const std::string& momentName);
259 inline const std::string& CaloRec::Lookup::getSamplingName(
CaloSampling::CaloSample sid) {
return samplingNames.find(sid)->second; }
261 auto fid(samplingIds.find(sname));
return fid != samplingIds.end() ? fid->second : samplingIds.find(
"Unknown")->second;
264 inline bool CaloRec::Lookup::haveMomentType(
const std::string& momentName) {
return clusterMomentTypes.contains(momentName); }
265 inline const std::string& CaloRec::Lookup::getMomentName(
xAOD::CaloCluster::MomentType momentType) {
return clusterMomentNames.at(momentType); }
267 bool isOk(haveMomentType(momentName));
if ( isOk ) { momentType = clusterMomentTypes.at(momentName); }
return isOk;