cm.cpp 937 Bytes
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
#include <iostream>
#include <fstream>
#include <cstdlib>
#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
20
  bool partial_run=false;
David Trudgian's avatar
David Trudgian committed
21
22
23
24
25
26
27
28
29
  int fs=-1;
  int fo=-1;

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

Raquel Bromberg's avatar
Raquel Bromberg committed
30
  while((c = getopt(argc,argv,"p:o:f:C")) != -1)
David Trudgian's avatar
David Trudgian committed
31
32
33
34
35
36
37
38
39
    {
      switch(c)
	{
	case 'o':
	  fo=atoi(optarg);
	  break;
	case 'f':
	  fs=atoi(optarg);
	  break;
Raquel Bromberg's avatar
Raquel Bromberg committed
40
41
42
	case 'C':
	  partial_run=true;
	  break;
David Trudgian's avatar
David Trudgian committed
43
44
45
46
47
	default:
	  abort();	  
	}
    }

48
  cout<<"Calling run on real data"<<endl;
Raquel Bromberg's avatar
Raquel Bromberg committed
49
  mctr m(full_path,"",fs,fo,partial_run);
David Trudgian's avatar
David Trudgian committed
50
  m.run_it0();
51
52
  
  cout<<"Calling run on scrambled data"<<endl;
53
  mctr mscr(full_path,"scr",fs,fo,partial_run);
David Trudgian's avatar
David Trudgian committed
54
55
56
57
  mscr.run_it0();

  return 0;
}