|
ATLAS Offline Software
|
Go to the documentation of this file.
34 const std::string&
name,
37 m_key(
"OOCCorrection"),
38 m_useEmProbability(false),
39 m_useHadProbability(false),
44 declareInterface<IClusterCellWeightTool>(
this);
73 for(; samplingIter!=samplingIterEnd; ++samplingIter) {
82 msg(MSG::ERROR) <<
"Calorimeter sampling "
84 <<
" is not a valid Calorimeter sampling name and will be ignored! "
85 <<
"Valid names are: ";
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) {
265 double weight = itrCell.weight();
284 if ( eWeightedOrig > 0 || eWeightedOrig < 0 ) {
285 double old_weight(1);
286 if (!theCluster->
retrieveMoment(CaloCluster::OOC_WEIGHT,old_weight)) {
287 ATH_MSG_ERROR(
"Cannot retrieve OOC_WEIGHT cluster moment." );
288 return StatusCode::FAILURE;
290 const double new_weight = old_weight*theCluster->
e()/eWeightedOrig;
291 theCluster->
insertMoment(CaloCluster::OOC_WEIGHT,new_weight);
293 return StatusCode::SUCCESS;
JetConstituentVector::iterator iterator
Class defines binning for user dimension.
char data[hepevt_bytes_allocation_ATLAS]
bool CENTER_LAMBDA(const xAOD::TauJet &, const xAOD::CaloVertexedTopoCluster &cluster, double &out)
double eSample(sampling_type sampling) const
Retrieve energy in a given sampling.
void reweightCell(const CaloCell *pCell, double weight)
Reweight a cell with kinematic update.
bool EM_PROBABILITY(const xAOD::TauJet &, const xAOD::CaloVertexedTopoCluster &cluster, double &out)
Gaudi::Details::PropertyBase & declareProperty(Gaudi::Property< T > &t)
This class groups all DetDescr information related to a CaloCell. Provides a generic interface for al...
static CaloLocalHadDefs::LocalHadDimensionId getDimensionId(const std::string &dimensionName)
float getXmin() const
return minimum value for the first bin
cell_iterator cell_end() const
Retrieve a STL-type end() iterator for the cell store.
LocalHadDimensionId
enums to identify user dimensions id number DIMC_* - classification, DIMW_*-weighting,...
CaloCluster_v1 CaloCluster
Define the latest version of the calorimeter cluster class.
std::vector< float > LocalHadCoeff
Correction parameters for one general bin.
CaloCompositeCellBase< CaloClusterNavigable >::cell_iterator cell_iterator
Iterator on CaloCell s.
::StatusCode StatusCode
StatusCode definition for legacy code.
Hold binned correction data for local hadronic calibration procedure.
void insertMoment(const moment_type &momType, const moment_value &momValue, bool useLink=true)
Set individual moment.
Principal data class for CaloCell clusters.
float getDx() const
return size of bin
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.)
float getXmax() const
return maximum value for the last bin
cell_iterator cell_begin() const
Retrieve a STL-type begin() iterator for the cell store.
StatusCode initialize(bool used=true)
static const std::string & getSamplingName(const CaloSampling::CaloSample theSample)
Returns a string (name) for each CaloSampling.
CaloCell_ID::CaloSample getSampling() const
cell sampling
virtual double eta() const
Retrieve eta independent of signal state.
#define ATH_MSG_WARNING(x)
CaloCell_ID::CaloSample CaloSample
virtual double e() const
Retrieve energy independent of signal state.
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.
bool retrieveMoment(const moment_type &momType, moment_value &momValue, bool useLink=true) const
Retrieve individual moment.
void nextDDE(Iter iter, Iter endIter)
Prefetch next CaloDDE.
virtual double phi() const
Retrieve phi independent of signal state.