file: ../SURF/eventtest.cc
#include "event.h"
#include "f2c.h"
#include "Cfort.h"
#include "math.h"
struct {
real blanc[100000];
} pawc_;
extern "C" {//You have to say extern "C" so MAIN__ doesn't get mangled
int MAIN__()
{
event A;
int nbin=100, i, nsim=1000, istat,icycle;
float temp,tempup,tempdown;
global=&A;
/* double max=0;
for(temp=.18;temp<.185;temp+=.000000001){
A.variable[yl].setvalue(temp);
if (A.g>max){ //OVERLOAD CALL: if: parameter.cc(?), parameter.cc(?)
max=A.g;
cout << "g = " << A.g << " yl = " << A.variable[yl] << endl;
}
}
cout << " max = " << max << endl;
*/
A.process_number_set(nr1);
A.major_mass_set(100.);
A.cut_size_set(.001);
hlimit_(&hundred_k);
hropen_(&one, "DUMMY", "events.hbook", "N", &one_k, &istat, 5L, 13L,
1L);
A.variable[plt].setvalue(50.);
tempup=A.kinematic_max[full_t];
tempdown=A.kinematic_min[full_t];
hbook1_(&one, "t", &nbin, &tempup, &tempdown, &zerof, 1L);
hbook1_(&two, "Rapidity of lepton", &nbin, &fourf, &neg_four_f,
&zerof, 18L);
tempup=A.kinematic_max[plt];
hbook1_(&three, "Transverse momentum of lepton", &nbin, &tempup, &zerof,
&zerof, 29L);
tempup=A.kinematic_max[full_t];
tempdown=A.kinematic_min[full_t];
hbook1_(&four, "full t in production", &nbin, &tempup, &tempdown,
&zerof, 20L);
hbook1_(&five, "decay time", &nbin, &hundred_k, &zerof,
&zerof, 10L);
A.hadronisation=false;
for (i=0;i<nsim;i++){
A.occur();
if (i%10000==0){ //OVERLOAD CALL: if: parameter.cc(?), parameter.cc(?)
A.print(); //OVERLOAD CALL: print: event.cc(event), parameter.cc(parameter)
cerr << "event " << i << " t = " << A.variable[t] << " yl = "
<< A.variable[yl] << " plt = " << A.variable[plt]
<< " i = " << i << endl;
}
if (i%10000==0) //OVERLOAD CALL: if: parameter.cc(?), parameter.cc(?)
lulist_(&two);
temp=A.variable[t];
// cout << " i " << i << " t " << temp << endl;
hf1_(&one, &temp, &onef);
if (A.current_process==nr1 || A.current_process==nr2) //OVERLOAD CALL: if: parameter.cc(?), parameter.cc(?)
temp=A.variable[yl];
else{
temp=acosh(lujets_1.p[12005]/sqrt(lujets_1.p[5]*lujets_1.p[5]+
lujets_1.p[4005]*lujets_1.p[4005]));
if (rlu_(&zeroi)>.5) //OVERLOAD CALL: if: parameter.cc(?), parameter.cc(?)
temp=-temp;//compensating for evenness of cosh
}
hf1_(&two, &temp, &onef);
if (A.current_process==nr1 || A.current_process==nr2) //OVERLOAD CALL: if: parameter.cc(?), parameter.cc(?)
temp=A.variable[plt];
else
temp=sqrt(lujets_1.p[5]*lujets_1.p[5]+lujets_1.p[4005]*lujets_1.p[4005]);
hf1_(&three, &temp, &onef);
temp=A.variable[full_t];
hf1_(&four, &temp, &onef);
temp=A.variable[time];
hf1_(&five, &temp, &onef);
}
double total=A.process_cross_section[nr1]+A.process_cross_section[nr2]
+A.process_cross_section[production];
cout << " total = " << total << endl;
temp=total/nsim/A.branching_ratio[nr1];
cout << " temp = " << temp << " i= " << i << endl;
int ip;
for (ip=1;ip<=5;ip++)
hopera_(&ip,"+",&ip,&ip,&temp,&zerof,1L);
for (i=0;i<num_procs;i++){
cout << "process cross section = " << A.process_cross_section[i]
<< " std_dev = " << A.process_cross_section_std_dev[i];
cout << " generation efficiency = " << A.generation_efficiency[i] << endl;
cout << " g max = " << A.g_function_max(i,true) << " "
<< A.g_function_max(i,false) << endl;
}
cout << " number of times Gmax exceeded = " << A.numover << endl;
cout << " number of time cut active = " <<A.cut_count << endl;
hrout_(&zeroi, &icycle, "T", 1L);
hrend_("DUMMY", 5L);
return 0;
}
}
C++ to HTML Conversion by ctoohtml