29 static const char WILDCARD =
'%';
37 struct JCopyInterface {
41 virtual ~JCopyInterface()
84 STATUS(T::Class_Name() << endl);
86 for ( ; i !=
in.end() && i->getFrameIndex() < range.
getLowerLimit(); ++i) {
87 STATUS(
"skip " << setw(9) << i->getFrameIndex() <<
'\r');
DEBUG(endl);
91 for ( ; i !=
in.end() && i->getFrameIndex() <= range.
getUpperLimit(); ++i) {
93 STATUS(
"copy " << setw(9) << i->getFrameIndex() <<
'\r');
DEBUG(endl);
111 template<
class JTypelist_t>
113 public std::vector< JSinglePointer<JCopyInterface> >,
118 JCopyMaster(
const std::string& input_file)
131 for (
iterator i = this->begin(); i != this->end(); ++i) {
145 template<
class JHead_t,
class JTail_t>
159 void add(
JType<T> type,
const std::string& input_file)
163 push_back(
new JCopy<T>(input_file, *
this));
178 template<
class JTypelist_t>
190 int main(
int argc,
char **argv)
197 std::string inputFile;
199 size_t numberOfFiles;
205 JParser<> zap(
"Auxiliary program to split data.");
215 catch(
const exception& error) {
216 FATAL(error.what() << endl);
220 if (numberOfFiles == 0 && ranges.empty()) {
221 FATAL(
"Invalid splitting " << numberOfFiles <<
'/' << ranges.size() << endl);
226 if (pos == string::npos) {
227 FATAL(
"Output file name " <<
outputFile <<
" does not contain wild card '" << WILDCARD <<
"'" << endl);
230 const JFrameIndexRange total = getFrameIndexRange<JDAQSummaryslice>(inputFile);
232 DEBUG(
"Total frame index range " << total << endl);
234 if (total.getLength() == 0) {
235 FATAL(
"No summary data in input file " << inputFile << endl);
239 if (ranges.empty()) {
241 int length = total.getLength() / numberOfFiles;
248 total.getLowerLimit() + length);
250 range.
add(length + 1)) {
251 ranges.push_back(range);
258 JCopyMaster<JDAQTypes_t>
master(inputFile);
260 for (ranges_type::const_iterator range = ranges.begin(); range != ranges.end(); ++range) {
267 STATUS(
"Writing " << file_name << endl);
269 master.open(file_name.c_str());
Utility class to parse command line options.
ROOT TTree parameter settings.
Recording of objects on file according a format that follows from the file name extension.
esac print_variable DETECTOR INPUT_FILE OUTPUT_FILE CDF for TYPE in
then echo Test string reversed by master(hit< return > to continue)." JProcess -c "JEcho" -rC fi if (( 1 ))
Empty structure for specification of parser element that is initialised (i.e. does not require input)...
Auxiliary class for a type holder.
Template definition for direct access of elements in ROOT TChain.
#define MAKE_STRING(A)
Make string.
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.
Utility class to parse command line options.
void copy(const Head &from, JHead &to)
Copy header from from to to.
Forward declarations for definitions of I/O redirect and pipe operators.
virtual bool put(const T &object)=0
Object output.
JTriggerParameters getTriggerParameters(const JMultipleFileScanner_t &file_list)
Get trigger parameters.
#define DEBUG(A)
Message macros.
int main(int argc, char *argv[])