Execute on a single cluster.
52{
53 CaloRecoStatus& recoStatus=theCluster->recoStatus();
54
57 }
58
59 bool isSelected (false);
62 if ( isSelected ) {
64
65
66
67
68 double centLambd(0.);
69 double engdens(0.);
70 double emprobability(0.);
71 double isolation(0.);
72
73
74
76 centLambd = 0;
78 engdens = 0;
80 emprobability = 0;
82 isolation = 0;
83
84 double oldEnergy = theCluster->e();
85
86 const CaloCell_ID* calo_id = nullptr;
88
89
90
93 int cellIndex = 0;
94
96 for(;cellIter!=theCluster->cell_end();cellIter++) {
97 const CaloCell* pCell = *cellIter;
98 double CellEnergy = pCell->
e();
99
100
101 if( CellEnergy < 0. ) CellEnergy = -1 * pCell->
e();
103 double cellWeight = cellIter.
weight();
104 myCluster->addCell(cellIndex,cellWeight);
105 cellIndex++;
106 }
107
109 myCluster->setRawE(myCluster->e());
110
111
112 for(
unsigned int i=0;
i != CaloSampling::Unknown; ++
i) {
115 }
116
118
123
124
125 for (
const ToolHandle<IClusterCellWeightTool>& tool :
m_calibTools) {
126 if (
tool->weight(myCluster.get(),ctx).isFailure())
127 msg(MSG::ERROR) <<
" failed to weight cluster " <<
endmsg;
128 }
129
130
131 std::map<IdentifierHash,double> weightMap;
134 for(;mycellIter!=mycellIterEnd;mycellIter++) {
135 const CaloCell* pCell = *mycellIter;
136 double cellWeight = mycellIter.
weight();
137 Identifier myId = pCell->
ID();
139 weightMap[myHashId] = cellWeight;
140 }
141
142
143
144
145 cellIter = theCluster->cell_begin();
146 for(;cellIter!=theCluster->cell_end();cellIter++) {
147 const CaloCell* pCell = *cellIter;
149 double weight = weightMap[myHashId];
150 theCluster->reweightCell(cellIter,weight);
151 }
152
153
155
156
157
158 double newWeightMoment = theCluster->e()/oldEnergy;
162 if(
m_calibTools[0].typeAndName() ==
"CaloLCOutOfClusterTool/LCOutPi0")
163 {
164 double ooc_weight;
166 newWeightMoment *= ooc_weight;
168 }
169 }
170 }
171
172 else{
173
174 for (
const ToolHandle<IClusterCellWeightTool>& tool :
m_calibTools) {
175 if (
tool->weight(theCluster,ctx).isFailure())
176 msg(MSG::ERROR) <<
" failed to weight cluster " <<
endmsg;
177 }
178
179 }
180
181 }
182
183
185
186 return StatusCode::SUCCESS;
187}
#define ATH_CHECK
Evaluate an expression and check for errors.
const ServiceHandle< StoreGateSvc > & detStore() const
IdentifierHash calo_cell_hash(const Identifier cellId) const
create hash id from 'global' cell id
float time() const
get time (data member)
virtual double e() const override final
get energy (data member) (synonym to method energy()
const CaloDetDescrElement * caloDDE() const
get pointer to CaloDetDescrElement (data member)
uint16_t provenance() const
get provenance (data member)
uint16_t quality() const
get quality (data member)
CaloGain::CaloGain gain() const
get gain (data member )
Identifier ID() const
get ID (from cached data member) non-virtual and inline for fast access
weight_t weight() const
Accessor for weight associated to this cell.
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.
ToolHandleArray< IClusterCellWeightTool > m_calibTools
property: Array of IClusterCellWeightTool
Gaudi::Property< std::vector< int > > m_recoStatus
property: vector of valid Reco Statuses for the clusters in order to be calibrated
ToolHandleArray< IClusterClassificationTool > m_classificationTool
property: Classification tools
Gaudi::Property< bool > m_absOpt
if set to true, negative clusters are weighted as well
static std::unique_ptr< xAOD::CaloCluster > makeCluster(const CaloCellContainer *cellCont)
Creates a valid CaloCluster with a private Aux-Store and CellLink container.
StatusIndicator
reconstruction status word
virtual bool checkStatus(const StatusIndicator &statusIndicator) const
Check status.
virtual void setStatus(const StatusIndicator &statusIndicator)
Set status.
CaloClusterCellLink::iterator cell_iterator
Iterator of the underlying CaloClusterCellLink (non-const version)
@ OOC_WEIGHT
Out-of-cluster weight (E_ooc/E_w)
@ EM_PROBABILITY
Classification probability to be em-like.
@ DM_WEIGHT
Dead-material weight (E_dm/E_ooc)
@ FIRST_ENG_DENS
First Moment in E/V.
@ HAD_WEIGHT
Hadronic weight (E_w/E_em)
@ CENTER_LAMBDA
Shower depth at Cluster Centroid.
@ ISOLATION
Energy weighted fraction of non-clustered perimeter cells.
CaloSampling::CaloSample CaloSample
@ OWN_ELEMENTS
this data object owns its elements