cm.cpp 1.14 KB
Newer Older
David Trudgian's avatar
David Trudgian committed
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
#include <iostream>
#include <fstream>
#include <cstdlib>
#include <omp.h>
#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;
  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;
    }

  while((c = getopt(argc,argv,"p:o:f:")) != -1)
    {
      switch(c)
	{
	case 'o':
	  fo=atoi(optarg);
	  break;
	  /*	case 'p':
	  full_path = optarg;
	  break;*/
	case 'f':
	  fs=atoi(optarg);
	  break;
	default:
	  abort();	  
	}
    }

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

  mctr m(full_path,"",fs,fo);
  cout<<"Calling run()"<<endl;
  m.run_it0();
  mctr mscr(full_path,"scr",fs,fo);//scrambled
  mscr.run_it0();

  return 0;
}