86 {
87
88 MsgStream log(
msgSvc(), name() );
89
90 log << MSG::INFO << "Phokhara initialize" << endmsg;
91
92 int i, s_seed[105];
93 long int k, j;
94
95 if ( m_initSeed == 0 )
96
97 {
98 IBesRndmGenSvc* p_BesRndmGenSvc;
99 static const bool CREATEIFNOTTHERE( true );
100 StatusCode RndmStatus = service( "BesRndmGenSvc", p_BesRndmGenSvc, CREATEIFNOTTHERE );
101 if ( !RndmStatus.isSuccess() || 0 == p_BesRndmGenSvc )
102 {
103 log << MSG::ERROR << " Could not initialize Random Number Service" << endmsg;
104 return RndmStatus;
105 }
106
107
108 HepRandomEngine* engine = p_BesRndmGenSvc->
GetEngine(
"PHOKHARA" );
109 const long*
s = engine->getSeeds();
111 }
112
113 log << MSG::INFO << "Set initial seed " << m_initSeed << endmsg;
114
115
116
117
118
119
120
121
122
123
124
125
126
128
129
130
131
132
134
138 FLAGS.fsrnlo = m_fsrnlo;
140
141 FLAGS.FF_pion = m_FF_Pion;
142 FLAGS.f0_model = m_f0_model;
143 FLAGS.FF_kaon = m_FF_Kaon;
144 FLAGS.narr_res = m_NarrowRes;
145
147 ;
148
150 CUTS.q2min = m_q2min;
151 CUTS.q2_min_c = m_q2_min_c;
152 CUTS.q2_max_c = m_q2_max_c;
154 CUTS.phot1cut = m_phot1cut;
155 CUTS.phot2cut = m_phot2cut;
156 CUTS.pi1cut = m_pi1cut;
157 CUTS.pi2cut = m_pi2cut;
158
160
161 cout << "-------------------------------------------------------------" << endl;
162 if (
FLAGS.pion == 0 ) cout <<
" PHOKHARA 7.0 : e^+ e^- -> mu^+ mu^- gamma" << endl;
163 else if (
FLAGS.pion == 1 ) cout <<
" PHOKHARA 7.0: e^+ e^- -> pi^+ pi^- gamma" << endl;
164 else if (
FLAGS.pion == 2 )
165 cout << " PHOKHARA 7.0: e^+ e^- -> pi^+ pi^- 2pi^0 gamma" << endl;
166 else if (
FLAGS.pion == 3 ) cout <<
" PHOKHARA 7.0: e^+ e^- -> 2pi^+ 2pi^- gamma" << endl;
167 else if (
FLAGS.pion == 4 ) cout <<
" PHOKHARA 7.0: e^+ e^- -> p pbar gamma" << endl;
168 else if (
FLAGS.pion == 5 ) cout <<
" PHOKHARA 7.0: e^+ e^- -> n nbar gamma" << endl;
169 else if (
FLAGS.pion == 6 ) cout <<
" PHOKHARA 7.0: e^+ e^- -> K^+ K^- gamma" << endl;
170 else if (
FLAGS.pion == 7 ) cout <<
" PHOKHARA 7.0: e^+ e^- -> K_0 K_0bar gamma" << endl;
171 else if (
FLAGS.pion == 8 )
172 cout << " PHOKHARA 7.0: e^+ e^- -> pi^+ pi^- pi^0 gamma" << endl;
173 else if (
FLAGS.pion == 9 )
174 {
175 cout << "PHOKHARA 7.0 : e^+ e^- ->" << endl;
176 cout << " Lambda (-> pi^- p) Lambda bar (-> pi^+ pbar) gamma" << endl;
177 }
178 else cout << " PHOKHARA 7.0: not yet implemented" << endl;
179
180
181 cout << "--------------------------------------------------------------" << endl;
182 printf(
" %s %f %s\n",
"cms total energy = ", sqrt(
CTES.Sp ),
183 " GeV " );
184
185 if ( (
CUTS.gmin / 2.0 /
CTES.ebeam ) < 0.0098 )
186 {
187 cerr << " minimal missing energy set to small" << endl;
188 return StatusCode::FAILURE;
189 }
190 printf(
" %s %f %s\n",
"minimal tagged photon energy = ",
CUTS.gmin,
" GeV " );
191 printf(
" %s %f,%f\n",
"angular cuts on tagged photon = ",
CUTS.phot1cut,
193
194
195
196
197
198
199
200
201
202
203
204
205
206 if (
FLAGS.pion == 0 )
207 printf(
" %s %f,%f\n",
"angular cuts on muons = ",
CUTS.pi1cut,
209 else if (
FLAGS.pion == 4 )
210 printf(
" %s %f,%f\n",
"angular cuts on protons = ",
CUTS.pi1cut,
212 else if (
FLAGS.pion == 5 )
213 printf(
" %s %f,%f\n",
"angular cuts on neutrons = ",
CUTS.pi1cut,
215 else if ( (
FLAGS.pion == 6 ) || (
FLAGS.pion == 7 ) )
216 printf(
" %s %f,%f\n",
"angular cuts on kaons = ",
CUTS.pi1cut,
218 else if (
FLAGS.pion == 9 )
219 printf(
" %s %f,%f\n",
"angular cuts on pions and protons = ",
CUTS.pi1cut,
221 else
222 printf(
" %s %f,%f\n",
"angular cuts on pions = ",
CUTS.pi1cut,
224
225
226 if (
FLAGS.pion == 0 )
227 printf(
" %s %f %s\n",
"min. muons-tagged photon inv.mass^2 = ",
CUTS.q2min,
" GeV^2" );
228 else if (
FLAGS.pion == 4 )
229 printf(
" %s %f %s\n",
"min. protons-tagged photon inv.mass^2 = ",
CUTS.q2min,
" GeV^2" );
230 else if (
FLAGS.pion == 5 )
231 printf(
" %s %f %s\n",
"min. neutrons-tagged photon inv.mass^2 = ",
CUTS.q2min,
" GeV^2" );
232 else if ( (
FLAGS.pion == 6 ) || (
FLAGS.pion == 7 ) )
233 printf(
" %s %f %s\n",
"min. kaons-tagged photon inv.mass^2 = ",
CUTS.q2min,
" GeV^2" );
234 else if (
FLAGS.pion == 9 )
235 printf(
" %s %f %s\n",
" min. lambdas-tagged photon inv.mass^2 = ",
CUTS.q2min,
" GeV^2" );
236 else
237 printf(
" %s %f %s\n",
"min. pions-tagged photon inv.mass^2 = ",
CUTS.q2min,
" GeV^2" );
238
239
240
243
244
245
246
247
248 cos2min = -1.0;
249 cos2max = 1.0;
250 cos3min = -1.0;
251 cos3max = 1.0;
252 if (
FLAGS.pion == 0 )
254 else if (
FLAGS.pion == 1 ) qqmin = 4.0 *
CTES.mpi *
CTES.mpi;
255 else if (
FLAGS.pion == 2 )
257 else if (
FLAGS.pion == 3 ) qqmin = 16.0 *
CTES.mpi *
CTES.mpi;
259 else if (
FLAGS.pion == 5 ) qqmin = 4.0 *
CTES.mnt *
CTES.mnt;
260 else if (
FLAGS.pion == 6 ) qqmin = 4.0 *
CTES.mKp *
CTES.mKp;
261 else if (
FLAGS.pion == 7 ) qqmin = 4.0 *
CTES.mKn *
CTES.mKn;
262 else if (
FLAGS.pion == 8 )
264 else if (
FLAGS.pion == 9 ) qqmin = 4.0 *
CTES.mlamb *
CTES.mlamb;
265
266
267
269 if (
CUTS.q2_max_c < qqmax ) qqmax =
CUTS.q2_max_c;
270
271
272 if ( (
CUTS.q2_min_c > qqmin ) &&
275 qqmin =
CUTS.q2_min_c;
276 else
277 {
278 cerr << "------------------------------" << endl;
279 cerr << " Q^2_min TOO SMALL" << endl;
280 cerr << " Q^2_min CHANGED BY PHOKHARA = " << qqmin << " GeV^2" << endl;
281 cerr << "------------------------------" << endl;
282 }
283
284 if ( qqmax <= qqmin )
285 {
286 cerr << " Q^2_max to small " << endl;
287 cerr << " Q^2_max = " << qqmax << endl;
288 cerr << " Q^2_min = " << qqmin << endl;
289 return StatusCode::FAILURE;
290 }
291
292
293 if (
FLAGS.pion == 0 )
294 {
295 printf( " %s %f %s\n", "minimal muon-pair invariant mass^2 = ", qqmin, " GeV^2" );
296 printf( " %s %f %s\n", "maximal muon-pair invariant mass^2 = ", qqmax, " GeV^2" );
297 }
298 else if (
FLAGS.pion == 1 )
299 {
300 printf( " %s %f %s\n", "minimal pion-pair invariant mass^2 = ", qqmin, " GeV^2" );
301 printf( " %s %f %s\n", "maximal pion-pair invariant mass^2 = ", qqmax, " GeV^2" );
302 }
303 else if (
FLAGS.pion == 4 )
304 {
305 printf( " %s %f %s\n", "minimal proton-pair invariant mass^2 = ", qqmin, " GeV^2" );
306 printf( " %s %f %s\n", "maximal proton-pair invariant mass^2 = ", qqmax, " GeV^2" );
307 }
308 else if (
FLAGS.pion == 5 )
309 {
310 printf( " %s %f %s\n", "minimal neutron-pair invariant mass^2 = ", qqmin, " GeV^2" );
311 printf( " %s %f %s\n", "maximal neutron-pair invariant mass^2 = ", qqmax, " GeV^2" );
312 }
313 else if ( (
FLAGS.pion == 6 ) || (
FLAGS.pion == 7 ) )
314 {
315 printf( " %s %f %s\n", "minimal kaon-pair invariant mass^2 = ", qqmin, " GeV^2" );
316 printf( " %s %f %s\n", "maximal kaon-pair invariant mass^2 = ", qqmax, " GeV^2" );
317 }
318 else if (
FLAGS.pion == 8 )
319 {
320 printf( " %s %f %s\n", "minimal three-pion invariant mass^2 = ", qqmin, " GeV^2" );
321 printf( " %s %f %s\n", "maximal three-pion invariant mass^2 = ", qqmax, " GeV^2" );
322 }
323 else if (
FLAGS.pion == 9 )
324 {
325 printf( " %s %f %s\n", "minimal lambda-pair invariant mass^2 = ", qqmin, " GeV^2" );
326 printf( " %s %f %s\n", "maximal lambda-pair invariant mass^2 = ", qqmax, " GeV^2" );
327 }
328 else
329 {
330 printf( " %s %f %s\n", "minimal four-pion invariant mass^2 = ", qqmin, " GeV^2" );
331 printf( " %s %f %s\n", "maximal four-pion invariant mass^2 = ", qqmax, " GeV^2" );
332 }
333
334 if (
FLAGS.nlo == 0 )
335 {
336 cout << "Born" << endl;
337 if (
FLAGS.fsrnlo != 0 )
338 {
339 cerr << "WRONG FSRNLO flag - only fsrnlo=0 allowed for Born" << endl;
340 return StatusCode::FAILURE;
341 }
342 }
343
344 if ( (
FLAGS.pion == 9 ) && (
FLAGS.nlo != 0 ) )
345 {
346 cerr << "WRONG NLO flag - only Born allowed for Lambdas" << endl;
347 cerr << "If you feel that you need NLO" << endl;
348 cerr << "please contact the authors" << endl;
349 return StatusCode::FAILURE;
350 }
351
352 if (
FLAGS.nlo == 1 )
353 printf(
" %s %f\n",
"NLO: soft photon cutoff w = ",
CUTS.w );
354 if ( (
FLAGS.pion <= 1 ) || (
FLAGS.pion == 6 ) )
355 {
356
357 if ( !( (
FLAGS.fsr == 1 ) || (
FLAGS.fsr == 2 ) || (
FLAGS.fsrnlo == 0 ) ||
359 (
FLAGS.fsrnlo == 0 ) ) )
360 {
361 cerr << "WRONG combination of FSR, FSRNLO flags" << endl;
362 return StatusCode::FAILURE;
363 }
364
365
366 if (
FLAGS.fsr == 0 ) cout <<
"ISR only" << endl;
367 else if (
FLAGS.fsr == 1 ) cout <<
"ISR+FSR" << endl;
368 else if (
FLAGS.fsr == 2 )
369 {
370 if (
FLAGS.nlo == 0 ) cout <<
"ISR+INT+FSR" << endl;
371 else
372 {
373 cerr << "WRONG FSR flag: interference is included only for nlo=0" << endl;
374 return StatusCode::FAILURE;
375 }
376 }
377 else
378 {
379 cerr <<
"WRONG FSR flag" <<
FLAGS.fsr << endl;
380 return StatusCode::FAILURE;
381 }
382
383 if (
FLAGS.fsrnlo == 1 ) cout <<
"IFSNLO included" << endl;
384 }
385 else
386 {
387 if ( (
FLAGS.fsr == 0 ) && (
FLAGS.fsrnlo == 0 ) ) cout <<
"ISR only" << endl;
388 else
389 {
390 cerr << "FSR is implemented only for pi+pi-, mu+mu- and K+K- modes" << endl;
391 return StatusCode::FAILURE;
392 }
393 }
394
395
396 if (
FLAGS.ivac == 0 ) { cout <<
"Vacuum polarization is NOT included" << endl; }
397 else if (
FLAGS.ivac == 1 )
398 {
399 cout << "Vacuum polarization by Fred Jegerlehner "
400 "(http://www-com.physik.hu-berlin.de/fjeger/alphaQEDn.uu)"
401 << endl;
402 }
403 else if (
FLAGS.ivac == 2 )
404 {
405 cout << "Vacuum polarization (VP_HLMNT_v1_3nonr) by Daisuke Nomura and Thomas Teubner"
406 << endl;
407 }
408 else
409 {
410 cout << "WRONG vacuum polarization switch" << endl;
411 return StatusCode::FAILURE;
412 }
413
414
415 if (
FLAGS.pion == 1 )
416 {
417 if (
FLAGS.FF_pion == 0 ) cout <<
"Kuhn-Santamaria PionFormFactor" << endl;
418 else if (
FLAGS.FF_pion == 1 ) cout <<
"Gounaris-Sakurai PionFormFactor old" << endl;
419 else if (
FLAGS.FF_pion == 2 ) cout <<
"Gounaris-Sakurai PionFormFactor new" << endl;
420 else
421 {
422 cout << "WRONG PionFormFactor switch" << endl;
423 return StatusCode::FAILURE;
424 }
425
426 if (
FLAGS.fsr != 0 )
427 {
428 if (
FLAGS.f0_model == 0 ) cout <<
"f0+f0(600): K+K- model" << endl;
429 else if (
FLAGS.f0_model == 1 ) cout <<
"f0+f0(600): \"no structure\" model" << endl;
430 else if (
FLAGS.f0_model == 2 ) cout <<
"NO f0+f0(600)" << endl;
431 else if (
FLAGS.f0_model == 3 )
432 cout << "only f0, KLOE: Cesare Bini-private communication" << endl;
433 else
434 {
435 cout << "WRONG f0+f0(600) switch" << endl;
436 return StatusCode::FAILURE;
437 }
438 }
439 }
440
441
442 if ( (
FLAGS.pion == 6 ) || (
FLAGS.pion == 7 ) )
443 {
444 if (
FLAGS.FF_kaon == 0 ) cout <<
"constrained KaonFormFactor" << endl;
445 else if (
FLAGS.FF_kaon == 1 ) { cout <<
"unconstrained KaonFormFactor" << endl; }
446 else if (
FLAGS.FF_kaon == 2 )
447 { cout << "Kuhn-Khodjamirian-Bruch KaonFormFactor" << endl; }
448 else
449 {
450 cout << "WRONG KaonFormFactor switch" << endl;
451 return StatusCode::FAILURE;
452 }
453 }
454
455 if ( (
FLAGS.pion == 0 ) || (
FLAGS.pion == 1 ) || (
FLAGS.pion == 6 ) ||
456 (
FLAGS.pion == 7 ) )
457 {
458 if (
FLAGS.narr_res == 1 ) { cout <<
"THE NARROW RESONANCE J/PSI INCLUDED" << endl; }
459 else if (
FLAGS.narr_res == 2 )
460 { cout << "THE NARROW RESONANCE PSI(2S) INCLUDED" << endl; }
461 else if (
FLAGS.narr_res != 0 )
462 {
463 cout << "wrong flag narr_res: only 0, 1 or 2 allowed" << endl;
464 return StatusCode::FAILURE;
465 }
466 }
467
468
469 cout << "--------------------------------------------------------------" << endl;
470
471
472
473 for ( i = 0; i < 2; i++ )
474 {
478 }
479
481
486
487
488
489 for ( j = 1; j <= m_nm; j++ )
490 {
492 Ar[1] = Ar_r[0];
494 {
496 GEN_1PH( 1, qqmin, qqmax, cos1min, cos1max, cos3min, cos3max );
497 }
498 else
499 {
501 GEN_2PH( 1, qqmin, cos1min, cos1max, cos2min, cos2max, cos3min, cos3max );
502 }
503 }
504
505
506
512
513 if ( (
FLAGS.pion == 0 ) && (
FLAGS.fsr == 1 ) && (
FLAGS.fsrnlo == 0 ) )
515
516 if ( (
FLAGS.pion == 2 ) || (
FLAGS.pion == 3 ) )
517 {
520 }
521
522 if (
FLAGS.pion == 8 )
523 {
526 }
527
528
533
534 return StatusCode::SUCCESS;
535}
#define RLXDINIT(LUXURY, SEED)
double cos(const BesAngle a)
virtual CLHEP::HepRandomEngine * GetEngine(const std::string &StreamName)=0
Interface to the CLHEP engine.