-
Notifications
You must be signed in to change notification settings - Fork 0
/
amplitudes.cc
65 lines (55 loc) · 1.39 KB
/
amplitudes.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
#include <iostream>
#include<iomanip>
#include <fstream>
using namespace std;
#include "amplitudes.h"
#include "numerical.h"
#include "physics.h"
const double mH = PhysConst::mH;
const double mt = PhysConst::mt;
int main()
{
double ds = 0.01;
double olds,news,diff;
double counter;
cerr
<< setw(15) << left << "amplitudes" << "|"
<< setw(15) << left << "trapezoid" << "|"
<< setw(15) << left << "montecarlo" << "|"
<< endl;
amp00 my00;
Integral_TDF myI00_y(my00);
Trapzd<Integral_TDF> myI00(myI00_y,0,1);
news = 0;
counter = 0;
do{
olds = news;
news = myI00.next();
//cerr << news << endl;
} while( abs(news-olds)>0.00001 && (++counter)<20 );
cerr
<< setw(15) << left << "Amplitude_00:" << "|"
<< setw(15) << left << news << "|";
MontecarloTriangle<amp00> MC_a00(my00,100000);
cerr
<< setw(15) << left << MC_a00.integrate() << "|"
<< endl;
amp12 my12;
Integral_TDF myI12_y(my12);
Trapzd<Integral_TDF> myI12(myI12_y,0,1);
news = 0;
counter = 0;
do{
olds = news;
news = myI12.next();
//cerr << news << endl;
} while( abs(news-olds)>0.00001 && (++counter)<20 );
cerr
<< setw(15) << left << "Amplitude_12:" << "|"
<< setw(15) << left << news << "|";
MontecarloTriangle<amp12> MC_a12(my12,100000);
cerr
<< setw(15) << left << MC_a12.integrate() << "|"
<< endl;
return 0;
}