Jpp test-rotations-new
the software that should make you happy
Loading...
Searching...
No Matches
JScale.cc File Reference

Example program to test JEEP::JScale_t enumeration. More...

#include <string>
#include <iostream>
#include <iomanip>
#include "Jeep/JScale.hh"
#include "Jeep/JParser.hh"
#include "Jeep/JMessage.hh"

Go to the source code of this file.

Macros

#define PRINT(out, scale)
 

Functions

int main (int argc, char *argv[])
 

Detailed Description

Example program to test JEEP::JScale_t enumeration.

Author
mdejong

Definition in file JScale.cc.

Macro Definition Documentation

◆ PRINT

#define PRINT ( out,
scale )
Value:
{\
out << setw(8) << left << #scale << ' ' \
<< scientific << setprecision(0) << getValue(scale) << ' ' \
<< getUnit(scale) \
<< endl; \
}
void scale(vector< double > &v, double c)
scale vector content

Definition at line 13 of file JScale.cc.

13#define PRINT(out, scale) {\
14 out << setw(8) << left << #scale << ' ' \
15 << scientific << setprecision(0) << getValue(scale) << ' ' \
16 << getUnit(scale) \
17 << endl; \
18 }

Function Documentation

◆ main()

int main ( int argc,
char * argv[] )

Definition at line 26 of file JScale.cc.

27{
28 using namespace std;
29
30 char unit;
31 int debug;
32
33 try {
34
35 JParser<> zap;
36
37 zap['U'] = make_field(unit) = ' ';
38 zap['d'] = make_field(debug) = 1;
39
40 zap(argc, argv);
41 }
42 catch(const exception &error) {
43 FATAL(error.what() << endl);
44 }
45
46
47 using namespace JPP;
48
49 cout << "unit [" << unit << "] " << scientific << setprecision(0) << getValue(getScale(unit)) << endl;
50
51 PRINT(cout, femto_t);
52 PRINT(cout, pico_t);
53 PRINT(cout, nano_t);
54 PRINT(cout, micro_t);
55 PRINT(cout, milli_t);
56 PRINT(cout, unit_t);
57 PRINT(cout, kilo_t);
58 PRINT(cout, mega_t);
59 PRINT(cout, tera_t);
60 PRINT(cout, peta_t);
61 PRINT(cout, exa_t);
62}
#define FATAL(A)
Definition JMessage.hh:67
int debug
debug level
Definition JSirene.cc:72
#define make_field(A,...)
macro to convert parameter to JParserTemplateElement object
Definition JParser.hh:2142
#define PRINT(out, scale)
Definition JScale.cc:13
Utility class to parse command line options.
Definition JParser.hh:1698
JScale_t getScale(const char unit)
Get scale corresponding to textual unit.
Definition JScale.hh:111
double getValue(const JScale_t scale)
Get numerical value corresponding to scale.
Definition JScale.hh:47
This name space includes all other name spaces (except KM3NETDAQ, KM3NET and ANTARES).