ROOT
6.12/07
Reference Guide
ROOT Home Page
Main Page
Tutorials
User's Classes
+
Namespaces
Namespace List
+
Namespace Members
+
All
<
_
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
y
z
+
Functions
<
_
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
y
z
+
Variables
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
y
z
+
Typedefs
a
b
c
d
e
f
g
h
i
l
m
n
o
p
q
r
s
u
w
x
+
Enumerations
a
e
f
g
m
p
t
w
y
+
Enumerator
b
c
d
e
f
g
h
i
k
l
m
n
o
p
r
s
w
+
All Classes
Class List
Class Index
Class Hierarchy
+
Class Members
+
All
:
_
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
y
z
~
+
Functions
_
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
y
z
~
+
Variables
_
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
y
z
+
Typedefs
a
b
c
d
e
f
g
h
i
k
l
m
n
o
p
r
s
t
u
v
w
x
y
+
Enumerations
a
b
c
d
e
f
g
h
i
l
m
o
p
r
s
w
y
+
Enumerator
_
a
b
c
d
e
f
g
h
i
k
l
m
n
o
p
q
r
s
t
u
v
w
+
Properties
f
+
Related Functions
:
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
z
+
Files
File List
+
File Members
+
All
1
2
3
4
5
6
7
8
9
_
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
y
z
+
Functions
_
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
y
+
Variables
_
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
y
z
+
Typedefs
a
b
c
d
e
f
g
h
i
k
l
m
n
o
p
q
r
s
t
u
v
w
x
+
Enumerations
c
e
f
i
l
m
p
r
u
x
+
Enumerator
a
c
d
e
f
g
h
i
k
l
n
o
p
r
s
v
w
+
Macros
1
2
3
4
5
6
7
8
9
_
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
y
z
Release Notes
•
All
Classes
Namespaces
Files
Functions
Variables
Typedefs
Enumerations
Enumerator
Properties
Friends
Macros
Modules
Pages
math
mathcore
src
UnBinData.cxx
Go to the documentation of this file.
1
// @(#)root/mathcore:$Id$
2
// Author: L. Moneta Wed Aug 30 11:10:03 2006
3
4
/**********************************************************************
5
* *
6
* Copyright (c) 2006 LCG ROOT Math Team, CERN/PH-SFT *
7
* *
8
* *
9
**********************************************************************/
10
11
// Implementation file for class UnBinData
12
13
#include "
Fit/UnBinData.h
"
14
#include "
Math/Error.h
"
15
16
#include <cassert>
17
#include <cmath>
18
19
namespace
ROOT
{
20
21
namespace
Fit
{
22
23
/*
24
void UnBinData::Initialize(unsigned int maxpoints, unsigned int dim, bool isWeighted ) {
25
// preallocate a data set given size and dimension
26
unsigned int pointSize = (isWeighted) ? dim+1 : dim;
27
if ( (dim != fDim || pointSize != fPointSize) && fDataVector) {
28
// MATH_INFO_MSGVAL("BinData::Initialize"," Reset amd re-initialize with a new fit point size of ",
29
// dim);
30
delete fDataVector;
31
fDataVector = 0;
32
}
33
fDim = dim;
34
fPointSize = pointSize;
35
unsigned int n = fPointSize*maxpoints;
36
if ( n > MaxSize() ) {
37
MATH_ERROR_MSGVAL("UnBinData::Initialize","Invalid data size", n );
38
return;
39
}
40
if (fDataVector)
41
(fDataVector->Data()).resize( fDataVector->Size() + n );
42
else
43
fDataVector = new DataVector( n);
44
}
45
46
void UnBinData::Resize(unsigned int npoints) {
47
// resize vector to new points
48
if (fDim == 0) return;
49
if ( npoints > MaxSize() ) {
50
MATH_ERROR_MSGVAL("BinData::Resize"," Invalid data size ", npoints );
51
return;
52
}
53
if (fDataVector != 0) {
54
int nextraPoints = npoints - fDataVector->Size()/fPointSize;
55
if (nextraPoints < 0) {
56
// delete extra points
57
(fDataVector->Data()).resize( npoints * fPointSize);
58
}
59
else if (nextraPoints > 0) {
60
// add extra points
61
Initialize(nextraPoints, fDim, IsWeighted() );
62
}
63
else // nextraPoints == 0
64
return;
65
}
66
else // no DataVector create it
67
fDataVector = new DataVector( npoints*fPointSize);
68
}
69
*/
70
71
72
}
// end namespace Fit
73
74
}
// end namespace ROOT
75
ROOT
Namespace for new ROOT classes and functions.
Definition:
StringConv.hxx:21
UnBinData.h
Error.h
HFit::Fit
TFitResultPtr Fit(FitObject *h1, TF1 *f1, Foption_t &option, const ROOT::Math::MinimizerOptions &moption, const char *goption, ROOT::Fit::DataRange &range)
Definition:
HFitImpl.cxx:134