makeFluxHistogramsL.cc
Go to the documentation of this file.
1 #include <string>
2 #include <iostream>
3 #include "TROOT.h"
4 #include "eventRates.h"
5 
6 int main(int argc, char* argv[]) {
7 
8  std::string user = std::string("beam");
9  std::string version = std::string("v3r0p1");
10  std::string macro = std::string("Nominal");
11  std::string current = std::string("200kA");
12  std::string location = std::string("LBNEFD");
13  std::string physics_list = std::string("QGSP_BERT");
14  int n_files = 250;
15  int start_index = 1;
16  double pot_per_file = 100000.;
17  bool on_grid = false;
18  bool dk2nu=false;
19 
20  char* myFile, myPath, myOutPath;
21 
22  for (int i = 1; i < argc; i++) {
23  std::string tmpStr = std::string(argv[i]);
24  if (tmpStr.find("--user=") == 0) {
25  //01234567
26  user = tmpStr.substr(7);
27  } else if (tmpStr.find("--version=") == 0) {
28  //012345678910123456789
29  version = tmpStr.substr(10);
30  } else if (tmpStr.find("--macro=") == 0) {
31  //012345678910123456789
32  macro = tmpStr.substr(8);
33  } else if (tmpStr.find("--current=") == 0) {
34  //012345678910123456789
35  current = tmpStr.substr(10);
36  } else if (tmpStr.find("--location=") == 0) {
37  //012345678910123456789
38  location = tmpStr.substr(11);
39  std::cout<<"location is "<<location<<std::endl;
40  } else if (tmpStr.find("--physics_list=") == 0) {
41  //012345678910123456789
42  physics_list = tmpStr.substr(15);
43  std::cout<<"Physics list is "<<physics_list<<std::endl;
44  } else if (tmpStr.find("--n_files=") == 0) {
45  //012345678910123456789
46  n_files = atoi((tmpStr.substr(10)).c_str());
47  } else if (tmpStr.find("--start_index=") == 0) {
48  //012345678910123456789
49  start_index = atoi((tmpStr.substr(14)).c_str());
50  } else if (tmpStr.find("--pot_per_file=") == 0) {
51  //012345678910123456789
52  pot_per_file = atof((tmpStr.substr(15)).c_str());
53  std::cout<<"pot_per_file "<<pot_per_file<<std::endl;
54  } else if (tmpStr.find("--on_grid=") == 0) {
55  //012345678910123456789
56  std::string log_on_grid = tmpStr.substr(10);
57  if ((log_on_grid == std::string("false")) || (log_on_grid == std::string("False"))) on_grid=false;
58  if ((log_on_grid == std::string("true")) || (log_on_grid == std::string("True"))) on_grid=true;
59  } else if (tmpStr.find("--dk2nu=") == 0) {
60  //012345678910123456789
61  std::string log_dk2nu = tmpStr.substr(8);
62  if ((log_dk2nu == std::string("false")) || (log_dk2nu == std::string("False"))) dk2nu=false;
63  if ((log_dk2nu == std::string("true")) || (log_dk2nu == std::string("True"))) dk2nu=true;
64  } else {
65  std::cout << " Unrecognized argument .\n" << tmpStr << " Fatal, exit here! \n " << std::endl;
66  exit(2);
67  }
68  }
69  std::string G4LBNEWORKDIR = getenv("G4LBNEWORKDIR");
70  std::string DK2NU = getenv("DK2NU");
71 
72  eventRates t(user, version, macro, current, location, physics_list, n_files, start_index, pot_per_file, on_grid, dk2nu);
73 
74  std::cout << " Event Rate class loaded.. " << std::endl;
75  std::cout << " Arguments are " << std::endl;
76  std::cout << " user = " << user << std::endl;
77  std::cout << " version = " << version << std::endl;
78  std::cout << " macro = " << macro << std::endl;
79  std::cout << " current = " << current << std::endl;
80  std::cout << " location = " << location << std::endl;
81  std::cout << " physics_list = " << physics_list << std::endl;
82  std::cout << " n_files " << n_files << std::endl;
83  std::cout << " start_index " << start_index << std::endl;
84  std::cout << " pot_per_file " << pot_per_file << std::endl;
85  if (on_grid) std::cout << " We are on the grid .. " << std::endl;
86  else std::cout << " We are NOT on the grid .. " << std::endl;
87  if (dk2nu) std::cout << " We are using Dk2nu .. " << std::endl;
88  else std::cout << " We are using the old NuMI style Ntuple .. " << std::endl;
89 
90  t.Loop();
91 
92 }
std::string string
Definition: nybbler.cc:12
string physics_list
Definition: makeScanPlots.py:5
virtual void Loop()
Definition: eventRatesL.cc:29
std::string getenv(std::string const &name)
Definition: getenv.cc:15
string on_grid
Definition: submit_flux.py:344
static Entry * current
int main(int argc, char *argv[])
QTextStream & endl(QTextStream &s)