 |
ATLAS Offline Software
|
dead material correction tool for local hadronic calibration
More...
#include <CaloLCDeadMaterialTool.h>
|
virtual | ~CaloLCDeadMaterialTool () override |
|
virtual StatusCode | weight (xAOD::CaloCluster *theCluster, const EventContext &ctx) const override |
| method to weight the cells in a cluster More...
|
|
virtual StatusCode | initialize () override |
|
| CaloLCDeadMaterialTool (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, V, H > &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 |
|
|
StatusCode | prepare_for_cluster (const xAOD::CaloCluster *theCluster, std::vector< Area > &areas, std::vector< Cell > &cells, float *smp_energy, float &cls_unweighted_energy, const CaloLocalHadCoeff *data) const |
|
Gaudi::Details::PropertyBase & | declareGaudiProperty (Gaudi::Property< T, V, H > &hndl, const SG::VarHandleKeyType &) |
| specialization for handling Gaudi::Property<SG::VarHandleKey> More...
|
|
Gaudi::Details::PropertyBase & | declareGaudiProperty (Gaudi::Property< T, V, H > &hndl, const SG::VarHandleKeyArrayType &) |
| specialization for handling Gaudi::Property<SG::VarHandleKeyArray> More...
|
|
Gaudi::Details::PropertyBase & | declareGaudiProperty (Gaudi::Property< T, V, H > &hndl, const SG::VarHandleType &) |
| specialization for handling Gaudi::Property<SG::VarHandleBase> More...
|
|
Gaudi::Details::PropertyBase & | declareGaudiProperty (Gaudi::Property< T, V, H > &t, const SG::NotHandleType &) |
| specialization for handling everything that's not a Gaudi::Property<SG::VarHandleKey> or a <SG::VarHandleKeyArray> More...
|
|
dead material correction tool for local hadronic calibration
- Author
- Gennady Pospelov guenn.nosp@m.adi..nosp@m.pospe.nosp@m.lov@.nosp@m.cern..nosp@m.ch
- Date
- 09-September-2009 Calculates dead material energy of given cluster. Cluster energy, lambda and eta are used to get appropriate set of DM correction coefficients for appropriate dead material area ( dead material area definition and set of correction coefficients are holded by CaloHadDMCoeff2 class). DM coefficients are applied to cluster cells sums to calculate DM energy in different calorimeter areas. Finally, calculated DM energy is added to the cluster by changing (increasing) cluster cells weights in appropriate samplings.
Definition at line 39 of file CaloLCDeadMaterialTool.h.
◆ StoreGateSvc_t
◆ dm_area_keys
Dead Material area number.
These keys are used to identify specific dead material areas in the calorimeter where procedure of DM correction will be applied
Enumerator |
---|
sDM_EMB0_EMB1 | |
sDM_EMB3_TILE0 | |
sDM_SCN | |
sDM_EME0_EME12 | |
sDM_EME3_HEC0 | |
sDM_FCAL | |
sDM_LEAKAGE | |
sDM_UNCLASS | |
sDM | |
Definition at line 47 of file CaloLCDeadMaterialTool.h.
◆ ~CaloLCDeadMaterialTool()
CaloLCDeadMaterialTool::~CaloLCDeadMaterialTool |
( |
| ) |
|
|
overridevirtualdefault |
◆ CaloLCDeadMaterialTool()
CaloLCDeadMaterialTool::CaloLCDeadMaterialTool |
( |
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 CaloLCDeadMaterialTool::initialize |
( |
| ) |
|
|
overridevirtual |
Definition at line 80 of file CaloLCDeadMaterialTool.cxx.
87 msg() << (*it2) <<
" ";
93 std::vector<int > *vtmp=
nullptr;
94 if((*it).first ==
"AREA_DMFIT") {
96 }
else if((*it).first ==
"AREA_DMLOOKUP") {
98 }
else if((*it).first ==
"AREA_DMSMPW") {
101 msg(MSG::WARNING) <<
"Unkown dead material area type '" << (*it).first <<
"'" << std::endl;
107 vtmp->push_back(
int(
id));
109 ATH_MSG_WARNING(
"Dimension '" << (*it2) <<
"' is invalid and will be excluded." );
120 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.
◆ prepare_for_cluster()
Definition at line 521 of file CaloLCDeadMaterialTool.cxx.
528 areas.resize(
data->getSizeAreaSet());
535 CaloCluster::const_cell_iterator itrCell = theCluster->
cell_begin();
536 CaloCluster::const_cell_iterator itrCellEnd = theCluster->
cell_end();
537 cls_unweighted_energy = 0;
538 for (;itrCell!=itrCellEnd; ++itrCell) {
540 const CaloCell* thisCell = *itrCell;
546 float weight = itrCell.weight();
547 cls_unweighted_energy +=
energy;
554 smp_energy[nsmp] +=
energy;
626 areas[
sDM_FCAL].eprep = cls_unweighted_energy;
630 return StatusCode::SUCCESS;
◆ 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 CaloLCDeadMaterialTool.cxx.
133 float wrong_dm_energy = 0.0;
134 float dm_total = 0.0;
137 double weightMom (1);
138 if (!theCluster->retrieveMoment(CaloCluster::DM_WEIGHT,weightMom)) {
145 double eWeighted = theCluster->e();
165 set_zero_moments(theCluster);
167 return StatusCode::SUCCESS;
173 ATH_MSG_ERROR(
"Cannot retrieve EM_PROBABILITY cluster moment, "
174 <<
" cluster energy " << theCluster->e() <<
" remains the same." );
175 return StatusCode::FAILURE;
179 }
else if ( pi0Prob > 1 ) {
186 double center_lambda = 0;
188 ATH_MSG_ERROR(
"Cannot retrieve CENTER_LAMBDA cluster moment, "
189 <<
" cluster energy " << theCluster->e() <<
" remains the same." );
190 return StatusCode::FAILURE;
198 return StatusCode::FAILURE;
201 ATH_MSG_DEBUG(
"Cluster is selected for local DM calibration."
202 <<
" Old cluster energy:" << theCluster->e()
206 std::vector<Area> areas;
207 std::vector<Cell>
cells;
209 float cls_unweighted_energy = 0;
211 smp_energy, cls_unweighted_energy,
data);
212 if ( !
sc.isSuccess() ) {
214 set_zero_moments(theCluster);
220 float cls_initial_energy = theCluster->e();
221 float cls_side = (theCluster->eta()<0?-1.0:1.0);
222 float cls_eta = fabs(theCluster->eta());
223 float cls_phi = theCluster->phi();
224 float log10ener = 0.0;
225 if(cls_unweighted_energy > 0.0) {
226 log10ener = log10(cls_unweighted_energy);
229 if(center_lambda > 0.0) {
230 log10lambda = log10(center_lambda);
231 if(log10lambda >=4.0) log10lambda = 3.9999;
235 #ifdef DEBUG_DMTHINGS
236 std::cout <<
" cls_initial_energy: " << cls_initial_energy <<
" cls_eta: " << cls_eta << std::endl;
237 std::cout <<
" log10ener: " << log10ener <<
" log10lambda: " << log10lambda << std::endl;
239 std::cout <<
" i_smp: " << i_smp <<
" smp_energy: " << smp_energy[i_smp] << std::endl;
243 std::vector<float > vars;
252 size_t n_dm =
data->getSizeAreaSet();
255 for(
int i_mix=0; i_mix<2; i_mix++){
256 float mixWeight = (i_mix==0?(1-pi0Prob):pi0Prob);
257 if(mixWeight == 0)
continue;
262 for(
size_t i_dm=0; i_dm < n_dm; i_dm++){
263 if(areas[i_dm].eprep <= 0.0)
continue;
267 if(log10ener > emax) log10ener = emax - 0.0001;
271 if( !
pars )
continue;
293 const int nSmp=
pars->size()-1;
295 double ecalonew = 0.0;
296 double ecaloold = 0.0;
297 for(
int i_smp=0; i_smp<nSmp; i_smp++){
298 ecaloold += smp_energy[i_smp];
299 ecalonew += smp_energy[i_smp] * (*pars)[i_smp];
301 ecalonew += (*pars)[nSmp];
302 edm = ecalonew - ecaloold;
319 std::cout <<
"CaloLCDeadMaterialTool -> Error! Unknown correction type " <<
area->getType()
320 <<
" with number of parameters " <<
area->getNpars() << std::endl;
322 wrong_dm_energy += areas[i_dm].edm_wrong;
324 #ifdef DEBUG_DMTHINGS
325 std::cout <<
" result> edm: " << edm <<
" edm_wrong:" << edm_wrong << std::endl;
327 edm -= areas[i_dm].edm_wrong;
329 areas[i_dm].erec = areas[i_dm].erec + edm*mixWeight;
340 #ifdef DEBUG_DMTHINGS
341 std::cout <<
"wc> calculation of weights" << std::endl;
347 theCluster->setE(cls_initial_energy + dm_total - wrong_dm_energy);
352 float sub_ener_old = 0.0;
353 for(
size_t i_c = 0; i_c <
cells.size(); i_c++)
357 sub_ener_old +=
cell.weight*
cell.energy;
359 if(sub_ener_old > 0.0) {
360 float corr = (sub_ener_old + dm_total)/sub_ener_old;
361 for(
size_t i_c = 0; i_c <
cells.size(); i_c++)
364 cells[i_c].weight *= corr;
372 for (
size_t cell_index = 0; cell_index <
cells.size(); ++cell_index)
376 float we =
cell.weight *
cell.energy;
378 areas[
cell.dm].sub_ener_old += we;
384 for(
size_t i_dm=0; i_dm < areas.size(); i_dm++) {
385 Area& dma = areas[i_dm];
387 if (i_dm >= n_dm || dma.eprep <= 0)
389 else if (dma.sub_ener_old > 0)
390 corrfac = (dma.sub_ener_old + dma.erec) / dma.sub_ener_old;
393 areas[
sDM_FCAL].sub_ener_old += (corrfac-1)*dma.sub_ener_old;
395 areas[
sDM_LEAKAGE].sub_ener_old += (corrfac-1)*dma.sub_ener_old;
397 areas[
sDM_UNCLASS].sub_ener_old += (corrfac-1)*dma.sub_ener_old;
403 for (
size_t cell_index = 0; cell_index <
cells.size(); ++cell_index)
409 cell.weight *= gblfac;
420 for (;itrCell!=itrCellEnd; ++itrCell) {
422 const float old_weight = itrCell.weight();
423 float new_weight =
cells[cell_index].weight;
425 theCluster->reweightCell(itrCell, new_weight);
427 new_weight = old_weight;
429 #ifdef DEBUG_DMTHINGS
430 std::cout <<
" cells> " << cell_index <<
" ener: " <<
cells[cell_index].energy <<
" old_w: " << old_weight <<
" new_w:" << new_weight << std::endl;
431 if( new_weight > 100) std::cout <<
"DeadMaterialCorrectionTool2 -> Panic! Too large weight" << std::endl;
441 <<
" (contains wrongly estimated DM energy: " << wrong_dm_energy <<
")"
442 <<
" calculated DM energy (to be added):" << dm_total
443 <<
" new cluster energy:" << theCluster->e());
449 bool result = theCluster->retrieveMoment(
xtype, xmom,
false);
456 theCluster->insertMoment(CaloCluster::ENG_RECO_EMB0,
x);
459 theCluster->insertMoment(CaloCluster::ENG_RECO_EME0,
x);
462 theCluster->insertMoment(CaloCluster::ENG_RECO_TILEG3,
x);
464 x = (
double)(dm_total+wrong_dm_energy);
465 theCluster->insertMoment(CaloCluster::ENG_RECO_DEAD_TOT,
x);
467 for(
size_t i_dm=0; i_dm < areas.size(); i_dm++) {
468 Area& dma = areas[i_dm];
485 if ( eWeighted > 0 || eWeighted < 0 ) {
486 weightMom *= theCluster->e()/eWeighted;
488 theCluster->insertMoment(CaloCluster::DM_WEIGHT,weightMom);
490 return StatusCode::SUCCESS;
◆ m_absOpt
bool CaloLCDeadMaterialTool::m_absOpt |
|
private |
In Abs Option case, DM calculation has to be handled in a slightly different way.
Definition at line 160 of file CaloLCDeadMaterialTool.h.
◆ m_detStore
◆ m_evtStore
◆ m_interpolate
bool CaloLCDeadMaterialTool::m_interpolate |
|
private |
◆ m_interpolateDimensionNames
std::map<std::string, std::vector<std::string > > CaloLCDeadMaterialTool::m_interpolateDimensionNames |
|
private |
vector of names of dimensions to interpolate (for different correction types different set of dimensions)
Definition at line 146 of file CaloLCDeadMaterialTool.h.
◆ m_interpolateDimensionsFit
std::vector<int > CaloLCDeadMaterialTool::m_interpolateDimensionsFit |
|
private |
actual set of dimension id's to interpolate (in the DM areas corrected with TProfile approach)
Definition at line 150 of file CaloLCDeadMaterialTool.h.
◆ m_interpolateDimensionsLookup
std::vector<int > CaloLCDeadMaterialTool::m_interpolateDimensionsLookup |
|
private |
actual set of dimension id's to interpolate (in the DM areas corrected with lookup approach)
Definition at line 153 of file CaloLCDeadMaterialTool.h.
◆ m_interpolateDimensionsSampling
std::vector<int > CaloLCDeadMaterialTool::m_interpolateDimensionsSampling |
|
private |
actual set of dimension id's to interpolate (in the DM areas corrected with sampling weight approach)
Definition at line 156 of file CaloLCDeadMaterialTool.h.
◆ m_key
◆ m_MaxChangeInCellWeight
float CaloLCDeadMaterialTool::m_MaxChangeInCellWeight |
|
private |
◆ m_MinCellEnergyToDeal
float CaloLCDeadMaterialTool::m_MinCellEnergyToDeal |
|
private |
◆ m_MinClusterEnergyToDeal
float CaloLCDeadMaterialTool::m_MinClusterEnergyToDeal |
|
private |
◆ m_MinLookupBinNentry
int CaloLCDeadMaterialTool::m_MinLookupBinNentry |
|
private |
◆ m_recoStatus
int CaloLCDeadMaterialTool::m_recoStatus |
|
private |
◆ m_updateSamplingVars
bool CaloLCDeadMaterialTool::m_updateSamplingVars |
|
private |
◆ m_useHadProbability
bool CaloLCDeadMaterialTool::m_useHadProbability |
|
private |
calculate DM energy using em-probability moment
The classification provides the probability p for the current cluster to be em-like. Dead material enegry of cluster is calculated as a mixture of DM energies for pure EM and pure HAD clusters using p as engDM = p *engDM_EM+(1-p)*endDM_HAD
Definition at line 134 of file CaloLCDeadMaterialTool.h.
◆ m_varHandleArraysDeclared
◆ m_vhka
◆ m_weightModeDM
int CaloLCDeadMaterialTool::m_weightModeDM |
|
private |
method of assignment of DM energy to cluster
if 0: setting cluster energy to the new value without changing of cells weights if 1: weights of all cells in the cluster with energy > m_MinCellEnergyToDeal will be changed if 2: changing only weights of cells which have been involved into DM calculation
Definition at line 109 of file CaloLCDeadMaterialTool.h.
The documentation for this class was generated from the following files:
JetConstituentVector::iterator iterator
MomentType
enums to identify different moments
char data[hepevt_bytes_allocation_ATLAS]
const_cell_iterator cell_begin() const
Iterator of the underlying CaloClusterCellLink (const version)
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
virtual double e() const override final
get energy (data member) (synonym to method energy()
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.
Gaudi::Details::PropertyBase & declareGaudiProperty(Gaudi::Property< T, V, H > &hndl, const SG::VarHandleKeyType &)
specialization for handling Gaudi::Property<SG::VarHandleKey>
CaloCompositeCellBase< CaloClusterNavigable >::cell_iterator cell_iterator
Iterator on CaloCell s.
::StatusCode StatusCode
StatusCode definition for legacy code.
Gaudi::Details::PropertyBase & declareProperty(Gaudi::Property< T, V, H > &t)
Hold binned correction data for local hadronic calibration procedure.
const CaloDetDescrElement * caloDDE() const
get pointer to CaloDetDescrElement (data member)
size_t size() const
size method (forwarded from CaloClusterCellLink obj)
StoreGateSvc_t m_detStore
Pointer to StoreGate (detector store by default)
bool EM_PROBABILITY(const xAOD::TauJet &, const xAOD::CaloVertexedTopoCluster &cluster, float &out)
virtual void renounce()=0
std::conditional< std::is_base_of< SG::VarHandleKeyArray, T >::value, VarHandleKeyArrayType, type2 >::type type
void prefetchNext(Iter iter, Iter endIter)
Prefetch next object in sequence.
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.)
StatusCode initialize(bool used=true)
float eSample(const CaloSample sampling) const
Data object for each calorimeter readout cell.
CaloCell_ID::CaloSample getSampling() const
cell sampling
#define ATH_MSG_WARNING(x)
defines enums and data types for different moments of CaloCluster
const_cell_iterator cell_end() const
SG::VarHandleKey & vhKey()
Return a non-const reference to the HandleKey.
Definition of correction area.
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 CENTER_LAMBDA(const xAOD::TauJet &, const xAOD::CaloVertexedTopoCluster &cluster, float &out)