ATLAS Offline Software
Toggle main menu visibility
Loading...
Searching...
No Matches
Calorimeter
CaloClusterCorrection
src
CaloComputeSWcellWeights.cxx
Go to the documentation of this file.
1
/*
2
Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration
3
*/
4
5
/********************************************************************
6
7
NAME: CaloComputeSWcellWeights.cxx
8
PACKAGE: offline/Calorimeter/CaloClusterCorrection
9
10
AUTHORS: D. Lelas
11
CREATED: Dec. 02, 2005
12
13
PURPOSE: - Compute simple cell weights for Sliding Window
14
clusters, to solve double-counting of cells' energies
15
for cells shared by two or more clusters.
16
17
This tool does not update the cluster kinematics,
18
only the cell weights. It should be followed by
19
a pass of CaloFillRectangularCluster with fill_cluster
20
set to False.
21
22
*********************************************************************/
23
24
// include header files
25
#include "
CaloComputeSWcellWeights.h
"
26
#include "
CaloEvent/CaloCell.h
"
27
#include "CaloEvent/CaloClusterContainer.h"
28
//#include "CaloDetDescr/CaloDetDescrElement.h"
29
//#include "CaloDetDescr/CaloDetDescrManager.h"
30
//#include "CaloIdentifier/CaloCell_ID.h"
31
#include "
xAODCaloEvent/CaloClusterKineHelper.h
"
32
33
// -------------------------------------------------------------
34
// Constructor
35
// -------------------------------------------------------------
36
37
CaloComputeSWcellWeights::CaloComputeSWcellWeights
(
const
std::string&
type
,
38
const
std::string& name,
39
const
IInterface* parent)
40
:
AthAlgTool
(
type
, name, parent)
41
{
42
}
43
44
// Make Corrections for SW cell weights
45
StatusCode
46
CaloComputeSWcellWeights::execute
(
const
EventContext&
/*ctx*/
,
47
xAOD::CaloClusterContainer
* clusColl)
const
48
{
49
50
51
ATH_MSG_DEBUG
(
"Executing CaloComputeSWcellWeights"
<<
endmsg
) ;
52
53
std::map<IdentifierHash,double> WeightMap;
//FIXME: use a vector!
54
55
for
(
const
xAOD::CaloCluster
* cluster : *clusColl) {
56
for
(
const
CaloCell
* cell : *cluster) {
57
IdentifierHash
myHashId = cell->caloDDE()->calo_hash();
58
WeightMap[myHashId] += cell->e();
59
}
60
}
61
62
for
(
xAOD::CaloCluster
* cluster : *clusColl) {
63
xAOD::CaloCluster::cell_iterator
cellIter = cluster->cell_begin();
64
xAOD::CaloCluster::cell_iterator
cellIterEnd = cluster->cell_end();
65
for
( ;cellIter!=cellIterEnd;cellIter++) {
66
const
CaloCell
* cell = *cellIter;
67
IdentifierHash
myHashId = cell->caloDDE()->calo_hash();
68
double
WEIGHT=(cell->e())/WeightMap[myHashId];
69
cellIter.
reweight
(WEIGHT);
70
}
71
CaloClusterKineHelper::calculateKine
(cluster);
//FIXME .. maybe unnecessary
72
}
73
74
return
StatusCode::SUCCESS;
75
}
76
77
78
79
80
endmsg
#define endmsg
Definition
AnalysisConfig_Ntuple.cxx:54
ATH_MSG_DEBUG
#define ATH_MSG_DEBUG(x)
Definition
AthMsgStreamMacros.h:29
CaloCell.h
CaloClusterKineHelper.h
CaloComputeSWcellWeights.h
AthAlgTool::AthAlgTool
AthAlgTool(const std::string &type, const std::string &name, const IInterface *parent)
Constructor with parameters:
Definition
AthAlgTool.cxx:16
CaloCell
Data object for each calorimeter readout cell.
Definition
CaloCell.h:57
CaloClusterCellLink::iterator::reweight
void reweight(const weight_t newWeight)
Update the weight.
Definition
CaloClusterCellLink.h:164
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
CaloComputeSWcellWeights::CaloComputeSWcellWeights
CaloComputeSWcellWeights(const std::string &type, const std::string &name, const IInterface *parent)
Definition
CaloComputeSWcellWeights.cxx:37
CaloComputeSWcellWeights::execute
StatusCode execute(const EventContext &ctx, xAOD::CaloClusterContainer *clusColl) const override
Execute on an entire collection of clusters.
Definition
CaloComputeSWcellWeights.cxx:46
IdentifierHash
This is a "hash" representation of an Identifier.
Definition
IdentifierHash.h:25
xAOD::CaloCluster_v1::cell_iterator
CaloClusterCellLink::iterator cell_iterator
Iterator of the underlying CaloClusterCellLink (non-const version).
Definition
CaloCluster_v1.h:819
xAOD::CaloCluster
CaloCluster_v1 CaloCluster
Define the latest version of the calorimeter cluster class.
Definition
Event/xAOD/xAODCaloEvent/xAODCaloEvent/CaloCluster.h:19
xAOD::CaloClusterContainer
CaloClusterContainer_v1 CaloClusterContainer
Define the latest version of the calorimeter cluster container.
Definition
Event/xAOD/xAODCaloEvent/xAODCaloEvent/CaloClusterContainer.h:17
type
Generated on
for ATLAS Offline Software by
1.17.0