|
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 > &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 |
|
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 |
|
) |
| |
Definition at line 32 of file CaloLCDeadMaterialTool.cxx.
47 declareInterface<IClusterCellWeightTool>(
this);
59 std::vector<std::string > vstr;
62 vstr[1] =
"DIMD_ENER";
66 vstr[1] =
"DIMD_ENER";
67 vstr[2] =
"DIMD_LAMBDA";
71 vstr[1] =
"DIMD_LAMBDA";
◆ 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 90 of file CaloLCDeadMaterialTool.cxx.
93 msg(MSG::INFO) <<
"Interpolation is ON, dimensions: ";
95 msg(MSG::INFO) <<
" " << (*it).first <<
" (";
97 msg() << (*it2) <<
" ";
103 std::vector<int > *vtmp=
nullptr;
104 if((*it).first ==
"AREA_DMFIT") {
106 }
else if((*it).first ==
"AREA_DMLOOKUP") {
108 }
else if((*it).first ==
"AREA_DMSMPW") {
111 msg(MSG::WARNING) <<
"Unkown dead material area type '" << (*it).first <<
"'" << std::endl;
117 vtmp->push_back(
int(
id));
119 ATH_MSG_WARNING(
"Dimension '" << (*it2) <<
"' is invalid and will be excluded." );
130 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 531 of file CaloLCDeadMaterialTool.cxx.
538 areas.resize(
data->getSizeAreaSet());
545 CaloCluster::const_cell_iterator itrCell = theCluster->
cell_begin();
546 CaloCluster::const_cell_iterator itrCellEnd = theCluster->
cell_end();
547 cls_unweighted_energy = 0;
548 for (;itrCell!=itrCellEnd; ++itrCell) {
550 const CaloCell* thisCell = *itrCell;
556 float weight = itrCell.weight();
557 cls_unweighted_energy +=
energy;
564 smp_energy[nsmp] +=
energy;
636 areas[
sDM_FCAL].eprep = cls_unweighted_energy;
640 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 138 of file CaloLCDeadMaterialTool.cxx.
143 float wrong_dm_energy = 0.0;
144 float dm_total = 0.0;
147 double weightMom (1);
148 if (!theCluster->retrieveMoment(CaloCluster::DM_WEIGHT,weightMom)) {
155 double eWeighted = theCluster->e();
175 set_zero_moments(theCluster);
177 return StatusCode::SUCCESS;
183 ATH_MSG_ERROR(
"Cannot retrieve EM_PROBABILITY cluster moment, "
184 <<
" cluster energy " << theCluster->e() <<
" remains the same." );
185 return StatusCode::FAILURE;
189 }
else if ( pi0Prob > 1 ) {
196 double center_lambda = 0;
198 ATH_MSG_ERROR(
"Cannot retrieve CENTER_LAMBDA cluster moment, "
199 <<
" cluster energy " << theCluster->e() <<
" remains the same." );
200 return StatusCode::FAILURE;
208 return StatusCode::FAILURE;
211 ATH_MSG_DEBUG(
"Cluster is selected for local DM calibration."
212 <<
" Old cluster energy:" << theCluster->e()
216 std::vector<Area> areas;
217 std::vector<Cell>
cells;
219 float cls_unweighted_energy = 0;
221 smp_energy, cls_unweighted_energy,
data);
222 if ( !
sc.isSuccess() ) {
224 set_zero_moments(theCluster);
230 float cls_initial_energy = theCluster->e();
231 float cls_side = (theCluster->eta()<0?-1.0:1.0);
232 float cls_eta = fabs(theCluster->eta());
233 float cls_phi = theCluster->phi();
234 float log10ener = 0.0;
235 if(cls_unweighted_energy > 0.0) {
236 log10ener = log10(cls_unweighted_energy);
239 if(center_lambda > 0.0) {
240 log10lambda = log10(center_lambda);
241 if(log10lambda >=4.0) log10lambda = 3.9999;
245 #ifdef DEBUG_DMTHINGS
246 std::cout <<
" cls_initial_energy: " << cls_initial_energy <<
" cls_eta: " << cls_eta << std::endl;
247 std::cout <<
" log10ener: " << log10ener <<
" log10lambda: " << log10lambda << std::endl;
249 std::cout <<
" i_smp: " << i_smp <<
" smp_energy: " << smp_energy[i_smp] << std::endl;
253 std::vector<float > vars;
262 size_t n_dm =
data->getSizeAreaSet();
265 for(
int i_mix=0; i_mix<2; i_mix++){
266 float mixWeight = (i_mix==0?(1-pi0Prob):pi0Prob);
267 if(mixWeight == 0)
continue;
272 for(
size_t i_dm=0; i_dm < n_dm; i_dm++){
273 if(areas[i_dm].eprep <= 0.0)
continue;
277 if(log10ener > emax) log10ener = emax - 0.0001;
281 if( !
pars )
continue;
303 const int nSmp=
pars->size()-1;
305 double ecalonew = 0.0;
306 double ecaloold = 0.0;
307 for(
int i_smp=0; i_smp<nSmp; i_smp++){
308 ecaloold += smp_energy[i_smp];
309 ecalonew += smp_energy[i_smp] * (*pars)[i_smp];
311 ecalonew += (*pars)[nSmp];
312 edm = ecalonew - ecaloold;
329 std::cout <<
"CaloLCDeadMaterialTool -> Error! Unknown correction type " <<
area->getType()
330 <<
" with number of parameters " <<
area->getNpars() << std::endl;
332 wrong_dm_energy += areas[i_dm].edm_wrong;
334 #ifdef DEBUG_DMTHINGS
335 std::cout <<
" result> edm: " << edm <<
" edm_wrong:" << edm_wrong << std::endl;
337 edm -= areas[i_dm].edm_wrong;
339 areas[i_dm].erec = areas[i_dm].erec + edm*mixWeight;
350 #ifdef DEBUG_DMTHINGS
351 std::cout <<
"wc> calculation of weights" << std::endl;
357 theCluster->setE(cls_initial_energy + dm_total - wrong_dm_energy);
362 float sub_ener_old = 0.0;
363 for(
size_t i_c = 0; i_c <
cells.size(); i_c++)
367 sub_ener_old +=
cell.weight*
cell.energy;
369 if(sub_ener_old > 0.0) {
370 float corr = (sub_ener_old + dm_total)/sub_ener_old;
371 for(
size_t i_c = 0; i_c <
cells.size(); i_c++)
374 cells[i_c].weight *= corr;
382 for (
size_t cell_index = 0; cell_index <
cells.size(); ++cell_index)
386 float we =
cell.weight *
cell.energy;
388 areas[
cell.dm].sub_ener_old += we;
394 for(
size_t i_dm=0; i_dm < areas.size(); i_dm++) {
395 Area& dma = areas[i_dm];
397 if (i_dm >= n_dm || dma.eprep <= 0)
399 else if (dma.sub_ener_old > 0)
400 corrfac = (dma.sub_ener_old + dma.erec) / dma.sub_ener_old;
403 areas[
sDM_FCAL].sub_ener_old += (corrfac-1)*dma.sub_ener_old;
405 areas[
sDM_LEAKAGE].sub_ener_old += (corrfac-1)*dma.sub_ener_old;
407 areas[
sDM_UNCLASS].sub_ener_old += (corrfac-1)*dma.sub_ener_old;
413 for (
size_t cell_index = 0; cell_index <
cells.size(); ++cell_index)
419 cell.weight *= gblfac;
430 for (;itrCell!=itrCellEnd; ++itrCell) {
432 const float old_weight = itrCell.weight();
433 float new_weight =
cells[cell_index].weight;
435 theCluster->reweightCell(itrCell, new_weight);
437 new_weight = old_weight;
439 #ifdef DEBUG_DMTHINGS
440 std::cout <<
" cells> " << cell_index <<
" ener: " <<
cells[cell_index].energy <<
" old_w: " << old_weight <<
" new_w:" << new_weight << std::endl;
441 if( new_weight > 100) std::cout <<
"DeadMaterialCorrectionTool2 -> Panic! Too large weight" << std::endl;
451 <<
" (contains wrongly estimated DM energy: " << wrong_dm_energy <<
")"
452 <<
" calculated DM energy (to be added):" << dm_total
453 <<
" new cluster energy:" << theCluster->e());
459 bool result = theCluster->retrieveMoment(
xtype, xmom,
false);
466 theCluster->insertMoment(CaloCluster::ENG_RECO_EMB0,
x);
469 theCluster->insertMoment(CaloCluster::ENG_RECO_EME0,
x);
472 theCluster->insertMoment(CaloCluster::ENG_RECO_TILEG3,
x);
474 x = (
double)(dm_total+wrong_dm_energy);
475 theCluster->insertMoment(CaloCluster::ENG_RECO_DEAD_TOT,
x);
477 for(
size_t i_dm=0; i_dm < areas.size(); i_dm++) {
478 Area& dma = areas[i_dm];
495 if ( eWeighted > 0 || eWeighted < 0 ) {
496 weightMom *= theCluster->e()/eWeighted;
498 theCluster->insertMoment(CaloCluster::DM_WEIGHT,weightMom);
500 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]
bool CENTER_LAMBDA(const xAOD::TauJet &, const xAOD::CaloVertexedTopoCluster &cluster, double &out)
const_cell_iterator cell_begin() const
Iterator of the underlying CaloClusterCellLink (const version)
bool EM_PROBABILITY(const xAOD::TauJet &, const xAOD::CaloVertexedTopoCluster &cluster, double &out)
Gaudi::Details::PropertyBase & declareProperty(Gaudi::Property< T > &t)
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.
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.
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)
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.
Gaudi::Details::PropertyBase & declareGaudiProperty(Gaudi::Property< T > &hndl, const SG::VarHandleKeyType &)
specialization for handling Gaudi::Property<SG::VarHandleKey>