Main Page
Namespaces
Classes
Package Documentation
All
Classes
Namespaces
Files
Functions
Variables
Typedefs
Enumerations
Enumerator
Properties
Friends
Macros
Groups
Pages
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:428
w
const double w
Definition:
UKUtility.cc:23
AbsPlan1RechitCombiner::energyWeightedAverage
static float energyWeightedAverage(const FPair *data, unsigned len, float valueToReturnOnFailure)
Definition:
AbsPlan1RechitCombiner.cc:3
AbsPlan1RechitCombiner.h
AbsPlan1RechitCombiner::FPair
std::pair< float, float > FPair
Definition:
AbsPlan1RechitCombiner.h:35
data
char data[epos_bytes_allocation]
Definition:
EPOS_Wrapper.h:79
validate-o2o-wbm.f
tuple f
Definition:
validate-o2o-wbm.py:27
Generated for CMSSW Reference Manual by
1.8.5