-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmain.cc
78 lines (62 loc) · 1.79 KB
/
main.cc
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
65
66
67
68
69
70
71
72
73
74
75
76
77
#include <iostream>
#include <vector>
#include <fstream>
#include <string>
#include <algorithm>
#include <stdio.h>
#include <TString.h>
#include <TSystem.h>
#include <TFile.h>
#include <TTree.h>
#include <TMinuit.h>
#include "AnaInput.h"
#include "HcalAna.h"
#include "getopt.h"
using namespace std;
int main(int argc, char* argv[])
{
bool runAll = false;
string datacardfile = "DataCard.txt";
int opt = 0;
while((opt = getopt(argc, argv, "bd:")) != -1)
{
switch(opt)
{
case 'b':
runAll = true;
break;
case 'd':
datacardfile = optarg;
break;
}
}
//cout << "runALL: " << runAll << endl << "datacard: " << datacardfile << endl;
//string datacardfile = (argc > 1) ? argv[1] : "DataCard.txt";
AnaInput *Input = new AnaInput(datacardfile);
int module = -1;
Input->GetParameters("Module", &module);
cout << " Run module " << module << endl;
if(runAll)
{
for(int u = 1; u <=5; u++)
{
for(int y = 0; y <=5; y++)
{
for(int t = 0; t <=5; t++)
{
HcalAna *hAna = new HcalAna(datacardfile, u, y, t);
if((module == 1) || (module == 3)) hAna->Analysis();
if((module == 2) || (module == 3)) hAna->DrawHistogram(); //probably going to want to change this back to one
delete hAna;
}
}
}
} else
{
HcalAna *hAna = new HcalAna(datacardfile);
if((module == 1) || (module == 3)) hAna->Analysis();
if((module == 2) || (module == 3)) hAna->DrawHistogram(); //probably going to want to change this back to one
delete hAna;
}
return 0;
}