12 #include "TTimeStamp.h" 
   39     JKey_t(
const int          string,
 
   41            const std::string& parameter) :
 
   55     friend inline bool operator<(
const JKey_t& first, 
const JKey_t& second)
 
   57       if (first.string == second.string) {
 
   59         if (first.floor == second.floor)
 
   60           return first.parameter < second.parameter;
 
   62           return first.floor     < second.floor;
 
   66         return first.string < second.string;
 
   76     std::string toString()
 const 
   78       std::ostringstream os;
 
   93     friend inline std::ostream& 
operator<<(std::ostream& out, 
const JKey_t& 
object)
 
   97       return out << setw(3) << setfill(
'0') << 
object.string << 
'.' 
   98                  << setw(2) << setfill(
'0') << 
object.floor  << 
'.' 
   99                  << setfill(
' ') << 
object.parameter;
 
  104     std::string parameter;
 
  115 int main(
int argc, 
char **argv)
 
  120   JMultipleFileScanner<JDatalog> inputFile;
 
  128     JParser<> zap(
"Auxiliary program to convert ROOT TTree with slow control data to ROOT TGraph's.");
 
  130     zap[
'f'] = 
make_field(inputFile,  
"ROOT input file (output file of JTuna).");
 
  131     zap[
'n'] = 
make_field(numberOfEvents)        = JLimit::max();
 
  138   catch(
const exception &error) {
 
  139     FATAL(error.what() << endl);
 
  145     void put(
const Double_t x, 
const Double_t y)
 
  161   long long int counter = 0;
 
  163   for (inputFile.rewind(); inputFile.hasNext(); ++counter) {
 
  167     JDatalog* p  = inputFile.next();
 
  169     if (filter.count(p->parameter) == 0) {
 
  171       JGraph_t& 
g1 = data[JKey_t(p->string, p->floor, p->parameter)];
 
  173       g1.put(p->getTime(), p->value);
 
  175       strings.insert(p->string);
 
  176       floors .insert(p->floor);
 
  186     TGraph 
g1(i->second.X.size(), i->second.X.data(), i->second.Y.data());
 
  188     g1.SetName(i->first.toString().c_str());
 
  190     const JRange<double> range(i->second.Y.begin(), i->second.Y.end());
 
  192     g1.SetMinimum(range.getLowerLimit());
 
  193     g1.SetMaximum(range.getUpperLimit());
 
  200   os << 
"set_variable NUMBER_OF_STRINGS " << setw(4) <<  strings.size()   << 
";" << endl;
 
  201   os << 
"set_variable NUMBER_OF_FLOORS  " << setw(4) <<  floors. size()   << 
";" << endl;
 
  202   if (!strings.empty()) {
 
  203     os << 
"set_variable FIRST_STRING      " << setw(4) << *strings. begin() << 
";" << endl;
 
  204     os << 
"set_variable LAST_STRING       " << setw(4) << *strings.rbegin() << 
";" << endl;
 
  206   if (!floors.empty()) {
 
  207     os << 
"set_variable FIRST_FLOOR       " << setw(4) << *floors.  begin() << 
";" << endl;
 
  208     os << 
"set_variable LAST_FLOOR        " << setw(4) << *floors. rbegin() << 
";" << endl;
 
  210   os << 
"set_array    STRINGS           ";
 
  211   copy(strings.begin(), strings.end(), ostream_iterator<int>(os, 
" "));
 
  214   TNamed meta(
"TUNA", os.str().c_str());