43 for(; samplingIter!=samplingIterEnd; ++samplingIter) {
44 int theSampling(CaloSampling::Unknown);
45 for (
unsigned int jsamp = 0;jsamp< CaloSampling::Unknown; jsamp++) {
51 if ( theSampling == CaloSampling::Unknown ) {
52 msg(MSG::ERROR) <<
"Calorimeter sampling "
54 <<
" is not a valid Calorimeter sampling name and will be ignored! "
55 <<
"Valid names are: ";
56 for (
unsigned int jsamp = 0;jsamp< CaloSampling::Unknown; jsamp++) {
58 if ( jsamp < CaloSampling::Unknown-1)
70 msg(MSG::INFO) <<
"Samplings to exclude from the out-of-cluster weighting:";
72 for(; samplingIter!=samplingIterEnd; ++samplingIter)
73 msg() <<
" " << *samplingIter;
77 msg(MSG::INFO) <<
"Interpolation is ON, dimensions: ";
79 msg() <<
" " << (*it);
87 ATH_MSG_WARNING(
"Dimension '" << (*it) <<
"' is invalid and will be excluded." );
95 return StatusCode::SUCCESS;
100 double eWeightedOrig = theCluster->
e();
101 double eWeighted = theCluster->
e();
104 std::vector<float> vars(5);
122 double classifyWeight = 1;
124 classifyWeight = pi0Prob;
127 classifyWeight = 1-pi0Prob;
129 double eEM = theCluster->rawE();
133 ATH_MSG_DEBUG(
"Basic Energy is 0. Use weighted energy instead");
144 for(; ivSamplingIter!=ivSamplingIterEnd; ++ivSamplingIter) {
149 if ( eEM > 0 && eWeighted > 0 ) {
153 ratio = eEM / eWeighted;
155 if ( ratio < 0.3 || ratio > 3 ) {
157 << ratio <<
" is out of normal range [0.3,3]"
158 <<
" - this mean we have mainly noise ... using 1 instead");
162 double log10cluse = log10(eEM);
174 if ( log10cluse > lemax )
176 if ( log10cluse < lemin )
179 double center_lambda,isolation;
182 if ( isolation > 0 ) {
183 if ( center_lambda > 0 ) {
184 const double abseta = fabs(theCluster->
eta());
185 const double log10lambda = log10(center_lambda);
193 bool isDataOK =
false;
197 int iBin =
data->getBin(0,vars);
216 <<
"isDataOK="<<isDataOK
217 <<
"side = " << vars[0]
218 <<
", phi = " << vars[1]
219 <<
", log10cluse = " << log10cluse
220 <<
", eta = " << abseta
221 <<
", log10lambda = " << log10lambda
222 <<
", ratio = " << ratio
223 <<
", isol = " << isolation
224 <<
", oocData = " << oocData);
227 const double oocWeight = 1.+classifyWeight*isolation*ratio*oocData;
231 for (;itrCell!=itrCellEnd; ++itrCell) {
254 if ( eWeightedOrig > 0 || eWeightedOrig < 0 ) {
255 double old_weight(1);
257 ATH_MSG_ERROR(
"Cannot retrieve OOC_WEIGHT cluster moment." );
258 return StatusCode::FAILURE;
260 const double new_weight = old_weight*theCluster->
e()/eWeightedOrig;
263 return StatusCode::SUCCESS;
#define ATH_CHECK
Evaluate an expression and check for errors.
#define ATH_MSG_WARNING(x)
char data[hepevt_bytes_allocation_ATLAS]
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,...