|
ATLAS Offline Software
|
calculates out-of-cluster corrections based on cluster quantities
More...
#include <CaloLCOutOfClusterTool.h>
|
virtual | ~CaloLCOutOfClusterTool () |
|
virtual StatusCode | weight (xAOD::CaloCluster *theCluster, const EventContext &ctx) const override |
| method to weight the cells in a cluster More...
|
|
virtual StatusCode | initialize () override |
|
| CaloLCOutOfClusterTool (const std::string &type, const std::string &name, const IInterface *parent) |
|
ServiceHandle< StoreGateSvc > & | evtStore () |
| The standard StoreGateSvc (event store) Returns (kind of) a pointer to the StoreGateSvc . More...
|
|
const ServiceHandle< StoreGateSvc > & | evtStore () const |
| The standard StoreGateSvc (event store) Returns (kind of) a pointer to the StoreGateSvc . More...
|
|
const ServiceHandle< StoreGateSvc > & | detStore () const |
| The standard StoreGateSvc/DetectorStore Returns (kind of) a pointer to the StoreGateSvc . More...
|
|
virtual StatusCode | sysInitialize () override |
| Perform system initialization for an algorithm. More...
|
|
virtual StatusCode | sysStart () override |
| Handle START transition. More...
|
|
virtual std::vector< Gaudi::DataHandle * > | inputHandles () const override |
| Return this algorithm's input handles. More...
|
|
virtual std::vector< Gaudi::DataHandle * > | outputHandles () const override |
| Return this algorithm's output handles. More...
|
|
Gaudi::Details::PropertyBase & | declareProperty (Gaudi::Property< T > &t) |
|
Gaudi::Details::PropertyBase * | declareProperty (const std::string &name, SG::VarHandleKey &hndl, const std::string &doc, const SG::VarHandleKeyType &) |
| Declare a new Gaudi property. More...
|
|
Gaudi::Details::PropertyBase * | declareProperty (const std::string &name, SG::VarHandleBase &hndl, const std::string &doc, const SG::VarHandleType &) |
| Declare a new Gaudi property. More...
|
|
Gaudi::Details::PropertyBase * | declareProperty (const std::string &name, SG::VarHandleKeyArray &hndArr, const std::string &doc, const SG::VarHandleKeyArrayType &) |
|
Gaudi::Details::PropertyBase * | declareProperty (const std::string &name, T &property, const std::string &doc, const SG::NotHandleType &) |
| Declare a new Gaudi property. More...
|
|
Gaudi::Details::PropertyBase * | declareProperty (const std::string &name, T &property, const std::string &doc="none") |
| Declare a new Gaudi property. More...
|
|
void | updateVHKA (Gaudi::Details::PropertyBase &) |
|
MsgStream & | msg () const |
|
MsgStream & | msg (const MSG::Level lvl) const |
|
bool | msgLvl (const MSG::Level lvl) const |
|
calculates out-of-cluster corrections based on cluster quantities
- Version
- $Id: CaloLCOutOfClusterTool.h,v 1.3 2009-01-27 09:09:14 gunal Exp $
- Author
- Sven Menke menke.nosp@m.@mpp.nosp@m.mu.mp.nosp@m.g.de
- Date
- 2-March-2007 concrete class implementing a IClusterCellWeightTool to calculate the out-of-cluster corrections for topo clusters. The cluster moments and its energy are used to derive the correction
- therefore the correction is not called cell-by-cell, but for the entire cluster This tool reads its data from pool containing TProfile2D based correction data.
Definition at line 27 of file CaloLCOutOfClusterTool.h.
◆ StoreGateSvc_t
◆ ~CaloLCOutOfClusterTool()
CaloLCOutOfClusterTool::~CaloLCOutOfClusterTool |
( |
| ) |
|
|
virtualdefault |
◆ CaloLCOutOfClusterTool()
CaloLCOutOfClusterTool::CaloLCOutOfClusterTool |
( |
const std::string & |
type, |
|
|
const std::string & |
name, |
|
|
const IInterface * |
parent |
|
) |
| |
◆ declareGaudiProperty() [1/4]
specialization for handling Gaudi::Property<SG::VarHandleKeyArray>
Definition at line 170 of file AthCommonDataStore.h.
175 hndl.documentation());
◆ declareGaudiProperty() [2/4]
specialization for handling Gaudi::Property<SG::VarHandleKey>
Definition at line 156 of file AthCommonDataStore.h.
161 hndl.documentation());
◆ declareGaudiProperty() [3/4]
specialization for handling Gaudi::Property<SG::VarHandleBase>
Definition at line 184 of file AthCommonDataStore.h.
189 hndl.documentation());
◆ declareGaudiProperty() [4/4]
◆ declareProperty() [1/6]
Declare a new Gaudi property.
- Parameters
-
name | Name of the property. |
hndl | Object holding the property value. |
doc | Documentation string for the property. |
This is the version for types that derive from SG::VarHandleBase
. The property value object is put on the input and output lists as appropriate; then we forward to the base class.
Definition at line 245 of file AthCommonDataStore.h.
250 this->declare(hndl.
vhKey());
251 hndl.
vhKey().setOwner(
this);
253 return PBASE::declareProperty(
name,hndl,
doc);
◆ declareProperty() [2/6]
Declare a new Gaudi property.
- Parameters
-
name | Name of the property. |
hndl | Object holding the property value. |
doc | Documentation string for the property. |
This is the version for types that derive from SG::VarHandleKey
. The property value object is put on the input and output lists as appropriate; then we forward to the base class.
Definition at line 221 of file AthCommonDataStore.h.
229 return PBASE::declareProperty(
name,hndl,
doc);
◆ declareProperty() [3/6]
◆ declareProperty() [4/6]
Declare a new Gaudi property.
- Parameters
-
name | Name of the property. |
property | Object holding the property value. |
doc | Documentation string for the property. |
This is the generic version, for types that do not derive from SG::VarHandleKey
. It just forwards to the base class version of declareProperty
.
Definition at line 333 of file AthCommonDataStore.h.
338 return PBASE::declareProperty(
name, property,
doc);
◆ declareProperty() [5/6]
Declare a new Gaudi property.
- Parameters
-
name | Name of the property. |
property | Object holding the property value. |
doc | Documentation string for the property. |
This dispatches to either the generic declareProperty
or the one for VarHandle/Key/KeyArray.
Definition at line 352 of file AthCommonDataStore.h.
◆ declareProperty() [6/6]
◆ detStore()
◆ evtStore() [1/2]
◆ evtStore() [2/2]
◆ extraDeps_update_handler()
Add StoreName to extra input/output deps as needed.
use the logic of the VarHandleKey to parse the DataObjID keys supplied via the ExtraInputs and ExtraOuputs Properties to add the StoreName if it's not explicitly given
◆ initialize()
StatusCode CaloLCOutOfClusterTool::initialize |
( |
| ) |
|
|
overridevirtual |
Definition at line 66 of file CaloLCOutOfClusterTool.cxx.
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;
◆ inputHandles()
Return this algorithm's input handles.
We override this to include handle instances from key arrays if they have not yet been declared. See comments on updateVHKA.
◆ interfaceID()
static const InterfaceID& IClusterCellWeightTool::interfaceID |
( |
| ) |
|
|
inlinestaticinherited |
Definition at line 28 of file IClusterCellWeightTool.h.
29 static const InterfaceID IID_IClusterCellWeightTool(
"IClusterCellWeightTool", 1 , 0);
30 return IID_IClusterCellWeightTool;
◆ msg() [1/2]
◆ msg() [2/2]
◆ msgLvl()
◆ outputHandles()
Return this algorithm's output handles.
We override this to include handle instances from key arrays if they have not yet been declared. See comments on updateVHKA.
◆ renounce()
◆ renounceArray()
◆ sysInitialize()
◆ sysStart()
Handle START transition.
We override this in order to make sure that conditions handle keys can cache a pointer to the conditions container.
◆ updateVHKA()
◆ weight()
method to weight the cells in a cluster
- Parameters
-
theCluster | the pointer to the CaloCluster to be weighted |
this method is purely virtual because every derived class needs to implement it.
Implements IClusterCellWeightTool.
Definition at line 128 of file CaloLCOutOfClusterTool.cxx.
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;
210 if ( theCluster->retrieveMoment(CaloCluster::ISOLATION,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();
268 theCluster->reweightCell(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;
◆ m_detStore
◆ m_evtStore
◆ m_interpolate
bool CaloLCOutOfClusterTool::m_interpolate |
|
private |
◆ m_interpolateDimensionNames
std::vector<std::string> CaloLCOutOfClusterTool::m_interpolateDimensionNames |
|
private |
◆ m_interpolateDimensions
std::vector<int> CaloLCOutOfClusterTool::m_interpolateDimensions |
|
private |
◆ m_invalidSamplingNames
std::vector<std::string> CaloLCOutOfClusterTool::m_invalidSamplingNames |
|
private |
vector of names of the calorimeter samplings not to use when applying the out-of-cluster weights.
The pre-sampler layers (barrel and endcap) and the gap-scintillators should not receive out-of-cluster weights as they mainly deal with dead-material corrections.
Definition at line 69 of file CaloLCOutOfClusterTool.h.
◆ m_invalidSamplings
std::set<int> CaloLCOutOfClusterTool::m_invalidSamplings |
|
private |
actual set of samplings to be ignored for out-of-cluster weights
This set is created according to the names given in the property m_invalidSamplingNames.
Definition at line 76 of file CaloLCOutOfClusterTool.h.
◆ m_key
◆ m_updateSamplingVars
bool CaloLCOutOfClusterTool::m_updateSamplingVars |
|
private |
◆ m_useEmProbability
bool CaloLCOutOfClusterTool::m_useEmProbability |
|
private |
look for em-probability moment and apply relative weight only
The classification provides the probability p for the current cluster to be em-like. OOC weights are applied with the additional em-prob factor p to all clusters for the cases EM and HAD.
Definition at line 52 of file CaloLCOutOfClusterTool.h.
◆ m_useHadProbability
bool CaloLCOutOfClusterTool::m_useHadProbability |
|
private |
look for em-probability moment and apply relative weight only
The classification provides the probability p for the current cluster to be em-like. OOC weights are applied with the additional had-prob factor (1-p) to all clusters for the cases EM and HAD.
Definition at line 60 of file CaloLCOutOfClusterTool.h.
◆ m_varHandleArraysDeclared
◆ m_vhka
The documentation for this class was generated from the following files:
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)
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)
StoreGateSvc_t m_evtStore
Pointer to StoreGate (event store by default)
std::vector< SG::VarHandleKeyArray * > m_vhka
float getXmin() const
return minimum value for the first bin
LocalHadDimensionId
enums to identify user dimensions id number DIMC_* - classification, DIMW_*-weighting,...
virtual void setOwner(IDataHandleHolder *o)=0
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.
float getDx() const
return size of bin
StoreGateSvc_t m_detStore
Pointer to StoreGate (detector store by default)
virtual void renounce()=0
std::conditional< std::is_base_of< SG::VarHandleKeyArray, T >::value, VarHandleKeyArrayType, type2 >::type type
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
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
#define ATH_MSG_WARNING(x)
CaloCell_ID::CaloSample CaloSample
SG::VarHandleKey & vhKey()
Return a non-const reference to the HandleKey.
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.
Gaudi::Details::PropertyBase & declareGaudiProperty(Gaudi::Property< T > &hndl, const SG::VarHandleKeyType &)
specialization for handling Gaudi::Property<SG::VarHandleKey>
void nextDDE(Iter iter, Iter endIter)
Prefetch next CaloDDE.