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