ROOT logo
#include <map>
#include <fstream>
#include <iostream>
#include <string>
#include <cctype>
#include <iomanip>

bool GCToBerg()
{
  bool debug = false;

  std::ifstream in("bergToGC.dat");
  if (!in)
    {
      std::cerr << "Could not open bergToGC.dat" << std::endl;
      return false;
    }
  std::map<int,int> gctoberg;

  int berg;
  std::string manu;;
  while ( in >> berg >> manu )
    {
      if (debug) std::cout << berg << " -> " << manu;
      if ( std::isdigit(manu[0]) )
	{
	  int imanu = std::atoi(manu.c_str());
	  if ( debug ) std::cout << " = " << imanu;
	  gctoberg[imanu] = berg;
	}
      if ( debug ) std::cout << std::endl;
    }

  in.close();

  std::map<int,int>::const_iterator it;

  for ( it = gctoberg.begin(); it != gctoberg.end(); ++it )
    {
      std::cout << std::setw(2) << it->first 
		<< std::setw(4) << it->second
		<< std::endl;
    }
  return true;
}
 GCToBerg.C:1
 GCToBerg.C:2
 GCToBerg.C:3
 GCToBerg.C:4
 GCToBerg.C:5
 GCToBerg.C:6
 GCToBerg.C:7
 GCToBerg.C:8
 GCToBerg.C:9
 GCToBerg.C:10
 GCToBerg.C:11
 GCToBerg.C:12
 GCToBerg.C:13
 GCToBerg.C:14
 GCToBerg.C:15
 GCToBerg.C:16
 GCToBerg.C:17
 GCToBerg.C:18
 GCToBerg.C:19
 GCToBerg.C:20
 GCToBerg.C:21
 GCToBerg.C:22
 GCToBerg.C:23
 GCToBerg.C:24
 GCToBerg.C:25
 GCToBerg.C:26
 GCToBerg.C:27
 GCToBerg.C:28
 GCToBerg.C:29
 GCToBerg.C:30
 GCToBerg.C:31
 GCToBerg.C:32
 GCToBerg.C:33
 GCToBerg.C:34
 GCToBerg.C:35
 GCToBerg.C:36
 GCToBerg.C:37
 GCToBerg.C:38
 GCToBerg.C:39
 GCToBerg.C:40
 GCToBerg.C:41
 GCToBerg.C:42
 GCToBerg.C:43
 GCToBerg.C:44
 GCToBerg.C:45
 GCToBerg.C:46