Jpp 20.0.0-195-g190c9e876
the software that should make you happy
Loading...
Searching...
No Matches
putMechanics.cc File Reference

Application to add mechanical model data to ROOT file. More...

#include <string>
#include <iostream>
#include <iomanip>
#include "TROOT.h"
#include "TFile.h"
#include "JSupport/JMeta.hh"
#include "JSupport/JMultipleFileScanner.hh"
#include "JSupport/JFileRecorder.hh"
#include "JAcoustics/JMechanics.hh"
#include "JAcoustics/JEvt.hh"
#include "JAcoustics/JSupport.hh"
#include "Jeep/JParser.hh"
#include "Jeep/JMessage.hh"

Go to the source code of this file.

Functions

int main (int argc, char **argv)
 

Detailed Description

Application to add mechanical model data to ROOT file.

Author
mdejong

Definition in file putMechanics.cc.

Function Documentation

◆ main()

int main ( int argc,
char ** argv )

Definition at line 26 of file putMechanics.cc.

27{
28 using namespace std;
29 using namespace JPP;
30
31
33 JLimit_t& numberOfEvents = inputFile.getLimit();
35 JDetectorMechanics mechanics; // mechanical model data
36 bool squash;
37 int debug;
38
39 try {
40
41 JParser<> zap("Application to add mechanical model data to ROOT file.");
42
43 zap['f'] = make_field(inputFile, "output of JKatoomba[.sh]");
44 zap['o'] = make_field(outputFile);
45 zap['n'] = make_field(numberOfEvents) = JLimit::max();
46 zap['M'] = make_field(mechanics, "mechanics data") = JPARSER::initialised();
47 zap['q'] = make_field(squash, "squash meta data");
48 zap['d'] = make_field(debug) = 1;
49
50 zap(argc, argv);
51 }
52 catch(const exception &error) {
53 FATAL(error.what() << endl);
54 }
55
56
57 outputFile.open();
58
59 outputFile.put(JMeta(argc, argv));
60 outputFile.put(mechanics);
61
62 inputFile >> outputFile;
63
64 if (!squash) {
65
66 JMultipleFileScanner<JMeta> io(inputFile);
67
68 io >> outputFile;
69 }
70
71 outputFile.close();
72}
string outputFile
#define FATAL(A)
Definition JMessage.hh:67
int debug
debug level
Definition JSirene.cc:74
#define make_field(A,...)
macro to convert parameter to JParserTemplateElement object
Definition JParser.hh:2142
Utility class to parse command line options.
Definition JParser.hh:1698
Object writing to file.
General purpose class for object reading from a list of file names.
This name space includes all other name spaces (except KM3NETDAQ, KM3NET and ANTARES).
Auxiliary data structure for mechanical model parameters with commented data.
Definition JMechanics.hh:38
Empty structure for specification of parser element that is initialised (i.e. does not require input)...
Definition JParser.hh:68
Auxiliary class for defining the range of iterations of objects.
Definition JLimit.hh:45
static counter_type max()
Get maximum counter value.
Definition JLimit.hh:128
Auxiliary class for ROOT I/O of application specific meta data.
Definition JMeta.hh:72