Main Page
Related Pages
Modules
Namespaces
Classes
Files
Examples
File List
File Members
canvas
canvas
Persistency
Provenance
SubRunAuxiliary.cc
Go to the documentation of this file.
1
#include "
canvas/Persistency/Provenance/SubRunAuxiliary.h
"
2
// vim: set sw=2 expandtab :
3
4
#include <ostream>
5
#include <utility>
6
7
using namespace
std
;
8
9
namespace
art
{
10
11
SubRunAuxiliary::~SubRunAuxiliary() {}
12
13
SubRunAuxiliary::SubRunAuxiliary()
14
: processHistoryID_{},
rangeSetID_
{-1u},
id_
{},
beginTime_
{},
endTime_
{}
15
{}
16
17
SubRunAuxiliary::SubRunAuxiliary
(
SubRunID
const
& theId,
18
Timestamp
const
& theTime,
19
Timestamp
const
& theEndTime)
20
:
processHistoryID_
{}
21
,
rangeSetID_
{-1u}
22
,
id_
{theId}
23
,
beginTime_
{theTime}
24
,
endTime_
{theEndTime}
25
{}
26
27
SubRunAuxiliary::SubRunAuxiliary
(
RunNumber_t
const
theRun,
28
SubRunNumber_t
const
theSubRun,
29
Timestamp
const
& theTime,
30
Timestamp
const
& theEndTime)
31
:
processHistoryID_
{}
32
,
rangeSetID_
{-1u}
33
,
id_
{theRun, theSubRun}
34
,
beginTime_
{theTime}
35
,
endTime_
{theEndTime}
36
{}
37
38
SubRunAuxiliary::SubRunAuxiliary
(
SubRunAuxiliary
const
& rhs)
39
:
processHistoryID_
{rhs.
processHistoryID_
}
40
,
rangeSetID_
{rhs.rangeSetID_}
41
,
id_
{rhs.id_}
42
,
beginTime_
{rhs.beginTime_}
43
,
endTime_
{rhs.endTime_}
44
{}
45
46
SubRunAuxiliary::SubRunAuxiliary
(
SubRunAuxiliary
&& rhs)
47
:
processHistoryID_
{
move
(rhs.processHistoryID_)}
48
,
rangeSetID_
{
move
(rhs.rangeSetID_)}
49
,
id_
{
move
(rhs.id_)}
50
,
beginTime_
{
move
(rhs.beginTime_)}
51
,
endTime_
{
move
(rhs.endTime_)}
52
{}
53
54
SubRunAuxiliary
&
55
SubRunAuxiliary::operator=
(
SubRunAuxiliary
const
& rhs)
56
{
57
if
(
this
!= &rhs) {
58
processHistoryID_
= rhs.
processHistoryID_
;
59
rangeSetID_
= rhs.
rangeSetID_
;
60
id_
= rhs.
id_
;
61
beginTime_
= rhs.
beginTime_
;
62
endTime_
= rhs.
endTime_
;
63
}
64
return
*
this
;
65
}
66
67
SubRunAuxiliary
&
68
SubRunAuxiliary::operator=
(
SubRunAuxiliary
&& rhs)
69
{
70
processHistoryID_
=
move
(rhs.processHistoryID_);
71
rangeSetID_
=
move
(rhs.rangeSetID_);
72
id_
=
move
(rhs.id_);
73
beginTime_
=
move
(rhs.beginTime_);
74
endTime_
=
move
(rhs.endTime_);
75
return
*
this
;
76
}
77
78
ProcessHistoryID
const
&
79
SubRunAuxiliary::processHistoryID
()
const
noexcept
80
{
81
return
processHistoryID_
;
82
}
83
84
void
85
SubRunAuxiliary::setProcessHistoryID
(
ProcessHistoryID
const
& phid)
const
86
{
87
processHistoryID_
= phid;
88
}
89
90
SubRunID
const
&
91
SubRunAuxiliary::id
()
const
noexcept
92
{
93
return
id_
;
94
}
95
96
SubRunID
const
&
97
SubRunAuxiliary::subRunID
()
const
noexcept
98
{
99
return
id_
;
100
}
101
102
RunID
const
&
103
SubRunAuxiliary::runID
()
const
noexcept
104
{
105
return
id_
.
runID
();
106
}
107
108
RunNumber_t
109
SubRunAuxiliary::run
()
const
noexcept
110
{
111
return
id_
.
run
();
112
}
113
114
SubRunNumber_t
115
SubRunAuxiliary::subRun
()
const
noexcept
116
{
117
return
id_
.
subRun
();
118
}
119
120
Timestamp
const
&
121
SubRunAuxiliary::beginTime
()
const
noexcept
122
{
123
return
beginTime_
;
124
}
125
126
Timestamp
const
&
127
SubRunAuxiliary::endTime
()
const
noexcept
128
{
129
return
endTime_
;
130
}
131
132
void
133
SubRunAuxiliary::setEndTime
(
Timestamp
const
&
time
)
134
{
135
if
(
endTime_
==
Timestamp::invalidTimestamp
()) {
136
endTime_
= time;
137
}
138
}
139
140
void
141
SubRunAuxiliary::setRangeSetID
(
unsigned
const
id
)
const
142
{
143
rangeSetID_
=
id
;
144
}
145
146
unsigned
147
SubRunAuxiliary::rangeSetID
()
const
noexcept
148
{
149
return
rangeSetID_
;
150
}
151
152
void
153
SubRunAuxiliary::write
(ostream& os)
const
154
{
155
os <<
"Process History ID = "
<<
processHistoryID_
<<
endl
;
156
os <<
id_
<<
endl
;
157
}
158
159
bool
160
SubRunAuxiliary::mergeAuxiliary
(
SubRunAuxiliary
const
& newAux)
161
{
162
if
((
beginTime_
==
Timestamp::invalidTimestamp
()) ||
163
(newAux.
beginTime
() ==
Timestamp::invalidTimestamp
())) {
164
beginTime_
=
Timestamp::invalidTimestamp
();
165
}
else
if
(newAux.
beginTime
() <
beginTime_
) {
166
beginTime_
= newAux.
beginTime
();
167
}
168
if
((
endTime_
==
Timestamp::invalidTimestamp
()) ||
169
(newAux.
endTime
() ==
Timestamp::invalidTimestamp
())) {
170
endTime_
=
Timestamp::invalidTimestamp
();
171
}
else
if
(newAux.
endTime
() >
endTime_
) {
172
endTime_
= newAux.
endTime
();
173
}
174
// Keep the process history ID that is in the preexisting principal
175
// It may have been updated to include the current process.
176
// There is one strange other case where the two ProcessHistoryIDs
177
// could be different which should not be important and we just ignore.
178
// There could have been previous processes which only dropped products.
179
// These processes could have dropped the same branches but had different
180
// process names ... Ignore this.
181
if
(
id_
!= newAux.
id
()) {
182
return
false
;
183
}
184
return
true
;
185
}
186
187
ostream&
188
operator<<
(ostream& os,
SubRunAuxiliary
const
&
p
)
189
{
190
p.
write
(os);
191
return
os;
192
}
193
194
}
// namespace art
art::SubRunAuxiliary::runID
RunID const & runID() const noexcept
Definition:
SubRunAuxiliary.cc:103
art::SubRunAuxiliary::write
void write(std::ostream &os) const
Definition:
SubRunAuxiliary.cc:153
art::SubRunAuxiliary::rangeSetID_
unsigned rangeSetID_
Definition:
SubRunAuxiliary.h:76
freeze_graph.const
const
Definition:
freeze_graph.py:179
art::SubRunAuxiliary::beginTime_
Timestamp beginTime_
Definition:
SubRunAuxiliary.h:80
art::SubRunID
Definition:
SubRunID.h:19
art::SubRunAuxiliary::id_
SubRunID id_
Definition:
SubRunAuxiliary.h:78
std
STL namespace.
art::SubRunAuxiliary::setProcessHistoryID
void setProcessHistoryID(ProcessHistoryID const &phid) const
Definition:
SubRunAuxiliary.cc:85
art::SubRunAuxiliary
Definition:
SubRunAuxiliary.h:17
art::SubRunAuxiliary::processHistoryID_
ProcessHistoryID processHistoryID_
Definition:
SubRunAuxiliary.h:74
art::Timestamp
Definition:
Timestamp.h:10
art::SubRunAuxiliary::subRunID
SubRunID const & subRunID() const noexcept
Definition:
SubRunAuxiliary.cc:97
art::SubRunAuxiliary::subRun
SubRunNumber_t subRun() const noexcept
Definition:
SubRunAuxiliary.cc:115
art::SubRunAuxiliary::endTime_
Timestamp endTime_
Definition:
SubRunAuxiliary.h:82
art::SubRunID::runID
RunID const & runID() const
Definition:
SubRunID.h:79
art::operator<<
std::ostream & operator<<(std::ostream &os, const GroupSelector &gs)
Definition:
GroupSelector.cc:62
SubRunAuxiliary.h
time
art::SubRunAuxiliary::rangeSetID
unsigned rangeSetID() const noexcept
Definition:
SubRunAuxiliary.cc:147
wirecell.gen.depos.move
def move(depos, offset)
Definition:
depos.py:107
art::SubRunID::run
RunNumber_t run() const
Definition:
SubRunID.h:85
art::SubRunAuxiliary::mergeAuxiliary
bool mergeAuxiliary(SubRunAuxiliary const &)
Definition:
SubRunAuxiliary.cc:160
art::SubRunNumber_t
IDNumber_t< Level::SubRun > SubRunNumber_t
Definition:
IDNumber.h:119
test.p
p
Definition:
test.py:223
art::SubRunAuxiliary::endTime
Timestamp const & endTime() const noexcept
Definition:
SubRunAuxiliary.cc:127
art::SubRunAuxiliary::run
RunNumber_t run() const noexcept
Definition:
SubRunAuxiliary.cc:109
art::SubRunAuxiliary::SubRunAuxiliary
SubRunAuxiliary()
Definition:
SubRunAuxiliary.cc:13
art::RunID
Definition:
RunID.h:21
art::SubRunAuxiliary::setRangeSetID
void setRangeSetID(unsigned const id) const
Definition:
SubRunAuxiliary.cc:141
art::Timestamp::invalidTimestamp
static constexpr Timestamp invalidTimestamp()
Definition:
Timestamp.h:82
art::SubRunAuxiliary::id
SubRunID const & id() const noexcept
Definition:
SubRunAuxiliary.cc:91
art::SubRunAuxiliary::operator=
SubRunAuxiliary & operator=(SubRunAuxiliary const &)
Definition:
SubRunAuxiliary.cc:55
art::SubRunAuxiliary::processHistoryID
ProcessHistoryID const & processHistoryID() const noexcept
Definition:
SubRunAuxiliary.cc:79
art
Definition:
BasicOptionsHandler.h:9
art::SubRunAuxiliary::setEndTime
void setEndTime(Timestamp const &time)
Definition:
SubRunAuxiliary.cc:133
art::SubRunID::subRun
SubRunNumber_t subRun() const
Definition:
SubRunID.h:91
art::SubRunAuxiliary::beginTime
Timestamp const & beginTime() const noexcept
Definition:
SubRunAuxiliary.cc:121
endl
QTextStream & endl(QTextStream &s)
Definition:
qtextstream.cpp:2030
art::Hash< ProcessHistoryType >
art::RunNumber_t
IDNumber_t< Level::Run > RunNumber_t
Definition:
IDNumber.h:120
Generated by
1.8.11