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