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

Auxiliary program to modify tripod configuration. More...

#include <iostream>
#include <iomanip>
#include <vector>
#include "JDetector/JTripod.hh"
#include "JSupport/JMeta.hh"
#include "Jeep/JContainer.hh"
#include "Jeep/JPrint.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

Auxiliary program to modify tripod configuration.

Syntax:

    -T "<tripod identifier>     (set|add|sub) east north z"
Author
mdejong

Definition in file JEditTripod.cc.

Function Documentation

int main ( int  argc,
char **  argv 
)

Definition at line 103 of file JEditTripod.cc.

104 {
105  using namespace std;
106  using namespace JPP;
107 
108  typedef JContainer< vector<JTripod> > container_type;
109 
110  string file_name;
111  vector<JModifier> mod;
112  int debug;
113 
114  try {
115 
116  JParser<> zap("Auxiliary program to modify tripod configuration.");
117 
118  zap['f'] = make_field(file_name, "tripod file");
119  zap['T'] = make_field(mod, "tripod modifier") = JPARSER::initialised();
120  zap['d'] = make_field(debug) = 1;
121 
122  zap(argc, argv);
123  }
124  catch(const exception &error) {
125  FATAL(error.what() << endl);
126  }
127 
128  container_type data;
129 
130  data.load(file_name.c_str());
131 
132  data.comment.add(JMeta(argc, argv));
133 
134  for (vector<JModifier>::const_iterator i = mod.begin(); i != mod.end(); ++i) {
135 
136  for (container_type::iterator target = data.begin(); target != data.end(); ++target) {
137 
138  if (target->getID() == i->id || i->id == WILDCARD) {
139 
140  DEBUG("Modifier" << ' '
141  << "(" << FILL(2,'0') << target->getID() << FILL() << ")" << ' '
142  << "action" << ' ' << i->pos << endl);
143 
144  if (!i->apply(*target)) {
145  ERROR("No valid action: " << *i << endl);
146  }
147  }
148  }
149  }
150 
151  data.store(file_name.c_str());
152 }
Auxiliary class for ROOT I/O of application specific meta data.
Definition: JMeta.hh:70
Utility class to parse command line options.
Definition: JParser.hh:1500
Target.
Definition: JHead.hh:268
Empty structure for specification of parser element that is initialised (i.e. does not require input)...
Definition: JParser.hh:66
Auxiliary wrapper for I/O of container with optional comment (see JComment).
Definition: JContainer.hh:39
#define make_field(A,...)
macro to convert parameter to JParserTemplateElement object
Definition: JParser.hh:1961
#define ERROR(A)
Definition: JMessage.hh:66
int debug
debug level
Definition: JSirene.cc:63
Auxiliary data structure for sequence of same character.
Definition: JManip.hh:328
#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