40 inline bool operator()(
const Evt&
first,
const Evt& second)
const
54 int main(
int argc,
char **argv)
70 JParser<> zap(
"Auxiliary program for time sorting of Monte-Carlo events.");
77 zap[
'O'] =
make_field(option,
"Write [multi] header to each output file");
82 catch(
const exception& error) {
83 FATAL(error.what() << endl);
87 if (numberOfFiles == 0) {
99 counter_type ns = (number_of_events + numberOfFiles - 1) / numberOfFiles;
104 for (
size_t i = 0;
i != numberOfFiles; ++
i, ni +=
ns) {
106 const JLimit limit(ni, min(ni +
ns, number_of_events));
110 STATUS(
"Processing " << filename <<
' ' << limit <<
"." << flush);
114 for (in.setLimit(limit); in.hasNext(); ) {
115 buffer.push_back(*in.next());
120 sort(buffer.begin(), buffer.end(),
JCompare_t());
130 out.put(
JMeta(argc, argv));
132 for (
const auto& evt : buffer) {
136 if (
i == 0 || option) {
Utility class to parse command line options.
int main(int argc, char *argv[])
ROOT TTree parameter settings of various packages.
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...
Auxiliary class for defining the range of iterations of objects.
#define make_field(A,...)
macro to convert parameter to JParserTemplateElement object
TTimeStamp mc_event_time
MC: true generation time (UTC) of the event, (default: 01 Jan 1970 00:00:00)
JTreeWriter object output.
General purpose messaging.
std::string setWildCard(const std::string &file_name, const std::string &value)
Get file name by setting wild card to given value.
JTreeWriter< T > & getTreeWriter()
Get TreeWriter.
then fatal The output file must have the wildcard in the e g root fi 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
Utility class to parse command line options.
std::string to_string(const T &value)
Convert value to string.
virtual void open(const char *file_name) override
Open file.
Object reading from a list of files.
static const char FILENAME_WILDCARD
wild card character for file name substitution
The Evt class respresent a Monte Carlo (MC) event as well as an offline event.
bool hasWildCard(const std::string &file_name)
Check presence of wild card.