58{
61
63
67
68 try {
69
70 JParser<> zap(
"Auxiliary program for time sorting of Monte-Carlo events.");
71
72 zap[
'f'] =
make_field(inputFile,
"Input file (produced with JEvtSplit)");
75
77 }
78 catch(const exception& error) {
80 }
81
82
84
86
87 const size_t N = inputFile.size();
88
90
91
93
95
96 for (size_t i = 0; i != N; ++i) {
97
98 in[i].configure(inputFile[i]);
99
100 STATUS(
"Processing " << inputFile[i] <<
endl);
101 }
102
103#ifdef PRIORITY_QUEUE
104
106
107 for (size_t i = 0; i != N; ++i) {
108
109 if (in[i].hasNext()) {
110
111 buffer.push({i, *in[i].next()});
112
114 }
115 }
116
118
120
121 const entry_type&
top = buffer.top();
122
124
125 if (in[
top.index].hasNext()) {
126
127 buffer.push({
top.index, *in[
top.index].next()});
128
130 }
131
132 buffer.pop();
133 }
134
135 while (!buffer.empty()) {
136
137 const entry_type&
top = buffer.top();
138
140
141 buffer.pop();
142 }
143
144#else
145
147
148 for (size_t i = 0; i != N; ++i) {
149
150 if (in[i].hasNext()) {
151
152 buffer.push_back({i, *in[i].next()});
153
155 }
156 }
157
159
161
163
164 const size_t index = buffer[0].index;
165
167
168 pop_heap(buffer.begin(), buffer.end());
169
170 buffer.pop_back();
171
172 if (in[index].hasNext()) {
173
174 buffer.push_back({index, *in[index].next()});
175
177
179 }
180 }
181
183
186 }
187#endif
189
190 int counter = 0;
191
194
195 for (size_t i = 0; i != N; ++i) {
196
197 try {
198
201
202 if (counter == 0) {
203
206
207 } else {
208
211 }
212
213 counter += 1;
214
215 h0 = h1;
217 }
218 catch (const exception&) {}
219 }
220
221 if (counter == 0) {
223 }
224
225 for (size_t i = 0; i != N; ++i) {
226
228
230 }
231
233
234 return 0;
235}
#define DEBUG(A)
Message macros.
#define make_field(A,...)
macro to convert parameter to JParserTemplateElement object
Template definition of a multi-dimensional oscillation probability interpolation table.
This name space includes all other name spaces (except KM3NETDAQ, KM3NET and ANTARES).
JMultiHead getMultiHeader(const JMultipleFileScanner_t &file_list)
Get multi-header corresponding to a given file list.
Head getHeader(const JMultipleFileScanner_t &file_list)
Get Monte Carlo header.
The Head class reflects the header of Monte-Carlo event files, which consists of keys (also referred ...