42{
45
47
50
51 char wildcard;
52
54
55 try {
56
58
63
64 zap(argc, argv);
65 }
66 catch(const exception& error) {
67 FATAL(error.what() << endl);
68 }
69
70
71 TTree::SetMaxTreeSize(1000000000000LL);
72
74
75 if (pos == string::npos) {
76 FATAL(
"Valid wildcard must be specified (<" <<
outputFile <<
"> does not contain \'" << wildcard <<
"\').");
77 }
78
79
80
81
83
84
85
86
87 const size_t Ndigits =
to_string(scanners.size()).size();
88
90
91 const size_t Nfile =
distance(scanners.begin(), scanner);
92
93 const string filename = string(
outputFile).replace(pos, 1,
MAKE_STRING(setfill(
'0') << setw(Ndigits) << Nfile));
94
95 NOTICE(
"Writing " << filename <<
"..." << endl);
96
97 if (scanner->getFilelist().size() == 1 &&
98 symlink(scanner->getFilename().c_str(), filename.c_str()) == 0) {
99 continue;
100 }
101
103
104 out.open();
105
107
108 out.put(head);
109
110 out.put(
JMeta(argc, argv));
111
112 while (scanner->hasNext()) {
113
114 const Evt*
event = scanner->next();
115
116 if (event != NULL) {
117
118 STATUS(
"Event:" <<
RIGHT(10) << scanner->getCounter() <<
'\r');
DEBUG(endl);
119 out.put(*event);
120
121 } else {
122
123 WARNING(
"Event " << scanner->getCounter() <<
" is empty; skip.");
124 }
125 }
126
128
129 io >> out;
130
131 out.close();
132 }
133
134 return 0;
135}
#define DEBUG(A)
Message macros.
#define make_field(A,...)
macro to convert parameter to JParserTemplateElement object
#define MAKE_STRING(A)
Make string.
std::vector< T >::difference_type distance(typename std::vector< T >::const_iterator first, typename PhysicsEvent::const_iterator< T > second)
Specialisation of STL distance.
Data structure for set of track fit results.
Utility class to parse command line options.
General purpose class for object reading from a list of file names.
std::string to_string(const T &value)
Convert value to string.
This name space includes all other name spaces (except KM3NETDAQ, KM3NET and ANTARES).
Head getHeader(const JMultipleFileScanner_t &file_list)
Get Monte Carlo header.
The Evt class respresent a Monte Carlo (MC) event as well as an offline event.
The Head class reflects the header of Monte-Carlo event files, which consists of keys (also referred ...
Auxiliary class for recursive type list generation.
Auxiliary class for organising Monte Carlo file scanners associated with event weighters.
std::vector< filescanner_type >::iterator iterator
Auxiliary base class for list of file names.