30 static const char WILDCARD =
'%';
38 struct JCopyInterface {
42 virtual ~JCopyInterface()
86 STATUS(T::Class_Name() << endl);
88 NOTICE(
"Time range " << range << endl);
90 for ( ; i !=
in.end() && i->getTimesliceStart().getTimeNanoSecond() < range.
getLowerLimit().getTimeNanoSecond(); ++i) {
91 STATUS(
"skip " <<
FIXED(20,1) << i->getTimesliceStart().getTimeNanoSecond() <<
'\r');
DEBUG(endl);
95 for ( ; i !=
in.end() && i->getTimesliceStart().getTimeNanoSecond() <= range.
getUpperLimit().getTimeNanoSecond(); ++i) {
97 STATUS(
"copy " <<
FIXED(20,1) << i->getTimesliceStart().getTimeNanoSecond() <<
'\r');
DEBUG(endl);
115 template<
class JTypelist_t>
117 public std::vector< JSinglePointer<JCopyInterface> >,
140 for (
iterator i = this->begin(); i != this->end(); ++i) {
155 template<
class JHead_t,
class JTail_t>
169 void add(
JType<T> type,
const std::string& input_file)
171 if (selection(type)) {
175 push_back(
new JCopy<T>(input_file, *
this));
191 template<
class JTypelist_t>
203 int main(
int argc,
char **argv)
210 std::string inputFile;
212 size_t numberOfFiles;
219 JParser<> zap(
"Auxiliary program to split data.");
226 "Precede name of data structure by a '+' or '-' "
227 "to add or remove data types in the output, respectively."
233 catch(
const exception& error) {
234 FATAL(error.what() << endl);
238 if (numberOfFiles == 0 && ranges.empty()) {
239 FATAL(
"Invalid splitting " << numberOfFiles <<
'/' << ranges.size() << endl);
244 if (pos == string::npos) {
245 FATAL(
"Output file name " <<
outputFile <<
" does not contain wild card '" << WILDCARD <<
"'" << endl);
248 const JDAQUTCTimeRange total = getUTCTimeRange<JDAQSummaryslice>(inputFile);
250 if (!total.is_valid()) {
251 FATAL(
"No (valid) summary data in input file " << inputFile <<
' ' << total << endl);
254 NOTICE(
"Total time range " << total << endl);
256 if (ranges.empty()) {
258 const double length = (total.getUpperLimit().getTimeNanoSecond() -
259 total.getLowerLimit().getTimeNanoSecond()) / numberOfFiles;
261 for (
double t1 = total.getLowerLimit().getTimeNanoSecond(); t1 < total.getUpperLimit().getTimeNanoSecond(); t1 += length) {
269 JCopyMaster<JDAQTypes_t>
master(inputFile, selection);
271 const int width = (int) (log10(ranges.size() + 1) + 1);
273 for (
size_t i = 0; i != ranges.size(); ++i) {
277 STATUS(
"Writing " << file_name << endl);
279 master.open(file_name.c_str());
283 master.copy(ranges[i]);
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.
Auxiliary class for ROOT class selection.
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.
Auxiliary data structure for floating point format specification.
Data structure for UTC time.
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.
JTOOLS::JRange< JDAQUTCExtended > JDAQUTCTimeRange
Type definition for DAQ UTC time range.
Auxiliary data structure for sequence of same character.
z range($ZMAX-$ZMIN)< $MINIMAL_DZ." fi fi typeset -Z 4 STRING typeset -Z 2 FLOOR JPlot1D -f $
Utility class to parse command line options.
void copy(const Head &from, JHead &to)
Copy header from from to to.
Template interface of object output for single data type.
virtual bool put(const T &object)=0
Object output.
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 source JAcoustics sh $DETECTOR_ID CHECK_EXIT_CODE typeset A TRIPODS get_tripods $WORKDIR tripod txt TRIPODS for EMITTER in
JTriggerParameters getTriggerParameters(const JMultipleFileScanner_t &file_list)
Get trigger parameters.
#define DEBUG(A)
Message macros.