70     JParser<> zap(
"Auxiliary program for time sorting of Monte-Carlo events.");
 
   72     zap[
'f'] = 
make_field(inputFile,  
"Input file (produced with JEvtSplit)");
 
   78   catch(
const exception& error) {
 
   79     FATAL(error.what() << endl);
 
   87   const size_t N = inputFile.size();
 
   96   for (
size_t i = 0; i != N; ++i) {
 
   98     in[i].configure(inputFile[i]);
 
  100     STATUS(
"Processing " << inputFile[i] << endl);
 
  103 #ifdef PRIORITY_QUEUE 
  105   priority_queue<entry_type, deque<entry_type> > buffer;    
 
  107   for (
size_t i = 0; i != N; ++i) {
 
  109     if (in[i].hasNext()) {
 
  111       buffer.push({i, *in[i].next()});
 
  117   while (number_of_events != 0) {                           
 
  119     STATUS(
"event: " << setw(10) << number_of_events << 
'\r'); 
DEBUG(endl);
 
  121     const entry_type& top = buffer.top();
 
  125     if (in[top.index].hasNext()) {
 
  127       buffer.push({top.index, *in[top.index].next()});
 
  135   while (!buffer.empty()) {                                 
 
  137     const entry_type& top = buffer.top();
 
  148   for (
size_t i = 0; i != N; ++i) {
 
  150     if (in[i].hasNext()) {
 
  152       buffer.push_back({i, *in[i].next()});
 
  158   make_heap(buffer.begin(), buffer.end());
 
  160   while (number_of_events != 0) {                           
 
  162     STATUS(
"event: " << setw(10) << number_of_events << 
'\r'); 
DEBUG(endl);
 
  164     const size_t index = buffer[0].index;
 
  168     pop_heap(buffer.begin(), buffer.end());
 
  172     if (in[index].hasNext()) {
 
  174       buffer.push_back({index, *in[index].next()});
 
  176       push_heap(buffer.begin(), buffer.end());      
 
  182   sort_heap(buffer.begin(), buffer.end());                  
 
  195   for (
size_t i = 0; i != N; ++i) {
 
  209         if (h0 != h1) { 
FATAL(
"Inconsistent header "       << endl << h1 << endl << 
"!=" << endl << h0 << endl); }
 
  210         if (m0 != m1) { 
FATAL(
"Inconsistent multi header " << endl << m1 << endl << 
"!=" << endl << m0 << endl); }
 
  218     catch (
const exception&) {}
 
  222     FATAL(
"Missing header." << endl);
 
  225   for (
size_t i = 0; i != N; ++i) {
 
#define DEBUG(A)
Message macros.
 
#define make_field(A,...)
macro to convert parameter to JParserTemplateElement object
 
Utility class to parse command line options.
 
Object reading from a list of files.
 
This name space includes all other name spaces (except KM3NETDAQ, KM3NET and ANTARES).
 
Long64_t counter_type
Type definition for counter.
 
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 ...