Execute on a single cluster.
61{
62 CaloRecoStatus& recoStatus=theCluster->recoStatus();
63
66 }
67
68 bool isSelected (false);
71 if ( isSelected ) {
73
74
75
76
77 double centLambd(0.);
78 double engdens(0.);
79 double emprobability(0.);
80 double isolation(0.);
81
82
83
85 centLambd = 0;
87 engdens = 0;
89 emprobability = 0;
91 isolation = 0;
92
93 double oldEnergy = theCluster->e();
94
95 const CaloCell_ID* calo_id = nullptr;
97
98
99
102 int cellIndex = 0;
103
105 for(;cellIter!=theCluster->cell_end();cellIter++) {
106 const CaloCell* pCell = *cellIter;
107 double CellEnergy = pCell->
e();
108
109
110 if( CellEnergy < 0. ) CellEnergy = -1 * pCell->
e();
112 double cellWeight = cellIter.
weight();
113 myCluster->addCell(cellIndex,cellWeight);
114 cellIndex++;
115 }
116
118 myCluster->setRawE(myCluster->e());
119
120
121 for(
unsigned int i=0;
i != CaloSampling::Unknown; ++
i) {
124 }
125
127
132
133
134 for (
const ToolHandle<IClusterCellWeightTool>& tool :
m_calibTools) {
135 if (
tool->weight(myCluster.get(),ctx).isFailure())
136 msg(MSG::ERROR) <<
" failed to weight cluster " <<
endmsg;
137 }
138
139
140 std::map<IdentifierHash,double> weightMap;
143 for(;mycellIter!=mycellIterEnd;mycellIter++) {
144 const CaloCell* pCell = *mycellIter;
145 double cellWeight = mycellIter.
weight();
146 Identifier myId = pCell->
ID();
148 weightMap[myHashId] = cellWeight;
149 }
150
151
152
153
154 cellIter = theCluster->cell_begin();
155 for(;cellIter!=theCluster->cell_end();cellIter++) {
156 const CaloCell* pCell = *cellIter;
158 double weight = weightMap[myHashId];
159 theCluster->reweightCell(cellIter,weight);
160 }
161
162
164
165
166
167 double newWeightMoment = theCluster->e()/oldEnergy;
171 if(
m_calibTools[0].typeAndName() ==
"CaloLCOutOfClusterTool/LCOutPi0")
172 {
173 double ooc_weight;
175 newWeightMoment *= ooc_weight;
177 }
178 }
179 }
180
181 else{
182
183 for (
const ToolHandle<IClusterCellWeightTool>& tool :
m_calibTools) {
184 if (
tool->weight(theCluster,ctx).isFailure())
185 msg(MSG::ERROR) <<
" failed to weight cluster " <<
endmsg;
186 }
187
188 }
189
190 }
191
192
194
195 return StatusCode::SUCCESS;
196}
#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.
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
retrieve(aClass, aKey=None)