Belle II Software
release-05-02-19
Main Page
Modules
Namespaces
Namespace List
Namespace Members
All
_
a
b
c
d
e
f
g
h
i
k
l
m
n
o
p
q
r
s
t
u
v
w
x
z
Functions
_
a
b
c
d
e
f
g
h
i
k
l
m
n
o
p
r
s
t
u
v
w
x
z
Variables
a
b
c
d
e
f
g
h
i
l
m
n
o
p
q
r
s
t
u
v
w
x
z
Typedefs
a
b
c
d
e
h
i
l
m
n
p
r
s
t
v
w
Enumerations
Enumerator
c
d
f
p
t
u
v
w
Classes
Class List
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
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
y
Enumerations
a
b
c
d
e
f
g
h
i
l
m
o
p
r
s
t
u
v
Enumerator
a
b
c
d
e
f
g
h
k
l
m
n
o
p
r
s
t
u
v
w
z
Related Functions
b
c
d
g
i
o
r
s
t
Files
File List
File Members
All
Functions
BackgroundMetaData.cc
1
/**************************************************************************
2
* BASF2 (Belle Analysis Framework 2) *
3
* Copyright(C) 2017 Belle II Collaboration *
4
* *
5
* Author: The Belle II Collaboration *
6
* Contributors: Marko Staric *
7
* *
8
* This software is provided "as is" without any warranty. *
9
**************************************************************************/
10
11
#include <framework/dataobjects/BackgroundMetaData.h>
12
#include <framework/logging/Logger.h>
13
14
using namespace
std;
15
using namespace
Belle2
;
16
17
18
bool
BackgroundMetaData::canBeMerged(
const
BackgroundMetaData
* otherObj)
19
{
20
21
if
(otherObj->
getBackgroundType
() != m_backgroundType) {
22
B2ERROR(
"BackgroundMetaData: objects cannot be merged (different backgroundType)"
);
23
return
false
;
24
}
25
26
if
(otherObj->
getBackgroundTag
() != m_backgroundTag) {
27
B2ERROR(
"BackgroundMetaData: objects cannot be merged (different backgroundTag)"
);
28
return
false
;
29
}
30
31
if
(otherObj->
getFileType
() != m_fileType) {
32
B2ERROR(
"BackgroundMetaData: objects cannot be merged (different fileType)"
);
33
return
false
;
34
}
35
36
return
true
;
37
}
38
39
40
void
BackgroundMetaData::merge
(
const
Mergeable
* other)
41
{
42
auto
otherObj =
static_cast<
const
BackgroundMetaData
*
>
(other);
43
44
if
(otherObj->getBackgroundType().empty())
return
;
// no merge for empty object
45
46
if
(m_backgroundType.empty()) {
// empty, replace it with other
47
*
this
= *otherObj;
48
return
;
49
}
50
51
if
(!canBeMerged(otherObj))
throw
BackgroundMetaDataNotMergeable();
52
53
m_realTime += otherObj->
getRealTime
();
54
55
}
56
57
void
BackgroundMetaData::clear()
58
{
59
m_realTime = 0;
60
}
Belle2::BackgroundMetaData::getBackgroundType
const std::string & getBackgroundType() const
Returns the type of background.
Definition:
BackgroundMetaData.h:116
Belle2::BackgroundMetaData::getRealTime
float getRealTime() const
Returns real time that corresponds to this background sample.
Definition:
BackgroundMetaData.h:128
Belle2::merge
std::vector< std::vector< double > > merge(std::vector< std::vector< std::vector< double >>> toMerge)
merge { vector<double> a, vector<double> b} into {a, b}
Definition:
tools.h:44
Belle2
Abstract base class for different kinds of events.
Definition:
MillepedeAlgorithm.h:19
Belle2::BackgroundMetaData
Metadata information about the beam background file.
Definition:
BackgroundMetaData.h:34
Belle2::BackgroundMetaData::getFileType
EFileType getFileType() const
Returns file type.
Definition:
BackgroundMetaData.h:134
Belle2::BackgroundMetaData::getBackgroundTag
BG_TAG getBackgroundTag() const
Returns background tag value.
Definition:
BackgroundMetaData.h:122
Belle2::Mergeable
Abstract base class for objects that can be merged.
Definition:
Mergeable.h:33
framework
dataobjects
src
BackgroundMetaData.cc
Generated on Tue Jan 4 2022 02:56:32 for Belle II Software by
1.8.17