Jpp  pmt_effective_area_update_2
the software that should make you happy
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
Functions
JGroup.cc File Reference

Example program to test JLANG::JGroup class. More...

#include <string>
#include <iostream>
#include <iomanip>
#include "JLang/JGroup.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

Example program to test JLANG::JGroup class.

Author
mdejong

Definition in file JGroup.cc.

Function Documentation

int main ( int  argc,
char **  argv 
)

Definition at line 33 of file JGroup.cc.

34 {
35  using namespace std;
36  using namespace JPP;
37 
38  int debug;
39 
40  try {
41 
42  JParser<> zap("Example program to test groups.");
43 
44  zap['d'] = make_field(debug) = 3;
45 
46  zap(argc, argv);
47  }
48  catch(const exception &error) {
49  FATAL(error.what() << endl);
50  }
51 
52  DEBUG("Size of group " << JGroup<double>::size << endl);
53 
54  const int N = 4;
55 
56  for (int i = 0; i != N; ++i) {
57  DEBUG(i << ' ' << getElement(i) << endl);
58  }
59 
60  ASSERT(JGroup<double>::size == N, "Test size of group.");
61 
62  for (int i = 0; i != N; ++i) {
63  ASSERT(getElement(i) == (double) i, "Test element access.");
64  }
65 
66  return 0;
67 }
Utility class to parse command line options.
Definition: JParser.hh:1500
#define ASSERT(A,...)
Assert macro.
Definition: JMessage.hh:90
#define make_field(A,...)
macro to convert parameter to JParserTemplateElement object
Definition: JParser.hh:1961
int debug
debug level
Definition: JSirene.cc:63
#define FATAL(A)
Definition: JMessage.hh:67
then usage $script< input_file >< detector_file > fi set_variable OUTPUT_DIR set_variable SELECTOR JDAQTimesliceL1 set_variable DEBUG case set_variable DEBUG
then usage $script[input file[working directory[option]]] nWhere option can be N
Definition: JMuonPostfit.sh:36