src
RecoLocalCalo
HcalRecAlgos
src
AbsPlan1RechitCombiner.cc
Go to the documentation of this file.
1
#include "
RecoLocalCalo/HcalRecAlgos/interface/AbsPlan1RechitCombiner.h
"
2
3
float
AbsPlan1RechitCombiner::energyWeightedAverage
(
const
FPair
*
data
,
4
const
unsigned
len,
5
const
float
valueToReturnOnFailure) {
6
double
sum = 0.0, wsum = 0.0;
7
for
(
unsigned
i
= 0;
i
< len; ++
i
) {
8
const
float
w
=
data
[
i
].second;
9
if
(
w
> 0.
f
) {
10
sum +=
w
*
data
[
i
].first;
11
wsum +=
w
;
12
}
13
}
14
if
(wsum > 0.0)
15
return
sum / wsum;
16
else
17
return
valueToReturnOnFailure;
18
}
mps_fire.i
i
Definition:
mps_fire.py:429
w
T w() const
Definition:
extBasic3DVector.h:225
AbsPlan1RechitCombiner::energyWeightedAverage
static float energyWeightedAverage(const FPair *data, unsigned len, float valueToReturnOnFailure)
Definition:
AbsPlan1RechitCombiner.cc:3
AbsPlan1RechitCombiner.h
f
double f[11][100]
Definition:
MuScleFitUtils.cc:78
AbsPlan1RechitCombiner::FPair
std::pair< float, float > FPair
Definition:
AbsPlan1RechitCombiner.h:35
data
char data[epos_bytes_allocation]
Definition:
EPOS_Wrapper.h:80
Generated for CMSSW Reference Manual by
1.8.14