40 friend inline bool operator<(
const entry_type&
first,
const entry_type& second)
42 return first.evt.mc_event_time.AsDouble() > second.evt.mc_event_time.AsDouble();
57 int main(
int argc,
char **argv)
70 JParser<> zap(
"Auxiliary program for time sorting of Monte-Carlo events.");
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());
190 for (
size_t i = 0; i !=
N; ++i) {
Utility class to parse command line options.
int main(int argc, char *argv[])
ROOT TTree parameter settings of various packages.
bool operator<(const Head &first, const Head &second)
Less than operator.
Recording of objects on file according a format that follows from the file name extension.
Long64_t counter_type
Type definition for counter.
then echo The file $DIR KM3NeT_00000001_00000000 root already please rename or remove it first
Scanning of objects from a single file according a format that follows from the extension of each fil...
#define make_field(A,...)
macro to convert parameter to JParserTemplateElement object
General purpose messaging.
Scanning of objects from multiple files according a format that follows from the extension of each fi...
then usage $script< input file >[option[primary[working directory]]] nWhere option can be N
Utility class to parse command line options.
Object reading from a list of files.
then fatal Wrong number of arguments fi set_variable DETECTOR $argv[1] set_variable INPUT_FILE $argv[2] eval JPrintDetector a $DETECTOR O IDENTIFIER eval JPrintDetector a $DETECTOR O SUMMARY JAcoustics sh $DETECTOR_ID source JAcousticsToolkit sh CHECK_EXIT_CODE typeset A EMITTERS get_tripods $WORKDIR tripod txt EMITTERS get_transmitters $WORKDIR transmitter txt EMITTERS for EMITTER in
The Evt class respresent a Monte Carlo (MC) event as well as an offline event.
#define DEBUG(A)
Message macros.