ATLAS Offline Software
Loading...
Searching...
No Matches
PFUnifiedLCCalibTool 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 <PFUnifiedLCCalibTool.h>

Inheritance diagram for PFUnifiedLCCalibTool:
Collaboration diagram for PFUnifiedLCCalibTool:

Public Member Functions

 PFUnifiedLCCalibTool (const std::string &type, const std::string &name, const IInterface *parent)
 ~PFUnifiedLCCalibTool ()
virtual StatusCode initialize () override
virtual StatusCode processPFlowData (const EventContext &ctx, PFData &thePFData) const override

Private Member Functions

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

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.
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.
SG::ReadCondHandleKey< CaloDetDescrManagerm_caloMgrKey
 ReadCondHandleKey for CaloDetDescrManager.

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 PFUnifiedLCCalibTool.h.

Constructor & Destructor Documentation

◆ PFUnifiedLCCalibTool()

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

Definition at line 19 of file PFUnifiedLCCalibTool.cxx.

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

◆ ~PFUnifiedLCCalibTool()

PFUnifiedLCCalibTool::~PFUnifiedLCCalibTool ( )
inline

Definition at line 28 of file PFUnifiedLCCalibTool.h.

28{}

Member Function Documentation

◆ apply()

StatusCode PFUnifiedLCCalibTool::apply ( const EventContext & ctx,
const ToolHandle< CaloClusterProcessor > & calibTool,
xAOD::CaloCluster * cluster ) const
private

Definition at line 83 of file PFUnifiedLCCalibTool.cxx.

83 {
84 if (m_useLocalWeight) ATH_MSG_WARNING("Applying recalculated weights, when configuration requested to use original weights");
85 ATH_CHECK(calibTool->execute(ctx,cluster));
86 return StatusCode::SUCCESS;
87}
#define ATH_CHECK
Evaluate an expression and check for errors.
#define ATH_MSG_WARNING(x)
Gaudi::Property< bool > m_useLocalWeight
Toggle which LC weights scheme to use - default is to recalculate weights, rather than use saved weig...

◆ applyLocalWeight()

void PFUnifiedLCCalibTool::applyLocalWeight ( eflowRecCluster * theEFRecCluster,
const CaloDetDescrManager & calo_dd_man )
staticprivate

Definition at line 89 of file PFUnifiedLCCalibTool.cxx.

89 {
90 xAOD::CaloCluster* theCluster = theEFRecClusters->getCluster();
91
92 /* Iterate over cells of old cluster and replicate them with energy weighted by -1 if negative and add it to the new cluster */
93 const std::map<IdentifierHash, double> weightMap = theEFRecClusters->getCellsWeight();
94
95 const CaloCell_ID* calo_id = calo_dd_man.getCaloCell_ID();
96 xAOD::CaloCluster::cell_iterator cellIter = theCluster->cell_begin();
97
98 for (;cellIter != theCluster->cell_end(); ++cellIter) {
99 const CaloCell* pCell = *cellIter;
100 IdentifierHash myHashId = calo_id->calo_cell_hash(pCell->ID());
101 if (const auto pWeight = weightMap.find(myHashId); pWeight!=weightMap.end()){
102 const double weight = pWeight->second;
103 theCluster->reweightCell(cellIter, weight);
104 }
105 }
106
107 CaloClusterKineHelper::calculateKine(theCluster, true, false);
108
110}
IdentifierHash calo_cell_hash(const Identifier cellId) const
create hash id from 'global' cell id
Identifier ID() const
get ID (from cached data member) non-virtual and inline for fast access
Definition CaloCell.h:295
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.
const CaloCell_ID * getCaloCell_ID() const
get calo cell ID helper
virtual void setStatus(const StatusIndicator &statusIndicator)
Set status.
void reweightCell(cell_iterator it, const double weight)
Method to reweight a cell in the cluster (Beware: Kinematics not updated!).
CaloClusterCellLink::iterator cell_iterator
Iterator of the underlying CaloClusterCellLink (non-const version).
const_cell_iterator cell_end() const
const_cell_iterator cell_begin() const
Iterator of the underlying CaloClusterCellLink (const version).
CaloRecoStatus & recoStatus()
Accesssor to CaloRecoStatus (non-const).
CaloCluster_v1 CaloCluster
Define the latest version of the calorimeter cluster class.

◆ initialize()

StatusCode PFUnifiedLCCalibTool::initialize ( )
overridevirtual

Definition at line 24 of file PFUnifiedLCCalibTool.cxx.

24 {
25
26 /* Retrieve the cluster collection tool */
28
29 /* Retrieve basic local-hadron calibration tool */
31
32 /* Retrieve tools for out-of-cluster corrections */
34
36
37 /* Retrieve tool for DM corrections */
39
40 /* Retrieve calorimeter detector manager */
41 ATH_CHECK(m_caloMgrKey.initialize());
42
43 return StatusCode::SUCCESS;
44
45}
ToolHandle< IPFClusterCollectionTool > m_clusterCollectionTool
Tool to put all clusters into a temporary container - then we use this to calculate moments,...
ToolHandle< CaloClusterProcessor > m_clusterLocalCalibOOCCTool
SG::ReadCondHandleKey< CaloDetDescrManager > m_caloMgrKey
ReadCondHandleKey for CaloDetDescrManager.
ToolHandle< CaloClusterProcessor > m_clusterLocalCalibDMTool
ToolHandle< CaloClusterProcessor > m_clusterLocalCalibTool
ToolHandle< CaloClusterProcessor > m_clusterLocalCalibOOCCPi0Tool

◆ processPFlowData()

StatusCode PFUnifiedLCCalibTool::processPFlowData ( const EventContext & ctx,
PFData & thePFData ) const
overridevirtual

Definition at line 47 of file PFUnifiedLCCalibTool.cxx.

47 {
48
49 if (!thePFData.caloObjects) {
50 ATH_MSG_ERROR("PFData::caloObjects is null; caller must set it before invoking the LC calib tool");
51 return StatusCode::FAILURE;
52 }
53
54 eflowCaloObjectContainer *theEflowCaloObjectContainer = thePFData.caloObjects;
55
56 if (m_useLocalWeight) {
57 std::unique_ptr<eflowRecClusterContainer> theEFRecClusterContainer = m_clusterCollectionTool->retrieve(*theEflowCaloObjectContainer, true);
58 /* Calibrate each cluster */
59 SG::ReadCondHandle<CaloDetDescrManager> caloMgrHandle{m_caloMgrKey, ctx};
60 if (caloMgrHandle.isValid()){
61 for (auto thisEFlowRecCluster : *theEFRecClusterContainer) applyLocalWeight(thisEFlowRecCluster,**caloMgrHandle);
62 }
63 else ATH_MSG_WARNING("Invalid pointer to CaloDetDescrManage: Did NOT calibrate any topoclusters.");
64 } else {
65 /* Collect all the clusters in a temporary container (with VIEW_ELEMENTS!) */
66 std::unique_ptr<xAOD::CaloClusterContainer> tempClusterContainer = m_clusterCollectionTool->execute(*theEflowCaloObjectContainer, true);
67 /* Calibrate each cluster */
68 for (auto thisCaloCluster : *tempClusterContainer){
69 /* Subsequently apply all ClusterLocalCalibTools, print debug output at each stage, if DEBUG it set */
70 ATH_CHECK(apply(ctx,m_clusterLocalCalibTool, thisCaloCluster));
71
72 ATH_CHECK(apply(ctx,m_clusterLocalCalibOOCCTool, thisCaloCluster));
73
74 ATH_CHECK(apply(ctx,m_clusterLocalCalibOOCCPi0Tool, thisCaloCluster));
75
76 ATH_CHECK(apply(ctx,m_clusterLocalCalibDMTool, thisCaloCluster));
77
78 }//loop on CaloCluster
79 }//if not use local weight scheme
80 return StatusCode::SUCCESS;
81}
#define ATH_MSG_ERROR(x)
StatusCode apply(const EventContext &ctx, const ToolHandle< CaloClusterProcessor > &calibTool, xAOD::CaloCluster *cluster) const
static void applyLocalWeight(eflowRecCluster *theEFRecCluster, const CaloDetDescrManager &calo_dd_man)
eflowCaloObjectContainer * caloObjects
Definition PFData.h:17

Member Data Documentation

◆ m_caloMgrKey

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

ReadCondHandleKey for CaloDetDescrManager.

Definition at line 57 of file PFUnifiedLCCalibTool.h.

57 { this
58 , "CaloDetDescrManager"
59 , "CaloDetDescrManager"
60 , "SG Key for CaloDetDescrManager in the Condition Store" };

◆ m_clusterCollectionTool

ToolHandle<IPFClusterCollectionTool> PFUnifiedLCCalibTool::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 39 of file PFUnifiedLCCalibTool.h.

39{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"};

◆ m_clusterLocalCalibDMTool

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

Definition at line 51 of file PFUnifiedLCCalibTool.h.

51{this,"CaloClusterLocalCalibDM","CaloClusterLocalCalib","Tool for correcting clusters at cell level for dead material"};

◆ m_clusterLocalCalibOOCCPi0Tool

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

Definition at line 48 of file PFUnifiedLCCalibTool.h.

48{this,"CaloClusterLocalCalibOOCCPi0","CaloClusterLocalCalib","Tool to do Pi0 corrections"};

◆ m_clusterLocalCalibOOCCTool

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

Definition at line 45 of file PFUnifiedLCCalibTool.h.

45{this,"CaloClusterLocalCalibOOCC","CaloClusterLocalCalib","Tool to deal with out of cluster corrections"};

◆ m_clusterLocalCalibTool

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

Definition at line 42 of file PFUnifiedLCCalibTool.h.

42{this,"CaloClusterLocalCalib","CaloClusterLocalCalib","Tool for applying local hadronc calibration weights to cells"};

◆ m_useLocalWeight

Gaudi::Property<bool> PFUnifiedLCCalibTool::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 54 of file PFUnifiedLCCalibTool.h.

54{this,"UseLocalWeight",false,"Toggle which LC weights scheme to use - default is to recalculate weights, rather than use saved weights"};

The documentation for this class was generated from the following files: