8#include "CaloGeoHelpers/CaloSampling.h"
18 : std::accumulate(wght.begin(),wght.end(),0.);
25 declareInterface<CaloTowerCollectionProcessor>(
this);
35 if ( cellWeights ==
nullptr ) {
36 ATH_MSG_ERROR(
"Tower calibrator needs valid pointer to LCW weight lookup");
37 return StatusCode::FAILURE;
45 for (
auto pClus : *pClusCont ) {
47 for (
auto fCell(pClus->cell_begin()); fCell != pClus->cell_end(); ++fCell ) {
51 double weight(fCell.weight());
53 weight *= accumulateWeight(wght);
57 pClus->eta(),pClus->phi(),(
size_t)fCell->caloDDE()->calo_hash(),weight,wght.size(),fCell.weight(),weight/std::max(fCell.weight(),1e-08),
62 pClus->eta(),pClus->phi(),(
size_t)fCell->caloDDE()->calo_hash(),weight,wght.size(),fCell.weight(),weight/fCell.weight()) );
63 pClus->reweightCell(fCell,weight);
67 double rawE(pClus->e());
68 double rawEta(pClus->eta());
69 double rawPhi(pClus->phi());
70 double rawM(pClus->m());
74 pClus->setRawEta(rawEta);
75 pClus->setRawPhi(rawPhi);
82 volatile double pt1(pc1->pt());
83 volatile double pt2(pc2->pt());
89 return StatusCode::SUCCESS;
Gaudi::Details::PropertyBase & declareProperty(Gaudi::Property< T, V, H > &t)
Hash lookup of calibration weights for calorimeter cells.
std::vector< double > weight_t
Type of weight.
const weight_t & at(size_t hash) const
Accessing value using function and hash.
static std::string getSamplingName(CaloSample theSample)
Returns a string (name) for each CaloSampling.
CaloTopoTowerFromClusterCalibrator(const std::string &type, const std::string &name, const IInterface *pParent)
Tool constructor.
virtual StatusCode execute(const EventContext &ctx, xAOD::CaloClusterContainer *pClusCont, CaloCellClusterWeights *cellWeights) const override
Tool execution.
bool m_orderByPt
Turn on pT ordering if true.
const_iterator end() const noexcept
Return a const_iterator pointing past the end of the collection.
const_iterator begin() const noexcept
Return a const_iterator pointing at the beginning of the collection.
bool calculateKine(xAOD::CaloCluster *pClus, bool onlyKine=false)
Kinematic updates.
std::string fmtMsg(const char *fmt,...)
void sort(typename DataModel_detail::iterator< DVL > beg, typename DataModel_detail::iterator< DVL > end)
Specialization of sort for DataVector/List.
CaloCluster_v1 CaloCluster
Define the latest version of the calorimeter cluster class.
CaloClusterContainer_v1 CaloClusterContainer
Define the latest version of the calorimeter cluster container.