33 const std::string& name,
34 const IInterface* parent)
43 declareInterface<IClusterCellWeightTool>(
this);
62 msg(MSG::INFO) <<
"Interpolation is ON, dimensions: ";
64 msg(MSG::INFO) <<
" " << (*it);
72 ATH_MSG_WARNING(
"Dimension '" << (*it) <<
"' is invalid and will be excluded." );
84 for (
int iSamp=0;iSamp<CaloSampling::Unknown;iSamp++) {
90 return StatusCode::SUCCESS;
104 return StatusCode::FAILURE;
107 std::vector<int> isAmpMap(CaloSampling::Unknown,-1);
108 for (
int iArea=0;iArea<
data->getSizeAreaSet();iArea++) {
109 for (
int iSamp=0;iSamp<CaloSampling::Unknown;iSamp++) {
112 isAmpMap[iSamp] = iArea;
118 double eEM = theCluster->
e();
120 std::vector<float> vars(5);
144 for (;itrCell!=itrCellEnd; ++itrCell) {
149 if ( isAmpMap[theSample] >= 0 ) {
151 double energy = fabs(itrCell->
e());
153 if ( std::isfinite(sigma) && sigma > 0 )
154 ratio = energy/sigma;
160 volume = myCDDE->
volume();
163 density = energy/volume;
165 double abseta = fabs(itrCell->
eta());
166 double log10edens = log10(density);
167 double log10cluse = log10(eEM);
170 if ( log10cluse > lemax ) log10cluse = lemax;
178 bool isDataOK =
false;
182 int iBin =
data->getBin(isAmpMap[theSample],vars);
209 weight *= (pi0Prob + (1-pi0Prob)*wData);
223 double new_weight (1);
225 ATH_MSG_ERROR(
"Cannot retrieve HAD_WEIGHT cluster moment." );
226 return StatusCode::FAILURE;
229 if ( eEM > 0 || eEM < 0 ) {
230 new_weight *= theCluster->
e()/eEM;
234 return StatusCode::SUCCESS;
#define ATH_CHECK
Evaluate an expression and check for errors.
#define ATH_MSG_WARNING(x)
char data[hepevt_bytes_allocation_ATLAS]
Gaudi::Details::PropertyBase & declareProperty(Gaudi::Property< T, V, H > &t)
const ServiceHandle< StoreGateSvc > & detStore() const
CaloSampling::CaloSample CaloSample
virtual double e() const override final
get energy (data member) (synonym to method energy()
virtual double phi() const override final
get phi (through CaloDetDescrElement)
const CaloDetDescrElement * caloDDE() const
get pointer to CaloDetDescrElement (data member)
virtual double eta() const override final
get eta (through CaloDetDescrElement)
CaloGain::CaloGain gain() const
get gain (data member )
Identifier ID() const
get ID (from cached data member) non-virtual and inline for fast access
weight_t weight() const
Accessor for weight associated to this cell.
static void calculateKine(xAOD::CaloCluster *clu, const bool useweight=true, const bool updateLayers=true, const bool useGPUCriteria=false)
Helper class to calculate cluster kinematics based on cells.
This class groups all DetDescr information related to a CaloCell.
float volume() const
cell volume
static bool Interpolate(const CaloLocalHadCoeff *m_data, const unsigned int n_area, std::vector< float > &x, CaloLocalHadCoeff::LocalHadCoeff &pars, const std::vector< int > &dim, double xfit=0.)
static CaloLocalHadDefs::LocalHadDimensionId getDimensionId(const std::string &dimensionName)
Class defines binning for user dimension.
float getDx() const
return size of bin
float getXmax() const
return maximum value for the last bin
Hold binned correction data for local hadronic calibration procedure.
std::vector< float > LocalHadCoeff
Correction parameters for one general bin.
float getNoise(const IdentifierHash h, const int gain) const
Accessor by IdentifierHash and gain.
virtual bool checkStatus(const StatusIndicator &statusIndicator) const
Check status.
static const std::string & getSamplingName(const CaloSampling::CaloSample theSample)
Returns a string (name) for each CaloSampling.
bool retrieveMoment(MomentType type, double &value) const
Retrieve individual moment.
void reweightCell(cell_iterator it, const double weight)
Method to reweight a cell in the cluster (Beware: Kinematics not updated!)
CaloClusterCellLink::iterator cell_iterator
Iterator of the underlying CaloClusterCellLink (non-const version)
virtual double e() const
The total energy of the particle.
void insertMoment(MomentType type, double value)
const_cell_iterator cell_end() const
@ EM_PROBABILITY
Classification probability to be em-like.
@ HAD_WEIGHT
Hadronic weight (E_w/E_em)
const_cell_iterator cell_begin() const
Iterator of the underlying CaloClusterCellLink (const version)
CaloRecoStatus & recoStatus()
Accesssor to CaloRecoStatus (non-const)
void nextDDE(Iter iter, Iter endIter)
Prefetch next CaloDDE.
CaloCluster_v1 CaloCluster
Define the latest version of the calorimeter cluster class.
LocalHadDimensionId
enums to identify user dimensions id number DIMC_* - classification, DIMW_*-weighting,...