cm.cpp 1.29 KB
Newer Older
David Trudgian's avatar
David Trudgian committed
1 2 3
#include <iostream>
#include <fstream>
#include <cstdlib>
4
//#include <omp.h>
David Trudgian's avatar
David Trudgian committed
5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20
#include <getopt.h>

#include "mctr.h"

using namespace std;

int main(int argc, char* argv[])
{
  if(argc<2)
    {
      cout<<"Wrong use of cm: ./cm <full path to main run directory>"<<endl;
      exit(1);
    }

  string full_path = argv[1];
  char c;
Raquel Bromberg's avatar
Raquel Bromberg committed
21
  bool partial_run=false;
David Trudgian's avatar
David Trudgian committed
22 23 24 25 26 27 28 29 30 31 32 33 34 35
  int fs=-1;
  int fo=-1;

  /*  if(argc<2)
    {
      cout<<"Wrong input to cm.cpp: ./cm -p <full path> -f <filtering steps, =0 for unfiltered (e.g. all) data> -o <filtering option, =0 for unfiltered (e.g. all) data>"<<endl;
      }*/

  cout<<"Values stored in argv:"<<endl;
  for(int i=0; i<argc; i++)
    {
      cout<<argv[i]<<endl;
    }

Raquel Bromberg's avatar
Raquel Bromberg committed
36
  while((c = getopt(argc,argv,"p:o:f:C")) != -1)
David Trudgian's avatar
David Trudgian committed
37 38 39 40 41 42 43 44 45 46 47 48
    {
      switch(c)
	{
	case 'o':
	  fo=atoi(optarg);
	  break;
	  /*	case 'p':
	  full_path = optarg;
	  break;*/
	case 'f':
	  fs=atoi(optarg);
	  break;
Raquel Bromberg's avatar
Raquel Bromberg committed
49 50 51
	case 'C':
	  partial_run=true;
	  break;
David Trudgian's avatar
David Trudgian committed
52 53 54 55 56 57 58 59 60
	default:
	  abort();	  
	}
    }

  //  cout<<"fo="<<fo<<endl;
  //  cout<<"p="<<full_path<<endl;
  //  cout<<"fs="<<fs<<endl;

61
  cout<<"Calling run on real data"<<endl;
Raquel Bromberg's avatar
Raquel Bromberg committed
62
  mctr m(full_path,"",fs,fo,partial_run);
David Trudgian's avatar
David Trudgian committed
63
  m.run_it0();
64 65
  
  cout<<"Calling run on scrambled data"<<endl;
Raquel Bromberg's avatar
Raquel Bromberg committed
66
  mctr mscr(full_path,"scr",fs,fo,partial_run);//scrambled
David Trudgian's avatar
David Trudgian committed
67 68 69 70
  mscr.run_it0();

  return 0;
}