ATLAS Offline Software
Public Member Functions | Private Member Functions | Static Private Member Functions | Private Attributes | List of all members
PFLCCalibTool Class Reference

This tool can either use a series of CaloClusterProcessor to calibrate the modified xAOD::CaloCluster (modified when we do the charged shower subtraction) using recalculated LC weights or its own internal method to use the stored LC weights in the eflowRecCluster objects. More...

#include <PFLCCalibTool.h>

Inheritance diagram for PFLCCalibTool:
Collaboration diagram for PFLCCalibTool:

Public Member Functions

 PFLCCalibTool (const std::string &type, const std::string &name, const IInterface *parent)
 
 ~PFLCCalibTool ()
 
virtual StatusCode initialize () override
 
virtual StatusCode execute (eflowCaloObjectContainer &theEflowCaloObjectContainer) override
 
virtual StatusCode finalize () override
 

Private Member Functions

StatusCode apply (ToolHandle< CaloClusterProcessor > &calibTool, xAOD::CaloCluster *cluster)
 

Static Private Member Functions

static void applyLocalWeight (eflowRecCluster *theEFRecCluster, const CaloDetDescrManager &calo_dd_man)
 

Private Attributes

ToolHandle< IPFClusterCollectionToolm_clusterCollectionTool {this,"eflowRecClusterCollectionTool","eflowRecClusterCollectionTool","Tool to put all clusters into a temporary container - then we use this to calculate moments, some of which depend on configuration of nearby clusters"}
 Tool to put all clusters into a temporary container - then we use this to calculate moments, some of which depend on configuration of nearby clusters. More...
 
ToolHandle< CaloClusterProcessorm_clusterLocalCalibTool {this,"CaloClusterLocalCalib","CaloClusterLocalCalib","Tool for applying local hadronc calibration weights to cells"}
 
ToolHandle< CaloClusterProcessorm_clusterLocalCalibOOCCTool {this,"CaloClusterLocalCalibOOCC","CaloClusterLocalCalib","Tool to deal with out of cluster corrections"}
 
ToolHandle< CaloClusterProcessorm_clusterLocalCalibOOCCPi0Tool {this,"CaloClusterLocalCalibOOCCPi0","CaloClusterLocalCalib","Tool to do Pi0 corrections"}
 
ToolHandle< CaloClusterProcessorm_clusterLocalCalibDMTool {this,"CaloClusterLocalCalibDM","CaloClusterLocalCalib","Tool for correcting clusters at cell level for dead material"}
 
Gaudi::Property< bool > m_useLocalWeight {this,"UseLocalWeight",false,"Toggle which LC weights scheme to use - default is to recalculate weights, rather than use saved weights"}
 Toggle which LC weights scheme to use - default is to recalculate weights, rather than use saved weights. More...
 
SG::ReadCondHandleKey< CaloDetDescrManagerm_caloMgrKey
 ReadCondHandleKey for CaloDetDescrManager. More...
 

Detailed Description

This tool can either use a series of CaloClusterProcessor to calibrate the modified xAOD::CaloCluster (modified when we do the charged shower subtraction) using recalculated LC weights or its own internal method to use the stored LC weights in the eflowRecCluster objects.

If using the LC weights which were stored in the eflowRecCluster then we use the container of eflowRecCluster, but if using recalculated LC weights for the modified xAOD::CaloCluster (modified when we remove calorimeter cells in the charged shower subtraction) then we need the container of xAOD::CaloCluster. The PFClusterCollectionTool provides both of these containers.

Definition at line 22 of file PFLCCalibTool.h.

Constructor & Destructor Documentation

◆ PFLCCalibTool()

PFLCCalibTool::PFLCCalibTool ( const std::string &  type,
const std::string &  name,
const IInterface *  parent 
)

Definition at line 18 of file PFLCCalibTool.cxx.

18  :
19  base_class(type, name, parent)
20 {
21 }

◆ ~PFLCCalibTool()

PFLCCalibTool::~PFLCCalibTool ( )
inline

Definition at line 28 of file PFLCCalibTool.h.

28 {}

Member Function Documentation

◆ apply()

StatusCode PFLCCalibTool::apply ( ToolHandle< CaloClusterProcessor > &  calibTool,
xAOD::CaloCluster cluster 
)
private

Definition at line 81 of file PFLCCalibTool.cxx.

81  {
82  if (m_useLocalWeight) ATH_MSG_WARNING("Applying recalculated weights, when configuration requested to use original weights");
83  ATH_CHECK(calibTool->execute(cluster));
84  return StatusCode::SUCCESS;
85 }

◆ applyLocalWeight()

void PFLCCalibTool::applyLocalWeight ( eflowRecCluster theEFRecCluster,
const CaloDetDescrManager calo_dd_man 
)
staticprivate

Definition at line 87 of file PFLCCalibTool.cxx.

87  {
88  xAOD::CaloCluster* theCluster = theEFRecClusters->getCluster();
89 
90  /* Iterate over cells of old cluster and replicate them with energy weighted by -1 if negative and add it to the new cluster */
91  const std::map<IdentifierHash, double> weightMap = theEFRecClusters->getCellsWeight();
92 
93  const CaloCell_ID* calo_id = calo_dd_man.getCaloCell_ID();
94  xAOD::CaloCluster::cell_iterator cellIter = theCluster->cell_begin();
95 
96  for (;cellIter != theCluster->cell_end(); ++cellIter) {
97  const CaloCell* pCell = *cellIter;
98  IdentifierHash myHashId = calo_id->calo_cell_hash(pCell->ID());
99  if (const auto pWeight = weightMap.find(myHashId); pWeight!=weightMap.end()){
100  const double weight = pWeight->second;
101  theCluster->reweightCell(cellIter, weight);
102  }
103  }
104 
105  CaloClusterKineHelper::calculateKine(theCluster, true, false);
106 
108 }

◆ execute()

StatusCode PFLCCalibTool::execute ( eflowCaloObjectContainer theEflowCaloObjectContainer)
overridevirtual

Definition at line 46 of file PFLCCalibTool.cxx.

46  {
47 
48  if (m_useLocalWeight) {
49  std::unique_ptr<eflowRecClusterContainer> theEFRecClusterContainer = m_clusterCollectionTool->retrieve(theEflowCaloObjectContainer, true);
50  /* Calibrate each cluster */
52  if (caloMgrHandle.isValid()){
53  for (auto thisEFlowRecCluster : *theEFRecClusterContainer) applyLocalWeight(thisEFlowRecCluster,**caloMgrHandle);
54  }
55  else ATH_MSG_WARNING("Invalid pointer to CaloDetDescrManage: Did NOT calibrate any topoclusters.");
56  } else {
57  /* Collect all the clusters in a temporary container (with VIEW_ELEMENTS!) */
58  std::unique_ptr<xAOD::CaloClusterContainer> tempClusterContainer = m_clusterCollectionTool->execute(theEflowCaloObjectContainer, true);
59 
60  /* Calibrate each cluster */
61  for (auto thisCaloCluster : *tempClusterContainer){
62  /* Subsequently apply all ClusterLocalCalibTools, print debug output at each stage, if DEBUG it set */
63  ATH_CHECK(apply(m_clusterLocalCalibTool, thisCaloCluster));
64 
65  ATH_CHECK(apply(m_clusterLocalCalibOOCCTool, thisCaloCluster));
66 
68 
69  ATH_CHECK(apply(m_clusterLocalCalibDMTool, thisCaloCluster));
70 
71  }//loop on CaloCluster
72  }//if not use local weight scheme
73  return StatusCode::SUCCESS;
74 }

◆ finalize()

StatusCode PFLCCalibTool::finalize ( )
overridevirtual

Definition at line 76 of file PFLCCalibTool.cxx.

76  {
77  return StatusCode::SUCCESS;
78 }

◆ initialize()

StatusCode PFLCCalibTool::initialize ( )
overridevirtual

Definition at line 23 of file PFLCCalibTool.cxx.

23  {
24 
25  /* Retrieve the cluster collection tool */
27 
28  /* Retrieve basic local-hadron calibration tool */
30 
31  /* Retrieve tools for out-of-cluster corrections */
33 
35 
36  /* Retrieve tool for DM corrections */
38 
39  /* Retrieve calorimeter detector manager */
41 
42  return StatusCode::SUCCESS;
43 
44 }

Member Data Documentation

◆ m_caloMgrKey

SG::ReadCondHandleKey<CaloDetDescrManager> PFLCCalibTool::m_caloMgrKey
private
Initial value:
{ this
, "CaloDetDescrManager"
, "CaloDetDescrManager"
, "SG Key for CaloDetDescrManager in the Condition Store" }

ReadCondHandleKey for CaloDetDescrManager.

Definition at line 58 of file PFLCCalibTool.h.

◆ m_clusterCollectionTool

ToolHandle<IPFClusterCollectionTool> PFLCCalibTool::m_clusterCollectionTool {this,"eflowRecClusterCollectionTool","eflowRecClusterCollectionTool","Tool to put all clusters into a temporary container - then we use this to calculate moments, some of which depend on configuration of nearby clusters"}
private

Tool to put all clusters into a temporary container - then we use this to calculate moments, some of which depend on configuration of nearby clusters.

Definition at line 40 of file PFLCCalibTool.h.

◆ m_clusterLocalCalibDMTool

ToolHandle<CaloClusterProcessor> PFLCCalibTool::m_clusterLocalCalibDMTool {this,"CaloClusterLocalCalibDM","CaloClusterLocalCalib","Tool for correcting clusters at cell level for dead material"}
private

Definition at line 52 of file PFLCCalibTool.h.

◆ m_clusterLocalCalibOOCCPi0Tool

ToolHandle<CaloClusterProcessor> PFLCCalibTool::m_clusterLocalCalibOOCCPi0Tool {this,"CaloClusterLocalCalibOOCCPi0","CaloClusterLocalCalib","Tool to do Pi0 corrections"}
private

Definition at line 49 of file PFLCCalibTool.h.

◆ m_clusterLocalCalibOOCCTool

ToolHandle<CaloClusterProcessor> PFLCCalibTool::m_clusterLocalCalibOOCCTool {this,"CaloClusterLocalCalibOOCC","CaloClusterLocalCalib","Tool to deal with out of cluster corrections"}
private

Definition at line 46 of file PFLCCalibTool.h.

◆ m_clusterLocalCalibTool

ToolHandle<CaloClusterProcessor> PFLCCalibTool::m_clusterLocalCalibTool {this,"CaloClusterLocalCalib","CaloClusterLocalCalib","Tool for applying local hadronc calibration weights to cells"}
private

Definition at line 43 of file PFLCCalibTool.h.

◆ m_useLocalWeight

Gaudi::Property<bool> PFLCCalibTool::m_useLocalWeight {this,"UseLocalWeight",false,"Toggle which LC weights scheme to use - default is to recalculate weights, rather than use saved weights"}
private

Toggle which LC weights scheme to use - default is to recalculate weights, rather than use saved weights.

Definition at line 55 of file PFLCCalibTool.h.


The documentation for this class was generated from the following files:
PFLCCalibTool::applyLocalWeight
static void applyLocalWeight(eflowRecCluster *theEFRecCluster, const CaloDetDescrManager &calo_dd_man)
Definition: PFLCCalibTool.cxx:87
xAOD::CaloCluster_v1::cell_begin
const_cell_iterator cell_begin() const
Iterator of the underlying CaloClusterCellLink (const version)
Definition: CaloCluster_v1.h:812
CaloRecoStatus::CALIBRATEDLHC
@ CALIBRATEDLHC
Definition: CaloRecoStatus.h:43
CaloCell_Base_ID::calo_cell_hash
IdentifierHash calo_cell_hash(const Identifier cellId) const
create hash id from 'global' cell id
SG::ReadCondHandle
Definition: ReadCondHandle.h:44
PFLCCalibTool::m_clusterLocalCalibTool
ToolHandle< CaloClusterProcessor > m_clusterLocalCalibTool
Definition: PFLCCalibTool.h:43
CaloRecoStatus::setStatus
virtual void setStatus(const StatusIndicator &statusIndicator)
Set status.
Definition: CaloRecoStatus.h:107
dqt_zlumi_pandas.weight
int weight
Definition: dqt_zlumi_pandas.py:200
xAOD::CaloCluster_v1
Description of a calorimeter cluster.
Definition: CaloCluster_v1.h:59
PFLCCalibTool::m_clusterLocalCalibOOCCTool
ToolHandle< CaloClusterProcessor > m_clusterLocalCalibOOCCTool
Definition: PFLCCalibTool.h:46
PFLCCalibTool::m_clusterLocalCalibOOCCPi0Tool
ToolHandle< CaloClusterProcessor > m_clusterLocalCalibOOCCPi0Tool
Definition: PFLCCalibTool.h:49
PFLCCalibTool::m_clusterCollectionTool
ToolHandle< IPFClusterCollectionTool > m_clusterCollectionTool
Tool to put all clusters into a temporary container - then we use this to calculate moments,...
Definition: PFLCCalibTool.h:40
test_pyathena.parent
parent
Definition: test_pyathena.py:15
ATH_CHECK
#define ATH_CHECK
Definition: AthCheckMacros.h:40
CaloCell_ID
Helper class for offline cell identifiers.
Definition: CaloCell_ID.h:34
PFLCCalibTool::m_useLocalWeight
Gaudi::Property< bool > m_useLocalWeight
Toggle which LC weights scheme to use - default is to recalculate weights, rather than use saved weig...
Definition: PFLCCalibTool.h:55
xAOD::CaloCluster_v1::reweightCell
void reweightCell(cell_iterator it, const double weight)
Method to reweight a cell in the cluster (Beware: Kinematics not updated!)
Definition: CaloCluster_v1.h:835
name
std::string name
Definition: Control/AthContainers/Root/debug.cxx:195
xAOD::CaloCluster_v1::recoStatus
CaloRecoStatus & recoStatus()
Accesssor to CaloRecoStatus (non-const)
Definition: CaloCluster_v1.h:840
SG::CondHandleKey::initialize
StatusCode initialize(bool used=true)
CaloCell::ID
Identifier ID() const
get ID (from cached data member) non-virtual and inline for fast access
Definition: CaloCell.h:279
PFLCCalibTool::apply
StatusCode apply(ToolHandle< CaloClusterProcessor > &calibTool, xAOD::CaloCluster *cluster)
Definition: PFLCCalibTool.cxx:81
CaloCell
Data object for each calorimeter readout cell.
Definition: CaloCell.h:57
ATH_MSG_WARNING
#define ATH_MSG_WARNING(x)
Definition: AthMsgStreamMacros.h:32
python.CaloScaleNoiseConfig.type
type
Definition: CaloScaleNoiseConfig.py:78
xAOD::CaloCluster_v1::cell_end
const_cell_iterator cell_end() const
Definition: CaloCluster_v1.h:813
CaloClusterKineHelper::calculateKine
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.
Definition: CaloClusterKineHelper.cxx:223
CaloDetDescrManager::getCaloCell_ID
const CaloCell_ID * getCaloCell_ID() const
get calo cell ID helper
Definition: CaloDetDescrManager.cxx:1590
PFLCCalibTool::m_caloMgrKey
SG::ReadCondHandleKey< CaloDetDescrManager > m_caloMgrKey
ReadCondHandleKey for CaloDetDescrManager.
Definition: PFLCCalibTool.h:58
PFLCCalibTool::m_clusterLocalCalibDMTool
ToolHandle< CaloClusterProcessor > m_clusterLocalCalibDMTool
Definition: PFLCCalibTool.h:52
IdentifierHash
Definition: IdentifierHash.h:38