-
Notifications
You must be signed in to change notification settings - Fork 0
/
main.cpp
80 lines (70 loc) · 2.04 KB
/
main.cpp
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
78
79
80
//
// main.cpp
// IXS
//
// Created by Bernhard Mistlberger on 20/10/17.
// Copyright © 2017 Bernhard Mistlberger. All rights reserved.
//
#include "includes/Higgs.h"
#include "includes/RunCard.h"
int main(int argc, const char * argv[]) {
RunCard card;
if(argc>2)
{
cout<<"Usage: ./main (inputfile)"<<endl;
return 0;
}
else if(argc==2)
{
string inputfile = argv[1];
card.ReadCard(inputfile);
}
Higgs xs;
xs.SetMh(card.mh);
xs.SetMuf(card.muf);
xs.SetMur(card.mur);
xs.SetE(card.ECM);
xs.Setmb(card.mb);
xs.SetPDF(card.pdfmember,card.pdfstr);
xs.SetVerbose(0);
xs.SetPrecision(card.MCPrecision);
xs.SetFONNLL(card.FONNLL);
xs.SetMBOS(card.Mb_OS);
cout<<"Running with the parameters: "<<endl;
cout<<card.PrintParameters()<<endl<<endl;
vector<vector<double> > res,err;
xs.IntegrateCrossSection();
xs.ApplyPrefactors(res,err);
stringstream ss;
vector<string> chans={"b ab","b g","b q","b qbar","b b","g g","q qbar","q g"};
for(int j=0;j<chans.size();j++)
for(int i=0;i<4;i++)
ss<<"XS at N^"<<i<<"LO for the channel "<<chans[j]<<" \t= "<<res[j][i]<<" +- "<<err[j][i]<<" pb +- "<<fabs(err[j][i]/res[j][i])*100<<" % "<<endl;
ss<<endl;
vector<double> totxs(4,0);
vector<double> toterr(4,0);
for(int i=0;i<4;i++)
{
for(int j=0;j<chans.size();j++)
{
totxs[i]+=res[j][i];
toterr[i]+=err[j][i]*err[j][i];
}
toterr[i]=sqrt(toterr[i]);
}
for(int i=0;i<4;i++)
ss<<"xs at N"<<i<<"LO \t="<<totxs[i]<<" +- "<<toterr[i]<<" pb +- "<<toterr[i]/totxs[i]*100<<" % "<<endl;
cout<<ss.str()<<endl;
ofstream out;
out.open(card.outputfile);
if(!out.is_open())
{
cout<<"Could not open outputfile"<<card.outputfile<<endl;
return 0;
}
cout<<"Storing output in "<<card.outputfile<<endl;
out<<card.PrintParameters()<<endl<<endl;
out<<ss.str()<<endl;
out.close();
return 0;
}