34 const std::string& name,
35 const IInterface* parent)
37 m_key(
"OOCCorrection"),
44 declareInterface<IClusterCellWeightTool>(
this);
73 for(; samplingIter!=samplingIterEnd; ++samplingIter) {
74 int theSampling(CaloSampling::Unknown);
75 for (
unsigned int jsamp = 0;jsamp< CaloSampling::Unknown; jsamp++) {
81 if ( theSampling == CaloSampling::Unknown ) {
82 msg(MSG::ERROR) <<
"Calorimeter sampling "
84 <<
" is not a valid Calorimeter sampling name and will be ignored! "
85 <<
"Valid names are: ";
86 for (
unsigned int jsamp = 0;jsamp< CaloSampling::Unknown; jsamp++) {
88 if ( jsamp < CaloSampling::Unknown-1)
100 msg(MSG::INFO) <<
"Samplings to exclude from the out-of-cluster weighting:";
102 for(; samplingIter!=samplingIterEnd; ++samplingIter)
103 msg() <<
" " << *samplingIter;
107 msg(MSG::INFO) <<
"Interpolation is ON, dimensions: ";
109 msg() <<
" " << (*it);
117 ATH_MSG_WARNING(
"Dimension '" << (*it) <<
"' is invalid and will be excluded." );
125 return StatusCode::SUCCESS;
130 double eWeightedOrig = theCluster->
e();
131 double eWeighted = theCluster->
e();
134 std::vector<float> vars(5);
152 double classifyWeight = 1;
154 classifyWeight = pi0Prob;
157 classifyWeight = 1-pi0Prob;
159 double eEM = theCluster->rawE();
163 ATH_MSG_DEBUG(
"Basic Energy is 0. Use weighted energy instead");
174 for(; ivSamplingIter!=ivSamplingIterEnd; ++ivSamplingIter) {
179 if ( eEM > 0 && eWeighted > 0 ) {
183 ratio = eEM / eWeighted;
185 if ( ratio < 0.3 || ratio > 3 ) {
187 << ratio <<
" is out of normal range [0.3,3]"
188 <<
" - this mean we have mainly noise ... using 1 instead");
192 double log10cluse = log10(eEM);
204 if ( log10cluse > lemax )
206 if ( log10cluse < lemin )
209 double center_lambda,isolation;
212 if ( isolation > 0 ) {
213 if ( center_lambda > 0 ) {
214 const double abseta = fabs(theCluster->
eta());
215 const double log10lambda = log10(center_lambda);
223 bool isDataOK =
false;
227 int iBin =
data->getBin(0,vars);
246 <<
"isDataOK="<<isDataOK
247 <<
"side = " << vars[0]
248 <<
", phi = " << vars[1]
249 <<
", log10cluse = " << log10cluse
250 <<
", eta = " << abseta
251 <<
", log10lambda = " << log10lambda
252 <<
", ratio = " << ratio
253 <<
", isol = " << isolation
254 <<
", oocData = " << oocData);
257 const double oocWeight = 1.+classifyWeight*isolation*ratio*oocData;
261 for (;itrCell!=itrCellEnd; ++itrCell) {
284 if ( eWeightedOrig > 0 || eWeightedOrig < 0 ) {
285 double old_weight(1);
287 ATH_MSG_ERROR(
"Cannot retrieve OOC_WEIGHT cluster moment." );
288 return StatusCode::FAILURE;
290 const double new_weight = old_weight*theCluster->
e()/eWeightedOrig;
293 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)
Header file for AthHistogramAlgorithm.
const CaloDetDescrElement * caloDDE() const
get pointer to CaloDetDescrElement (data member)
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.
Principal data class for CaloCell clusters.
double eSample(sampling_type sampling) const
Retrieve energy in a given sampling.
bool retrieveMoment(const moment_type &momType, moment_value &momValue, bool useLink=true) const
Retrieve individual moment.
virtual double e() const
Retrieve energy independent of signal state.
void insertMoment(const moment_type &momType, const moment_value &momValue, bool useLink=true)
Set individual moment.
virtual double eta() const
Retrieve eta independent of signal state.
virtual double phi() const
Retrieve phi independent of signal state.
cell_iterator cell_end() const
Retrieve a STL-type end() iterator for the cell store.
void reweightCell(const CaloCell *pCell, double weight)
Reweight a cell with kinematic update.
cell_iterator cell_begin() const
Retrieve a STL-type begin() iterator for the cell store.
This class groups all DetDescr information related to a CaloCell.
CaloCell_ID::CaloSample getSampling() const
cell sampling
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
float getXmin() const
return minimum value for the first bin
Hold binned correction data for local hadronic calibration procedure.
std::vector< float > LocalHadCoeff
Correction parameters for one general bin.
static const std::string & getSamplingName(const CaloSampling::CaloSample theSample)
Returns a string (name) for each CaloSampling.
CaloClusterCellLink::iterator cell_iterator
Iterator of the underlying CaloClusterCellLink (non-const version)
@ OOC_WEIGHT
Out-of-cluster weight (E_ooc/E_w)
@ EM_PROBABILITY
Classification probability to be em-like.
@ CENTER_LAMBDA
Shower depth at Cluster Centroid.
@ ISOLATION
Energy weighted fraction of non-clustered perimeter cells.
CaloSampling::CaloSample CaloSample
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,...