1 C--------------------------------------------------------------------------
4 C This software is part of the EvtGen package developed jointly
5 C for the BaBar and CLEO collaborations. If you use all or part
6 C of it, please give an appropriate acknowledgement.
8 C Copyright Information: See EvtGen/COPYRIGHT
9 C Copyright (C) 1998 Caltech, UCSB
15 C Modification history:
17 C DJL/RYD August 11, 1998 Module created
19 C------------------------------------------------------------------------
20 C===================================================================
21 C This package is providing a B -->-- 3pions decay generator
22 C Its is composed of the following subroutines:
25 C This is an How To Use routine where one may find the
26 C implementation of the time dependance: That is to
27 C say that it shows how the output of the routine is
28 C supposed to be used in the mind of the authors.
30 C===================================================================
32 C The routine to be called. Note that on the first call
33 C some initialization will be made, in particular the
34 C computation of a normalization factor designed to help
35 C the subsequent time-dependent generation of events.
36 C The normalisation done inside EVT3pions is such that
37 C at the level of the time implementation, the maximum
38 C time-dependant weight is unity : nothing is to be
39 C computed to generate unity-weight events. The exact
40 C meaning of the above is made explicit in the HowToUse
43 C Generation of the kinematics of the 3 pions
44 C It uses the function evtranf which is a random number
45 C generator providing an uniform distribution
46 C of Real*4 random number between 0 and 1
48 C return the amplitudes of the B0 -->-- 3pions
49 C and of the B0_bar -->-- 3pions
50 C corrected for the generation mechanism
51 C The notations used are the ones of the paper of
52 C A. Snyder and H. Quinn [Phys.Rev.D48 (1993) 2139]
54 C compute the Breit-Wigner of the contributing rho s
55 C taking into account the cosine term linked to the
56 C zero-helicity of the rho s. There is three forms of
57 C Breit-Wigners available. The first one is the simple
58 C non-relativistic form, while the second and third
59 C ones are more involved relativistic expressions which
60 C in addition incorporate the contributions of three
61 C rho resonances [rho(770:1450:1700)]. The parameters
62 C used are the ones resulting from the ALEPH analysis
63 C which might be found in CERN-PPE:97013 (submitted to
64 C Zeitschrift für Physik C). The two parametrizations
65 C of the relativistic Breit-Wigners are the ones of
66 C Kuhn-SantaMaria [default] and of Gounaris-Sakurai.
67 C The default setting is the non-relativistic Breit-
70 C Set the constants values, from the pion mass to the
71 C penguin contributions. It is called by EVT3pions
73 C And other routines which do not deserve comment here.
74 C===================================================================
80 subroutine EvtHowToUse
84 Integer iset,number,i,j,jset,N_gener,N_asked
85 Real*8 p_pi_plus(4),p_pi_minus(4),p_gamma_1(4),p_gamma_2(4)
86 Real*8 q_pi_plus(4),q_pi_minus(4),q_gamma_1(4),q_gamma_2(4)
88 Real*8 Real_B0,Imag_B0,Real_B0bar,Imag_B0bar
89 Real*8 t3pions,ttag,t,Weight,Weight_max
90 Real*8 AB0,AB0bar,Ainter,xd
91 Real*8 m_rhop_2,m_rhom_2
93 Real*8 Kin_moy,Kin_moy2,Kin,Lambda
96 Lambda = Dsin(2.*alphaCP)
104 c xd is not needed by the generator but by the time-dependant
105 C sector of the general BaBar Generator.
108 c run : Simulation of the Anders Ryd Generator
110 Do number=1,N_asked ! weighted events as generated here
113 iset=10000 ! 10^4 events are used to normalize amplitudes
115 iset=0 ! iset must be reset to zero after the first call
118 c Here is the call to EVT3pions !!!!!!!!!!!!!!!!!!!!!!!!!
119 c communication of data is done by argument only <<<<<<<<
122 + p_pi_plus,p_pi_minus,p_gamma_1,p_gamma_2,
123 + Real_B0,Imag_B0,Real_B0bar,Imag_B0bar)
125 C that is it !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
126 c what follows is just to show how the ouput of EVT3pions
127 C should be used at the time dependant level.
128 c Decay time of the B->-3 pions
130 t3pions=-Alog(Evtranf())
131 If(t3pions.gt.10.) Go to 1
132 c Decay time of the tagging B
134 ttag =-Alog(Evtranf())
135 If(ttag .gt.10.) Go to 2
136 c time-difference between the 3pi decay and the tagging decay
140 C get the relevant quantities
141 AB0 = Real_B0 **2 + Imag_B0 **2
142 AB0bar= Real_B0bar**2 + Imag_B0bar**2
143 Ainter= Real_B0*Imag_B0bar - Imag_B0*Real_B0bar
144 c generate acording to the tag
147 c a B0bar tag => at t3pions=ttag the decay is one from a B0
148 Weight= AB0 *Dcos(xd*t/2.D+00)**2
149 + + AB0bar*Dsin(xd*t/2.D+00)**2
150 + - Ainter*Dsin(xd*t )
154 c a B0 tag => at t3pions=ttag the decay is one from a B0bar
155 Weight= AB0bar*Dcos(xd*t/2.D+00)**2
156 + + AB0 *Dsin(xd*t/2.D+00)**2
157 + + Ainter*Dsin(xd*t )
160 c Print*,'weight',weight
161 If(Weight.Gt.evtranf()) Then
162 c Print*,'unweighted events'
163 c----------------------------------------------------------------------------
164 c unweighted event production
165 c----------------------------------------------------------------------------
167 C here is just a Dalitz plot and a few prints
169 m_rhop_2=(p_pi_plus (4)+p_gamma_1(4)+p_gamma_2(4))**2
170 m_rhom_2=(p_pi_minus(4)+p_gamma_1(4)+p_gamma_2(4))**2
172 m_rhop_2=m_rhop_2-(p_pi_plus (j)+p_gamma_1(j)+p_gamma_2(j))**2
173 m_rhom_2=m_rhom_2-(p_pi_minus(j)+p_gamma_1(j)+p_gamma_2(j))**2
176 c here is a check that weight_max is one
178 If(Weight.gt.Weight_max) Then
180 Print*,' overweighted event found at weight = ',Weight_max
183 c here is an example of use of the iset<0 option.
184 c One does not want to generate a new event but just to
185 c compute the matrix element of the CP conjugate event:
186 c the example provided below uses the Kin variable, but
187 c this kind of facility will be very usefull for other
188 c types of applications. For example, to deal with events
189 c in a likelihood analysis, one needs to compute matrix
190 c elements, and it would be nice to be able to do that from
191 c the BaBar generator itself, to be sure that the Physics
194 q_pi_plus (4)= p_pi_minus(4)
195 q_pi_minus(4)= p_pi_plus (4)
196 q_gamma_1 (4)= p_gamma_1 (4)
197 q_gamma_2 (4)= p_gamma_2 (4)
200 q_pi_plus (i)= - p_pi_minus(i)
201 q_pi_minus(i)= - p_pi_plus (i)
202 q_gamma_1 (i)= - p_gamma_1 (i)
203 q_gamma_2 (i)= - p_gamma_2 (i)
206 c Here is the call to EVT3pions !!!!!!!!!!!!!!!!!!!!!!!!!
207 c with the iset<0 option
213 + q_pi_plus,q_pi_minus,q_gamma_1,q_gamma_2,
214 + Real_B0,Imag_B0,Real_B0bar,Imag_B0bar)
215 c that is it !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
216 C get the relevant quantities
217 AB0 = Real_B0 **2 + Imag_B0 **2
218 AB0bar= Real_B0bar**2 + Imag_B0bar**2
219 Ainter= Real_B0*Imag_B0bar - Imag_B0*Real_B0bar
223 c a B0bar tag => at t3pions=ttag the decay is one from a B0
224 CPWeight= AB0 *Dcos(xd*t/2.D+00)**2
225 + + AB0bar*Dsin(xd*t/2.D+00)**2
226 + - Ainter*Dsin(xd*t )
230 c a B0 tag => at t3pions=ttag the decay is one from a B0bar
231 CPWeight= AB0bar*Dcos(xd*t/2.D+00)**2
232 + + AB0 *Dsin(xd*t/2.D+00)**2
233 + + Ainter*Dsin(xd*t )
237 Kin = (Weight-CPweight)/(Weight+CPweight)/Lambda
238 Kin_moy = Kin_moy + Kin
239 Kin_moy2 = Kin_moy2 + Kin**2
241 c----------------------------------------------------------------------------
244 c end of the loop over events
247 Print*,'number of unity-weight events generated : ',N_gener
248 Print*,'number of trials : ',N_asked
249 Print*,' measurement of sin(2 alpha) = ',
251 Print*,' true value = ',Lambda
254 C===================================================================
255 subroutine Evt3pions(
257 + p_pi_plus,p_pi_minus,p_gamma_1,p_gamma_2,
258 + Real_B0,Imag_B0,Real_B0bar,Imag_B0bar)
259 c-----------------------------------------------------------------
260 c ----------------------------------------------------------
261 c --- This is the routine to be called by the Main generator
262 c****************************************************************************
265 c --- alpha : the value of the alpha angle (radians)
266 c Note that the amplitude which are returned incorporate the
267 c CP violating phase present in the mixing.
269 c --- iset : to initialize the generator
270 c iset should be set to the number
271 c of events to be used for the pre-run
272 c devoted to the computation of the
273 c normalization factor designed to help
274 c the subsequent time-dependent generation
276 c After the first call iset should be
278 c**************************************************************************** set to 0.
281 c --- p_pi_plus : the four momentum of the pi+
282 c --- p_pi_minus: the four momentum of the pi-
283 c --- p_gamma_1 : the four momentum of the first photon
284 c --- p_gamma_2 : the four momentum of the second photon
285 c Note that : the energy is stored in the fourth component
286 c the values are the ones of the B rest frame
287 c a random rotation has been applied
289 c --- Real_B0 : The real part of the amplitude of
290 c the B0 ->- 3 pions decay
291 c --- Imag_B0 : The imaginary part of the amplitude of
292 c the B0 ->- 3 pions decay
293 c --- Real_B0bar: The real part of the amplitude of
294 c the B0bar ->- 3 pions decay
295 c --- Imag_B0bar: The imaginary part of the amplitude of
296 c the B0bar ->- 3 pions decay
297 c****************************************************************************
298 c-----------------------------------------------------------------
300 #include "EvtGenModels/EvtBTo3pi.inc"
304 Real*8 p_pi_plus(4),p_pi_minus(4),p_gamma_1(4),p_gamma_2(4)
305 Real*8 Real_B0,Imag_B0,Real_B0bar,Imag_B0bar
309 Real*8 p1(5),p2(5),p3(5),Gamma1(5),Gamma2(5)
310 Real*8 factor,factor_max,AB0,AB0bar,Ainter,R1,R2
311 data factor_max/1.D+00/
314 c-------------------------------------------------------------------
316 c-------------------------------------------------------------------
317 c this is the normal mode of operation
318 c First, generate the kinematics
327 call Evtfirst_step(p1,p2,p3)
329 c Then, compute the amplitudes
332 Call EvtCompute(p1,p2,p3,
333 + Real_B0,Imag_B0,Real_B0bar,Imag_B0bar,iset,ierr)
334 if(ierr.ne.0) Go To 10
336 c-------------------------------------------------------------------
337 ElseIf(iset.lt.0) Then
338 c-------------------------------------------------------------------
339 c This is an user mode of operation where the kinematics is
340 c provided by the user who only wants the corresponding amplitudes
345 p2(i)= p_gamma_1 (i) + p_gamma_2 (i)
352 Call EvtCompute(p1,p2,p3,
353 + Real_B0,Imag_B0,Real_B0bar,Imag_B0bar,iset,ierr)
356 Print*,'the provided kinematics are not physical'
358 Print*,'the program will stop'
361 c-------------------------------------------------------------------
362 ElseIf(iset.gt.0) Then
363 c-------------------------------------------------------------------
364 c This is the pre-run mode of operation where initializations are
369 C Ghm : beta is not needed for this generation - put a default value
372 call Evtset_constants(alpha_input, beta_input)
382 call Evtfirst_step(p1,p2,p3)
384 Call EvtCompute(p1,p2,p3,Real_B0,Imag_B0,Real_B0bar,
385 + Imag_B0bar,iset,ierr)
386 if(ierr.ne.0) Go To 20
387 AB0 = Real_B0 **2 + Imag_B0 **2
388 AB0bar= Real_B0bar**2 + Imag_B0bar**2
389 Ainter= Real_B0*Imag_B0bar - Imag_B0*Real_B0bar
390 R1 = (AB0-AB0bar) /(AB0+AB0bar)
391 R2 =(2.D+00*Ainter)/(AB0+AB0bar)
392 factor=(1.D+00+Dsqrt(R1**2+R2**2))*(AB0+AB0bar)/2.D+00
393 If(factor.gt.factor_max) factor_max=factor
397 c Normalization factor
398 factor_max=1.D+00/Dsqrt(factor_max)
399 c Print*,'factor_max',factor_max,p1,p2,p3
400 c-------------------------------------------------------------------
402 c-------------------------------------------------------------------
404 Real_B0 =Real_B0 * factor_max
405 Imag_B0 =Imag_B0 * factor_max
406 Real_B0bar=Real_B0bar * factor_max
407 Imag_B0bar=Imag_B0bar * factor_max
411 c P1,p2,p3 ---> random rotation in B rest frame
413 Call EvtRotation(p1,1)
414 Call EvtRotation(p2,0)
415 Call EvtRotation(p3,0)
417 C Desintegrate the pi_0
419 Call EvtGammaGamma(p2,Gamma1,Gamma2)
421 C Feed the output four vectors
427 p_gamma_1 (i)=Gamma1(i)
428 p_gamma_2 (i)=Gamma2(i)
436 c===================================================================
437 subroutine Evtfirst_step(P1,P2,P3)
438 c-----------------------------------------------------------------
439 c ----------------------------------------------------------
440 c --- This routine generates the 5-vectors P1,P2,P3
441 c --- Associated respectively with the Pi+,Pi0 and Pi-
447 c ----------------------------------------------------------
448 c --- Input Four Vectors
449 C --- Particle [1] is the pi+
450 C --- Particle [2] is the pi0
451 C --- Particle [3] is the pi-
452 c ----------------------------------------------------------
454 c ----------------------------------------------------------
456 c ----------------------------------------------------------
457 #include "EvtGenModels/EvtBTo3pi.inc"
458 c ----------------------------------------------------------
460 c ----------------------------------------------------------
464 c ----------------------------------------------------------
465 c --- Variables in Argument
466 c ----------------------------------------------------------
468 real*8 P1(5),P2(5),P3(5)
470 c ----------------------------------------------------------
471 c --- Local Variables
472 c ----------------------------------------------------------
474 real*8 m12,min_m12, max_m12
475 real*8 m13,min_m13, max_m13
476 real*8 m23,min_m23, max_m23
477 Real*8 cost13,cost12,cost23
479 real*8 p1mom,p2mom,p3mom
483 C There is two ways of generating the events:
484 C The first one used a pole-compensation method to generate the
485 C events efficiently taking into account the poles due to the
486 C Breit-Wigners of the rho s. It is activated by setting
487 C Phase_Space to .false.
488 C The second one generates events according to phase space. It is
489 C inneficient but allows the exploration of the full Dalitz plot
490 C in an uniform way. It was found to be usefull fopr some peculiar
491 C applications. It is activated by setting
492 C Phase_space to .true.
493 C Note that in that case, the generation is no longer correct.
496 data Phase_space/.false./
498 c initialize to avoid warning on Linux.
501 c ----------------------------------------------------------
503 c ----------------------------------------------------------
505 min_m12 = P1(5) + P2(5)
508 min_m13 = P1(5) + P3(5)
511 min_m23 = P2(5) + P3(5)
516 c ----------------------------------------------------------
517 c --- Generation of the Mass of the Rho(+,-,0)
518 c ----------------------------------------------------------
520 If(.not.Phase_space) Then
521 y = evtranf()*PI - PI/2.
523 mass = x*Gam_rho/2. +Mass_rho
526 c ----------------------------------------------------------
527 c --- z is the Flag needed to choose between the generation
528 c --- of a Rho+, a Rho-,or a Rho0
529 c ----------------------------------------------------------
536 m12 = evtranf()*(max_m12-min_m12)+min_m12
540 m13 = evtranf()*(max_m13-min_m13)+min_m13
541 m23 = MB2 - m12 - m13
542 else if (z.lt.2.) Then
545 m13 = evtranf()*(max_m13-min_m13)+min_m13
549 m12 = evtranf()*(max_m12-min_m12)+min_m12
550 m23 = MB2 - m12 - m13
554 m23 = evtranf()*(max_m23-min_m23)+min_m23
558 m12 = evtranf()*(max_m12-min_m12)+min_m12
559 m13 = MB2 - m12 - m23
562 c ----------------------------------------------------------
563 c --- Check that the physics is OK :
564 c --- Are the invariant Masses in allowed ranges ?
565 c ----------------------------------------------------------
567 If(m23.lt.min_m23.or.m23.gt.max_m23) Go to 100
568 If(m13.lt.min_m13.or.m13.gt.max_m13) Go to 100
569 If(m12.lt.min_m12.or.m12.gt.max_m12) Go to 100
571 c ----------------------------------------------------------
572 c --- Are the Cosines of the angles between particles
573 c --- Between -1 and +1 ?
574 c ----------------------------------------------------------
576 P1(4)=(M_B**2+P1(5)-m23)/(2.*M_B)
577 P2(4)=(M_B**2+P2(5)-m13)/(2.*M_B)
578 P3(4)=(M_B**2+P3(5)-m12)/(2.*M_B)
579 if (p1(4)**2-P1(5).le.0.0) go to 100
580 if (p2(4)**2-P2(5).le.0.0) go to 100
581 if (p3(4)**2-P3(5).le.0.0) go to 100
582 p1mom=Dsqrt(p1(4)**2-P1(5))
583 p2mom=Dsqrt(p2(4)**2-P2(5))
584 p3mom=Dsqrt(p3(4)**2-P3(5))
585 cost13=(2.*p1(4)*p3(4)+P1(5)+p3(5)-m13)/(2.*p1mom*p3mom)
586 cost12=(2.*p1(4)*p2(4)+P1(5)+p2(5)-m12)/(2.*p1mom*p2mom)
587 cost23=(2.*p2(4)*p3(4)+P2(5)+p3(5)-m23)/(2.*p2mom*p3mom)
588 If(Dabs(cost13).gt.1.) Go to 100
589 If(Dabs(cost12).gt.1.) Go to 100
590 If(Dabs(cost23).gt.1.) Go to 100
592 c ----------------------------------------------------------
593 c --- Filling the 5-vectors P1,P2,P3
594 c ----------------------------------------------------------
601 P1(1) = p1mom*Dsqrt(1.D+00-cost13**2)
611 c======================================================================
612 Subroutine EvtCompute(p1,p2,p3,
613 + Real_B0,Imag_B0,Real_B0bar,Imag_B0bar,iset,ierr)
614 c-----------------------------------------------------------------------
616 #include "EvtGenModels/EvtBTo3pi.inc"
619 Real*8 m12, m13, m23, W12, W13, W23, Wtot
621 Complex*16 MatBp,MatBm
622 Real*8 Real_B0,Imag_B0,Real_B0bar,Imag_B0bar
624 Real*8 p1(5),p2(5),p3(5)
626 COMPLEX*16 Mat_rhop,Mat_rhom,Mat_rho0
627 Complex*16 BreitWigner,Mat_1,Mat_2,Mat_3
628 c ----------------------------------------------------------------
629 C --- Account for the pole compensation
630 c ----------------------------------------------------------------
633 if(evt_gmas(p1,p2).lt.0.or.evt_gmas(p1,p3)
634 + .lt.0.or.evt_gmas(p2,p3).lt.0) Then
639 m12 = sqrt(evt_gmas(p1,p2))
640 m13 = sqrt(evt_gmas(p1,p3))
641 m23 = sqrt(evt_gmas(p2,p3))
643 W12 = (1./m12)*1./((Mass_rho - m12)**2+(Gam_rho/2.)**2)
644 W13 = (1./m13)*1./((Mass_rho - m13)**2+(Gam_rho/2.)**2)
645 W23 = (1./m23)*1./((Mass_rho - m23)**2+(Gam_rho/2.)**2)
648 Wtot = 1./Dsqrt(W12 + W13 + W23)
653 c ----------------------------------------------------------------
654 C --- Compute Breit-Wigners
655 c ----------------------------------------------------------------
657 Mat_rhop=BreitWigner(p1,p2,p3,ierr)
658 Mat_rhom=BreitWigner(p2,p3,p1,ierr)
659 Mat_rho0=BreitWigner(p1,p3,p2,ierr)
662 c ----------------------------------------------------------------
663 C --- Build up the amplitudes
664 c ----------------------------------------------------------------
666 Mat_1 = Mat_s3*Mat_rhop
667 Mat_2 = Mat_s4*Mat_rhom
668 Mat_3 = Mat_s5*Mat_rho0*0.5D+00
670 MatBp = (Mat_1+Mat_2+Mat_3) * Wtot
672 Mat_1 = Nat_s3*Mat_rhom
673 Mat_2 = Nat_s4*Mat_rhop
674 Mat_3 = Nat_s5*Mat_rho0*0.5D+00
676 MatBm = (Mat_1+Mat_2+Mat_3) * Wtot
678 c Pick up the Real and Imaginary parts
680 c changed Real to DBLE and Imag DIMAG to make it complie
681 c with Absoft and g77 (ryd)
683 Real_B0 = DBLE(MatBp)
684 Imag_B0 = DIMAG(MatBp)
686 Real_B0bar = DBLE(MatBm)
687 Imag_B0bar = DIMAG(MatBm)
692 c======================================================================
693 Function BreitWigner(p1,p2,p3,ierr)
694 c----------------------------------------------------------------------
696 #include "EvtGenModels/EvtBTo3pi.inc"
697 Complex *16 BreitWigner,EvtCRhoF_W
702 c ---------------------------------------------------------------
703 c --- Input Four Vectors
704 c ---------------------------------------------------------------
705 Real*8 p1(5),p2(5),p3(5)
707 c ---------------------------------------------------------------
708 C --- intermediate variables
709 c ---------------------------------------------------------------
710 Real*8 E12_2,m12_2,beta,gamma,argu,m13_2,costet,coscms,m12
711 Real*8 Factor,Num_real,Num_imag
713 Real *8 p1z,p1zcms12,e1cms12,p1cms12
715 c ---------------------------------------------------------------
717 c ---------------------------------------------------------------
719 BreitWigner=Dcmplx(0,0)
723 E12_2=(p1(4)+p2(4))**2
726 m12_2=m12_2-(p1(i)+p2(i))**2
728 Argu = 1.D+00 - m12_2 / E12_2
733 Print *,'Abnormal beta ! Argu = ',Argu
742 Print *,'Abnormal m12 ! m12_2 = ',m12_2
749 gamma=Dsqrt(E12_2/m12_2)
750 c ---------------------------------------------------------------
751 C --- get the cosine in the B CMS
752 c ---------------------------------------------------------------
754 m13_2=(p1(4)+p3(4))**2
756 m13_2=m13_2-(p1(i)+p3(i))**2
758 if(m13_2.lt.0) Go To 50
759 if((p1(4)**2-p1(5)).lt.0) Go To 50
760 if((p3(4)**2-p3(5)).lt.0) Go To 50
761 costet= (2.D+00*p1(4)*p3(4)-m13_2+p1(5)+p3(5))
763 > (2.D+00*Dsqrt( (p1(4)**2-p1(5)) * (p3(4)**2-p3(5)) ))
765 c ---------------------------------------------------------------
766 C --- get the costet in the 1-2 CMS
767 c ---------------------------------------------------------------
769 p1z=dsqrt(P1(4)**2-p1(5))*costet
770 p1zcms12=gamma*(p1z+beta*P1(4))
771 e1cms12 =gamma*(p1(4)+beta*p1z)
772 p1cms12 =Dsqrt(e1cms12**2-p1(5))
773 coscms=p1zcms12/p1cms12
775 c ---------------------------------------------------------------
776 C --- Build the Breit Wigner
777 c ---------------------------------------------------------------
780 BreitWigner= coscms * EvtCRhoF_W( m12_2 )
782 Factor = 2.D+00* ( (Mass_rho-m12)**2+(0.5D+00*Gam_rho)**2 )
783 Factor = coscms * Gam_rho / Factor
784 Num_real= (Mass_rho-m12) * Factor
785 Num_imag= 0.5D+00*Gam_rho * Factor
786 BreitWigner=Dcmplx(Num_real,Num_imag)
795 c======================================================================
796 Subroutine EvtSet_Constants(balpha, bbeta)
797 c----------------------------------------------------------------------
799 #include "EvtGenModels/EvtBTo3pi.inc"
801 c -------------------------------------------------------------
802 c --- Basic matrix elements
803 c -------------------------------------------------------------
805 Complex *16 Mat_Tp0,Mat_Tm0,Mat_T0p,Mat_T0m,Mat_Tpm,Mat_Tmp
807 > ,Nat_Tp0,Nat_Tm0,Nat_T0p,Nat_T0m,Nat_Tpm,Nat_Tmp
808 > ,Nat_P1,Nat_P0, Mat_Ppm, Mat_Pmp
814 Real*8 Rho_gen,Eta_gen,c_factor
815 c -------------------------------------------------------------
816 pi = 3.141592653 D+00
818 calpha = Dcos(alphaCP)
819 salpha = Dsin(alphaCP)
835 MB2 = M_B**2 + M_pip**2 + M_pim**2 + M_pi0**2
836 MC2 = M_B**2 + M_Kp **2 + M_pim**2 + M_pi0**2
840 c -------------------------------------------------------------
841 StrongExp = Dcmplx(Dcos(StrongPhase),Dsin(StrongPhase))
844 c if(balpha.ne.0) Then
845 c eta_gen = cos(balpha)/sin(balpha)
851 >Sqrt((rho_gen**2+eta_gen**2)/((1.-rho_gen)**2+eta_gen**2))
853 Mat_Tp0 = Dcmplx(calpha, -salpha) *1.09D+00
854 Mat_Tm0 = Dcmplx(calpha, -salpha) *1.09D+00
855 Mat_T0p = Dcmplx(calpha, -salpha) *0.66D+00
856 Mat_T0m = Dcmplx(calpha, -salpha) *0.66D+00
857 Mat_Tpm = Dcmplx(calpha, -salpha) *1.00D+00
858 Mat_Tmp = Dcmplx(calpha, -salpha) *0.47D+00
860 Mat_Ppm = -Dcmplx(Dcos(-0.5D0),Dsin(-0.5D0))*0.2D0
861 Mat_Pmp = Dcmplx(Dcos(2.D0),Dsin(2.D0))*0.15D0
863 Mat_P1 = 0.5D0*(Mat_Ppm-Mat_Pmp)
864 Mat_P0 = 0.5D0*(Mat_Ppm+Mat_Pmp)
865 Nat_Tp0 = Dcmplx(calpha, salpha) *1.09D+00
866 Nat_Tm0 = Dcmplx(calpha, salpha) *1.09D+00
867 Nat_T0p = Dcmplx(calpha, salpha) *0.66D+00
868 Nat_T0m = Dcmplx(calpha, salpha) *0.66D+00
869 Nat_Tpm = Dcmplx(calpha, salpha) *1.00D+00
870 Nat_Tmp = Dcmplx(calpha, salpha) *0.47D+00
874 Mat_Tpm = StrongExp * Mat_Tpm
875 Nat_Tpm = StrongExp * Nat_Tpm
877 Mat_S1 = Mat_Tp0 + 2.D+00 * Mat_P1
878 Mat_S2 = Mat_T0p - 2.D+00 * Mat_P1
879 Mat_S3 = Mat_Tpm + Mat_P1 + Mat_P0
880 Mat_S4 = Mat_Tmp - Mat_P1 + Mat_P0
881 Mat_S5 = - Mat_Tpm - Mat_Tmp + Mat_Tp0 + Mat_T0p
884 Nat_S1 = Nat_Tp0 + 2.D+00 * Nat_P1
885 Nat_S2 = Nat_T0p - 2.D+00 * Nat_P1
886 Nat_S3 = Nat_Tpm + Nat_P1 + Nat_P0
887 Nat_S4 = Nat_Tmp - Nat_P1 + Nat_P0
888 Nat_S5 = - Nat_Tpm - Nat_Tmp + Nat_Tp0 + Nat_T0p
892 c=====================================================================
893 c=====================================================================
896 C Gautier 14-Jan-98 :
897 C set matrix elements according to Jerome s calculations
898 C (so called Reference set)
899 c B0 -->-- K*+ pi- Amplitudes (Trees + Penguins)
900 MatKstarp = Dcmplx(calpha, -salpha) * Dcmplx( 0.220,0.)
901 > + Dcmplx(cbeta, sbeta) * Dcmplx(-1.200,0.)
902 c B0 -->-- K*0 pi0 Amplitudes (Trees + Penguins)
903 MatKstar0 = Dcmplx(calpha, -salpha) * Dcmplx( 0.015,0.)
904 > + Dcmplx(cbeta, sbeta) * Dcmplx( 0.850,0.)
905 c B0 -->-- K+ rho- Amplitudes (Trees + Penguins)
906 MatKrho = Dcmplx(calpha, -salpha) * Dcmplx( 0.130,0.)
907 > + Dcmplx(cbeta, sbeta) * Dcmplx( 0.160,0.)
908 c=====================================================================
909 c B0bar -->-- K*+ pi- Amplitudes (Trees + Penguins)
910 NatKstarp = Dcmplx(0.,0.)
911 c B0bar -->-- K*0 pi0 Amplitudes (Trees + Penguins)
912 NatKstar0 = Dcmplx(0.,0.)
913 c B0bar -->-- K+ rho- Amplitudes (Trees + Penguins)
914 NatKrho = Dcmplx(0.,0.)
915 c=====================================================================
916 c=====================================================================
917 c Print*,'Mat_Tp0',Mat_Tp0
918 c Print*,'Mat_T0p',Mat_T0p
919 c Print*,'Mat_Tpm',Mat_Tpm
920 c Print*,'Mat_Tmp',Mat_Tmp
921 c Print*,'Mat_P1',Mat_P1
922 c Print*,'Mat_P0',Mat_P0
929 C=====================================================================
930 subroutine EvtGammaGamma(P2,PG1Boost,PG2Boost)
931 c---------------------------------------------------------------------
932 c --------------------------------------------------------------
933 c --- The aim of this routine is to generate two photons
934 c --- for the decay of the pi0
935 c --------------------------------------------------------------
939 #include "EvtGenModels/EvtBTo3pi.inc"
945 c --- Variables in Argument
947 Real*8 PG1Boost(5), PG2Boost(5)
950 c --- Local Variables
953 Real*8 PGamma1(5), PGamma2(5)
954 Real*8 sinThetaRot, cosThetaRot, PhiRot
959 Beta(i) = P2(i)/p2(4)
962 EGammaCmsPi0 = Dsqrt(P2(5))/2.
965 cosThetaRot = evtranf()*2.D+00-1.D+00
966 sinThetaRot = Dsqrt(1.D+00 - cosThetaRot**2)
967 PhiRot = evtranf()*2.D+00*pi
969 PGamma1(1) = EGammaCmsPi0 * sinThetaRot * Dcos(PhiRot)
970 PGamma1(2) = EGammaCmsPi0 * sinThetaRot * Dsin(PhiRot)
971 PGamma1(3) = EGammaCmsPi0 * cosThetaRot
972 PGamma1(4) = EGammaCmsPi0
975 PGamma2(1) = - PGamma1(1)
976 PGamma2(2) = - PGamma1(2)
977 PGamma2(3) = - PGamma1(3)
978 PGamma2(4) = PGamma1(4)
981 Call EvtREFREF(BETA,PGamma1,PG1Boost,1)
982 Call EvtREFREF(BETA,PGamma2,PG2Boost,1)
986 C===================================================================
987 SUBROUTINE EvtREFREF(BETA,PIN,POUT,S)
988 c-------------------------------------------------------------------
989 c ------------------------------------------------------------
990 c --- GIVEN A FINAL STATE , TO BOOST IT IN ITS C.M.S TAKE
991 c --- BETA =-SIGMA(P(K))/SIGMA(E(K))
993 c --- TO GO BACK TO THE INITIAL FRAME : SET
995 c ------------------------------------------------------------
1000 dimension BETA(4),PIN(5),POUT(5)
1001 Real*8 GAMMA,BETPIN,BETA2
1004 BETA2 =BETA(1)**2+BETA(2)**2+BETA(3)**2
1005 IF(BETA2.GT.1.D0) Print*,'Beta**2 .gt.1!!!'
1006 IF(BETA2.GT..99999D0) BETA2=0.99999
1007 BETA(4)=DSQRT(BETA2)
1008 GAMMA=1./DSQRT(1.D0-BETA2)
1012 BetPin = Beta(i)*Pin(i) + BetPin
1017 POUT(I)=PIN(I)+S*BETA(I)*GAMMA*
1018 > (PIN(4)+GAMMA/(GAMMA+1.)*BETPIN)
1020 POUT(4) = GAMMA*(PIN(4)+BETPIN)
1026 C******************************************************************
1027 function evt_gmas(P1,P2)
1028 C******************************************************************
1029 c -----------------------------------------------------------
1030 c --- compute the invariant mass between particle 1 and 2
1031 c -----------------------------------------------------------
1037 evt_gmas = (P1(4)+P2(4))**2
1040 evt_gmas = evt_gmas - (P1(i) + P2(i))**2
1045 C===================================================================
1046 Subroutine EvtRotation(p,new)
1047 c------------------------------------------------------------------
1049 #include "EvtGenModels/EvtBTo3pi.inc"
1051 Real*8 p(5),pstor(3)
1053 Real*8 c1,c2,c3,s1,s2,s3
1060 c ---------------------------------------------------------
1061 C --- generate a random rotation
1062 c ---------------------------------------------------------
1064 phi2=evtranf()*2.*pi
1065 phi3=evtranf()*2.*pi
1067 c1=2.D+00*evtranf()-1.D+00
1071 s1=Dsqrt(1.D+00-c1**2)
1075 c ---------------------------------------------------------
1076 C --- Compute the overall rotation matrix
1077 c ---------------------------------------------------------
1082 MatRot(2,2)=c1*c2*c3-s2*s3
1083 MatRot(2,3)=c1*c2*s3+s2*c3
1085 MatRot(3,2)=-c1*s2*c3-c2*s3
1086 MatRot(3,3)=-c1*s2*s3+c2*c3
1089 c ---------------------------------------------------------
1090 C --- store the input 3-momentum
1091 c ---------------------------------------------------------
1096 c ---------------------------------------------------------
1097 C --- Apply the rotation
1098 c ---------------------------------------------------------
1101 p(i)=p(i)+MatRot(i,j)*pstor(j)
1109 c======================================================================
1110 FUNCTION EvtCRhoF_W( s )
1111 C -----------------------------------------------------------------------
1113 C Author : Andreas Hoecker [Aleph Collaboration, BaBar]
1118 IMPLICIT DOUBLE PRECISION (A-H,O-Z)
1119 COMPLEX*16 EvtCRhoF_W, EvtcBW_KS, EvtcBW_GS
1121 PARAMETER (AmPi2=0.13956995**2)
1123 LOGICAL KUHN_SANTA / .TRUE. / !...type of Breit-Wigner formula
1124 double precision lambda
1129 IF (KUHN_SANTA) THEN
1161 EvtCRhoF_W = DCMPLX(0.,0.)
1163 IF (KUHN_SANTA) THEN
1165 C Kuehn-Santamaria model
1168 > ( EvtcBW_KS(s,AmRho**2,GamRho) + !...BW-rho( 770)
1169 > EvtcBW_KS(s,AmRhoP**2,GamRhoP)*(beta) + !...BW-rho(1450)
1170 > EvtcBW_KS(s,AmRhoPP**2,GamRhoPP)*(gamma) ) / !...BW-rho(1700)
1174 C Gounaris-Sakurai model
1177 > ( EvtcBW_GS(s,AmRho**2,GamRho) +
1178 > EvtcBW_GS(s,AmRhoP**2,GamRhoP)*(beta) +
1179 > EvtcBW_GS(s,AmRhoPP**2,GamRhoPP)*(gamma) ) /
1186 C * ================================================================== *
1189 C * ------------------------------------------------------------- *
1191 FUNCTION EvtcBW_KS( s,Am2,Gam )
1193 IMPLICIT DOUBLE PRECISION (A-H,O-Z)
1194 COMPLEX*16 EvtcBW_KS
1195 PARAMETER (AmPi2=0.13956995**2)
1197 DOUBLE PRECISION lambda
1201 IF (s.le.4.*AmPi2) RETURN
1203 G = Gam* (Am2/s)**lambda * ((s-4.*AmPi2)/(Am2-4.*AmPi2))**1.5
1204 D = (Am2-s)**2 + s*G**2
1208 EvtcBW_KS = DCMPLX(X/D,Y/D)
1213 C * ------------------------------------------------------------- *
1215 FUNCTION EvtcBW_GS( s,Am2,Gam )
1217 IMPLICIT DOUBLE PRECISION (A-H,O-Z)
1218 COMPLEX*16 EvtcBW_GS
1219 PARAMETER (AmPi2=0.13956995**2)
1221 DOUBLE PRECISION Evtfs,d,N
1223 DOUBLE PRECISION lambda
1227 IF (s.le.4.*AmPi2) RETURN
1229 G = Gam* (Am2/s)**lambda * ((s-4.*AmPi2)/(Am2-4.*AmPi2))**1.5
1230 z1 = Am2 - s + Evtfs(s,Am2,Gam)
1232 z3 = Am2 + d(Am2)*Gam*SQRT(Am2)
1238 EvtcBW_GS = DCMPLX(X/N,Y/N)
1243 C---------------------------------------------------------------------
1245 FUNCTION Evtfs(s,AmRho2,GamRho)
1246 IMPLICIT DOUBLE PRECISION (A-H,O-Z)
1247 DOUBLE PRECISION k,k_s,k_Am2
1251 Evtfs = GamRho * AmRho2 / k_Am2**3 *
1253 > k_s**2 * (h(s)-h(AmRho2)) +
1254 > (AmRho2-s) * k_Am2**2 * dh_ds(AmRho2)
1260 IMPLICIT DOUBLE PRECISION (A-H,O-Z)
1262 PARAMETER (AmPi2=0.13956995**2)
1263 k = 0.5 * SQRT(s - 4.*AmPi2)
1268 IMPLICIT DOUBLE PRECISION (A-H,O-Z)
1269 DOUBLE PRECISION k,k_s
1270 PARAMETER (pi=3.141593)
1271 PARAMETER (AmPi=0.13957)
1274 h = 2./pi * (k_s/SQRTs) * LOG((SQRTs+2.*k_s)/(2.*AmPi))
1279 IMPLICIT DOUBLE PRECISION (A-H,O-Z)
1281 PARAMETER (pi=3.141593)
1282 dh_ds = h(s) * (1./(8.*k(s)**2) - 1./(2.*s)) + 1./(2.*pi*s)
1287 IMPLICIT DOUBLE PRECISION (A-H,O-Z)
1288 DOUBLE PRECISION k,k_AmRho2
1289 PARAMETER (pi=3.141593)
1290 PARAMETER (AmPi=0.13956995)
1291 PARAMETER (AmPi2=AmPi**2)
1292 AmRho = SQRT(AmRho2)
1293 k_AmRho2 = k(AmRho2)
1294 d = 3./pi * AmPi2/k_AmRho2**2 *
1295 > LOG((AmRho+2.*k_AmRho2)/(2.*AmPi)) +
1296 > AmRho/(2.*pi*k_AmRho2) - AmPi2*AmRho/(pi*k_AmRho2**3)