Main Page
Namespaces
Classes
Package Documentation
src
CommonTools
Statistics
interface
BinomialProbability.h
Go to the documentation of this file.
1
#ifndef BinomialProbability_H
2
#define BinomialProbability_H
3
4
#include <cmath>
5
12
class
BinomialProbability
{
13
public
:
14
15
BinomialProbability
() :
theHits
(0),
theTotal
(0) {}
16
17
BinomialProbability
(
int
hits
,
int
entries
) :
18
theHits
(hits),
theTotal
(entries) {}
19
20
float
value
()
const
{
21
return
theTotal
== 0 ? 0 :
float
(
theHits
) /
float
(
theTotal
);
22
}
23
24
float
error
()
const
{
25
float
p
=
value
();
26
return
theTotal
<= 1 ? 0 :
sqrt
( p*(1.
f
- p)/(
theTotal
-1));
27
}
28
29
int
entries
()
const
{
return
theTotal
;}
30
31
int
hits
()
const
{
return
theHits
;}
32
33
void
hit
() {
theHits
++;
theTotal
++;}
34
35
void
miss
() {
theTotal
++;}
36
37
void
update
(
bool
hit
) {
38
if
( hit)
theHits
++;
39
theTotal
++;
40
}
41
42
private
:
43
44
int
theHits
;
45
int
theTotal
;
46
47
};
48
49
#endif
BinomialProbability
Definition:
BinomialProbability.h:12
AlCaHLTBitMon_ParallelJobs.p
p
Definition:
AlCaHLTBitMon_ParallelJobs.py:153
BinomialProbability::theTotal
int theTotal
Definition:
BinomialProbability.h:45
BinomialProbability::hit
void hit()
Definition:
BinomialProbability.h:33
BinomialProbability::theHits
int theHits
Definition:
BinomialProbability.h:44
BinomialProbability::entries
int entries() const
Definition:
BinomialProbability.h:29
mathSSE::sqrt
T sqrt(T t)
Definition:
SSEVec.h:18
f
double f[11][100]
Definition:
MuScleFitUtils.cc:78
BinomialProbability::BinomialProbability
BinomialProbability()
Definition:
BinomialProbability.h:15
objects.autophobj.float
float
Definition:
autophobj.py:147
BinomialProbability::miss
void miss()
Definition:
BinomialProbability.h:35
BinomialProbability::hits
int hits() const
Definition:
BinomialProbability.h:31
BinomialProbability::update
void update(bool hit)
Definition:
BinomialProbability.h:37
BinomialProbability::value
float value() const
Definition:
BinomialProbability.h:20
BinomialProbability::error
float error() const
Definition:
BinomialProbability.h:24
hit
Definition:
SiStripHitEffFromCalibTree.cc:87
BinomialProbability::BinomialProbability
BinomialProbability(int hits, int entries)
Definition:
BinomialProbability.h:17
Generated for CMSSW Reference Manual by
1.8.11