12#define RLXDRESETF( SEED ) CCALLSFSUB1( RLXDRESETF, rlxdresetf, INTV, SEED )
15#define INPUT( NGES, NM, OUTFILE ) \
16 CCALLSFSUB3( INPUT, input, PLONG, PINT, PSTRING, NGES, NM, OUTFILE )
19#define INITHISTO() CCALLSFSUB0( INITHISTO, inithisto )
22#define ENDHISTO() CCALLSFSUB0( ENDHISTO, endhisto )
25#define WRITEEVENT() CCALLSFSUB0( WRITEEVENT, writeevent )
28#define RANLXDF( AR, VAL ) CCALLSFSUB2( RANLXDF, ranlxdf, DOUBLEV, INT, AR, VAL )
32#define GEN_1PH( I, QQMIN, QQMAX, COS1MIN, COS1MAX, COS3MIN, COS3MAX ) \
33 CCALLSFSUB7( GEN_1PH, gen_1ph_, INT, PDOUBLE, PDOUBLE, PDOUBLE, PDOUBLE, PDOUBLE, PDOUBLE, \
34 I, QQMIN, QQMAX, COS1MIN, COS1MAX, COS3MIN, COS3MAX )
38#define GEN_2PH( I, QQMIN, COS1MIN, COS1MAX, COS2MIN, COS2MAX, COS3MIN, COS3MAX ) \
39 CCALLSFSUB8( GEN_2PH, gen_2ph_, INT, PDOUBLE, PDOUBLE, PDOUBLE, PDOUBLE, PDOUBLE, PDOUBLE, \
40 PDOUBLE, I, QQMIN, COS1MIN, COS1MAX, COS2MIN, COS2MAX, COS3MIN, COS3MAX )
44 double cos1min, cos1max, cos2min, cos2max, cos3min, cos3max;
45 double dsigm1, dsigm2, sigma1, sigma2, sigma, dsigm, Ar[14], Ar_r[14];
46 int nm, i, s_seed[105];
51 ifstream seeds(
"seed.dat" );
52 if ( seeds.is_open() )
55 while ( !seeds.eof() ) seeds >> s_seed[ii++];
57 else cerr <<
"Cannot open file seed.dat for reading" << endl;
64 INPUT( nges, nm, outfile );
70 cout <<
"----------------------------------------------------" <<
FLAGS.pion << endl;
71 if (
FLAGS.pion == 0 ) cout <<
" PHOKHARA 6.0 : e^+ e^- -> mu^+ mu^- gamma" << endl;
72 else if (
FLAGS.pion == 1 ) cout <<
" PHOKHARA 6.0: e^+ e^- -> pi^+ pi^- gamma" << endl;
73 else if (
FLAGS.pion == 2 )
74 cout <<
" PHOKHARA 6.0: e^+ e^- -> pi^+ pi^- 2pi^0 gamma" << endl;
75 else if (
FLAGS.pion == 3 ) cout <<
" PHOKHARA 6.0: e^+ e^- -> 2pi^+ 2pi^- gamma" << endl;
76 else if (
FLAGS.pion == 4 ) cout <<
" PHOKHARA 6.0: e^+ e^- -> p pbar gamma" << endl;
77 else if (
FLAGS.pion == 5 ) cout <<
" PHOKHARA 6.0: e^+ e^- -> n nbar gamma" << endl;
78 else if (
FLAGS.pion == 6 ) cout <<
" PHOKHARA 6.0: e^+ e^- -> K^+ K^- gamma" << endl;
79 else if (
FLAGS.pion == 7 ) cout <<
" PHOKHARA 6.0: e^+ e^- -> K_0 K_0bar gamma" << endl;
80 else if (
FLAGS.pion == 8 )
81 cout <<
" PHOKHARA 6.0: e^+ e^- -> pi^+ pi^- pi^0 gamma" << endl;
82 else if (
FLAGS.pion == 9 )
84 cout <<
"PHOKHARA 6.0 : e^+ e^- ->" << endl;
85 cout <<
" Lambda (-> pi^- p) Lambda bar (-> pi^+ pbar) gamma" << endl;
87 else cout <<
" PHOKHARA 6.0: not yet implemented" << endl;
90 cout <<
"----------------------------------------------------" << endl;
91 printf(
" %s %f %s\n",
"cms total energy = ", sqrt(
CTES.Sp ),
93 if (
FLAGS.tagged == 0 )
95 if ( (
CUTS.gmin / 2.0 /
CTES.ebeam ) < 0.0098 )
97 cerr <<
" minimal missing energy set to small" << endl;
100 printf(
" %s %f %s\n",
"minimal tagged photon energy = ",
CUTS.gmin,
" GeV " );
101 printf(
" %s %f,%f\n",
"angular cuts on tagged photon = ",
CUTS.phot1cut,
106 if ( (
CUTS.gmin / 2.0 /
CTES.ebeam ) < 0.0098 )
108 cerr <<
" minimal missing energy set to small" << endl;
111 printf(
" %s %f %s\n",
"minimal missing energy = ",
CUTS.gmin,
" GeV " );
112 printf(
" %s %f,%f\n",
"angular cuts on missing momentum = ",
CUTS.phot1cut,
117 if (
FLAGS.pion == 0 )
118 printf(
" %s %f,%f\n",
"angular cuts on muons = ",
CUTS.pi1cut,
120 else if (
FLAGS.pion == 4 )
121 printf(
" %s %f,%f\n",
"angular cuts on protons = ",
CUTS.pi1cut,
123 else if (
FLAGS.pion == 5 )
124 printf(
" %s %f,%f\n",
"angular cuts on neutrons = ",
CUTS.pi1cut,
126 else if ( (
FLAGS.pion == 6 ) || (
FLAGS.pion == 7 ) )
127 printf(
" %s %f,%f\n",
"angular cuts on kaons = ",
CUTS.pi1cut,
129 else if (
FLAGS.pion == 9 )
130 printf(
" %s %f,%f\n",
"angular cuts on pions and protons = ",
CUTS.pi1cut,
133 printf(
" %s %f,%f\n",
"angular cuts on pions = ",
CUTS.pi1cut,
136 if (
FLAGS.tagged == 0 )
138 if (
FLAGS.pion == 0 )
139 printf(
" %s %f %s\n",
"min. muons-tagged photon inv.mass^2 = ",
CUTS.q2min,
141 else if (
FLAGS.pion == 4 )
142 printf(
" %s %f %s\n",
"min. protons-tagged photon inv.mass^2 = ",
CUTS.q2min,
144 else if (
FLAGS.pion == 5 )
145 printf(
" %s %f %s\n",
"min. neutrons-tagged photon inv.mass^2 = ",
CUTS.q2min,
147 else if ( (
FLAGS.pion == 6 ) || (
FLAGS.pion == 7 ) )
148 printf(
" %s %f %s\n",
"min. kaons-tagged photon inv.mass^2 = ",
CUTS.q2min,
150 else if (
FLAGS.pion == 9 )
151 printf(
" %s %f %s\n",
" min. lambdas-tagged photon inv.mass^2 = ",
CUTS.q2min,
154 printf(
" %s %f %s\n",
"min. pions-tagged photon inv.mass^2 = ",
CUTS.q2min,
163 if (
FLAGS.tagged == 0 )
178 if (
FLAGS.pion == 0 )
180 else if (
FLAGS.pion == 1 ) qqmin = 4.0 *
CTES.mpi *
CTES.mpi;
181 else if (
FLAGS.pion == 2 )
183 else if (
FLAGS.pion == 3 ) qqmin = 16.0 *
CTES.mpi *
CTES.mpi;
185 else if (
FLAGS.pion == 5 ) qqmin = 4.0 *
CTES.mnt *
CTES.mnt;
186 else if (
FLAGS.pion == 6 ) qqmin = 4.0 *
CTES.mKp *
CTES.mKp;
187 else if (
FLAGS.pion == 7 ) qqmin = 4.0 *
CTES.mKn *
CTES.mKn;
188 else if (
FLAGS.pion == 8 )
190 else if (
FLAGS.pion == 9 ) qqmin = 4.0 *
CTES.mlamb *
CTES.mlamb;
195 if (
CUTS.q2_max_c < qqmax ) qqmax =
CUTS.q2_max_c;
198 if ( (
CUTS.q2_min_c > qqmin ) &&
201 qqmin =
CUTS.q2_min_c;
204 cerr <<
"------------------------------" << endl;
205 cerr <<
" Q^2_min TOO SMALL" << endl;
206 cerr <<
" Q^2_min CHANGE BY PHOKHARA = " << qqmin <<
" GeV^2" << endl;
207 cerr <<
"------------------------------" << endl;
210 if ( qqmax <= qqmin )
212 cerr <<
" Q^2_max to small " << endl;
213 cerr <<
" Q^2_max = " << qqmax << endl;
214 cerr <<
" Q^2_min = " << qqmin << endl;
219 if (
FLAGS.pion == 0 )
221 printf(
" %s %f %s\n",
"minimal muon-pair invariant mass^2 = ", qqmin,
" GeV^2" );
222 printf(
" %s %f %s\n",
"maximal muon-pair invariant mass^2 = ", qqmax,
" GeV^2" );
224 else if (
FLAGS.pion == 1 )
226 printf(
" %s %f %s\n",
"minimal pion-pair invariant mass^2 = ", qqmin,
" GeV^2" );
227 printf(
" %s %f %s\n",
"maximal pion-pair invariant mass^2 = ", qqmax,
" GeV^2" );
229 else if (
FLAGS.pion == 4 )
231 printf(
" %s %f %s\n",
"minimal proton-pair invariant mass^2 = ", qqmin,
" GeV^2" );
232 printf(
" %s %f %s\n",
"maximal proton-pair invariant mass^2 = ", qqmax,
" GeV^2" );
234 else if (
FLAGS.pion == 5 )
236 printf(
" %s %f %s\n",
"minimal neutron-pair invariant mass^2 = ", qqmin,
" GeV^2" );
237 printf(
" %s %f %s\n",
"maximal neutron-pair invariant mass^2 = ", qqmax,
" GeV^2" );
239 else if ( (
FLAGS.pion == 6 ) || (
FLAGS.pion == 7 ) )
241 printf(
" %s %f %s\n",
"minimal kaon-pair invariant mass^2 = ", qqmin,
" GeV^2" );
242 printf(
" %s %f %s\n",
"maximal kaon-pair invariant mass^2 = ", qqmax,
" GeV^2" );
244 else if (
FLAGS.pion == 8 )
246 printf(
" %s %f %s\n",
"minimal three-pion invariant mass^2 = ", qqmin,
" GeV^2" );
247 printf(
" %s %f %s\n",
"maximal three-pion invariant mass^2 = ", qqmax,
" GeV^2" );
249 else if (
FLAGS.pion == 9 )
251 printf(
" %s %f %s\n",
"minimal lambda-pair invariant mass^2 = ", qqmin,
" GeV^2" );
252 printf(
" %s %f %s\n",
"maximal lambda-pair invariant mass^2 = ", qqmax,
" GeV^2" );
256 printf(
" %s %f %s\n",
"minimal four-pion invariant mass^2 = ", qqmin,
" GeV^2" );
257 printf(
" %s %f %s\n",
"maximal four-pion invariant mass^2 = ", qqmax,
" GeV^2" );
260 if (
FLAGS.nlo == 0 )
262 cout <<
"Born" << endl;
263 if (
FLAGS.fsrnlo != 0 )
265 cerr <<
"WRONG FSRNLO flag - only fsrnlo=0 allowed for Born" << endl;
270 if ( (
FLAGS.pion == 9 ) && (
FLAGS.nlo != 0 ) )
272 cerr <<
"WRONG NLO flag - only Born allowed for Lambdas" << endl;
273 cerr <<
"If you feel that you need NLO" << endl;
274 cerr <<
"please contact the authors" << endl;
278 if (
FLAGS.nlo == 1 )
279 printf(
" %s %f\n",
"NLO: soft photon cutoff w = ",
CUTS.w );
280 if ( (
FLAGS.pion <= 1 ) || (
FLAGS.pion == 6 ) )
283 if ( !( (
FLAGS.fsr == 1 ) || (
FLAGS.fsr == 2 ) || (
FLAGS.fsrnlo == 0 ) ||
285 (
FLAGS.fsrnlo == 0 ) ) )
287 cerr <<
"WRONG combination of FSR, FSRNLO flags" << endl;
292 if (
FLAGS.fsr == 0 ) cout <<
"ISR only" << endl;
293 else if (
FLAGS.fsr == 1 ) cout <<
"ISR+FSR" << endl;
294 else if (
FLAGS.fsr == 2 )
296 if (
FLAGS.nlo == 0 ) cout <<
"ISR+INT+FSR" << endl;
299 cerr <<
"WRONG FSR flag: interference is included only for nlo=0" << endl;
305 cerr <<
"WRONG FSR flag" <<
FLAGS.fsr << endl;
309 if (
FLAGS.fsrnlo == 1 ) cout <<
"IFSNLO included" << endl;
313 if ( (
FLAGS.fsr == 0 ) && (
FLAGS.fsrnlo == 0 ) ) cout <<
"ISR only" << endl;
316 cerr <<
"FSR is implemented only for pi+pi-, mu+mu- and K+K- modes" << endl;
322 if (
FLAGS.ivac == 0 ) { cout <<
"Vacuum polarization is NOT included" << endl; }
323 else if (
FLAGS.ivac == 1 ) { cout <<
"Vacuum polarization is included" << endl; }
326 cout <<
"WRONG vacuum polarization switch" << endl;
330 if (
FLAGS.pion == 1 )
332 if (
FLAGS.FF_pion == 0 ) cout <<
"Kuhn-Santamaria PionFormFactor" << endl;
333 else if (
FLAGS.FF_pion == 1 ) cout <<
"Gounaris-Sakurai PionFormFactor" << endl;
336 cout <<
"WRONG PionFormFactor switch" << endl;
340 if (
FLAGS.fsr != 0 )
342 if (
FLAGS.f0_model == 0 ) cout <<
"f0+f0(600): K+K- model" << endl;
343 else if (
FLAGS.f0_model == 1 ) cout <<
"f0+f0(600): \"no structure\" model" << endl;
344 else if (
FLAGS.f0_model == 2 ) cout <<
"NO f0+f0(600)" << endl;
345 else if (
FLAGS.f0_model == 3 )
346 cout <<
"only f0, KLOE: Cesare Bini-private communication" << endl;
349 cout <<
"WRONG f0+f0(600) switch" << endl;
358 for ( i = 0; i < 2; i++ )
366 for ( i = 1; i <= 2; i++ )
375 for ( j = 1; j <= k; j++ )
383 GEN_1PH( i, qqmin, qqmax, cos1min, cos1max, cos3min, cos3max );
388 GEN_2PH( i, qqmin, cos1min, cos1max, cos2min, cos2max, cos3min, cos3max );
401 if ( (
FLAGS.pion == 1 ) && (
FLAGS.fsrnlo == 1 ) )
403 if ( (
FLAGS.pion == 0 ) && (
FLAGS.fsrnlo == 1 ) )
406 if ( (
FLAGS.pion == 0 ) && (
FLAGS.fsr == 1 ) && (
FLAGS.fsrnlo == 0 ) )
409 if ( (
FLAGS.pion == 2 ) || (
FLAGS.pion == 3 ) )
415 if (
FLAGS.pion == 8 )
425 if (
FLAGS.pion == 9 )
435 if (
FLAGS.nlo == 0 )
458 sigma = sigma1 + sigma2;
459 dsigm = sqrt( dsigm1 * dsigm1 + dsigm2 * dsigm2 );
463 cout <<
"----------------------------------------------------" << endl;
464 cout << int(
MAXIMA.tr[0] +
MAXIMA.tr[1] ) <<
" total events accepted of " << endl;
465 cout << int( nges ) <<
" total events generated" << endl;
466 cout << int(
MAXIMA.tr[0] ) <<
" one photon events accepted of " << endl;
467 cout << int(
MAXIMA.count[0] ) <<
" events generated" << endl;
468 cout << int(
MAXIMA.tr[1] ) <<
" two photon events accepted of " << endl;
469 cout << int(
MAXIMA.count[1] ) <<
" events generated" << endl;
471 if (
FLAGS.nlo != 0 ) cout <<
"sigma1(nbarn) = " << sigma1 <<
" +- " << dsigm1 << endl;
472 if (
FLAGS.nlo != 0 ) cout <<
"sigma2(nbarn) = " << sigma2 <<
" +- " << dsigm2 << endl;
473 cout <<
"sigma (nbarn) = " << sigma <<
" +- " << dsigm << endl;
475 cout <<
"maximum1 = " <<
MAXIMA.gross[0] <<
" minimum1 = " <<
MAXIMA.klein[0] << endl;
476 cout <<
"Mmax1 = " <<
MAXIMA.Mmax[0] << endl;
477 cout <<
"maximum2 = " <<
MAXIMA.gross[1] <<
" minimum2 = " <<
MAXIMA.klein[1] << endl;
478 cout <<
"Mmax2 = " <<
MAXIMA.Mmax[1] << endl;
479 cout <<
"----------------------------------------------------" << endl;
#define GEN_1PH(I, QQMIN, QQMAX, COS1MIN, COS1MAX, COS3MIN, COS3MAX)
#define GEN_2PH(I, QQMIN, COS1MIN, COS1MAX, COS2MIN, COS2MAX, COS3MIN, COS3MAX)
double cos(const BesAngle a)
PROTOCCALLSFSUB7(GEN_1PH, gen_1ph_, INT, PDOUBLE, PDOUBLE, PDOUBLE, PDOUBLE, PDOUBLE, PDOUBLE)
#define GEN_1PH(I, QQMIN, QQMAX, COS1MIN, COS1MAX, COS3MIN, COS3MAX)
PROTOCCALLSFSUB3(INPUT, input, PLONG, PINT, PSTRING)
PROTOCCALLSFSUB8(GEN_2PH, gen_2ph_, INT, PDOUBLE, PDOUBLE, PDOUBLE, PDOUBLE, PDOUBLE, PDOUBLE, PDOUBLE)
PROTOCCALLSFSUB1(RLXDRESETF, rlxdresetf, INTV)
#define INPUT(NGES, NM, OUTFILE)
PROTOCCALLSFSUB2(RANLXDF, ranlxdf, DOUBLEV, INT)
#define GEN_2PH(I, QQMIN, COS1MIN, COS1MAX, COS2MIN, COS2MAX, COS3MIN, COS3MAX)
PROTOCCALLSFSUB0(INITHISTO, inithisto)