365 gaskelld 1.1
366 genvol = domega_e
367 ! genvol_inclusive = genvol !may want dOmega, or dE*dOmega
368
369 ! ... 2-fold to 5-fold.
370 if (doing_deuterium.or.doing_heavy.or.doing_pion.or.doing_kaon
371 1 .or.doing_delta.or.doing_rho .or. doing_semi) then
372 genvol = genvol * domega_p * (gen.e.E.max-gen.e.E.min)
373 endif
374
375 if (doing_heavy.or.doing_semi) then !6-fold
376 genvol = genvol * (gen.p.E.max-gen.p.E.min)
377 endif
378
379 normfac = normfac * genvol
380 if (doing_phsp) normfac = 1.0
381 wtcontribute = wtcontribute*normfac
382
383 ! Close diagnostic ntuple file, if used
384
385 if (Nntu.gt.0) call NtupleClose(filename)
386 gaskelld 1.1
387 ! Calculate resolutions
388
389 if (npasscuts.gt.1) then
390 tmpnum = dble(npasscuts)
391 aveerr.e.delta = sumerr.e.delta/tmpnum
392 aveerr.e.xptar = sumerr.e.xptar/tmpnum
393 aveerr.e.yptar = sumerr.e.yptar/tmpnum
394 aveerr.e.ytar = sumerr.e.ytar /tmpnum
395 aveerr.p.delta = sumerr.p.delta/tmpnum
396 aveerr.p.xptar = sumerr.p.xptar/tmpnum
397 aveerr.p.yptar = sumerr.p.yptar/tmpnum
398 aveerr.p.ytar = sumerr.p.ytar /tmpnum
399 resol.e.delta = sqrt(max(0.,(sumerr2.e.delta/tmpnum) -
400 > (sumerr.e.delta/tmpnum)**2 ))
401 resol.e.xptar = sqrt(max(0.,(sumerr2.e.xptar/tmpnum) -
402 > (sumerr.e.xptar/tmpnum)**2 ))
403 resol.e.yptar = sqrt(max(0.,(sumerr2.e.yptar/tmpnum) -
404 > (sumerr.e.yptar/tmpnum)**2 ))
405 resol.e.ytar = sqrt(max(0.,(sumerr2.e.ytar/tmpnum) -
406 > (sumerr.e.ytar/tmpnum)**2 ))
407 gaskelld 1.1 resol.p.delta = sqrt(max(0.,(sumerr2.p.delta/tmpnum) -
408 > (sumerr.p.delta/tmpnum)**2 ))
409 resol.p.xptar = sqrt(max(0.,(sumerr2.p.xptar/tmpnum) -
410 > (sumerr.p.xptar/tmpnum)**2 ))
411 resol.p.yptar = sqrt(max(0.,(sumerr2.p.yptar/tmpnum) -
412 > (sumerr.p.yptar/tmpnum)**2 ))
413 resol.p.ytar = sqrt(max(0.,(sumerr2.p.ytar/tmpnum) -
414 > (sumerr.p.ytar/tmpnum)**2 ))
415 endif
416
417 ! write(6,9910) 'e- delta=',10.*aveerr.e.delta,10.*resol.e.delta,'x10^-3'
418 ! write(6,9910) 'e- xptar=',1000.*aveerr.e.xptar,1000.*resol.e.xptar,'mr'
419 ! write(6,9910) 'e- yptar=',1000.*aveerr.e.yptar,1000.*resol.e.yptar,'mr'
420 ! write(6,9910) 'e- ytar =',10.*aveerr.e.ytar,10.*resol.e.ytar ,'mm'
421 ! write(6,9910) 'p delta=',10.*aveerr.p.delta,10.*resol.p.delta,'x10-3'
422 ! write(6,9910) 'p xptar=',1000.*aveerr.p.xptar,1000.*resol.p.xptar,'mr'
423 ! write(6,9910) 'p yptar=',1000.*aveerr.p.yptar,1000.*resol.p.yptar,'mr'
424 ! write(6,9910) 'p ytar =',10.*aveerr.p.ytar,10.*resol.p.ytar,'mm'
425 !9910 format(1x,a10,2f10.3,3x,a)
426
427 ! Produce output files
428 gaskelld 1.1
429 900 if (ngen.eq.0) goto 1000
430
431 ! ... the diagnostic histograms
432
433 i = index(base,' ')
434 genfile = ' '
435 write(genfile,'(a,''.gen'')') 'outfiles/'//base(1:i-1)
436 genifile = ' '
437 write(genifile,'(a,''.geni'')') 'outfiles/'//base(1:i-1)
438 histfile = ' '
439 write(histfile,'(a,''.hist'')') 'outfiles/'//base(1:i-1)
440 write(6,'(1x,''... writing '',a)') genfile
441
442 write(6,*) 'Come back soon!'
443
444 open(unit=7, file=genifile, status='unknown')
445 if (electron_arm.eq.1 .or. hadron_arm.eq.1) then
446 write(7,*) 'HMS Trials: ',hSTOP_trials
447 write(7,*) 'Slit hor/vert/corners ',hSTOP_slit_hor,hSTOP_slit_vert,hSTOP_slit_oct
448 write(7,*) 'Q1 entrance/mid/exit ',hSTOP_Q1_in,hSTOP_Q1_mid,hSTOP_Q1_out
449 gaskelld 1.1 write(7,*) 'Q2 entrance/mid/exit ',hSTOP_Q2_in,hSTOP_Q2_mid,hSTOP_Q2_out
450 write(7,*) 'Q3 entrance/mid/exit ',hSTOP_Q3_in,hSTOP_Q3_mid,hSTOP_Q3_out
451 write(7,*) 'Dipole entrance/exit ',hSTOP_D1_in,hSTOP_D1_out
452 write(7,*) 'Events reaching hut ',hSTOP_hut
453 write(7,*) 'DC1, DC2, Scin, Cal ',hSTOP_dc1,hSTOP_dc2,hSTOP_scin,hSTOP_cal
454 write(7,*) 'Successes ',hSTOP_successes
455 write(7,*)
456 endif
457 if (electron_arm.eq.2 .or. hadron_arm.eq.2) then
458 write(7,*) 'SOS Trials: ',sSTOP_trials
459 write(7,*) 'Slit hor/vert/corners ',sSTOP_slit_vert,sSTOP_slit_hor,sSTOP_slit_oct
460 write(7,*) 'Quad entrance/mid/exit',sSTOP_quad_in,sSTOP_quad_mid,sSTOP_quad_out
461 write(7,*) 'D1 entrance/exit ',sSTOP_bm01_in,sSTOP_bm01_out
462 write(7,*) 'D2 entrance/exit ',sSTOP_bm02_in,sSTOP_bm02_out
463 write(7,*) 'Vacuum exit ',sSTOP_exit
464 write(7,*) 'Events reaching hut ',sSTOP_hut
465 write(7,*) 'DC1, DC2, Scin, Cal ',sSTOP_dc1,sSTOP_dc2,sSTOP_scin,sSTOP_cal
466 write(7,*) 'Successes ',sSTOP_successes
467 write(7,*)
468 endif
469 if (electron_arm.eq.3 .or. hadron_arm.eq.3) then
470 gaskelld 1.1 write(7,*) 'HRSr Trials: ',rSTOP_trials
471 write(7,*) 'Slit hor/vert ',rSTOP_slit_vert,rSTOP_slit_hor
472 write(7,*) 'Q1 entrance/mid/exit ',rSTOP_Q1_in,rSTOP_Q1_mid,rSTOP_Q1_out
473 write(7,*) 'Q2 entrance/mid/exit ',rSTOP_Q2_in,rSTOP_Q2_mid,rSTOP_Q2_out
474 write(7,*) 'Dipole entrance/exit ',rSTOP_D1_in,rSTOP_D1_out
475 write(7,*) 'Q3 entrance/mid/exit ',rSTOP_Q3_in,rSTOP_Q3_mid,rSTOP_Q3_out
476 write(7,*) 'Events reaching hut ',rSTOP_hut
477 write(7,*) 'VDC1, VDC2 ',rSTOP_dc1,rSTOP_dc2
478 write(7,*) 'S1, S2, Cal ',rSTOP_s1,rSTOP_s2,rSTOP_cal
479 write(7,*)
480 endif
481 if (electron_arm.eq.4 .or. hadron_arm.eq.4) then
482 write(7,*) 'HRSl Trials: ',lSTOP_trials
483 write(7,*) 'Slit hor/vert ',lSTOP_slit_vert,lSTOP_slit_hor
484 write(7,*) 'Q1 entrance/mid/exit ',lSTOP_Q1_in,lSTOP_Q1_mid,lSTOP_Q1_out
485 write(7,*) 'Q2 entrance/mid/exit ',lSTOP_Q2_in,lSTOP_Q2_mid,lSTOP_Q2_out
486 write(7,*) 'Dipole entrance/exit ',lSTOP_D1_in,lSTOP_D1_out
487 write(7,*) 'Q3 entrance/mid/exit ',lSTOP_Q3_in,lSTOP_Q3_mid,lSTOP_Q3_out
488 write(7,*) 'Events reaching hut ',lSTOP_hut
489 write(7,*) 'VDC1, VDC2 ',lSTOP_dc1,lSTOP_dc2
490 write(7,*) 'S1, S2, Cal ',lSTOP_s1,lSTOP_s2,lSTOP_cal
491 gaskelld 1.1 endif
492 if (electron_arm.eq.5 .or. hadron_arm.eq.5 .or.
493 > electron_arm.eq.6 .or. hadron_arm.eq.6) then
494 write(7,*) 'SHMS Trials: ',shmsSTOP_trials
495 write(7,*) 'Slit hor/vert/corners ',shmsSTOP_slit_hor,shmsSTOP_slit_vert,shmsSTOP_slit_oct
496 write(7,*) 'Q1 entrance/mid/exit ',shmsSTOP_Q1_in,shmsSTOP_Q1_mid,shmsSTOP_Q1_out
497 write(7,*) 'Q2 entrance/mid/exit ',shmsSTOP_Q2_in,shmsSTOP_Q2_mid,shmsSTOP_Q2_out
498 write(7,*) 'D1 entrance/mid/exit ',shmsSTOP_D1_in,shmsSTOP_D1_mid,shmsSTOP_D1_out
499 write(7,*) 'BP thingie in/out ',shmsSTOP_BP_in,shmsSTOP_BP_out
500 write(7,*) 'Events reaching hut ',shmsSTOP_hut
501 write(7,*) 'DC1, DC2, Scin, Cal ',shmsSTOP_dc1,shmsSTOP_dc2
502 write(7,*) 'S1, S2, S3, Cal ',shmsSTOP_s1,shmsSTOP_s2,shmsSTOP_s3,shmsSTOP_cal
503 write(7,*) 'Successes ',shmsSTOP_successes
504 write(7,*)
505 endif
506
507 close(7)
508
509 open(unit=7, file=genfile, status='unknown')
510
511 write(7,*) 'E arm Experimental Target Distributions:'
512 gaskelld 1.1 write(7,'(6a12)') 'delta','EXPERIM','yptar','EXPERIM','xptar','EXPERIM'
513 do i=1,nHbins
514 write(7,'(3(1x,2(e11.4,1x)))')
515 > H.RECON.e.delta.min+(i-0.5)*H.RECON.e.delta.bin,
516 > H.RECON.e.delta.buf(i), H.RECON.e.yptar.min+(i-0.5)*
517 > H.RECON.e.yptar.bin, H.RECON.e.yptar.buf(i),
518 > H.RECON.e.xptar.min+(i-0.5)*H.RECON.e.xptar.bin,
519 > H.RECON.e.xptar.buf(i)
520 enddo
521
522 write(7,*) 'P arm Experimental Target Distributions:'
523 write(7,'(6a12)') 'delta','EXPERIM','yptar','EXPERIM','xptar','EXPERIM'
524 do i=1,nHbins
525 write(7,'(3(1x,2(e11.4,1x)))')
526 > H.RECON.p.delta.min+(i-0.5)*H.RECON.p.delta.bin,
527 > H.RECON.p.delta.buf(i), H.RECON.p.yptar.min+(i-0.5)*
528 > H.RECON.p.yptar.bin, H.RECON.p.yptar.buf(i),
529 > H.RECON.p.xptar.min+(i-0.5)*H.RECON.p.xptar.bin,
530 > H.RECON.p.xptar.buf(i)
531 enddo
532
533 gaskelld 1.1 write(7,*) 'Distributions of Contributing E arm Events:'
534 write(7,'(6a12)') 'delta','CONTRIB','yuptar','CONTRIB','xptar','CONTRIB'
535 do i=1,nHbins
536 write(7,'(3(1x,2(e11.4,1x)))')
537 > H.gen.e.delta.min+(i-0.5)*H.gen.e.delta.bin,
538 > H.gen.e.delta.buf(i), H.gen.e.yptar.min+(i-0.5)*
539 > H.gen.e.yptar.bin, H.gen.e.yptar.buf(i),
540 > H.gen.e.xptar.min+(i-0.5)*H.gen.e.xptar.bin, H.gen.e.xptar.buf(i)
541 enddo
542
543 write(7,*) 'Distributions of Contributing P arm Events:'
544 write(7,'(6a12)') 'delta','CONTRIB','yptar','CONTRIB','xptar','CONTRIB'
545 do i=1,nHbins
546 write(7,'(3(1x,2(e11.4,1x)))')
547 > H.gen.p.delta.min+(i-0.5)*H.gen.p.delta.bin,
548 > H.gen.p.delta.buf(i), H.gen.p.yptar.min+(i-0.5)*
549 > H.gen.p.yptar.bin, H.gen.p.yptar.buf(i),
550 > H.gen.p.xptar.min+(i-0.5)*H.gen.p.xptar.bin, H.gen.p.xptar.buf(i)
551 enddo
552
553 write(7,*) 'Original E arm Events:'
554 gaskelld 1.1 write(7,'(6a12)') 'delta','ORIGIN','yptar','ORIGIN','xptar','ORIGIN'
555 do i=1,nHbins
556 write(7,'(3(1x,2(e11.4,1x)))')
557 > H.gen.e.delta.min+(i-0.5)*H.gen.e.delta.bin,
558 > H.gen.e.delta.buf(i), H.gen.e.yptar.min+(i-0.5)*
559 > H.gen.e.yptar.bin, H.geni.e.yptar.buf(i),
560 > H.gen.e.xptar.min+(i-0.5)*H.gen.e.xptar.bin, H.geni.e.xptar.buf(i)
561 enddo
562
563 write(7,*) 'Original P arm Events:'
564 write(7,'(6a12)') 'delta','ORIGIN','yptar','ORIGIN','xptar','ORIGIN'
565 do i=1,nHbins
566 write(7,'(3(1x,2(e11.4,1x)))')
567 > H.geni.p.delta.min+(i-0.5)*H.geni.p.delta.bin,
568 > H.geni.p.delta.buf(i), H.geni.p.yptar.min+(i-0.5)*
569 > H.geni.p.yptar.bin, H.geni.p.yptar.buf(i),
570 > H.geni.p.xptar.min+(i-0.5)*H.geni.p.xptar.bin, H.geni.p.xptar.buf(i)
571 enddo
572
573 write(7,*) 'Original Em/Pm distributions:'
574 write(7,'(4a12)') 'Em','ORIGIN','Pm','ORIGIN'
575 gaskelld 1.1 do i=1,nHbins
576 write(7,'(3(1x,4(e11.4,1x)))')
577 > H.geni.Em.min+(i-0.5)*H.geni.Em.bin,
578 > H.geni.Em.buf(i), H.geni.Pm.min+(i-0.5)*
579 > H.geni.Pm.bin, H.geni.Pm.buf(i)
580 enddo
581
582 close(7)
583
584 ! Counters, etc report to the screen and to the diagnostic histogram file
585 ! call report(6,timestring1,timestring2,central,contrib,sum_sigcc,aveerr,resol)
586 open(unit=7,file=histfile,status='unknown')
587 call report(7,timestring1,timestring2,central,contrib,sum_sigcc,aveerr,resol)
588 close(unit=7)
589
590 1000 end
591
592 !-------------------------------------------------------------------
593
594 subroutine inc(hist,val,weight)
595
596 gaskelld 1.1 implicit none
597 include 'histograms.inc'
598
599 integer*4 ibin
600 real*8 val, weight
601 record /hist_entry/ hist
602
603 ibin= nint(0.5+(val-hist.min)/hist.bin)
604 if(ibin.ge.1.and.ibin.le.nHbins)then
605 hist.buf(ibin) = hist.buf(ibin) + weight
606 endif
607
608 return
609 end
610
611 !--------------------------------------------------------------------
612
613 subroutine report(iun,timestring1,timestring2,central,contrib,
614 > sum_sigcc,aveerr,resol)
615
616 implicit none
617 gaskelld 1.1 include 'simulate.inc'
618 include 'radc.inc'
619 include 'brem.inc'
620
621 integer*4 iun
622 real*8 sum_sigcc
623 character*23 timestring1, timestring2
624 record /contrib/ contrib
625 record /event_central/ central
626 record /sums_twoarm/ aveerr, resol
627
628 ! Output of diagnostics
629
630 ! Run time
631 write(iun,'(/1x,''BEGIN Time: '',a23)') timestring1
632 write(iun,'(1x,''END Time: '',a23)') timestring2
633
634 ! Kinematics
635 write(iun,*) 'KINEMATICS:'
636 if (doing_eep) then
637 if (doing_hyd_elast) then
638 gaskelld 1.1 write(iun,*) ' ****-------- H(e,e''p) --------****'
639 else if (doing_deuterium) then
640 write(iun,*) ' ****-------- D(e,e''p) --------****'
641 else if (doing_heavy) then
642 write(iun,*) ' ****-------- A(e,e''p) --------****'
643 else
644 stop 'I don''t have ANY idea what (e,e''p) we''re doing!!!'
645 endif
646 else if (doing_semi) then
647 if (doing_semipi) then
648 if (targ.A .eq. 1) then
649 if(doing_hplus) then
650 write(iun,*) ' ****-------- H(e,e''pi+)X --------****'
651 else
652 write(iun,*) ' ****-------- H(e,e''pi-)X --------****'
653 endif
654 elseif (targ.A .eq. 2) then
655 if(doing_hplus) then
656 write(iun,*) ' ****-------- D(e,e''pi+)X --------****'
657 else
658 write(iun,*) ' ****-------- D(e,e''pi-)X --------****'
659 gaskelld 1.1 endif
660 else
661 stop 'I don''t have ANY idea what A(e,e''pi)X we''re doing!!!'
662 endif
663 else if (doing_semika) then
664 if (targ.A .eq. 1) then
665 if(doing_hplus) then
666 write(iun,*) ' ****-------- H(e,e''k+)X --------****'
667 else
668 write(iun,*) ' ****-------- H(e,e''k-)X --------****'
669 endif
670 elseif (targ.A .eq. 2) then
671 if(doing_hplus) then
672 write(iun,*) ' ****-------- D(e,e''k+)X --------****'
673 else
674 write(iun,*) ' ****-------- D(e,e''k-)X --------****'
675 endif
676 else
677 stop 'I don''t have ANY idea what A(e,e''k)X we''re doing!!!'
678 endif
679 else
680 gaskelld 1.1 stop 'I don''t have ANY idea what A(e,e''x)X we''re doing!!!'
681 endif
682 else if (doing_rho) then
683 if (targ.A .eq. 1) then
684 write(iun,*) ' ****-------- H(e,e''rho) --------****'
685 else
686 write(iun,*) 'I am not set up for anything else yet!'
687 endif
688 else if (doing_delta) then
689 if (doing_hyddelta) then
690 write(6,*) ' ****-------- H(e,e''p)pi --------****'
691 else if (doing_deutpi) then
692 write(6,*) ' ****-------- D(e,e''p)pi --------****'
693 else if (doing_hepi) then
694 write(6,*) ' ****-------- A(e,e''p)pi --------****'
695 else
696 stop 'I don''t have ANY idea what (e,e''p)pi we''re doing!!!'
697 endif
698 else if (doing_pion) then
699 if (doing_hydpi) then
700 if (targ.A .eq. 1) then
701 gaskelld 1.1 write(iun,*) ' ****-------- H(e,e''pi) --------****'
702 else if (targ.A .ge.3) then
703 write(iun,*) ' ****-------- A(e,e''pi) --------****'
704 endif
705 else if (doing_deutpi) then
706 write(iun,*) ' ****-------- D(e,e''pi) --------****'
707 else if (doing_hepi) then
708 write(iun,*) ' ****-------- A(e,e''pi) --------****'
709 else
710 stop 'I don''t have ANY idea what (e,e''pi) we''re doing!!!'
711 endif
712 if (which_pion .eq. 0) then
713 write(iun,*) ' ****---- Default Final State ----****'
714 else if (which_pion .eq. 10) then
715 write(iun,*) ' ****---- Final State is A+pi ----****'
716 endif
717 else if (doing_kaon) then
718 if (doing_hydkaon) then
719 if (targ.A .eq. 1) then
720 write(iun,*) ' ****-------- H(e,e''K) --------****'
721 else if (targ.A .ge.3) then
722 gaskelld 1.1 write(iun,*) ' ****-------- A(e,e''K) --------****'
723 endif
724 else if (doing_deutkaon) then
725 write(iun,*) ' ****-------- D(e,e''K) --------****'
726 else if (doing_hekaon) then
727 write(iun,*) ' ****-------- A(e,e''K) --------****'
728 else
729 stop 'I don''t have ANY idea what (e,e''K) we''re doing!!!'
730 endif
731 if (which_kaon.eq.0) then
732 write(iun,*) ' ****---- producing a LAMBDA ----****'
733 else if (which_kaon.eq.1) then
734 write(iun,*) ' ****---- producing a SIGMA0 ----****'
735 else if (which_kaon.eq.2) then
736 write(iun,*) ' ****---- producing a SIGMA- ----****'
737 else if (which_kaon.eq.10) then
738 write(iun,*) ' ****---- WITH BOUND LAMBDA ----****'
739 else if (which_kaon.eq.11) then
740 write(iun,*) ' ****---- WITH BOUND SIGMA0 ----****'
741 else if (which_kaon.eq.12) then
742 write(iun,*) ' ****---- WITH BOUND SIGMA- ----****'
743 gaskelld 1.1 else
744 stop 'I don''t have ANY idea what (e,e''K) we''re doing!!!'
745 endif
746 else if (doing_phsp) then
747 write(iun,*) ' ****--- PHASE SPACE - NO physics, NO radiation (may not work)---****'
748 else
749 stop 'I don''t have ANY idea what we''re doing!!!'
750 endif
751
752 write(iun,'(9x,a12,'' = '',f15.4,2x,a10)') 'Ebeam', Ebeam, 'MeV'
753 write(iun,'(9x,a12,'' = '',f15.4,2x,a10)')
754 > '(dE/E)beam', dEbeam/Ebeam, '(full wid)'
755 write(iun,'(9x,a12,'' = '',f15.4,2x,a10)') 'x-width', gen.xwid, 'cm'
756 write(iun,'(9x,a12,'' = '',f15.4,2x,a10)') 'y-width', gen.ywid, 'cm'
757 write(iun,'(9x,a12,'' = '',i15,2x,a16)')
758 > 'fr_pattern',targ.fr_pattern, '1=square,2=circ'
759 write(iun,'(9x,a12,'' = '',f15.4,2x,a10)') 'fr1', targ.fr1, 'cm'
760 write(iun,'(9x,a12,'' = '',f15.4,2x,a10)') 'fr2', targ.fr2, 'cm'
761
762 write(iun,*) ' '
763 write(iun,'(9x,18x,2(a15,2x))') '____E arm____','____P arm____'
764 gaskelld 1.1 write(iun,'(9x,a12,'' = '',2(f15.4,2x),2x,a5)') 'angle',
765 > spec.e.theta*degrad, spec.p.theta*degrad, 'deg'
766 write(iun,'(9x,a12,'' = '',2(f15.4,2x),2x,a5)') 'momentum',
767 > spec.e.p, spec.p.p, 'MeV/c'
768
769 write(iun,'(9x,a12,'' = '',2(f15.4,2x),2x,a5)') 'x offset',
770 > spec.e.offset.x, spec.p.offset.x, 'cm'
771 write(iun,'(9x,a12,'' = '',2(f15.4,2x),2x,a5)') 'y offset',
772 > spec.e.offset.y, spec.p.offset.y, 'cm'
773 write(iun,'(9x,a12,'' = '',2(f15.4,2x),2x,a5)') 'z offset',
774 > spec.e.offset.z, spec.p.offset.z, 'cm'
775 write(iun,'(9x,a12,'' = '',2(f15.4,2x),2x,a5)') 'xptar offset',
776 > spec.e.offset.xptar, spec.p.offset.xptar, 'mr'
777 write(iun,'(9x,a12,'' = '',2(f15.4,2x),2x,a5)') 'yptar offset',
778 > spec.e.offset.yptar, spec.p.offset.yptar, 'mr'
779
780 write(iun,*) ' VALUES FOR "CENTRAL" EVENT:'
781 write(iun,'(9x,a12,'' = '',2(f15.4,2x),2x,a5)') 'delta',
782 > central.e.delta, central.p.delta, '%'
783 write(iun,'(9x,a12,'' = '',2(f15.4,2x),2x,a5)') 'xptar',
784 > central.e.xptar, central.p.xptar, 'mr'
785 gaskelld 1.1 write(iun,'(9x,a12,'' = '',2(f15.4,2x),2x,a5)') 'yptar',
786 > central.e.yptar, central.p.yptar, 'mr'
787
788 write(iun,'(17x,a10,'' = '',f15.4,2x,a9)') 'Q2',central.Q2/1.d6,'(GeV/c)^2'
789 write(iun,'(17x,a10,'' = '',f15.4,2x,a9)') 'q', central.q, 'MeV/c'
790 write(iun,'(17x,a10,'' = '',f15.4,2x,a9)') 'nu',
791 > central.nu, 'MeV'
792 write(iun,'(17x,a10,'' = '',f15.4,2x,a9)') 'recon Em', central.Em, 'MeV'
793 write(iun,'(17x,a10,'' = '',f15.4,2x,a9)') 'recon Pm', central.Pm, 'MeV/c'
794 write(iun,'(17x,a10,'' = '',f15.4,2x,a9)') 'recon W', central.W, 'MeV/c'
795 write(iun,'(17x,a10,'' = '',f15.4,2x,a9)') 'recon MM', central.MM, 'MeV/c'
796
797 ! Target
798 write(iun,*) 'TARGET specs:'
799 9911 format(2x,2(5x,a10,' = ',e12.6,1x,a5))
800 write(iun,9911) 'A', targ.A, ' ', 'Z', targ.Z, ' '
801 write(iun,9911) 'mass', targ.mass_amu, 'amu', 'mass', targ.M,'MeV'
802 write(iun,9911) 'Mrec', targ.mrec_amu, 'amu', 'Mrec', targ.Mrec,'MeV'
803 write(iun,9911) 'Mtar_struc',targ.Mtar_struck,'MeV',
804 > 'Mrec_struc',targ.Mrec_struck,'MeV'
805 write(iun,9911) 'rho', targ.rho, 'g/cm3', 'thick', targ.thick,'g/cm2'
806 gaskelld 1.1 write(iun,9911) 'angle', targ.angle*degrad, 'deg', 'abundancy',
807 > targ.abundancy, '%'
808 write(iun,9911) 'X0', targ.X0, 'g/cm2', 'X0_cm', targ.X0_cm,'cm'
809 write(iun,9911) 'length',targ.length,'cm','zoffset',targ.zoffset,'cm'
810 write(iun,9911) 'xoffset',targ.xoffset,'cm','yoffset',targ.yoffset,'cm'
811 write(iun,'(t12,3a15)') '__ave__', '__lo__', '__hi__'
812 9912 format(1x,a15,3f15.5,2x,a6)
813 write(iun,9912) 'Coulomb', targ.Coulomb.ave, targ.Coulomb.min,
814 > targ.Coulomb.max, 'MeV'
815 write(iun,9912) 'Eloss_beam', targ.Eloss(1).ave,
816 > targ.Eloss(1).min, targ.Eloss(1).max, 'MeV'
817 write(iun,9912) 'Eloss_e', targ.Eloss(2).ave, targ.Eloss(2).min,
818 > targ.Eloss(2).max, 'MeV'
819 write(iun,9912) 'Eloss_p', targ.Eloss(3).ave, targ.Eloss(3).min,
820 > targ.Eloss(3).max, 'MeV'
821 write(iun,9912) 'teff_beam', targ.teff(1).ave, targ.teff(1).min,
822 > targ.teff(1).max, 'radlen'
823 write(iun,9912) 'teff_e', targ.teff(2).ave, targ.teff(2).min,
824 > targ.teff(2).max, 'radlen'
825 write(iun,9912) 'teff_p', targ.teff(3).ave, targ.teff(3).min,
826 > targ.teff(3).max, 'radlen'
827 gaskelld 1.1 9913 format(1x,a15,t25,f15.5,2x,a6)
828 write(iun,9913) 'musc_nsig_max', targ.musc_nsig_max, ' '
829 write(iun,9913) 'musc_max_beam', targ.musc_max(1)*1000., 'mr'
830 write(iun,9913) 'musc_max_e', targ.musc_max(2)*1000., 'mr'
831 write(iun,9913) 'musc_max_p', targ.musc_max(3)*1000., 'mr'
832
833 ! Flags
834 write(iun,*) 'FLAGS:'
835 write(iun,'(5x,3(2x,a19,''='',l2))') 'doing_eep', doing_eep,
836 > 'doing_kaon', doing_kaon, 'doing_pion', doing_pion
837 write(iun,'(5x,3(2x,a19,''='',l2))') 'doing_semi', doing_semi,
838 > 'doing_rho', doing_rho, 'doing_hplus', doing_hplus
839 write(iun,'(5x,2(2x,a19,''='',l2))') 'doing_semipi',doing_semipi,
840 > 'doing_semika', doing_semika
841 write(iun,'(5x,2(2x,a19,''='',l2))') 'doing_delta',doing_delta,
842 > 'doing_phsp', doing_phsp
843 write(iun,'(5x,2(2x,a19,''='',l2))') 'which_pion', which_pion,
844 > 'which_kaon', which_kaon
845 write(iun,'(5x,3(2x,a19,''='',l2))') 'doing_hyd_elast', doing_hyd_elast,
846 > 'doing_deuterium', doing_deuterium, 'doing_heavy', doing_heavy
847 write(iun,'(5x,3(2x,a19,''='',l2))') 'doing_hydpi', doing_hydpi,
848 gaskelld 1.1 > 'doing_deutpi', doing_deutpi, 'doing_hepi', doing_hepi
849 write(iun,'(5x,3(2x,a19,''='',l2))') 'doing_hydkaon', doing_hydkaon,
850 > 'doing_deutkaon', doing_deutkaon, 'doing_hekaon', doing_hekaon
851 write(iun,'(5x,3(2x,a19,''='',l2))') 'doing_hydsemi', doing_hydsemi,
852 > 'doing_deutsemi', doing_deutsemi, 'do_fermi', do_fermi
853 write(iun,'(5x,3(2x,a19,''='',l2))') 'doing_hydrho', doing_hydrho,
854 > 'doing_deutrho', doing_deutrho, 'doing_herho', doing_herho
855 write(iun,'(5x,(2x,a19,''='',l2),2(2x,a19,''='',i2))') 'mc_smear',
856 > mc_smear,'electron_arm',electron_arm,'hadron_arm',hadron_arm
857 write(iun,'(5x,3(2x,a19,''='',l2)))') 'using_Eloss', using_Eloss,
858 > 'using_Coulomb',using_Coulomb,'deForest_flag',deForest_flag
859 write(iun,'(5x,3(2x,a19,''='',l2)))') 'correct_Eloss', correct_Eloss,
860 > 'correct_raster',correct_raster, 'doing_decay', doing_decay
861 write(iun,'(5x,2(2x,a19,''='',l2))')
862 > 'using_E_arm_montecarlo', using_E_arm_montecarlo,
863 > 'using_P_arm_montecarlo', using_P_arm_montecarlo
864 if (electron_arm.eq.5 .or. hadron_arm.eq.5 .or.
865 > electron_arm.eq.6 .or. hadron_arm.eq.6)
866 > write(iun,'(7x,a19,''='',l2)') 'use_first_cer',use_first_cer
867 write(iun,'(7x,a11,''='',f10.3,a4)') 'ctau',ctau,'cm'
868
869 gaskelld 1.1 ! Counters
870 write(iun,*) 'COUNTERS:'
871 write(iun,'(12x,''Ngen (request) = '',i10)') ngen
872 write(iun,'(12x,''Ntried = '',i10)') ntried
873 write(iun,'(12x,''Ncontribute = '',i10)') ncontribute
874 write(iun,'(12x,''Nco_no_rad_prot= '',i10)') ncontribute_no_rad_proton
875 write(iun,'(12x,''-> %no_rad_prot= '',f10.3)')
876 > (100.*ncontribute_no_rad_proton/max(dble(ncontribute),0.1d0))
877 write(iun,'(/1x,''INTEGRATED WEIGHTS (number of counts in delta/Em cuts!):'')')
878 write(iun,'(1x,'' MeV: wtcontr= '',e16.8)') wtcontribute/nevent
879
880 ! Radiative corrections
881 write(iun,*) 'RADIATIVE CORRECTIONS:'
882 if (.not.using_rad) then
883 write(iun,'(x,a14,''='',l3)') 'using_rad', using_rad
884 else
885 write(iun,'(4(x,a14,''='',l3))') 'use_expon',use_expon,
886 > 'include_hard',include_hard,'calc_spence',calculate_spence
887 write(iun,'(2(x,a14,''='',l3))') 'using_rad', using_rad,
888 > 'use_offshell_rad', use_offshell_rad
889 write(iun,'(4(x,a14,''='',i3))') 'rad_flag',rad_flag,
890 gaskelld 1.1 > 'extrad_flag', extrad_flag, 'one_tail', one_tail,
891 > 'intcor_mode', intcor_mode
892 write(iun,'(x,a14,''='',f11.3)') 'dE_edge_test',dE_edge_test
893 write(iun,'(x,a14,''='',f11.3)') 'Egamma_max', Egamma_tot_max
894
895 9914 format(1x,a18,' = ',4f11.3)
896 write(iun,*) 'Central Values:'
897 write(iun,9914) 'hardcorfac', central.rad.hardcorfac
898 write(iun,9914) 'etatzai', central.rad.etatzai
899 write(iun,9914) 'frac(1:3)', central.rad.frac
900 write(iun,9914) 'lambda(1:3)', central.rad.lambda
901 write(iun,9914) 'bt(1:2)', central.rad.bt
902 write(iun,9914) 'c_int(0:3)', central.rad.c_int
903 write(iun,9914) 'c_ext(0:3)', central.rad.c_ext
904 write(iun,9914) 'c(0:3)', central.rad.c
905 write(iun,9914) 'g_int', central.rad.g_int
906 write(iun,9914) 'g_ext', central.rad.g_ext
907 write(iun,9914) 'g(0:3)', central.rad.g
908 endif
909
910 ! Miscellaneous
911 gaskelld 1.1 write(iun,*) 'MISCELLANEOUS:'
912 9915 format(12x,a14,' = ',e16.6,1x,a6)
913 write(iun,*) 'Note that central.sigcc is for central delta,theta,phi in both spectrometers'
914 write(iun,*) ' and may give non-physical kinematics, esp. for Hydrogen'
915 write(iun,*) 'Note also that AVE.sigcc is really AVER.weight (the two arenot exactly equal)'
916 write(iun,9915) 'CENTRAL.sigcc', central.sigcc, ' '
917 write(iun,9915) 'AVERAGE.sigcc', sum_sigcc/nevent, ' '
918 write(iun,9915) 'charge', EXPER.charge, 'mC'
919 write(iun,9915) 'targetfac', targetfac, ' '
920 write(iun,9915) 'luminosity', luminosity, 'ub^-1'
921 write(iun,9915) 'luminosity', luminosity*(hbarc/100000.)**2, 'GeV^2'
922 write(iun,9915) 'genvol', genvol, ' '
923 write(iun,9915) 'normfac', normfac, ' '
924 9916 format(12x,a14,' = ',f6.1,' to ',f6.1,' in ',i4,' bins of ',f7.2,1x,a5)
925 if (doing_heavy) then
926 write(iun,'(12x,''Theory file: '',a)')
927 > theory_file(1:index(theory_file,' ')-1)
928 endif
929
930 ! Resolution summary
931
932 gaskelld 1.1 write(iun,*) 'RECON SUMMARY: Ave.Error Resolution'
933 write(iun,99165) 'Electron arm: delta =',10.*aveerr.e.delta,10.*resol.e.delta,'x10^-3'
934 write(iun,99165) 'xptar =',1000.*aveerr.e.xptar,1000.*resol.e.xptar,'mr'
935 write(iun,99165) 'yptar =',1000.*aveerr.e.yptar,1000.*resol.e.yptar,'mr'
936 write(iun,99165) 'ytar =',10.*aveerr.e.ytar,10.*resol.e.ytar ,'mm'
937 write(iun,99165) 'Hadron arm: delta =',10.*aveerr.p.delta,10.*resol.p.delta,'x10-3'
938 write(iun,99165) 'xptar =',1000.*aveerr.p.xptar,1000.*resol.p.xptar,'mr'
939 write(iun,99165) 'yptar =',1000.*aveerr.p.yptar,1000.*resol.p.yptar,'mr'
940 write(iun,99165) 'ytar =',10.*aveerr.p.ytar,10.*resol.p.ytar,'mm'
941 99165 format(2x,a22,2f12.5,2x,a)
942
943
944 ! Input spectrometer limits.
945
946 write(iun,*) 'Input Spectrometer Limits:'
947 write(iun,'(9x,a25,'' = '',2(2x,f15.4),a5)') 'SPedge.e.delta.min/max',
948 > SPedge.e.delta.min,SPedge.e.delta.max,'%'
949 write(iun,'(9x,a25,'' = '',2(2x,f15.4),a5)') 'SPedge.e.yptar.min/max',
950 > SPedge.e.yptar.min,SPedge.e.yptar.max,'rad'
951 write(iun,'(9x,a25,'' = '',2(2x,f15.4),a5)') 'SPedge.e.xptar.min/max',
952 > SPedge.e.xptar.min,SPedge.e.xptar.max,'rad'
953 gaskelld 1.1 write(iun,'(9x,a25,'' = '',2(2x,f15.4),a5)') 'SPedge.p.delta.min/max',
954 > SPedge.p.delta.min,SPedge.p.delta.max,'%'
955 write(iun,'(9x,a25,'' = '',2(2x,f15.4),a5)') 'SPedge.p.yptar.min/max',
956 > SPedge.p.yptar.min,SPedge.p.yptar.max,'rad'
957 write(iun,'(9x,a25,'' = '',2(2x,f15.4),a5)') 'SPedge.p.xptar.min/max',
958 > SPedge.p.xptar.min,SPedge.p.xptar.max,'rad'
959
960
961 ! Edges used in generation and checking, as well as range of events found
962 ! to contribute within those edges
963
964 ! ... on GENERATED qties
965 write(iun,*) 'Limiting VERTEX values (vertex.e/p.*,Em,Pm,Trec)'
966 write(iun,*) ' USED limits are gen.e/p.*, and VERTEXedge.Em,Pm,Trec'
967 write(iun,'(t25,2x,a16,2x,t50,2x,a16,2x)') '______used______',
968 > '_____found______'
969 write(iun,'(t25,2a10,t50,2a10)') 'min','max', 'lo', 'hi'
970 9917 format(1x,a18,t21,2f12.3,t50,2f10.3,2x,a5)
971 write(iun,9917) 'E arm delta', gen.e.delta.min, gen.e.delta.max,
972 > contrib.gen.e.delta.lo, contrib.gen.e.delta.hi, '%'
973 write(iun,9917) 'E arm yptar', gen.e.yptar.min*1000.,
974 gaskelld 1.1 > gen.e.yptar.max*1000.,
975 > contrib.gen.e.yptar.lo*1000., contrib.gen.e.yptar.hi*1000.,'mr'
976 write(iun,9917) 'E arm xptar', gen.e.xptar.min*1000.,
977 > gen.e.xptar.max*1000.,
978 > contrib.gen.e.xptar.lo*1000., contrib.gen.e.xptar.hi*1000.,'mr'
979 write(iun,9917) 'P arm delta', gen.p.delta.min, gen.p.delta.max,
980 > contrib.gen.p.delta.lo, contrib.gen.p.delta.hi, '%'
981 write(iun,9917) 'P arm yptar', gen.p.yptar.min*1000.,
982 > gen.p.yptar.max*1000.,
983 > contrib.gen.p.yptar.lo*1000., contrib.gen.p.yptar.hi*1000.,'mr'
984 write(iun,9917) 'P arm xptar', gen.p.xptar.min*1000.,
985 > gen.p.xptar.max*1000.,
986 > contrib.gen.p.xptar.lo*1000., contrib.gen.p.xptar.hi*1000.,'mr'
987 write(iun,9917) 'sumEgen', gen.sumEgen.min, gen.sumEgen.max,
988 > contrib.gen.sumEgen.lo, contrib.gen.sumEgen.hi, 'MeV'
989
990 ! ... on VERTEX qties
991 ! write(iun,*) 'Limiting VERTEX values:'
992 ! write(iun,'(t25,2x,a16,2x,t50,2x,a16,2x)')
993 ! > '______used______', '_____found______'
994 ! write(iun,'(t25,2a10,t50,2a10)') 'min','max', 'lo', 'hi'
995 gaskelld 1.1 write(iun,9917) 'Trec', VERTEXedge.Trec.min, VERTEXedge.Trec.max,
996 > contrib.vertex.Trec.lo, contrib.vertex.Trec.hi, 'MeV'
997 write(iun,9917) 'Em', VERTEXedge.Em.min, VERTEXedge.Em.max,
998 > contrib.vertex.Em.lo, contrib.vertex.Em.hi, 'MeV'
999 write(iun,9917) 'Pm', VERTEXedge.Pm.min, VERTEXedge.Pm.max,
1000 > contrib.vertex.Pm.lo, contrib.vertex.Pm.hi, 'MeV/c'
1001 if ((doing_deuterium .or. doing_pion .or. doing_kaon .or. doing_delta) .and. using_rad)
1002 > write(iun,*) ' *** NOTE: sumEgen.min only used in GENERATE_RAD'
1003
1004 ! ... on TRUE qties
1005 write(iun,*) 'Limiting ORIGINAL values: orig.e/p.*,Em,Pm,Trec (no edge.* limits for Pm,Trec)'
1006 write(iun,'(t25,2x,a16,2x,t50,2x,a16,2x)')
1007 > '______used______', '_____found______'
1008 write(iun,'(t25,2a10,t50,2a10)') 'min','max', 'lo', 'hi'
1009 write(iun,9917) 'E arm E', edge.e.E.min, edge.e.E.max,
1010 > contrib.tru.e.E.lo, contrib.tru.e.E.hi, 'MeV'
1011 write(iun,9917) 'E arm yptar', edge.e.yptar.min*1000.,
1012 > edge.e.yptar.max*1000.,
1013 > contrib.tru.e.yptar.lo*1000., contrib.tru.e.yptar.hi*1000.,'mr'
1014 write(iun,9917) 'E arm xptar', edge.e.xptar.min*1000., edge.e.xptar.max*1000.,
1015 > contrib.tru.e.xptar.lo*1000., contrib.tru.e.xptar.hi*1000., 'mr'
1016 gaskelld 1.1 write(iun,9917) 'P arm E', edge.p.E.min, edge.p.E.max,
1017 > contrib.tru.p.E.lo, contrib.tru.p.E.hi, 'MeV'
1018 write(iun,9917) 'P arm yptar', edge.p.yptar.min*1000.,
1019 > edge.p.yptar.max*1000.,
1020 > contrib.tru.p.yptar.lo*1000., contrib.tru.p.yptar.hi*1000.,'mr'
1021 write(iun,9917) 'P arm xptar', edge.p.xptar.min*1000., edge.p.xptar.max*1000.,
1022 > contrib.tru.p.xptar.lo*1000., contrib.tru.p.xptar.hi*1000., 'mr'
1023 write(iun,9917) 'Em', max(-999999.999d0,edge.Em.min), min(999999.999d0,edge.Em.max),
1024 > contrib.tru.Em.lo, contrib.tru.Em.hi, 'MeV'
1025 write(iun,9917) 'Pm', 0., 0., contrib.tru.Pm.lo,
1026 > contrib.tru.Pm.hi, 'MeV'
1027 write(iun,9917) 'Trec', 0., 0., contrib.tru.Trec.lo,
1028 > contrib.tru.Trec.hi, 'MeV'
1029
1030 ! ... on SPECTROMETER qties
1031 write(iun,*) 'Limiting SPECTROMETER values'
1032 write(iun,'(t25,2x,a16,2x,t50,2x,a16,2x)')
1033 > '______used______', '_____found______'
1034 write(iun,'(t25,2a10,t50,2a10)') 'min','max', 'lo', 'hi'
1035 write(iun,9917) 'E arm delta', SPedge.e.delta.min,
1036 > SPedge.e.delta.max, contrib.SP.e.delta.lo,
1037 gaskelld 1.1 > contrib.SP.e.delta.hi, '%'
1038 write(iun,9917) 'E arm yptar', SPedge.e.yptar.min*1000.,
1039 > SPedge.e.yptar.max*1000.,
1040 > contrib.SP.e.yptar.lo*1000., contrib.SP.e.yptar.hi*1000., 'mr'
1041 write(iun,9917) 'E arm xptar', SPedge.e.xptar.min*1000.,
1042 > SPedge.e.xptar.max*1000.,
1043 > contrib.SP.e.xptar.lo*1000., contrib.SP.e.xptar.hi*1000., 'mr'
1044 write(iun,9917) 'P arm delta', SPedge.p.delta.min,
1045 > SPedge.p.delta.max, contrib.SP.p.delta.lo,
1046 > contrib.SP.p.delta.hi, '%'
1047 write(iun,9917) 'P arm yptar', SPedge.p.yptar.min*1000.,
1048 > SPedge.p.yptar.max*1000.,
1049 > contrib.SP.p.yptar.lo*1000., contrib.SP.p.yptar.hi*1000., 'mr'
1050 write(iun,9917) 'P arm xptar', SPedge.p.xptar.min*1000.,
1051 > SPedge.p.xptar.max*1000.,
1052 > contrib.SP.p.xptar.lo*1000., contrib.SP.p.xptar.hi*1000., 'mr'
1053
1054 ! ... on RADIATION qties
1055 if (using_rad) then
1056 write(iun,*) 'Limiting RADIATION values CONTRIBUTING to the (Em,Pm) distributions:'
1057 write(iun,'(t25,2x,a16,2x,t50,2x,a16,2x)')
1058 gaskelld 1.1 > '______used______', '_____found______'
1059 write(iun,'(t25,2a10,t50,2a10)') 'min','max', 'lo', 'hi'
1060 write(iun,9917) 'Egamma(1)', 0., Egamma1_max,
1061 > contrib.rad.Egamma(1).lo, contrib.rad.Egamma(1).hi, 'MeV'
1062 write(iun,9917) 'Egamma(2)', 0., Egamma2_max, contrib.rad.Egamma(2).lo,
1063 > contrib.rad.Egamma(2).hi, 'MeV'
1064 write(iun,9917) 'Egamma(3)', 0., Egamma3_max, contrib.rad.Egamma(3).lo,
1065 > contrib.rad.Egamma(3).hi, 'MeV'
1066 write(iun,9917) 'Egamma_total', 0., Egamma_tot_max,
1067 > contrib.rad.Egamma_total.lo, contrib.rad.Egamma_total.hi,'MeV'
1068 endif
1069
1070 ! ... on slops
1071 write(iun,*) 'ACTUAL and LIMITING SLOP values used/obtained:'
1072 write(iun,'(t25,3a10)') '__used__', '__min__', '__max__'
1073 9918 format(1x,a10,a12,t25,3f10.3,2x,a5)
1074 write(iun,9918) 'slop.MC ', 'E arm delta', slop.MC.e.delta.used,
1075 > slop.MC.e.delta.lo, slop.MC.e.delta.hi, '%'
1076 write(iun,9918) ' ', 'E arm yptar', slop.MC.e.yptar.used*1000.,
1077 > slop.MC.e.yptar.lo*1000., slop.MC.e.yptar.hi*1000., 'mr'
1078 write(iun,9918) ' ', 'E arm xptar', slop.MC.e.xptar.used*1000.,
1079 gaskelld 1.1 > slop.MC.e.xptar.lo*1000., slop.MC.e.xptar.hi*1000., 'mr'
1080 write(iun,9918) ' ', 'P arm delta', slop.MC.p.delta.used,
1081 > slop.MC.p.delta.lo, slop.MC.p.delta.hi, '%'
1082 write(iun,9918) ' ', 'P arm yptar', slop.MC.p.yptar.used*1000.,
1083 > slop.MC.p.yptar.lo*1000., slop.MC.p.yptar.hi*1000., 'mr'
1084 write(iun,9918) ' ', 'P arm xptar', slop.MC.p.xptar.used*1000.,
1085 > slop.MC.p.xptar.lo*1000., slop.MC.p.xptar.hi*1000., 'mr'
1086 write(iun,9918) 'slop.total', 'Em', slop.total.Em.used,
1087 > slop.total.Em.lo, slop.total.Em.hi, 'MeV'
1088 write(iun,9918) ' ', 'Pm', 0., slop.total.Pm.lo,
1089 > slop.total.Pm.hi, 'MeV/c'
1090
1091 write(iun,'(/)')
1092 return
1093 end
1094
1095 !-----------------------------------------------------------------------
1096
1097 subroutine calculate_central(central,vertex0)
1098
1099 implicit none
1100 gaskelld 1.1 include 'simulate.inc'
1101 include 'radc.inc'
1102
1103 integer i
1104 real*8 m_spec
1105 logical success
1106 record /event_main/ main0
1107 record /event/ vertex0, recon0
1108 record /event_central/ central
1109
1110 ! JRA 2002: Redo this so that central values are chosen as in generate,
1111 ! and then call complete_ev and complete_recon_ev, just like a normal event.
1112
1113 if (debug(2)) write(6,*)'calc_cent: entering...'
1114 main0.target.x = 0.0
1115 main0.target.y = 0.0
1116 main0.target.z = targ.zoffset
1117 main0.target.rastery = 0.0
1118 main0.target.Eloss(1) = targ.Eloss(1).ave
1119 main0.target.Coulomb = targ.Coulomb.ave
1120 main0.target.teff(1) = targ.teff(1).ave
1121 gaskelld 1.1 vertex0.Ein = Ebeam_vertex_ave
1122 main0.Ein_shift = 0.0
1123 main0.Ee_shift = 0.0
1124 main0.gen_weight = 1.0
1125
1126 ! Set all of these to central values, but then complete_ev will force
1127 ! the variables that are not normally generated to their appropriate values.
1128 vertex0.e.delta = 0.0
1129 vertex0.e.yptar = 0.0
1130 vertex0.e.xptar = 0.0
1131 vertex0.e.theta = spec.e.theta
1132 vertex0.e.phi = spec.e.phi
1133 vertex0.e.P = spec.e.P*(1.+vertex0.e.delta/100.)
1134 vertex0.e.E = vertex0.e.P
1135
1136 vertex0.p.delta = 0.0
1137 vertex0.p.yptar = 0.0
1138 vertex0.p.xptar = 0.0
1139 vertex0.p.theta = spec.p.theta
1140 vertex0.p.phi = spec.p.phi
1141 vertex0.p.P = spec.p.P*(1.+vertex0.p.delta/100.)
1142 gaskelld 1.1 vertex0.p.E = sqrt(vertex0.p.P**2 + Mh2)
1143
1144 pfer = 0.0
1145 pferx = 0.0
1146 pfery = 0.0
1147 pferz = 0.0
1148 vertex0.Em = targ.Mtar_struck + targ.Mrec - targ.M
1149 m_spec = targ.M - targ.Mtar_struck + vertex0.Em !=targ.Mrec
1150 efer = targ.M - sqrt(m_spec**2+pfer**2) !=M-Mrec
1151
1152 ! Old version - not appropriate for all event types.
1153 ! Pop in generation values for central event
1154 !
1155 ! if (debug(2)) write(6,*)'calc_cent: entering...'
1156 ! main0.target.x = 0.0
1157 ! main0.target.y = 0.0
1158 ! main0.target.z = 0.0
1159 ! vertex0.Ein = Ebeam_vertex_ave
1160 ! main0.target.Coulomb = targ.Coulomb.ave
1161 ! main0.target.Eloss(1) = targ.Eloss(1).ave
1162 ! main0.target.teff(1) = targ.teff(1).ave
1163 gaskelld 1.1 ! vertex0.e.delta = 0.0
1164 ! vertex0.e.yptar = 0.0
1165 ! vertex0.e.xptar = 0.0
1166 ! vertex0.e.theta = spec.e.theta
1167 ! vertex0.e.phi = spec.e.phi
1168 ! vertex0.e.P = spec.e.P*(1.+vertex0.e.delta/100.)
1169 ! vertex0.e.E = vertex0.e.P
1170 ! vertex0.p.delta = 0.0
1171 ! vertex0.p.yptar = 0.0
1172 ! vertex0.p.xptar = 0.0
1173 ! vertex0.p.theta = spec.p.theta
1174 ! vertex0.p.phi = spec.p.phi
1175 ! vertex0.p.P = spec.p.P*(1.+vertex0.p.delta/100.)
1176 ! vertex0.p.E = sqrt(vertex0.p.P**2 + Mh2)
1177
1178 ! Complete_recon_ev for vertex0. Note: complete_recon_ev doesn't
1179 ! call radc_init_ev or calculate teff(2,3).
1180
1181 ! JRA: Do we want complete_ev or complete_recon_ev? Do we want to calculate
1182 ! and/or dump other central values (for pion/kaon production, for example).
1183
1184 gaskelld 1.1 c call complete_ev(main0,vertex0,success)
1185 c if (debug(2)) write(6,*)'calc_cent: done with complete_ev'
1186 c if (.not.success) stop 'COMPLETE_EV failed trying to complete a CENTRAL event!'
1187
1188 call complete_recon_ev(vertex0,success)
1189 if (debug(2)) write(6,*)'calc_cent: done with complete_recon_ev'
1190 if (.not.success) stop 'COMPLETE_EV failed trying to complete a CENTRAL event!'
1191 central.Q2 = vertex0.Q2
1192 central.q = vertex0.q
1193 central.nu = vertex0.nu
1194 central.Em = vertex0.Em
1195 central.Pm = vertex0.Pm
1196 central.W = vertex0.W
1197 central.e.xptar = vertex0.e.xptar
1198 central.e.yptar = vertex0.e.yptar
1199 central.e.delta = vertex0.e.delta
1200 central.p.xptar = vertex0.p.xptar
1201 central.p.yptar = vertex0.p.yptar
1202 central.p.delta = vertex0.p.delta
1203
1204 if (central.Em**2-central.Pm**2 .lt. 0) then
1205 gaskelld 1.1 central.MM = -sqrt(abs(central.Em**2-central.Pm**2))
1206 else
1207 central.MM = sqrt(central.Em**2-central.Pm**2)
1208 endif
1209
1210 main0.target.teff(2) = targ.teff(2).ave
1211 main0.target.teff(3) = targ.teff(3).ave
1212 if (debug(2)) write(6,*)'calc_cent: calling radc_init_ev'
1213 if (debug(4)) write(6,*)'calc_cent: Ein =',vertex0.Ein
1214 call radc_init_ev(main0,vertex0)
1215 if (debug(2)) write(6,*)'calc_cent: done with radc_init_ev'
1216 if (using_rad) then
1217 central.rad.hardcorfac = hardcorfac
1218 central.rad.etatzai= etatzai
1219 central.rad.g_int = g_int
1220 central.rad.g_ext = g_ext
1221 do i = 0, 3
1222 if (i.gt.0) central.rad.frac(i) = frac(i)
1223 if (i.gt.0) central.rad.lambda(i) = lambda(i)
1224 if (i.gt.0.and.i.lt.3) central.rad.bt(i) = bt(i)
1225 central.rad.c_int(i) = c_int(i)
1226 gaskelld 1.1 central.rad.c_ext(i) = c_ext(i)
1227 central.rad.c(i) = c(i)
1228 central.rad.g(i) = g(i)
1229 enddo
1230 endif
1231 if (debug(4)) write(6,*)'calc_cent: at 1'
1232
1233 do i = 1, neventfields
1234 recon0.all(i) = vertex0.all(i)
1235 enddo
1236 call complete_main(.true.,main0,vertex0,vertex0,recon0,success)
1237 central.sigcc = main0.sigcc
1238
|